/* style.css completo */

/* — Base y Navbar — */
body {
  font-family: 'Open Sans', sans-serif;
  margin: 0; padding: 0;
  background-color: #f4f4f4;
  height: 100%;
}

.navbar {
  background-color: #f3f3f3;
  display: flex; align-items: center;
  padding: 10px 20px;
  position: relative;
}
.navbar .logo { height:50px; margin-right:30px; }
.navbar nav ul { list-style:none; display:flex; margin:0; padding:0; }
.navbar nav ul li { margin:0 20px; position:relative; }
.navbar nav ul li a {
  text-decoration:none; color:#333;
  font-weight:600; font-size:16px;
  transition:0.3s;
}
.navbar nav ul li a:hover {
  color:#fff; background:#40a15e;
  padding:10px 15px; border-radius:5px;
}
.navbar nav ul li.dropdown .dropdown-menu {
  display: none; position: absolute;
  top:100%; left:0;
  background:rgba(200,200,200,0.8);
  list-style:none; padding:10px 0; margin:0;
  border-radius:5px; min-width:150px;
  box-shadow:0 2px 6px rgba(0,0,0,0.2);
}
.navbar nav ul li.dropdown .dropdown-menu li a {
  display:block; padding:10px 25px;  
  color:#333; text-decoration:none;
  transition:0.2s; white-space:nowrap;
}
.navbar nav ul li.dropdown .dropdown-menu li a:hover {
  background:#40a15e; color:#fff;
}
.navbar nav ul li.dropdown:hover .dropdown-menu {
  display:block;
}

/* — Receta Pulido — */
.receta-pulido { padding:30px 20px; text-align:center; }
.entrada {
  background:#212121; border-radius:10px;
  color:#fff; width:1075px;
  margin:0 auto 20px; padding:40px 50px;
  box-sizing:border-box;
  overflow: hidden;
}

/* — Filas y Campos — */
.fila { display:flex; }
.fila-1 {
  display: flex;
  justify-content: flex-start;
  gap: 30px; /* ajuste esto a su gusto */
  margin-bottom: 15px;
}

.fila-2 {
  justify-content: flex-start;
  align-items: flex-end;
  margin-bottom: 40px;
  gap: 30px; /* Cambie este valor a su gusto */
}

.fila-datos {
  display: flex;
  flex-wrap: nowrap;
  justify-content: flex-start;
  align-items: stretch;
  gap: 40px;
  margin-top: 45px;
  width: 100%;
  box-sizing: border-box;
}



.fila-1 .campo { display:flex; align-items:center; }
.fila-1 .campo label { margin-right:8px; white-space:nowrap; }
.fila-1 input {
  padding:5px 10px; font-size:14px;
  border:1px solid #ccc; border-radius:4px;
  background-color:#404040;
  color:#E0E0E0;
}
.fila-1 input#semana { width:60px; }



/* — Floating label operario — */
.grupo-operario { width:550px; margin-right:10px; }
.input-group { position:relative; display:flex; padding:7px 0 0; width:100%; }
.input-text {
  width:100%; border:none; border-bottom:2px solid #7f7f7f;
  font-size:17px; color:#E0E0E0; padding:7px 0;
  background:transparent; transition:border-color .2s;
}
.input-text-label {
  position:absolute; top:7px; left:0;
  font-size:17px; color:#7f7f7f;
  pointer-events:none; transition:.2s;
}
.input-text:focus {
  padding-bottom:6px; border-bottom-width:3px;
  border-image:linear-gradient(to right,#fa961b,#fa961b)1;
}
.input-text:focus ~ .input-text-label,
.input-text:not(:placeholder-shown) ~ .input-text-label {
  top:-17px; font-size:15px; font-weight:700; color:#fa961b;
}

/* — Campos de datos — */
.col-left {
  display: flex;
  flex-direction: column;
  flex: 1 1 0;
  max-width: 300px;
  gap: 20px;
}



.col-left .campo { display:flex; align-items:center; gap:9px }
.col-left .campo label { font-size:14px; font-weight:bold; white-space:nowrap; }

.origen-ajustado {
  display:flex; align-items:center; gap:15px;
  margin-bottom: opx;
}
.origen-ajustado select {
  padding:0px 10px; font-size:14px;
  border:none; border-radius:.4vw;
  background-color:#404040;
  font-weight:500;
  color:#E0E0E0;
  width:125px;
  height: 30px; 
  
  
}
.input {
  background:#404040; color:#E0E0E0;
  border:none; outline:none; border-radius:.4vw;
  padding:.4vw; font-size:.8vw; font-weight:500;
  transition:.4s;
}

.input:focus { box-shadow:0 0 0 .15vw #fa961b; }
#integral.input { width:65px; height: 25px; font-size: 18px; padding: 6px 10px;}
#objetivo_id.input { width:125px; height: 30px; font-size: 14px; padding: 0px 10px;}
#pulidor1.input,
#pulidor2.input,
#pulidor3.input {
  width:65px;
  height: 25px;          
  font-size: 18px;      
  padding: 6px 10px;   
}

.pulidores { margin-top:25px; text-align:left; }
.pulidores > label {
  display:inline-block; margin:0 0 10px 0;
  transform:translateY(-6px); font-weight:bold; font-size:14px;
}
.pulidores .item {
  display: flex;
  align-items: center;
  gap: 28px;
  margin-bottom: 10px;
  white-space: nowrap;
  flex-wrap: nowrap;
}

.subir-integral {
  display: flex;
  align-items:center;
  gap: 48px; /* ajustá este valor según lo que ocupés */
  margin-top: 50px;
}

/* — Resultados — */
.salida {
  
  flex: 2 1 0;
  width: 100%;
  
  background:#303030;
  color:#fff;
  border-radius:10px;
  padding:20px;
  display:flex;
  flex-direction:column;
  gap:12px;
  align-items:flex-start;
  justify-content:flex-start;
  position:relative;
  box-sizing: border-box;
  min-height: 430px;
  min-width: 600px;

}

#sinResultados {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  font-size: 16px;
  color: #a0a0a0;
  text-align: center;
}


