/* Apariencia compartida, sin fuentes remotas ni dependencias. */
:root {
  --acento: #236449;
  --borde: #e2e5e7;
  --sombra: 0 2px 6px #182b2203, 0 8px 24px #182b2205;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px; line-height: 1.5; color: #252a2e; background: #f5f6f7;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { color: #202528; font-weight: 650; letter-spacing: -.035em; line-height: 1.2; }
h1 { font-size: 30px; margin: 0 0 22px; }
h2 { font-size: 21px; margin: 28px 0 16px; }
p { color: #626c75; }
a { color: var(--acento); text-underline-offset: 3px; }
button, .boton {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 40px; padding: 9px 16px; border: 1px solid transparent; border-radius: 10px;
  background: var(--acento); color: #fff; font-size: 13px; font-weight: 550; line-height: 1.4;
  text-decoration: none; transition: background .15s ease, border-color .15s ease, box-shadow .15s ease;
}
button:hover, .boton:hover { background: #194e38; color: #fff; box-shadow: 0 2px 6px #1e4f3820; }
button:disabled { opacity: .45; cursor: wait; box-shadow: none; }
:is(a,button,input,select,textarea):focus-visible { outline: 3px solid #37816485; outline-offset: 3px; }
input, select, textarea {
  min-width: 0; padding: 10px 12px; border: 1px solid #d8dee1; border-radius: 9px;
  background: #fff; color: #252a2e; transition: border-color .15s ease, box-shadow .15s ease;
}
input:hover, select:hover, textarea:hover { border-color: #aabbb2; }
input:focus, select:focus, textarea:focus { border-color: #508c72; box-shadow: 0 0 0 3px #2b735514; }
input::placeholder, textarea::placeholder { color: #879098; }
input[readonly] { background: #f3f5f6; color: #5d6864; border-color: #e8ebec; }
input[type=checkbox] { width: 17px; height: 17px; padding: 0; margin: 0; accent-color: var(--acento); flex-shrink: 0; }
input[type=hidden], [hidden] { display: none !important; }
textarea { min-height: 84px; resize: vertical; }
label { gap: 7px; font-size: 12px; font-weight: 550; color: #535e65; }
label :is(input,select,textarea) { font-size: 14px; font-weight: 400; }
/* Menú superior fijo, liviano y translúcido. */
.cabecera-sistema {
  padding: 17px 28px 12px; background: #ffffffed; color: #252a2e;
  backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
  border-bottom: 1px solid #e4e7e9; box-shadow: 0 3px 14px #17261c04;
}
.cabecera-fila { gap: 20px; margin-bottom: 15px; }
.identidad-sistema { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
.emblema-nca { display: grid; place-items: center; width: 39px; height: 39px; background: #255a44; color: #fff; border: 1px solid #30664f; border-radius: 12px; font-size: 22px; font-weight: 600; letter-spacing: -.07em; box-shadow: inset 0 1px 0 #ffffff25, 0 3px 7px #21463012; }
.marca { font-size: 10px; letter-spacing: .18em; text-transform: uppercase; font-weight: 650; color: #657a70; }
.cabecera-sistema h2 { font-size: 16px; margin: 3px 0 0; letter-spacing: -.025em; }
.sesion-superior { gap: 18px; font-size: 12px; }
.sesion-superior form { margin: 0; }
.sesion-superior button { min-height: 34px; padding: 7px 12px; background: #f3f4f5; border-color: var(--borde); color: #505b62; font-size: 12px; }
.sesion-superior button:hover { background: #e8eded; box-shadow: none; }
.temporada-actual { display: inline-flex; align-items: center; gap: 7px; color: #33624d; background: #eef5f0; border: 1px solid #dce9e0; border-radius: 20px; padding: 5px 10px; white-space: nowrap; font-size: 11px; font-weight: 600; }
.temporada-actual::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: #438862; }
.usuario-conectado { display: flex; align-items: center; gap: 8px; color: #525d63; }
.avatar-usuario { display: grid; place-items: center; width: 29px; height: 29px; background: #eef0f2; border: 1px solid #e1e5e8; border-radius: 50%; color: #62706b; font-size: 10px; font-weight: 650; }
.menu-superior { gap: 4px; }
.menu-superior a { padding: 8px 12px; color: #687179; border-radius: 8px; font-size: 12px; font-weight: 500; }
.menu-superior a:hover { background: #f1f3f4; color: #263c31; }
.menu-superior a[aria-current=page] { background: #e9f1ec; color: #245b40; font-weight: 650; }
.contenido>main { padding: 30px 28px; }
main>h1:has(+a.boton) { display: inline-block; margin-bottom: 18px; }
main>h1+.boton { float: right; margin-left: 14px; }
main>h1+.boton::before { content: "+"; font-size: 19px; line-height: 1; font-weight: 400; }
main>a:first-child:not(.boton) { display: inline-block; font-size: 12px; text-decoration: none; margin: 0 0 16px; }
footer { clear: both; padding: 16px 28px 24px; color: #7d878d; font-size: 11px; }
section, .tabla, .form-maestro, .calibracion-cabecera, .detalle-recepcion { border-color: var(--borde); border-radius: 14px; box-shadow: var(--sombra); }
section { padding: 22px; }
section>h2:first-child { margin-top: 0; }
.filtros-recepcion { clear: both; gap: 12px; margin-top: 8px; padding: 18px; background: #fff; border: 1px solid var(--borde); border-radius: 14px; box-shadow: var(--sombra); }
.filtros-recepcion label { flex-basis: 120px; }
.filtros-recepcion input, .filtros-recepcion select { min-height: 39px; padding: 9px 10px; font-size: 13px; background: #fcfcfd; }
.filtros-recepcion button { min-height: 39px; }
.filtros-recepcion>a { align-self: end; padding: 10px 2px; font-size: 12px; color: #67726c; text-decoration: none; }
.filtros-recepcion>a.boton { padding: 10px 18px; font-size: 14px; color: #fff; }
.herramientas, .herramientas form, .acciones { gap: 10px; }
.herramientas form { flex: 1; max-width: 430px; }
.acciones a:not(.boton):not(.accion-icono) { color: #5d6863; font-size: 13px; text-decoration: none; padding: 8px; }
/* Tablas: datos densos, estados suaves y acciones discretas. */
.tabla { margin-top: 20px; }
.contenido .tabla>table, .contenido .tabla:not(:has(.calibracion-lineas))>table { font-size: 13px; }
.contenido .tabla th, .contenido .tabla td, .contenido .tabla:not(:has(.calibracion-lineas)) th, .contenido .tabla:not(:has(.calibracion-lineas)) td { padding: 12px 13px; border-bottom-color: #eef0f2; line-height: 1.45; }
.contenido .tabla th { background: #fafbfc; color: #646f77; font-size: 11px; font-weight: 650; letter-spacing: .01em; }
.contenido .tabla td { color: #424d54; font-variant-numeric: tabular-nums; }
.contenido .tabla tbody tr:last-child td { border-bottom: 0; }
.contenido .tabla tbody tr:hover>td { background: #f8faf9; }
.tabla td>a:not(.accion-icono) { text-decoration: none; }
.tabla th:last-child, .tabla td:has(>.accion-icono) { white-space: nowrap; }
.embalajes-listado .dato-secundario { color: #728078; font-size: 12px; }
.embalajes-listado .dato-estado { font-size: 11px; }
.estado-documento { display: inline-flex; align-items: center; border: 1px solid #e4e7e9; border-radius: 6px; padding: 3px 7px; font-size: 10px; font-weight: 600; line-height: 1.5; letter-spacing: .015em; white-space: nowrap; background: #f3f5f6; color: #748087; }
.estado-documento[data-estado="CONFIRMADA"], .estado-documento[data-estado="CONFIRMADO"], .estado-documento[data-estado="RECIBIDO"] { background: #edf6ef; border-color: #dbeadf; color: #38694d; }
.estado-documento[data-estado="BORRADOR"] { background: #fcf5e9; border-color: #eee2c8; color: #8a681f; }
.contenido .tabla .accion-icono { width: 31px; min-width: 31px; height: 31px; min-height: 31px; margin: 0 2px; border-radius: 8px; color: #78847e; box-shadow: none; }
.accion-icono svg { width: 17px; height: 17px; }
.contenido .tabla .accion-icono:hover { background: #eaf2ee; border-color: transparent; color: #245b40; }
.contenido .tabla .accion-icono-peligro:hover { background: #fff0ed; color: #ad4836; }
.contenido .tabla button.accion-icono:disabled { opacity: .32; cursor: not-allowed; background: transparent; color: #7f8985; }
/* Formularios, detalle y accesos a módulos. */
.form-maestro { max-width: 720px; gap: 19px; padding: 25px; }
.calibracion-cabecera { gap: 18px; padding: 22px; }
.detalle-recepcion { grid-template-columns: repeat(auto-fit,minmax(190px,1fr)); gap: 23px; padding: 25px; }
.detalle-recepcion dt { font-size: 11px; font-weight: 500; color: #7c858c; }
.detalle-recepcion dd { color: #34423b; font-size: 14px; }
.confirmacion { gap: 9px; line-height: 1.6; }
#anular { background: #fffafa; border-color: #ebdeda; }
#anular button { background: #a94438; }
#anular button:hover { background: #8e352a; }
#cal-agregar { background: #ebf2ee; color: var(--acento); border-color: #dce7e0; }
#cal-totales { padding: 15px 18px; border: 1px solid #dfe8e2; border-radius: 10px; color: #456151; font-size: 13px; }
.maestros-menu { grid-template-columns: repeat(auto-fit,minmax(215px,1fr)); gap: 14px; margin-top: 22px; }
.maestros-menu a { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 82px; padding: 22px; border-color: var(--borde); border-radius: 14px; color: #34483c; font-weight: 550; text-decoration: none; box-shadow: var(--sombra); }
.maestros-menu a::after { content: "↗"; color: #84988c; font-size: 18px; font-weight: 400; }
.maestros-menu a:hover { border-color: #b9cfc1; box-shadow: 0 5px 18px #203e3110; }
.maestros-menu .dato-secundario, .tabla .dato-secundario { display: block; margin-top: 4px; color: #728078; font-size: 12px; font-weight: 400; }
.resumen-stock section { margin-top: 0; padding: 22px; }
.resumen-stock span { font-size: 12px; color: #718079; }
.resumen-stock strong { font-size: 30px; font-weight: 600; letter-spacing: -.04em; color: #274936; font-variant-numeric: tabular-nums; }
.permisos-editor .tabla { box-shadow: none; }
.contenido .permisos-tabla th[scope=row] { font-size: 12px; color: #46574d; }
.permisos-tabla input[type=checkbox] { width: 18px; height: 18px; }
[role=status] { color: #326444; background: #edf6f0; padding: 12px 16px; border-radius: 10px; }
[role=alert], #cal-error { color: #aa4634; }
[role=alert]:empty, #cal-error:empty { display: none; }
.aviso-estado-maestro { z-index: 30; border-color: #d4e5da; border-radius: 12px; box-shadow: 0 8px 30px #0002; }
/* Ventanas emergentes. */
.ventana-formulario { width: min(1240px,calc(100vw - 40px)); height: calc(100dvh - 48px); border-color: #ffffffa0; border-radius: 18px; box-shadow: 0 24px 90px #111a2540; background: #f5f6f7; }
.ventana-formulario::backdrop { background: #1c25344d; backdrop-filter: blur(4px); }
.ventana-barra { padding: 13px 22px; background: #fafbfc; border-bottom: 1px solid var(--borde); color: #4a555e; }
.ventana-barra strong { font-size: 13px; font-weight: 600; }
.ventana-barra button { min-height: 32px; padding: 6px 11px; font-size: 12px; background: #ecedef; color: #5b646c; border-color: #e0e3e6; }
.ventana-barra button:hover { background: #e1e5e7; box-shadow: none; }
.ventana-marco { background: #f5f6f7; }
.formulario-emergente .contenido>main { padding: 25px; }
.formulario-emergente main>a:first-child:not(.boton) { display: none; }
.formulario-emergente main>h1 { font-size: 26px; }
.formulario-emergente .form-maestro:not(:has(.permisos-tabla)) { max-width: 900px; margin: 0 auto; gap: 16px; grid-template-columns: repeat(2,minmax(0,1fr)); }
.formulario-emergente .form-maestro>.acciones, .formulario-emergente .form-maestro>[role=alert], .formulario-emergente .form-maestro>p, .formulario-emergente .form-maestro>label:has(textarea), .formulario-emergente .form-maestro>label:has(select[multiple]), .formulario-emergente .form-maestro>.confirmacion { grid-column: 1/-1; }
/* Acceso. */
.login { max-width: 430px; margin: 9vh auto; padding: 38px; border-color: #e0e5e3; border-radius: 22px; box-shadow: 0 16px 60px #253e3210; }
.login .marca { margin-bottom: 20px; color: var(--acento); }
.login h1 { font-size: 29px; margin-bottom: 12px; }
.login>p { margin-bottom: 28px; }
.login button { margin-top: 5px; min-height: 44px; }
@media(min-width:1500px) { .cabecera-sistema, .contenido>main { padding-inline: 36px; } }
@media(max-width:1000px) {
  .cabecera-sistema { padding: 14px 20px 10px; }
  .menu-superior { gap: 2px; }
  .menu-superior a { padding: 8px 9px; }
  .sesion-superior { gap: 10px; }
  .usuario-conectado>span:last-child { max-width: 130px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .contenido>main { padding: 24px 20px; }
  .contenido .tabla:not(:has(.calibracion-lineas)) th, .contenido .tabla:not(:has(.calibracion-lineas)) td { padding: 10px; }
}
@media(max-width:700px) {
  .cabecera-sistema { padding: 12px; }
  .cabecera-fila { gap: 12px; margin-bottom: 10px; }
  .sesion-superior { margin-bottom: 0; gap: 8px; }
  .usuario-conectado>span:last-child { display: none; }
  .menu-superior a { flex: 1 1 auto; text-align: center; padding: 7px 10px; font-size: 11px; }
  .contenido>main { padding: 22px 14px; }
  h1 { font-size: 26px; }
  main>h1+.boton { float: none; display: flex; width: fit-content; margin: 0 0 18px; }
  .filtros-recepcion { padding: 14px; }
  .filtros-recepcion label { flex-basis: 130px; }
  .detalle-recepcion { padding: 18px; grid-template-columns: repeat(auto-fit,minmax(140px,1fr)); }
  .form-maestro { padding: 18px; }
  .ventana-formulario { width: calc(100vw - 12px); height: calc(100dvh - 12px); border-radius: 12px; }
  .ventana-barra { padding: 11px 14px; }
  .formulario-emergente .contenido>main { padding: 18px 12px; }
  .formulario-emergente .form-maestro:not(:has(.permisos-tabla)) { grid-template-columns: minmax(0,1fr); }
  .login { margin: 24px 14px; padding: 28px; }
}
@media(prefers-reduced-motion:reduce) { *, *::before, *::after { transition: none !important; scroll-behavior: auto !important; } }

.peso-bins-control { display:grid; gap:4px; margin-top:6px; min-width:145px; }
.peso-bins-control[hidden] { display:none; }
.peso-bins-control select { font-size:12px; padding:5px 8px; min-height:30px; }
.peso-bins-control small { color:#596e64; font-size:11px; line-height:1.4; }

/* Cuadratura: categorías y totales como planilla de temporada. */
.cuadratura td { text-align:right; white-space:nowrap; font-variant-numeric:tabular-nums; }
.cuadratura th { text-align:left; }
.cuadratura .cuadratura-seccion th { background:#d5ded9; }
.cuadratura .cuadratura-categoria th { background:#edf1ee; }
.cuadratura .cuadratura-subtotal>* { background:#e7ece8; font-weight:600; }
.cuadratura .cuadratura-total>* { background:#fff2cb; font-weight:700; }


.filtros-recepcion .acciones-recepcion { flex-basis:100%; flex-wrap:wrap; white-space:normal; margin-bottom:4px; }
/* Filtros compactos exclusivos del listado de Recepción. */
@media (min-width: 1000px) {
 form[aria-label="Filtros de recepción"] {
  display: grid;
  grid-template-columns: minmax(110px,1fr) 124px 124px minmax(130px,1.25fr) 88px 120px auto auto;
  gap: 8px;
  align-items: end;
 }
 form[aria-label="Filtros de recepción"] .acciones-recepcion { grid-column: 1 / -1; }
 form[aria-label="Filtros de recepción"] > label { min-width: 0; }
 form[aria-label="Filtros de recepción"] input,
 form[aria-label="Filtros de recepción"] select { width: 100%; min-width: 0; box-sizing: border-box; padding-left: 7px; padding-right: 7px; }
 form[aria-label="Filtros de recepción"] > button { padding-left: 12px; padding-right: 12px; }
}
@media (min-width: 1000px) {
 form[aria-label="Filtros de recepción"] {
  grid-template-columns: auto auto minmax(70px,1fr) 112px 112px minmax(90px,1fr) 76px 108px auto auto;
  gap: 6px;
  padding: 12px;
 }
 form[aria-label="Filtros de recepción"] .acciones-recepcion { display: contents; }
 form[aria-label="Filtros de recepción"] .acciones-recepcion .boton {
  font-size: 12px;
  padding: 10px 8px;
  white-space: nowrap;
  min-height: 39px;
  box-sizing: border-box;
 }
 form[aria-label="Filtros de recepción"] > label { font-size: 12px; }
 form[aria-label="Filtros de recepción"] input,
 form[aria-label="Filtros de recepción"] select { font-size: 12px; padding: 9px 4px; }
 form[aria-label="Filtros de recepción"] > button { font-size: 12px; padding: 10px 8px; }
}