#resultados {
  min-height: 470px; /* o el mismo alto del contenido total con barras */
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
}






.input-invalido {
  border: 2px solid red !important;
}



.salida:empty::before {
  content:'Sin resultados.'; color:#404040; font-size:10px;
  position:absolute;
}
.tabla-resultados {
  width:100%; border-collapse:collapse;
}
.tabla-resultados td {
  padding:6px 8px; font-size:15px;
  border-bottom:1px solid rgba(255,255,255,0.1);
}
.tabla-resultados tr:last-child td { border-bottom:none; }

/* — Botones — */
.botones {
  display:flex; justify-content:flex-end; gap:15px; margin-top:20px;
}
.botones button {
  padding:10px 18px; border:none; border-radius:6px;
  font-weight:bold; cursor:pointer;
}
#calcularReceta { background:#40a15e; color:#fff; }
#calcularReceta:disabled { opacity:.6; cursor:not-allowed; }
#guardarBtn { background:#f3f3f3; color:#000; }
#guardarBtn.enabled { background:#fa961b; color:#fff; }
#guardarBtn:disabled { opacity:.6; cursor:not-allowed; }

/* === Botón "Nueva Receta" (adaptado de Uiverse) === */
.botones .btn-nueva {
  /* aspecto base */
  display: flex;
  align-items: center;
  justify-content: flex-start;
  height: 40px;                 /* alto similar a "Calcular Receta" */
  width: 48px;                  /* colapsado: solo el + */
  padding: 0;                   /* anulamos el padding general de .botones button */
  background-color: #e6e6e6;    /* gris claro */
  color: #000;                  /* texto negro */
  border: none;
  border-radius: 6px;           /* mismo redondeo que "Calcular Receta" */
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: width .3s ease, border-radius .3s ease, transform .06s ease;
  box-shadow: 2px 2px 10px rgba(0,0,0,.18);
}

.botones .btn-nueva .sign {
  width: 100%;
  font-size: 1.4em;
  color: #000;                  /* + en negro */
  display: flex;
  align-items: center;
  justify-content: center;
  transition: width .3s ease, padding-left .3s ease;
}

.botones .btn-nueva .text {
  position: absolute;
  right: 0;
  width: 0;
  opacity: 0;
  color: #000;                  /* texto en negro */
  font-size: 0.75rem;
  font-weight: 700;
  transition: width .3s ease, opacity .3s ease, padding-right .3s ease;
  white-space: nowrap;
}

/* Hover: expande y muestra el texto */
.botones .btn-nueva:hover {
  width: 150px;                 /* expande ancho */
  border-radius: 6px;           /* mantenemos el mismo radio */
}

.botones .btn-nueva:hover .sign {
  width: 34%;
  padding-left: 10px;
}

.botones .btn-nueva:hover .text {
  opacity: 1;
  width: 66%;
  padding-right: 14px;
}

/* Click feedback */
.botones .btn-nueva:active {
  transform: translate(1px, 1px);
}




/* — Registro Histórico — */
#registro-historico .entrada {
  background:#212121; border-radius:10px;
  color:#fff; width:1375px;
  margin:0 auto 20px; padding:25px 30px;
  box-sizing:border-box;
}
#registro-historico .filter-container select {
  padding:5px 10px; font-size:12px;
  border:1px solid #ccc; border-radius:4px;
  background-color:#404040;
  color:#E0E0E0;
  width:100px;
}

/* — Search bar — */
.container {
  display:flex; justify-content:flex-end; align-items:center; height:35px;
  margin-bottom:20px;
}
.container .input {
  max-width:190px;
  height:100%;
  outline:none;
  font-size:14px;
  font-weight:500;
  background-color:#53535f;
  caret-color:#f7f7f8;
  color:#fff;
  padding:7px 10px;
  border:2px solid transparent;
  border-top-left-radius:7px;
  border-bottom-left-radius:7px;
  margin-right:1px;
  transition:all .2s ease;
}
.container .input:hover {
  border:2px solid rgba(255,255,255,0.16);
}
.container .input:focus {
  border:2px solid #fa961b;
  background-color:#0e0e10;
}
.search__btn {
  border:none;
  cursor:pointer;
  background-color:rgba(42,42,45,1);
  border-top-right-radius:7px;
  border-bottom-right-radius:7px;
  height:100%;
  width:30px;
  display:flex;
  justify-content:center;
  align-items:center;
}
.search__btn:hover {
  background-color:rgba(54,54,56,1);
}

/* — Resultados Histórico — */
.resultados-historico {
  background:#303030; color:#fff;
  border-radius:10px; padding:25px 35px;
  width: 1050px;
  height:600px;
  display:flex; align-items:center; justify-content:center;
  margin:0 auto;
}

/* — Botón Mostrar Gráfico — */
#mostrarGrafico {
  background:#40a15e; color:#ffffff;
}

/* — Índice de Descascarado — */
.tabs {
  display:flex;
  gap:10px;
  margin-bottom:20px;
}
.tabs button {
  padding:10px 20px;
  background:#404040;
  color:#fff;
  border:none;
  border-radius:6px;
  cursor:pointer;
  font-weight:bold;
}
.tabs button.active {
  background:#40a15e;
}
.descascarado-tab {
  display:none;
}
.descascarado-content {
  display:flex;
  gap:20px;
  justify-content:center;
}
.tabla-contenedor {
  background:#303030;
  border-radius:10px;
  padding:20px;
  flex:1;
  display:flex;
  flex-direction:column;
  align-items:center;
  min-height:300px;
}
.tabla-contenedor h3 {
  margin:0 0 15px;
  text-align:center;
}
.tabla-descascarado {
  width:100%;
  border-collapse:collapse;
}
.tabla-descascarado th,
.tabla-descascarado td {
  border-bottom:1px solid rgba(255,255,255,0.1);
  padding:8px;
  font-size:14px;
  text-align:center;
}
.tabla-descascarado th {
  font-weight:bold;
}

.barra-container {
  display: grid;
  grid-template-columns: 430px auto;
  align-items: center;
  font-weight: 600;
  font-family: 'Open Sans', sans-serif;
  white-space: nowrap;
  margin-bottom: 0px;
  border-bottom: 1px solid #666;
  padding-bottom: 0px;
}

.barra-container:not(:last-child) {
  border-bottom: 1px solid #666;
  padding-bottom: 0px;
  margin-bottom: 15px;
}

.barra {
  width: 125px;
  height: 25px;
  background-color: #ccc;
  position: relative;
  border-radius: 4px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.relleno {
  height: 100%;
  background-color: #ffa726;
  width: 0%;
  transition: width 0.3s ease;
  position: absolute;
  left: 0;
  top: 0;
  border-radius: 4px;
  z-index: 1;
}

.barra span {
  position: relative;
  z-index: 2;
  font-size: 12px;
  color: #000;
  text-align: center;
}

.relleno span {
  position: absolute;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  text-align: center;
  line-height: 20px;
  font-size: 12px;
  color: #000;
  pointer-events: none;
  z-index: 2;
}

.alineador-barras {
  display: flex;
  flex-direction: column;
  align-items: flex-start; /* Alinea a la izquierda */
  gap: 10px;
  padding-left: 5px; /* Ajustá según lo que ocupés */
}

.barra-ajustada {
  margin-left: 0px; /* Se puede ajustar individualmente en línea */
}

/* Total blanqueado visualmente aparte */
.dato-final {
  margin-top: 15px;
  margin-bottom: 20px;
  font-size: 16px;
  font-weight: bold;
}

.label-wrapper {
  text-align: left;
}

.contenido-principal {
  min-height: calc(100vh - 50px); /* 50px es la altura del footer */
  box-sizing: border-box;
  padding-bottom: 50px; /* previene que se monte el contenido encima */
}

.panel-indice-pulimento {
  width: 300px;
  min-height: 300px;
  background: #303030;
  color: #fff;
  border-radius: 10px;
  padding: 20px;
  box-sizing: border-box;
  
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.panel-indice-pulimento h4 {
  margin-top: 0;
  font-size: 18px;
  color: #fa961b;
}
.panel-indice-pulimento select,
.panel-indice-pulimento input[type="checkbox"] {
  margin-top: 5px;
}

.contenedor-historico {
  display: flex;
  justify-content: flex-start;
  align-items: stretch;
  gap: 20px; /* espacio entre panel y resultados */
}

.filtro-item {
  display: flex;
  align-items: center;
  margin-bottom: 10px;
}

/* Gap diferente para cada uno según el orden */
.filtro-item:nth-child(2) {
  gap: 25px; /* primer filtro */
}

.filtro-item:nth-child(3) {
  gap: 25px; /* segundo filtro */
}

.filtro-item:nth-child(4) {
  gap: 80px; /* tercer filtro */
}

.filtro-item label {
  white-space: nowrap;
}

/* Estilo estándar de los selects */
.filtro-select {
  min-width: 100px;
  height: 28px;
  background: #404040;
  color: #fff;
  border: 1px solid #888;
  border-radius: 4px;
  padding: 4px 8px;
}

/* Forzamos visibilidad para evitar conflictos */
.filtro-item select {
  visibility: visible !important;
  opacity: 1 !important;
}




/* — Footer — */
main { padding:20px; text-align:center; margin-bottom:50px; }
footer {
  background:#333;
  color:#fff;
  text-align:center;
  padding:10px 0;
  width:100%;
}

/* Ancho propio para el Índice de Descascarado */
#indice-descascarado .entrada {
  width: 1375px; /* o el ancho que ocupés */
  height: 705px;
  display: flex;           /* para que el contenido crezca y el scroll funcione */
  flex-direction: column;
    
}

/* 1) Evitar salto de línea en el encabezado "Min/Toma" (y su columna) */
#indice .tabla-contenedor:first-child table th:nth-child(8),
#indice .tabla-contenedor:first-child table td:nth-child(8) {
  white-space: nowrap;   /* se verá "Min/Toma" en una sola línea */
}

#indice-descascarado .descascarado-tab {
  flex: 1 1 auto;
  overflow-y: auto;        /* scroll vertical para ver todos los datos */
  overflow-x: auto;        /* por si la tabla se hace más ancha */
}

/* Opcional: que las dos tablas no se queden centradas si hay scroll */
#indice-descascarado .descascarado-content {
  align-items: flex-start;
}

#indice-descascarado.receta-pulido {
  padding: 0;            /* antes: 30px 20px */
}

/* Tabs con filtros a la derecha */
#indice-descascarado .tabs {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
#indice-descascarado .tabs .tabs-left {
  display: flex;
  gap: 10px;
}
#indice-descascarado .resumen-filtros {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Que "Min/Toma" no se parta en Resumen también */
#resumen table th:nth-child(5),
#resumen table td:nth-child(5) {
  white-space: nowrap;
}

/* Selector debajo de tabs */
#indice-descascarado .resumen-vista {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 10px 0 15px;
}

/* Mostrar la tabla elegida pegada a la izquierda */
#resumen .descascarado-content {
  justify-content: flex-start;  /* ya no centrado */
}

/* Opcional: que el contenedor mostrado tenga un ancho cómodo */
#resumen .tabla-contenedor {
  flex: 0 1 750px;    /* ajusta a gusto (700–900px) */
}

/* Resaltar la fila Total general en todas las tablas de Resumen */
#resumen table tbody tr.fila-total th {
  color: #fa961b;
  font-weight: 700;
}

/* Alinear el contenido del tab Índice a la izquierda (panel + tablas) */
#indice .descascarado-content {
  justify-content: flex-start;  /* no centrado */
  align-items: stretch;
}

/* Que las tarjetas se adapten bien junto al panel (300px) */
#indice .tabla-contenedor {
  flex: 1 1 520px;   /* ajustá el mínimo (500–700px) a tu gusto */
  max-width: 820px;  /* opcional para evitar ensanchar demasiado */
}

/* Color corporativo verde (ajusta si ya lo definiste) */
:root {
  --app-green: #00e676;
}

/* Fancy checkbox SOLO en el tab Índice */
#indice-descascarado #panelIndiceDesc .chkbox-fancy {
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  line-height: 1;
}

#indice-descascarado #panelIndiceDesc .chkbox-fancy input {
  display: none;
}

#indice-descascarado #panelIndiceDesc .chkbox-fancy svg {
  overflow: visible;
}

#indice-descascarado #panelIndiceDesc .chkbox-fancy .path {
  fill: none;
  stroke: #fff;                 /* color inactivo */
  stroke-width: 6;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: stroke-dasharray 0.5s ease, stroke-dashoffset 0.5s ease, stroke 0.2s ease;
  stroke-dasharray: 241 9999999;
  stroke-dashoffset: 0;
}

/* Activo: animación + color verde corporativo */
#indice-descascarado #panelIndiceDesc .chkbox-fancy input:checked ~ svg .path {
  stroke-dasharray: 70.5096664428711 9999999;
  stroke-dashoffset: -262.2723388671875;
  stroke: var(--app-green);
}

/* Texto al lado del check */
#indice-descascarado #panelIndiceDesc .filtro-label {
  margin: 0 8px 0 6px; /* separa el icono del texto */
  user-select: none;
  white-space: nowrap;
}

/* (Opcional) Alineación consistente de etiquetas en el panel */
#panelIndiceDesc .filtro-item label,
#panelIndiceDesc .filtro-item .chkbox-fancy,
#panelIndiceDesc .filtro-item .filtro-label {
  display: inline-flex;
  align-items: center;
}

/* Gap específico para el filtro Silo (si lo ocupás) */
#panelIndiceDesc .filtro-item.filtro-silo { gap: 40px; }


/* Usamos un grid interno exclusivo del TAB Índice */
#indice .descascarado-content { display: block; }  /* resetea cualquier display previo */
#indice .indice-grid {
  display: grid;
  grid-template-columns: 300px 1fr 1fr; /* panel | MP | MQ */
  gap: 16px;
  align-items: start;
  width: 100%;
  box-sizing: border-box;
}

/* Panel columna 1; tarjetas en columnas 2 y 3 */
#panelIndiceDesc { grid-column: 1; }
#mpPanel        { grid-column: 2; min-width: 0; }
#mqPanel        { grid-column: 3; min-width: 0; }

#indice .tabla-contenedor {
  overflow: auto;           /* scroll si el contenido crece */
  background: transparent;
}

#indice .tabla-descascarado {
  width: 100%;
  table-layout: fixed;      /* columnas estables */
  border-collapse: collapse;
}
#indice .tabla-descascarado th,
#indice .tabla-descascarado td {
  white-space: nowrap;      /* una línea */
  overflow: hidden;
  text-overflow: ellipsis;  /* … cuando se corta */
}

/* El tab tiene scroll interno dentro del contenedor gris (.entrada) */
#indice-descascarado .descascarado-tab { overflow: auto; }

/* Responsive: si hay poco ancho, apila MP y MQ una debajo de la otra */
@media (max-width: 1400px) {
  #indice .indice-grid {
    grid-template-columns: 280px 1fr; /* panel + una columna */
  }
  #mpPanel, #mqPanel { grid-column: 2; }
}

/* === Estado bloqueado: oculta el menú superior mientras no haya login === */
body.locked .navbar nav {
  display: none !important;
}

/* === Login (adaptado de Uiverse.io) === */
#contenidoInicio .login-box {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 400px;
  max-width: 94vw;
  padding: 40px;
  margin: 20px auto;
  transform: translate(-50%, -55%);
  background: rgba(0,0,0,.9);
  box-sizing: border-box;
  box-shadow: 0 15px 25px rgba(0,0,0,.6);
  border-radius: 10px;
  z-index: 1; /* encima del fondo del main */
}

#contenidoInicio .login-box p:first-child {
  margin: 0 0 30px;
  padding: 0;
  color: #fff;
  text-align: center;
  font-size: 1.5rem;
  font-weight: bold;
  letter-spacing: 1px;
}

#contenidoInicio .login-box .user-box {
  position: relative;
}

#contenidoInicio .login-box .user-box input {
  width: 100%;
  padding: 10px 0;
  font-size: 16px;
  color: #fff;
  margin-bottom: 30px;
  border: none;
  border-bottom: 1px solid #fff;
  outline: none;
  background: transparent;
}

#contenidoInicio .login-box .user-box label {
  position: absolute;
  top: 0; left: 0;
  padding: 10px 0;
  font-size: 16px;
  color: #fff;
  pointer-events: none;
  transition: .5s;
}

#contenidoInicio .login-box .user-box input:focus ~ label,
#contenidoInicio .login-box .user-box input:valid ~ label {
  top: -20px;
  left: 0;
  color: #fff;
  font-size: 12px;
}

/* Botón animado (ancla) */
#contenidoInicio .login-box .btn-login {
  position: relative;
  display: inline-block;
  padding: 10px 20px;
  font-weight: bold;
  color: #fff;
  font-size: 16px;
  text-decoration: none;
  text-transform: uppercase;
  overflow: hidden;
  transition: .5s;
  margin-top: 10px;
  letter-spacing: 3px;
  border-radius: 5px;
}

#contenidoInicio .login-box .btn-login:hover {
  background: #fff;
  color: #272727;
}

#contenidoInicio .login-box .btn-login span {
  position: absolute;
  display: block;
}

#contenidoInicio .login-box .btn-login span:nth-child(1) {
  top: 0; left: -100%;
  width: 100%; height: 2px;
  background: linear-gradient(90deg, transparent, #fff);
  animation: btn-anim1 1.5s linear infinite;
}
@keyframes btn-anim1 { 0%{left:-100%} 50%,100%{left:100%} }

#contenidoInicio .login-box .btn-login span:nth-child(2) {
  top: -100%; right: 0;
  width: 2px; height: 100%;
  background: linear-gradient(180deg, transparent, #fff);
  animation: btn-anim2 1.5s linear infinite; animation-delay: .375s;
}
@keyframes btn-anim2 { 0%{top:-100%} 50%,100%{top:100%} }

#contenidoInicio .login-box .btn-login span:nth-child(3) {
  bottom: 0; right: -100%;
  width: 100%; height: 2px;
  background: linear-gradient(270deg, transparent, #fff);
  animation: btn-anim3 1.5s linear infinite; animation-delay: .75s;
}
@keyframes btn-anim3 { 0%{right:-100%} 50%,100%{right:100%} }

#contenidoInicio .login-box .btn-login span:nth-child(4) {
  bottom: -100%; left: 0;
  width: 2px; height: 100%;
  background: linear-gradient(360deg, transparent, #fff);
  animation: btn-anim4 1.5s linear infinite; animation-delay: 1.125s;
}
@keyframes btn-anim4 { 0%{bottom:-100%} 50%,100%{bottom:100%} }

/* Shake sutil en error */
#contenidoInicio .login-box.shake {
  animation: shake .3s linear;
}
@keyframes shake {
  0%,100% { transform: translate(-50%, -55%) }
  20% { transform: translate(calc(-50% - 6px), -55%) }
  40% { transform: translate(calc(-50% + 5px), -55%) }
  60% { transform: translate(calc(-50% - 4px), -55%) }
  80% { transform: translate(calc(-50% + 3px), -55%) }
}

/* En pantallas chicas, centra sin overlap */
@media (max-width: 600px) {
  #contenidoInicio .login-box {
    position: relative;
    left: 0; top: 0;
    transform: none;
    margin: 40px auto;
  }
}

/* Bloqueo pre-login */
.locked .navbar nav,
.locked .navbar .dropdown-menu {
  display: none !important;
}
.locked .navbar a {
  pointer-events: none;
  opacity: .55;
  cursor: not-allowed;
}

/* ===== Sesión en navbar (derecha) ===== */
.navbar { display: flex; align-items: center; gap: 16px; } /* no rompe si ya era flex */
.navbar nav { flex: 0 1 auto; }
.navbar .nav-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 12px;
}
.locked .nav-actions { display: none; } /* ocultar si no hay sesión */
.navbar .nav-user {
  font: 600 14px/1 "Open Sans", system-ui, -apple-system, sans-serif;
  color: #e0e0e0;
  letter-spacing: .2px;
}

/* ===== From Uiverse.io by vinodjangid07 (scopeado al navbar) ===== */
.navbar .Btn {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  width: 45px;
  height: 45px;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition-duration: .3s;
  box-shadow: 2px 2px 10px rgba(0, 0, 0, .2);
  background-color: rgb(255, 65, 65);
}

.navbar .sign { /* plus/arrow */
  width: 100%;
  transition-duration: .3s;
  display: flex;
  align-items: center;
  justify-content: center;
}
.navbar .sign svg { width: 17px; }
.navbar .sign svg path { fill: #fff; }

.navbar .Btn .text {
  position: absolute;
  right: 0%;
  width: 0%;
  opacity: 0;
  color: #fff;
  font-size: 1.05rem;
  font-weight: 600;
  transition-duration: .3s;
}

.navbar .Btn:hover {
  width: 125px;
  border-radius: 40px;
  transition-duration: .3s;
}
.navbar .Btn:hover .sign {
  width: 30%;
  transition-duration: .3s;
  padding-left: 20px;
}
.navbar .Btn:hover .text {
  opacity: 1;
  width: 70%;
  transition-duration: .3s;
  padding-right: 10px;
}
.navbar .Btn:active { transform: translate(2px, 2px); }






/* ===== Fix solapamiento icono/texto en botón Logout ===== */
.navbar .Btn {
  /* riel reservado para el icono */
  --iconRail: 45px; /* ancho del botón cerrado */
}

/* El texto se ancla desde la izquierda, dejando libre el riel del icono */
.navbar .Btn .text {
  position: absolute;
  left: calc(var(--iconRail) + 4px); /* despega el texto del icono */
  right: 8px;                        /* margen derecho */
  width: 0;                          /* animamos desde 0 */
  opacity: 0;
  z-index: 2;                        /* por encima del icono, por si acaso */
  top: 50%;
  transform: translateY(-50%);       /* centrado vertical */
  overflow: hidden;                  /* evita ver letras durante el ancho 0 */
}

/* Al hacer hover: el ancho del texto ocupa todo lo disponible menos el riel del icono */
.navbar .Btn:hover .text {
  width: calc(100% - (var(--iconRail) + 12px));
  opacity: 1;
  padding-right: 10px;               /* el que ya tenía */
}

/* Evitamos que el icono invada el área del texto durante la animación */
.navbar .Btn:hover .sign {
  width: 30%;
  padding-left: 0; /* <- QUITAR el padding que empujaba el icono sobre la “L” */
}

/* (Opcional) si quiere separar un pelín más el texto del icono: */
.navbar .Btn:hover .sign svg { margin-left: 2px; }


/* === Indicadores Resumen (Índice de Descascarado) === */
#indice-descascarado #resumen .indicadores-col {
  flex: 0 1 540px;           /* columna fija al lado derecho de contDias */
  display: flex;
  align-items: flex-start;
}
#indice-descascarado .indicadores-grid {
  display: grid;
  grid-template-columns: 1fr 1fr; /* 2 x 2 */
  gap: 16px;
  align-content: start;
}

/* Tarjeta (derivado de Uiverse, scopeado) */
#indice-descascarado .ind-card { max-height: 150px; }
#indice-descascarado .ind-card .ind-title {
  margin-bottom: 6px;
  font: 700 14px/1 "Open Sans", system-ui, sans-serif;
  color: #e0e0e0;
}

/* From Uiverse.io by gharsh11032000 (reducido y scopeado) */
#indice-descascarado .ind-card .card-container {
  width: 250px; height: 140px; position: relative;
  border-radius: 10px; overflow: hidden;
  box-shadow: 0 10px 20px rgba(0,0,0,0.2);
  background: #2a2a2a;
}
#indice-descascarado .ind-card .card { width: 100%; height: 100%; border-radius: inherit; }
#indice-descascarado .ind-card .card .front-content {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  transition: all .6s cubic-bezier(.23,1,.32,1);
}
#indice-descascarado .ind-card .card .front-content p {
  font-size: 28px; font-weight: 800; opacity: 1;
  background: linear-gradient(-45deg, #f89b29 0%, #ff0f7b 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  transition: all .6s cubic-bezier(.23,1,.32,1);
}

#indice-descascarado .ind-card .card .content {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  text-align: center; gap: 8px;
  background: linear-gradient(-45deg, #f89b29 0%, #ff0f7b 100%);
  color: #e8e8e8; padding: 16px; line-height: 1.35;
  border-radius: 5px; pointer-events: none;
  transform: translateY(-96%);
  transition: all .6s cubic-bezier(.23,1,.32,1);
}
#indice-descascarado .ind-card .card .content .heading { font-size: 18px; font-weight: 700; }
#indice-descascarado .ind-card .card:hover .content { transform: translateY(0); }
#indice-descascarado .ind-card .card:hover .front-content { transform: translateY(30%); }
#indice-descascarado .ind-card .card:hover .front-content p { opacity: 0; }

/* Estados OK / BAD (cambian color del número y del fondo animado) */
#indice-descascarado .ind-card.ok  .card .front-content p { 
  background: linear-gradient(-45deg, #00e676 0%, #40a15e 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
#indice-descascarado .ind-card.bad .card .front-content p {
  background: linear-gradient(-45deg, #ff1744 0%, #ff0f7b 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
#indice-descascarado .ind-card.ok  .card .content { background: linear-gradient(-45deg, #00e676 0%, #40a15e 100%); }
#indice-descascarado .ind-card.bad .card .content { background: linear-gradient(-45deg, #ff1744 0%, #ff0f7b 100%); }

/* Responsive (si queda corto el ancho, que apile) */
@media (max-width: 1400px) {
  #indice-descascarado #resumen .indicadores-col { flex: 1 1 100%; }
  #indice-descascarado .indicadores-grid { grid-template-columns: 1fr 1fr; }
}

/* ===== Botón de Login con flecha (scope login) ===== */
#contenidoInicio .login-box .btn-arrow {
  /* Colores solicitados */
  --primary-color: #ccc;     /* fondo inicial */
  --hover-color: #40a15e;    /* color en hover */
  --arrow-width: 10px;
  --arrow-stroke: 2px;

  box-sizing: border-box;
  border: 0;
  border-radius: 20px;
  background: var(--primary-color);
  color: #000;               /* texto negro al inicio */

  /* +5 px de alto (≈ +2.5 arriba/abajo) y ~+15 px de largo (≈ +7.5 por lado) */
  padding: 12.5px 26px;

  display: inline-flex;
  align-items: center;
  gap: 0.6em;
  font-weight: bold;
  font-family: inherit;      /* misma fuente que el login */
  transition: background .2s ease, color .2s ease;
}

#contenidoInicio .login-box .btn-arrow .arrow-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
}

#contenidoInicio .login-box .btn-arrow .arrow {
  margin-top: 1px;
  width: var(--arrow-width);
  height: var(--arrow-stroke);
  background: #ccc;          /* línea de la flecha en reposo (negro) */
  position: relative;
  transition: .2s;
}

#contenidoInicio .login-box .btn-arrow .arrow::before {
  content: "";
  position: absolute;
  top: -3px;
  right: 3px;
  padding: 3px;
  border: solid #000;        /* punta de la flecha en reposo (negro) */
  border-width: 0 var(--arrow-stroke) var(--arrow-stroke) 0;
  transform: rotate(-45deg);
  transition: .2s;
}

/* Hover: fondo verde corporativo y mejor legibilidad */
#contenidoInicio .login-box .btn-arrow:hover {
  background-color: var(--hover-color);
  color: #fff;               /* contraste correcto sobre verde */
}

#contenidoInicio .login-box .btn-arrow:hover .arrow {
  background: #fff;          /* flecha en blanco sobre verde */
}

#contenidoInicio .login-box .btn-arrow:hover .arrow::before {
  right: 0;
  border-color: #fff;
}

/* ===== Fancy checkbox compartido: Índice + Registro Histórico ===== */
#indice-descascarado #panelIndiceDesc .chkbox-fancy,
#registro-historico  #panelIndicePulimento .chkbox-fancy {
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  line-height: 1;
}

#indice-descascarado #panelIndiceDesc .chkbox-fancy input,
#registro-historico  #panelIndicePulimento .chkbox-fancy input {
  display: none;
}

#indice-descascarado #panelIndiceDesc .chkbox-fancy svg,
#registro-historico  #panelIndicePulimento .chkbox-fancy svg {
  overflow: visible;
}

#indice-descascarado #panelIndiceDesc .chkbox-fancy .path,
#registro-historico  #panelIndicePulimento .chkbox-fancy .path {
  fill: none;
  stroke: #fff;               /* estado inactivo */
  stroke-width: 6;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: stroke-dasharray .5s ease, stroke-dashoffset .5s ease, stroke .2s ease;

  /* valores base: misma animación que el Índice */
  stroke-dasharray: 241 9999999;
  stroke-dashoffset: 0;
}

/* Estado marcado (animación) */
#indice-descascarado #panelIndiceDesc .chkbox-fancy input:checked + svg .path,
#registro-historico  #panelIndicePulimento .chkbox-fancy input:checked + svg .path {
  stroke-dasharray: 70.5096664428711 9999999;
  stroke-dashoffset: -262.2723388671875;
  stroke: var(--app-green);
}

/* Texto al lado del icono */
#indice-descascarado #panelIndiceDesc .filtro-label,
#registro-historico  #panelIndicePulimento .filtro-label {
  margin: 0 8px 0 6px;
  user-select: none;
  white-space: nowrap;
}

/* (Opcional) Alinear todo bonito dentro del panel */
#registro-historico #panelIndicePulimento .filtro-item {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Use el verde corporativo en Registro Histórico sin tocar el global */
#registro-historico {
  --app-green: #40a15e; /* o elimine este bloque si ya usa el mismo verde en :root */
}

/* ==== OVERRIDE SOLO para Registro Histórico (agregar al final) ==== */
#registro-historico {
  --chk-off: #FFFF;      /* trazo inactivo visible en fondo claro */
  --chk-on:  #40a15e;      /* trazo activo */
}

#registro-historico #panelIndicePulimento .chkbox-fancy svg{
  width: 26px;
  height: 26px;
  min-width: 26px;
  min-height: 26px;
  flex: 0 0 26px;          /* reserva espacio */
}

#registro-historico #panelIndicePulimento .chkbox-fancy .path{
  fill: none !important;
  stroke: var(--chk-off) !important;
  stroke-width: 6 !important;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 1 !important;
  stroke-dasharray: 241 9999999 !important;
  stroke-dashoffset: 0 !important;
}

#registro-historico #panelIndicePulimento .chkbox-fancy input:checked + svg .path{
  stroke: var(--chk-on) !important;
  stroke-dasharray: 70.5096664428711 9999999 !important;
  stroke-dashoffset: -262.2723388671875 !important;
}

#registro-historico #panelIndicePulimento .filtro-item{
  display: flex;
  align-items: center;
  gap: 8px;
}




/* ===== Registro Histórico: selects a la derecha (limpio) ===== */

/* 1) Fila base del panel */
#registro-historico #panelIndicePulimento .filtro-item{
  display: flex;
  align-items: center;
  gap: 8px;                /* compacto para que todo quepa */
}

/* 2) Ícono del check (SVG) con tamaño fijo */
#registro-historico #panelIndicePulimento .chkbox-fancy svg{
  flex: 0 0 26px;
  width: 26px;
  height: 26px;
}

/* 3) Texto del rótulo a la izquierda (se puede acortar si no hay espacio) */
#registro-historico #panelIndicePulimento .filtro-label{
  flex: 1 1 auto;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 4) Todos los selects se alinean a la derecha */
#registro-historico #panelIndicePulimento .filtro-select{
  margin-left: auto;      /* se va a la derecha */
  width: 100px;           /* ancho base para Origen/Objetivo */
  flex: 0 0 100px;
}

/* 5) Solo TIEMPO más largo (no afecta a los demás) */
#registro-historico #panelIndicePulimento #selTiempo{
  width: 120px;
  flex-basis: 120px;
}

/* 6) Neutralizar gaps heredados solo dentro de este panel */
#registro-historico #panelIndicePulimento .filtro-item:nth-child(2),
#registro-historico #panelIndicePulimento .filtro-item:nth-child(3),
#registro-historico #panelIndicePulimento .filtro-item:nth-child(4){
  gap: 8px;
}

/* === Icon-only button para Reset Zoom === */
.icon-btn {
  width: 40px;
  height: 40px;
  border: none;
  background: transparent;
  padding: 0;
  cursor: pointer;
  border-radius: 6px;     /* mismo radio que tus botones */
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.icon-btn.icon-zoom-reset {
  background-image: url('img/disminuir-zoom.png'); /* o .png si prefieres */
  background-repeat: no-repeat;
  background-position: center;
  background-size: 70% auto; /* tamaño del icono dentro del cuadrado */
}

.icon-btn.icon-zoom-reset:hover {
  filter: brightness(0.9);
}

.icon-btn:active {
  transform: translate(1px, 1px);
}

