/* =====================================================================
   ITAX PERÚ — Tema Horizon (claro + oscuro) · marca 2026
   ---------------------------------------------------------------------
   GLOBAL_TEMA-HORIZON_SPECS.md. TODO color y fuente del ERP sale de acá:
   en los módulos no debe quedar ningún hex suelto, solo var(--…).

   El tema lo pone js/utils/tema.js en <html data-theme="light|dark">.
   Claro por defecto en todo el ERP, fi.html incluido (spec FI v19). PDF y
   Excel, siempre en claro (no leen estas variables).

   Reemplaza al Brand Kit anterior (navy, azul, ámbar, crema, fuentes
   serif y «Marfil y dorado»), que se eliminó — no convive.
   ===================================================================== */

/* ---------------------------------------------------------------------
   §1 · VARIABLES
   --------------------------------------------------------------------- */
:root {
  --shell:#354A5F; --shell-txt:#FFFFFF; --shell-sub:#A2AEBB;
  --fondo:#F5F6F7; --card:#FFFFFF; --side:#FFFFFF;
  --texto:#32363A; --titulo:#354A5F; --suave:#6B7280; --cuerpo:#374151;
  --borde:#DCDEE1; --borde-fuerte:#C8CACE;
  --th:#E9EAEC; --th-grupo:#F0F1F3; --hover:#F0F1F3; --cebra:#F7F8F8;
  --accion:#0070F2; --accion-hover:#0064D9;
  --nav-activo-bg:#EBF8FF; --nav-activo-txt:#0064D9;
  --ok:#256F3A; --ok-bg:#F5FAE5; --warn:#8A5A00; --warn-bg:#FFF8D6; --neg:#AA0808;
  --total-bg:#EAECEE; --total-borde:#556B82; --total-txt:#32363A;
  --font-ui:'Source Sans 3', sans-serif; --font-num:'IBM Plex Mono', monospace; --font-logo:'Archivo', sans-serif;
}
[data-theme="dark"] {
  --shell:#12212F; --fondo:#1D2D3E; --card:#29384A; --side:#172636;
  --texto:#EAECEE; --titulo:#FFFFFF; --suave:#A2AEBB; --cuerpo:#EAECEE;
  --borde:#3A4B5E; --borde-fuerte:#3A4B5E; --th:#22334A; --th-grupo:#1D2D3E; --hover:#33445A; --cebra:#243447;
  --accion:#4DB1FF; --accion-hover:#8FCBFF;
  --nav-activo-bg:rgba(77,177,255,.14); --nav-activo-txt:#8FCBFF;
  --ok:#5DD27A; --ok-bg:rgba(93,210,122,.12); --warn:#F2C14E; --warn-bg:rgba(242,193,78,.12); --neg:#FF8A80;
  --total-bg:#22334A; --total-borde:#8C9AAB; --total-txt:#EAECEE;
}
/* Controles nativos (scroll, selects, fechas) en el tema que corresponde. */
:root { color-scheme: light; }
[data-theme="dark"] { color-scheme: dark; }

/* ---------------------------------------------------------------------
   Base: fuente, fondo y texto
   --------------------------------------------------------------------- */
html, body { background: var(--fondo); color: var(--texto); }

/* =====================================================================
   §1b · TIPOGRAFÍA Y COLOR DE LETRA — global, no por módulo (06/10/2026)
   ---------------------------------------------------------------------
   Se pone UNA vez acá y la heredan todos los módulos (HR, TX, TR, FI, VT,
   CIGE…). En los módulos NO va: font-family propio, font-weight:300,
   itálica en títulos ni hex de texto sueltos — van estas clases o var(--…).

   Cómo pesan las reglas (importa, porque app.html carga Tailwind DESPUÉS):
   · «html body :where(…)» pesa (0,0,2): le gana al preflight de Tailwind
     (0,0,1) y pierde contra cualquier clase (text-xs, h-8, .fi-in…). Una
     pantalla que ya fijó su tamaño con una clase lo conserva.
   · El chevron del select pesa (1,0,2) a propósito: si un módulo pinta el
     select con «background:» (que borra la imagen), el select quedaría sin
     flecha porque appearance:none sigue puesto.
   · Las tablas no llevan font-size ni color propios: en modo estándar (todas
     las páginas tienen <!DOCTYPE>) heredan del body, y forzarlos le pisaría
     el tamaño a toda tabla que vive dentro de un contenedor text-xs.
   ===================================================================== */
:root { --secundario: #9AA0A8; --chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%236B7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); }
[data-theme="dark"] { --secundario: #8C9AAB; --chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23A2AEBB' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); }

html { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
html body { font-family: var(--font-ui); color: var(--texto); font-size: 14px; }
html body :where(input, select, textarea, button, table) { font-family: var(--font-ui); }

/* Cifras, fechas y códigos: IBM Plex Mono con dígitos tabulares */
html body :where(.num, td.num, .mono, input[type=date], input[type=number], input[type=month], .codigo) {
  font-family: var(--font-num);
  font-variant-numeric: tabular-nums;
}
html body ::placeholder { color: var(--secundario); opacity: 1; }

/* ---- Campos de formulario (modales incluidos) ----------------------------
   Alto 38, borde --borde-fuerte, radio 6, foco en --accion. Quedan fuera:
   los campos dentro de una celda de tabla (grillas editables), los que van
   embebidos en un contenedor que ya dibuja el borde (bg-transparent,
   border-0) y la barra superior, que tiene su propio diseño. */
html body :where(input:not([type=checkbox], [type=radio], [type=range], [type=color], [type=file], [type=hidden], [type=button], [type=submit], [type=reset], [type=image]), select, textarea) {
  font-size: 14px;
  color: var(--texto);
}
html body :where(input:not([type=checkbox], [type=radio], [type=range], [type=color], [type=file], [type=hidden], [type=button], [type=submit], [type=reset], [type=image]), select, textarea):not(:where(td *, th *, .itx-head *, .bg-transparent, .border-0, .border-none)) {
  border: 1px solid var(--borde-fuerte);
  border-radius: 6px;
  padding: 0 12px;
}
html body :where(input:not([type=checkbox], [type=radio], [type=range], [type=color], [type=file], [type=hidden], [type=button], [type=submit], [type=reset], [type=image]), select):not(:where(td *, th *, .itx-head *, .bg-transparent, .border-0, .border-none)) {
  height: 38px;
}
html body textarea:not(:where(td *, th *, .bg-transparent, .border-0, .border-none)) { padding: 8px 12px; }
html body :where(input, select, textarea):focus-visible { outline: 2px solid var(--accion); outline-offset: -1px; }
/* Select sin flecha nativa: chevron 14px #6B7280 */
html body select:not([multiple], [size], [style*="background"], #\#):not(:where(td *, th *, .itx-head *, .f28 *)) {
  -webkit-appearance: none;
  appearance: none;
  background-image: var(--chevron);
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 14px 14px;
  padding-right: 36px;
}
/* En una celda el select conserva la flecha nativa (la grilla es angosta) */

/* ---- Escala de texto (reemplaza los gray-500/600/700 de Tailwind) --------
   Título / h1 / h2 ......... --titulo 600, una palabra en --accion, SIN itálica
   Valor, celda, cuerpo ..... --texto 400 (cuerpo largo: --cuerpo)
   .itx-lbl ................. etiqueta de campo: --suave 12px 600
   .itx-meta ................ etiqueta de sección / meta: Plex Mono 11px, .08em, MAYÚSCULAS
   .itx-secundario .......... DNI, RUC, código bajo el nombre: #9AA0A8 Plex Mono 12px
   Enlace --accion · negativo --neg · ok --ok · alerta --warn */
html body :where(h1, h2) { color: var(--titulo); font-weight: 600; font-style: normal; }
html body :where(h1, h2) em { font-style: normal; color: var(--accion); }
.itx-lbl { display: block; font: 600 12px/1.3 var(--font-ui); color: var(--suave); margin-bottom: 4px; }
.itx-meta {
  font-family: var(--font-num); font-size: 11px; font-weight: 500;
  letter-spacing: .08em; text-transform: uppercase; color: var(--suave);
}
.itx-secundario { font-family: var(--font-num); font-size: 12px; color: var(--secundario); }
.itx-link { color: var(--accion); }
.itx-link:hover { color: var(--accion-hover); }

/* Cabecera de tabla (§1b): Plex Mono 11px, .08em, mayúsculas, --suave.
   Las tablas compartidas (tables-sap.css, patrones-v1.css, fi.css) leen
   estas dos variables: si hay que volver a la cabecera de 9.5px, se cambia
   acá y en ningún otro lado. */
:root { --th-fs: 11px; --th-ls: .08em; }

/* Toda cifra, fecha, DNI y código en IBM Plex Mono (regla de marca) */
.tabular,
.tabular-nums,
.font-mono,
.rep-num-mono,
.rep-num-display {
  font-family: var(--font-num);
}
.itx-kpi-card .value,
.itx-hero-kpi,
.itax-table td.num,
.itax-table td.text-right,
td.tabular-nums {
  font-variant-numeric: tabular-nums;
}

/* ---------------------------------------------------------------------
   §4 · h1 y miga
   El h1 es Source Sans 3 600; UNA palabra en itálica color acción:
       <h1 class="itx-page-title">Períodos de <em>planilla</em></h1>
   --------------------------------------------------------------------- */
.itx-page-title,
.itax-title,
h1.itx-page-title {
  font-family: var(--font-ui);
  font-weight: 600;
  font-size: 30px;
  letter-spacing: -0.01em;
  color: var(--titulo);
}
/* AUDITORIA_HORIZON_T1 · T1 (08/10/2026): en NINGÚN h1 la palabra destacada va en
   itálica; también en los títulos con clase propia (.p-h1 de Períodos) o inline. */
h1 em,
.p-h1 em,
.itx-page-title em,
.itax-title em {
  font-family: var(--font-ui);
  font-style: normal;   /* v12: la palabra va en --accion, SIN itálica */
  font-weight: 600;
  color: var(--accion);
}
.itx-page-kicker,
.itx-overline {
  font-family: var(--font-num);
  font-size: 10.5px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--suave);
}

/* ---------------------------------------------------------------------
   §4 · Chips de filtro con contador (el HTML lo arma js/utils/brand-ui.js)
   --------------------------------------------------------------------- */
.itx-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.itx-chip {
  display: inline-flex; align-items: center; gap: 6px;
  height: 30px; padding: 0 12px; border-radius: 999px;
  font: 400 13px/1 var(--font-ui);
  border: 1px solid var(--borde); background: var(--card); color: var(--texto); cursor: pointer;
}
.itx-chip .n {
  font-family: var(--font-num); font-size: 10.5px;
  padding: 2px 6px; border-radius: 999px; background: var(--th); color: var(--suave);
}
.itx-chip:hover { background: var(--hover); }
.itx-chip[aria-pressed="true"] { background: var(--shell); border-color: var(--shell); color: var(--shell-txt); font-weight: 600; }
.itx-chip[aria-pressed="true"] .n { background: rgba(255,255,255,.2); color: var(--shell-txt); }

/* Toggle «Compacto» (GLOBAL_COMPACTO_SPECS.md): activo = fondo shell */
.itx-dens {
  display: inline-flex; align-items: center; gap: 6px;
  height: 34px; padding: 0 12px; border-radius: 8px; white-space: nowrap;   /* T17: un solo tamaño en todo el ERP */
  font: 600 12px/1 var(--font-ui);
  border: 1px solid var(--borde-fuerte); background: var(--card); color: var(--cuerpo); cursor: pointer;
}
.itx-dens:hover { background: var(--hover); }
.itx-dens.on { border-color: var(--shell); background: var(--shell); color: var(--shell-txt); }

/* Estado: punto de 7px + texto. La pill con fondo es solo para cuando el
   estado es lo principal de la fila (Períodos). */
.itx-pill {
  display: inline-flex; align-items: center; gap: 6px;
  font: 600 12.5px/1 var(--font-ui);
  padding: 5px 10px; border-radius: 999px; border: 1px solid; white-space: nowrap;
}
.itx-pill i { width: 7px; height: 7px; border-radius: 50%; background: currentColor; flex: none; }
.itx-pill .suf { opacity: .75; font-weight: 400; }

/* Densidad compacta: la aplica el módulo poniendo .itx-compacto en su raíz. */
.itx-compacto table td { padding-top: 5px !important; padding-bottom: 5px !important; }
.itx-compacto table th { padding-top: 7px !important; padding-bottom: 7px !important; }
.itx-compacto .trab-row,
.itx-compacto .emp-row { padding-top: 6px !important; padding-bottom: 6px !important; }
.itx-compacto .trab-row .w-9,
.itx-compacto .emp-row .w-9,
.itx-compacto .trab-row .w-10 { width: 28px !important; height: 28px !important; font-size: 10px !important; }

/* Trabajador cesado: la fila lleva fondo inline (trab-rediseno.js) y el
   inline le gana al hover de Tailwind; sin esto no respondía al mouse. */
#itx-app .trab-row[data-cesado="1"]:hover,
.trab-row[data-cesado="1"]:hover { background: color-mix(in srgb, var(--neg) 10%, var(--card)) !important; }

/* Cifra dentro de un texto corrido */
.itx-num {
  font-family: var(--font-num);
  font-variant-numeric: tabular-nums;
  font-weight: 500;
  color: var(--texto);
}

/* ---------------------------------------------------------------------
   MODAL DE OPERACIÓN EXITOSA (MODAL-EXITO_SPECS.md)
   Lo levanta showSuccess() en js/utils/toast.js, sobre cualquier modal.
   --------------------------------------------------------------------- */
.itx-ok-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: color-mix(in srgb, var(--shell) 40%, transparent);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  transition: opacity .15s ease-out;
}
.itx-ok-card {
  width: 320px;
  max-width: 100%;
  background: var(--card);
  border: 1px solid var(--borde);
  border-radius: 16px;
  box-shadow: 0 20px 50px color-mix(in srgb, var(--shell) 35%, transparent);
  padding: 32px 28px 24px;
  text-align: center;
  transform: scale(.96);
  transition: transform .15s ease-out;
}
.itx-ok-overlay[style*="opacity: 1"] .itx-ok-card { transform: scale(1); }

.itax-check-circle {
  display: inline-flex;
  width: 64px;
  height: 64px;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: var(--ok-bg);
  border: 2px solid color-mix(in srgb, var(--ok) 30%, transparent);
  animation: itaxPop .45s cubic-bezier(.34, 1.56, .64, 1) both;
}
.itax-check-path {
  stroke-dasharray: 30;
  stroke-dashoffset: 30;
  animation: itaxDraw .4s ease-out .25s forwards;
}
@keyframes itaxPop {
  0%   { transform: scale(.4); opacity: 0; }
  65%  { transform: scale(1.12); }
  100% { transform: scale(1); opacity: 1; }
}
@keyframes itaxDraw {
  from { stroke-dashoffset: 30; }
  to   { stroke-dashoffset: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .itax-check-circle, .itax-check-path { animation: none; }
  .itax-check-path { stroke-dashoffset: 0; }
  .itx-ok-overlay, .itx-ok-card { transition: none; }
}

.itx-ok-tit {
  font-family: var(--font-ui);
  font-weight: 600;
  font-size: 19px;
  color: var(--titulo);
  margin-top: 16px;
  line-height: 1.3;
}
.itx-ok-det {
  font-size: 13px;
  color: var(--suave);
  line-height: 1.55;
  margin-top: 6px;
}
.itx-ok-det:empty { display: none; }
.itx-ok-det strong { color: var(--texto); font-weight: 600; }
.itx-ok-num {
  font-family: var(--font-num);
  font-variant-numeric: tabular-nums;
}
.itx-ok-btn {
  height: 38px;
  padding: 0 28px;
  border: 0;
  border-radius: 7px;
  background: var(--accion);
  color: var(--shell-txt);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  margin-top: 20px;
  transition: background .15s ease;
}
.itx-ok-btn:hover { background: var(--accion-hover); }
.itx-ok-btn:focus-visible { outline: 2px solid var(--accion); outline-offset: 2px; }

.itx-ok-datos {
  margin-top: 12px;
  border-top: 1px solid var(--borde);
  padding-top: 8px;
  text-align: left;
}
.itx-ok-fila {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 3px 0;
  font-size: 12.5px;
}
.itx-ok-fila > span { color: var(--suave); }
.itx-ok-fila .itx-ok-num { color: var(--texto); font-weight: 600; white-space: nowrap; }

.itx-ok-acciones {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
}
.itx-ok-btn2 {
  height: 38px;
  padding: 0 16px;
  margin-top: 20px;
  border: 1px solid var(--borde-fuerte);
  border-radius: 7px;
  background: var(--card);
  color: var(--cuerpo);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.itx-ok-btn2:hover { background: var(--hover); }

/* ---------------------------------------------------------------------
   MODAL GENÉRICO — showModal/showConfirm/showError (js/utils/modal.js)
   --------------------------------------------------------------------- */
.itx-modal-ov { background: rgba(50, 54, 58, .45); }
[data-theme="dark"] .itx-modal-ov { background: rgba(8, 16, 26, .6); }
.itx-modal-card {
  background: var(--card); color: var(--texto);
  border: 1px solid var(--borde); border-radius: 12px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, .18);
  font-family: var(--font-ui);
  /* Nunca más alto que la pantalla: el cuerpo hace scroll y los botones quedan a la vista. */
  display: flex; flex-direction: column; max-height: calc(100vh - 2rem); max-height: calc(100dvh - 2rem);
}
.itx-modal-head, .itx-modal-foot { flex-shrink: 0; }
.itx-modal-head { padding: 16px 20px; border-bottom: 1px solid var(--borde); }
.itx-modal-tit { margin: 0; font: 600 18px/1.3 var(--font-ui); color: var(--titulo); letter-spacing: -0.01em; }
.itx-modal-body { padding: 16px 20px; color: var(--cuerpo); overflow-y: auto; min-height: 0; flex: 1 1 auto; }
.itx-modal-foot {
  display: flex; justify-content: flex-end; gap: 8px;
  padding: 12px 20px; border-top: 1px solid var(--borde); background: var(--th-grupo);
}

/* ---------------------------------------------------------------------
   TOAST — showToast (js/utils/toast.js). Errores y avisos; el éxito va
   en el modal de operación exitosa.
   --------------------------------------------------------------------- */
.itx-toast {
  background: var(--card); color: var(--texto);
  border-color: var(--borde) !important; border-left: 4px solid var(--accion) !important;
  box-shadow: 0 8px 24px color-mix(in srgb, var(--shell) 16%, transparent);
  font-family: var(--font-ui);
}
.itx-toast .ico { color: var(--accion); }
.itx-toast[data-tipo="success"] { border-left-color: var(--ok) !important; }
.itx-toast[data-tipo="success"] .ico { color: var(--ok); }
.itx-toast[data-tipo="error"] { border-left-color: var(--neg) !important; }
.itx-toast[data-tipo="error"] .ico { color: var(--neg); }
.itx-toast[data-tipo="warning"] { border-left-color: var(--warn) !important; }
.itx-toast[data-tipo="warning"] .ico { color: var(--warn); }

/* ---------------------------------------------------------------------
   §7b · Modal Cerrar sesión — lo arma confirmarSalida() en js/utils/modal.js
   --------------------------------------------------------------------- */
.itx-salir-ov {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(50, 54, 58, .45);
  display: flex; align-items: center; justify-content: center; padding: 20px;
  animation: itxSalirIn .14s ease-out;
}
[data-theme="dark"] .itx-salir-ov { background: rgba(8, 16, 26, .6); }
.itx-salir-card {
  width: 320px; max-width: 100%;
  background: var(--card); border: 1px solid var(--borde); border-radius: 12px;
  padding: 24px 24px 20px; text-align: center;
  box-shadow: 0 12px 32px rgba(0, 0, 0, .18);
  font-family: var(--font-ui);
}
[data-theme="dark"] .itx-salir-card { box-shadow: 0 12px 32px rgba(0, 0, 0, .4); }
.itx-salir-ico {
  width: 56px; height: 56px; margin: 0 auto; border-radius: 50%;
  background: var(--nav-activo-bg); color: var(--accion);
  box-shadow: 0 0 0 7px color-mix(in srgb, var(--accion) 5%, transparent);
  display: flex; align-items: center; justify-content: center;
}
.itx-salir-t { font-weight: 600; font-size: 18px; color: var(--texto); margin-top: 16px; }
.itx-salir-d { font-size: 14px; color: var(--suave); margin-top: 4px; }
.itx-salir-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 20px; }
.itx-salir-btns button {
  height: 38px; border-radius: 6px; font: 600 14px/1 var(--font-ui); cursor: pointer;
}
.itx-salir-no { border: 1px solid var(--borde-fuerte); background: var(--card); color: var(--texto); }
.itx-salir-no:hover { background: var(--hover); }
.itx-salir-si { border: 0; background: var(--accion); color: var(--shell-txt); }
[data-theme="dark"] .itx-salir-si { color: var(--shell); }
.itx-salir-si:hover { background: var(--accion-hover); }
.itx-salir-btns button:focus-visible { outline: 2px solid var(--accion); outline-offset: 2px; }
@keyframes itxSalirIn { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .itx-salir-ov { animation: none; } }

/* ---------------------------------------------------------------------
   §5 · Fila TOTAL (reemplaza «Marfil y dorado»)
     <tr class="itx-total">
       <td class="lbl">Total <span class="sub">· 22 comprobantes</span></td>
       <td class="num">1,234.00</td>            <!-- .num.neg si es negativo -->
     </tr>
     <tr class="itx-subtotal">…</tr>
   El estilo va en las CELDAS: un border-top en el <tr> no se ve con
   border-collapse:separate. Un style inline en la celda le gana a esto.
   --------------------------------------------------------------------- */
tr.itx-total > td,
tr.itx-total > th {
  background: var(--total-bg);
  border-top: 2px solid var(--total-borde);
  padding-top: 9px;
  padding-bottom: 9px;
  font-family: var(--font-num);
  font-weight: 700;
  font-size: 13.5px;
  color: var(--titulo);
  text-align: right;
  white-space: nowrap;
}
tr.itx-total > td.lbl,
tr.itx-total > th.lbl,
tr.itx-total > td:first-child,
tr.itx-total > th:first-child,
tr.itx-total .lbl {
  font-family: var(--font-ui);
  font-weight: 700;
  font-size: 11px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--total-txt);
  text-align: left;
}
tr.itx-total .sub {
  font-weight: 500;
  font-size: 11px;
  letter-spacing: .02em;
  text-transform: none;
  color: var(--suave);
}
tr.itx-total .num {
  font-family: var(--font-num);
  font-weight: 700;
  font-size: 13.5px;
  color: var(--titulo);
  text-align: right;
  white-space: nowrap;
}
tr.itx-total .num.neg { color: var(--neg); }
tr.itx-total.compacto > td,  tr.itx-total.compacto > th,
.compacto tr.itx-total > td, .compacto tr.itx-total > th { padding-top: 6px; padding-bottom: 6px; }

tr.itx-subtotal > td,
tr.itx-subtotal > th { background: var(--th-grupo); border-top: 1px solid var(--borde-fuerte); }

/* =====================================================================
   §3 · SHELL — barra superior
   ===================================================================== */
/* Layout: barra a todo el ancho y, debajo, sidebar + contenido. */
.itx-app { display: flex; flex-direction: column; height: 100vh; }
.itx-app > header.itx-head { flex: none; }
.itx-app-cuerpo { flex: 1; display: flex; min-height: 0; }
.itx-app-cuerpo > main { min-width: 0; }

header.itx-head {
  height: 60px;
  background: var(--shell) !important;
  border-bottom: 1px solid var(--shell) !important;
  color: var(--shell-txt);
  padding: 0 22px;
}
[data-theme="dark"] header.itx-head { border-bottom-color: var(--borde) !important; }

/* Izquierda: logo IT + ITAX PERÚ │ [código] miga/pantalla · buscador /n */
.itx-head-izq { display: flex; align-items: center; gap: 12px; min-width: 0; flex: 1; }
.itx-head-marca { display: flex; align-items: center; gap: 12px; text-decoration: none; flex: none; }
.itx-head-marca b { font-family: var(--font-logo); font-weight: 800; font-size: 16px; color: var(--shell-txt); white-space: nowrap; }
.itx-head-logo { width: 30px; height: 30px; display: block; flex: none; }
/* Sobre el shell va el negativo: fondo blanco, IT en shell, barra en acción. */
.itx-head-logo .fondo { fill: var(--shell-txt); }
.itx-head-logo .letras { fill: var(--shell); font-family: var(--font-logo); font-weight: 800; }
.itx-head-logo .barra { fill: var(--accion); }
[data-theme="dark"] .itx-head-logo .fondo { fill: var(--texto); }
.itx-head-tit { display: flex; align-items: center; gap: 12px; min-width: 0; flex: 0 0 auto; max-width: 340px; }
.itx-head-tit:empty { display: none; }
/* El separador que precede al chip se va con él (en el Home no hay chip). */
.itx-head-sep-tit:has(+ .itx-head-tit:empty) { display: none; }

/* Buscador /n (js/utils/codigos-nav.js) */
.itx-head-cmd { position: relative; flex: 0 1 380px; min-width: 150px; }
.itx-head-cmd label {
  height: 34px; display: flex; align-items: center; gap: 8px; padding: 0 10px;
  border: 1px solid rgba(255,255,255,.22); border-radius: 6px; cursor: text;
  color: var(--shell-sub); font-size: 13px;
}
.itx-head-cmd label:focus-within { border-color: var(--shell-sub); background: rgba(255,255,255,.06); }
.itx-head-cmd .pre { font-family: var(--font-num); font-weight: 600; color: color-mix(in srgb, var(--accion) 45%, white); flex: none; }
.itx-head-cmd input {
  flex: 1; min-width: 0; height: 100%; border: 0 !important; outline: 0; padding: 0;
  background: transparent !important; color: var(--shell-txt) !important;
  font-family: var(--font-ui); font-size: 13px;
}
.itx-head-cmd input::placeholder { color: var(--shell-sub); opacity: 1; }
/* El buscador es type="search" (para que el navegador no le autocomplete el
   correo del login): sin la «x» ni la lupa que el navegador le agrega. */
.itx-head-cmd input[type="search"] { -webkit-appearance: none; appearance: none; }
.itx-head-cmd input::-webkit-search-cancel-button,
.itx-head-cmd input::-webkit-search-decoration { -webkit-appearance: none; display: none; }
.itx-head-cmd kbd {
  flex: none; font-family: var(--font-num); font-size: 10px; color: var(--shell-sub);
  border: 1px solid rgba(255,255,255,.25); border-radius: 4px; padding: 1px 5px;
}
@media (max-width: 1180px) { .itx-head-cmd kbd { display: none; } }
@media (max-width: 1024px) { .itx-head-marca b, .itx-head-txt .itx-head-miga { display: none; } }
.itx-head-code {
  font-family: var(--font-num); font-size: 12px; font-weight: 700; color: var(--shell-txt);
  background: var(--accion); border-radius: 5px; padding: 3px 9px; flex: none;
}
[data-theme="dark"] .itx-head-code { color: var(--shell); }
.itx-head-txt { line-height: 1.2; min-width: 0; }
.itx-head-miga {
  font-family: var(--font-num); font-size: 9.5px; letter-spacing: .14em;
  text-transform: uppercase; color: var(--shell-sub);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.itx-head-pant {
  font-size: 16px; font-weight: 600; color: var(--shell-txt);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* Derecha: selectores SIN borde ni fondo, separados por filetes */
.itx-head-der { display: flex; align-items: center; gap: 8px; color: var(--shell-txt); font-size: 13px; }
.itx-head-sep { width: 1px; height: 22px; background: rgba(255,255,255,.22); flex: none; }
#periodo-wrap.hidden + .itx-head-sep { display: none; }
.itx-head-sel {
  height: 34px; padding: 0 10px; display: inline-flex; align-items: center; gap: 8px;
  background: transparent; border: 0; border-radius: 6px; color: var(--shell-txt);
  font-size: 13px; cursor: pointer; white-space: nowrap;
}
.itx-head-sel:hover { background: rgba(255,255,255,.08); }
.itx-head-sel .tri { opacity: .55; font-size: 10px; }
#empresa-selector { font-weight: 600; max-width: 360px; }
#empresa-selector-label { overflow: hidden; text-overflow: ellipsis; }

/* Período: dos <select> nativos que se leen como «Setiembre 2026 ▼» */
#periodo-wrap { gap: 0; }
#periodo-wrap select {
  appearance: none; -webkit-appearance: none;
  background: transparent; border: 0; color: var(--shell-txt);
  font-family: var(--font-num); font-size: 13px; padding: 0 2px; height: 34px; cursor: pointer;
}
#periodo-wrap select:focus-visible { outline: 2px solid var(--shell-sub); border-radius: 4px; }
#periodo-wrap .tri { opacity: .55; font-size: 10px; margin-left: 6px; }
/* La lista desplegable la pinta el sistema: las opciones van legibles. */
.itx-head select option,
.itx-head select optgroup { color: var(--texto); background: var(--card); }

/* Campana, botón de tema y avatar */
#notif-trigger { color: var(--shell-txt); border-radius: 6px; padding: 7px; }
#notif-trigger:hover { background: rgba(255,255,255,.08); }
.itx-head #notif-badge { border-color: var(--shell) !important; }
.itx-head #user-menu-btn {
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--accion) !important; color: var(--shell-txt) !important;
  font-size: 11px; font-weight: 700;
}
[data-theme="dark"] .itx-head #user-menu-btn { color: var(--shell) !important; }
.itx-head #user-menu-btn:hover { box-shadow: 0 0 0 2px rgba(255,255,255,.3); }

/* Menús que cuelgan de la barra (usuario, notificaciones). La empresa ya no
   es un menú: es el switcher Ctrl E (.itx-sw-*, al final de este archivo). */
#user-menu, #notif-menu {
  background: var(--card) !important; border: 1px solid var(--borde) !important; color: var(--texto);
  box-shadow: 0 16px 40px color-mix(in srgb, var(--shell) 22%, transparent) !important;
}
#empresa-menu-manage:hover { color: var(--accion-hover) !important; }

/* =====================================================================
   TAILWIND EN EL TEMA
   La paleta de Tailwind ya apunta a estas variables (tools/tailwind/
   tailwind.config.js), así que bg-amber-50, text-stone-500, etc. siguen al
   tema solas. Quedan dos casos que la configuración no cubre: bg-white
   (en oscuro es la tarjeta) y los controles nativos de formulario.
   ===================================================================== */
[data-theme="dark"] .bg-white { background-color: var(--card) !important; }
/* Fondos grises OSCUROS de Tailwind (tooltips, botones negros): son fondos,
   no texto; en el tema oscuro --texto es claro, así que van en --shell. */
.bg-stone-700, .bg-stone-800, .bg-stone-900, .bg-gray-800, .bg-gray-900, .bg-slate-800, .bg-slate-900,
.hover\:bg-stone-800:hover, .hover\:bg-stone-900:hover { background-color: var(--shell) !important; }
[data-theme="dark"] input:not([type="checkbox"]):not([type="radio"]),
[data-theme="dark"] select,
[data-theme="dark"] textarea { background-color: var(--fondo); color: var(--texto); border-color: var(--borde); }

/* ---------------------------------------------------------------------
   COMBOBOX (js/utils/combobox.js): opción de la lista
   --------------------------------------------------------------------- */
.itx-cmb-op { color: var(--texto); background: transparent; }
.itx-cmb-op:hover, .itx-cmb-op:focus-visible { background: var(--nav-activo-bg); color: var(--nav-activo-txt); outline: 0; }
.itx-cmb-op .cmb-cod { font-family: var(--font-num); color: var(--suave); }

/* ---------------------------------------------------------------------
   §7 · Logo IT en línea (<svg class="it-logo">): páginas que no son el
   shell (Asistencia). Positivo sobre claro; negativo en .topbar / .hero.
   --------------------------------------------------------------------- */
.it-logo { width: 1.35em; height: 1.35em; vertical-align: -.32em; margin-right: .45em; flex: none; display: inline-block; }
.it-logo .f { fill: var(--shell); }
.it-logo .l { fill: var(--shell-txt); font-family: var(--font-logo); font-weight: 800; }
.it-logo .b { fill: var(--accion); }
.topbar .it-logo .f, .hero .it-logo .f { fill: var(--shell-txt); }
.topbar .it-logo .l, .hero .it-logo .l { fill: var(--shell); }

/* ---------------------------------------------------------------------
   Switcher de empresa activa · Ctrl E (CLIENTES_HORIZON_SPECS.md §B)
   Reemplaza al dropdown de empresa del header en todo el ERP.
   --------------------------------------------------------------------- */
.itx-sw-kbd {
  font-family: var(--font-num); font-size: 10px; font-weight: 400;
  border: 1px solid rgba(255,255,255,.3); border-radius: 4px; padding: 1px 5px; opacity: .8;
}
.itx-sw-ov {
  position: fixed; inset: 0; z-index: 200; background: rgba(50,54,58,.45);
  display: flex; align-items: flex-start; justify-content: center; padding: 80px 20px;
}
.itx-sw-ov.hidden { display: none; }
.itx-sw-card {
  width: 640px; max-width: 100%; background: var(--card); border-radius: 12px;
  box-shadow: 0 12px 32px rgba(0,0,0,.18); overflow: hidden; color: var(--texto);
  font-family: var(--font-ui);
}
.itx-sw-head { padding: 16px 20px 12px; border-bottom: 1px solid var(--borde); }
.itx-sw-kicker { font-family: var(--font-num); font-size: 10px; letter-spacing: .14em; color: var(--accion); }
.itx-sw-titulo { font-weight: 600; font-size: 18px; color: var(--titulo); margin-top: 2px; }
.itx-sw-buscar {
  margin: 12px 20px; height: 40px; border: 1px solid var(--borde-fuerte); border-radius: 7px;
  padding: 0 12px; display: flex; align-items: center; gap: 10px; background: var(--card);
}
.itx-sw-buscar:focus-within { border-color: var(--accion); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accion) 14%, transparent); }
.itx-sw-buscar input { flex: 1; min-width: 0; border: 0 !important; outline: 0; background: transparent !important; box-shadow: none !important; font-size: 14px; color: var(--texto); font-family: var(--font-ui); }
.itx-sw-buscar input::placeholder { color: var(--suave); }
.itx-sw-count {
  font-family: var(--font-num); font-size: 11px; padding: 1px 7px; border-radius: 4px;
  background: var(--th); color: var(--suave); white-space: nowrap;
}
.itx-sw-lista { max-height: min(420px, calc(100vh - 330px)); overflow-y: auto; }
.itx-sw-sec {
  padding: 6px 20px 6px; font-family: var(--font-num); font-size: 9.5px; letter-spacing: .12em;
  color: var(--suave); text-transform: uppercase;
}
.itx-sw-sec + .itx-sw-sec, .itx-sw-frec + .itx-sw-sec { border-top: 1px solid var(--th-grupo); padding-top: 8px; }
.itx-sw-frec { padding: 0 20px 12px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
@media (max-width: 560px) { .itx-sw-frec { grid-template-columns: 1fr; } }
.itx-sw-fcard {
  text-align: left; border: 1px solid var(--borde); background: var(--card); border-radius: 8px;
  padding: 12px; cursor: pointer; min-width: 0; font-family: var(--font-ui); color: var(--texto);
}
.itx-sw-fcard:hover { background: var(--hover); }
.itx-sw-fcard.on { border-color: var(--accion); background: var(--nav-activo-bg); }
.itx-sw-ini {
  width: 34px; height: 34px; border-radius: 7px; background: var(--shell); color: var(--shell-txt);
  font-size: 12px; font-weight: 700; display: flex; align-items: center; justify-content: center;
}
.itx-sw-cod { font-family: var(--font-num); font-size: 10.5px; color: var(--accion); }
.itx-sw-fcard .itx-sw-cod { margin-top: 10px; min-height: 14px; }
.itx-sw-nom { font-size: 13px; font-weight: 600; color: var(--texto); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.itx-sw-ruc { font-family: var(--font-num); font-size: 11px; color: var(--suave); }
.itx-sw-todas { padding: 0 20px 8px; }
.itx-sw-fila {
  width: 100%; text-align: left; display: flex; align-items: center; gap: 12px; padding: 9px 10px;
  border: 0; border-radius: 6px; background: transparent; cursor: pointer; font-family: var(--font-ui); color: var(--texto);
}
.itx-sw-fila:hover, .itx-sw-fila.hl { background: var(--hover) !important; }
.itx-sw-fila.on { background: var(--nav-activo-bg); }
.itx-sw-fila .itx-sw-ini { width: 30px; height: 30px; border-radius: 6px; background: var(--th); color: var(--titulo); font-size: 10.5px; flex: none; }
.itx-sw-fila .itx-sw-nom { font-size: 13.5px; }
.itx-sw-check { color: var(--accion); font-weight: 700; flex: none; }
.itx-sw-pie {
  padding: 10px 20px; border-top: 1px solid var(--borde); display: flex; flex-wrap: wrap; align-items: center; gap: 16px;
  font-size: 11.5px; color: var(--suave); font-family: var(--font-num);
}
.itx-sw-pie b { border: 1px solid var(--borde-fuerte); border-radius: 3px; padding: 0 5px; color: var(--texto); font-weight: 400; }
.itx-sw-gestion {
  margin-left: auto; border: 0; background: transparent; padding: 0; cursor: pointer;
  font-family: var(--font-ui); font-size: 12.5px; font-weight: 600; color: var(--accion);
}
/* Avatar de empresa con su logo (switcher, Clientes): fondo blanco también en
   oscuro, porque los logos están hechos para ir sobre blanco. */
.itx-emp-logo { background: #fff !important; border: 1px solid var(--borde); padding: 3px; overflow: hidden; }
.itx-emp-logo img { width: 100%; height: 100%; object-fit: contain; display: block; }
.itx-sw-vacio { padding: 28px 20px; text-align: center; font-size: 13px; color: var(--suave); }

/* ---------------------------------------------------------------------
   Botonera de cabecera (GLOBAL §4, v15): 1 primario + 1 secundario y el
   resto en «···». Lo arma js/utils/botonera.js (ITAXBotonera.aplicar).
   --------------------------------------------------------------------- */
.itx-botonera { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.itx-botonera > button:not(.itx-mas),
.itx-botonera > a {
  height: 36px; border-radius: 7px !important; font-family: var(--font-ui);
  font-size: 13.5px; font-weight: 600; display: inline-flex; align-items: center; gap: 0;
}
.itx-mas-origen { display: none !important; }
.itx-mas {
  width: 36px; height: 36px; border: 1px solid var(--borde-fuerte); border-radius: 7px;
  background: var(--card); color: var(--texto); font-size: 16px; font-weight: 700; letter-spacing: 1px;
  display: inline-flex; align-items: center; justify-content: center; cursor: pointer; line-height: 1; padding: 0 0 4px;
}
.itx-mas:hover, .itx-mas[aria-expanded="true"] { background: var(--hover); }
.itx-mas-menu {
  position: fixed; z-index: 190; width: 220px; background: var(--card); border: 1px solid var(--borde-fuerte);
  border-radius: 8px; box-shadow: 0 8px 24px rgba(0,0,0,.12); padding: 6px; font-family: var(--font-ui);
}
.itx-mas-menu button {
  width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 8px 10px; border: 0; border-radius: 5px; background: transparent; cursor: pointer;
  font-size: 13.5px; color: var(--texto); text-align: left; font-family: var(--font-ui);
}
.itx-mas-menu button:hover, .itx-mas-menu button:focus { background: var(--hover); outline: 0; }
.itx-mas-menu button:disabled { opacity: .45; cursor: not-allowed; }
.itx-mas-menu button.neg { color: var(--neg); }
.itx-mas-menu button.sep { border-top: 1px solid var(--th-grupo); border-radius: 0 0 5px 5px; }
.itx-mas-menu kbd { font-family: var(--font-num); font-size: 10.5px; color: #A2AEBB; font-weight: 400; }

/* =====================================================================
   ESTADOS DE CARGA, VACÍO Y ERROR (global) — js/core/estados.js
   Spec: ESTADOS-VACIOS-CARGA_HORIZON_SPECS.md (07/10/2026).
   .sk = barra de esqueleto con brillo; .indet = barra indeterminada.
   Sin spinners. Con «reducir movimiento» se apaga toda animación.
   ===================================================================== */
.sk { display: block; border-radius: 4px; background: linear-gradient(90deg, #E9EAEC 0%, #F5F6F7 50%, #E9EAEC 100%); background-size: 200% 100%; animation: es-brillo 1.4s ease-in-out infinite; }
@keyframes es-brillo { 0% { background-position: 100% 0; } 100% { background-position: -100% 0; } }
.indet { display: block; position: relative; height: 3px; overflow: hidden; background: transparent; }
.indet::before { content: ''; position: absolute; top: 0; left: -35%; width: 35%; height: 100%; background: var(--accion, #0070F2); animation: es-indet 1.4s ease-in-out infinite; }
@keyframes es-indet { 0% { left: -35%; } 100% { left: 100%; } }
@media (prefers-reduced-motion: reduce) {
  .sk, .indet::before { animation: none !important; }
  .indet::before { left: 0; width: 100%; opacity: .35; }
}

/* A1 · esqueleto de página: KPIs (70 px) y tabla (cabecera 30 px, filas 46/58 px) */
.es-sk { display: flex; flex-direction: column; gap: 14px; }
.es-sk-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; }
.es-sk-kpi { height: 70px; box-sizing: border-box; background: var(--card); border: 1px solid var(--borde); border-left: 4px solid #DCDEE1; border-radius: 10px; padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; }
.es-sk-tabla { background: var(--card); border: 1px solid var(--borde); border-radius: 12px; overflow: hidden; }
.es-sk-cab { height: 30px; background: var(--th, #E9EAEC); }
.es-sk-fila { display: flex; align-items: center; gap: 16px; padding: 0 14px; border-top: 1px solid var(--borde); }
.es-sk-av { width: 28px; height: 28px; border-radius: 50%; background: #E9EAEC; flex: none; }
.es-sk-nom { flex: 2; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.es-sk-col { flex: 1; min-width: 0; }
.es-sk-bt { width: 64px; flex: none; }
/* A4 · panel lateral / modal */
.es-sk-panel { display: flex; flex-direction: column; gap: 14px; padding: 16px 18px; }
.es-sk-campo { display: flex; flex-direction: column; gap: 6px; }
.es-sk-tarj { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }

/* A2 · recarga: lo actual atenuado, barra arriba y pastilla «actualizando…» */
.es-recargando { position: relative; }
.es-recargando > :not(.es-rec) { opacity: .45; pointer-events: none; transition: opacity .15s; }
.es-rec { position: absolute; inset: 0 0 auto 0; z-index: 5; height: 0; }
.es-rec .indet { position: absolute; top: 0; left: 0; right: 0; }
.es-rec span { position: absolute; top: 48px; left: 50%; transform: translateX(-50%); font-size: 12px; color: var(--suave); background: var(--card); border: 1px solid var(--borde); border-radius: 999px; padding: 4px 12px; box-shadow: 0 4px 12px rgba(53, 74, 95, .14); white-space: nowrap; }

/* A3 · botón en curso: gerundio, mismo ancho, sin spinner */
.es-encurso { opacity: .6; cursor: default !important; }

/* B · pasos debajo de la tarjeta de Toreto */
.es-pasos { list-style: none; margin: -4px 0 12px; padding: 0 16px; display: flex; flex-direction: column; gap: 6px; font-size: 12.5px; color: var(--texto); }
.es-pasos li { display: flex; align-items: center; gap: 8px; }
.es-pasos li i { width: 14px; height: 14px; border-radius: 50%; display: grid; place-items: center; font-style: normal; font-size: 9px; font-weight: 700; color: #fff; background: #E9EAEC; flex: none; }
.es-pasos li.hecho i { background: var(--ok); }
.es-pasos li.curso i { background: var(--accion); }
.es-pasos li.pendiente { color: var(--suave); }
.es-proc { background: var(--card); border: 1px solid var(--borde); border-radius: 10px; padding: 12px 16px; margin: 0 0 12px; }
.es-proc .t { font-size: 14px; font-weight: 600; color: var(--titulo); }
.es-proc .d { font-size: 12px; color: var(--suave); margin: 2px 0 8px; font-family: var(--font-num); }

/* C · vacíos (C1 es el de Toreto) */
.es-vacio { min-height: 230px; box-sizing: border-box; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 28px 20px; gap: 6px; }
.es-vacio .t { font-size: 15px; font-weight: 600; color: var(--titulo); }
.es-vacio .x { font-size: 13px; color: var(--suave); max-width: 420px; }
.es-vacio .es-circ { width: 40px; height: 40px; border-radius: 50%; background: #F0F1F3; color: var(--suave); display: grid; place-items: center; margin-bottom: 4px; }
.es-link { border: 0; background: none; padding: 0; margin-top: 4px; font-size: 13px; font-weight: 600; color: var(--accion); cursor: pointer; }
.es-link:hover { text-decoration: underline; }

/* D · error / sin permiso / sin conexión (sin Toreto) */
.es-error { min-height: 230px; box-sizing: border-box; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 28px 20px; gap: 6px; }
.es-error .es-circ { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; margin-bottom: 4px; }
.es-error.error .es-circ { color: #AA0808; background: #FBECEC; }
.es-error.permiso .es-circ { color: #8A5A00; background: #FBF3E3; }
.es-error.offline .es-circ { color: #6B7280; background: #F0F1F3; }
.es-error .t { font-size: 15px; font-weight: 600; color: var(--titulo); }
.es-error .x { font-size: 13px; color: var(--suave); max-width: 440px; }
.es-error .r { font-family: var(--font-num); font-size: 11px; color: #9AA0A8; }
.es-error .es-bt { margin-top: 8px; height: 32px; padding: 0 14px; border: 1px solid var(--borde-fuerte); border-radius: 8px; background: var(--card); font-size: 13px; font-weight: 600; color: var(--texto); cursor: pointer; }
.es-error .es-bt:hover { background: var(--hover); }

/* Íconos de módulo (js/core/iconos.js) en tema oscuro: color del área aclarado y tinte translúcido. */
[data-theme="dark"] .itx-ico { color: color-mix(in srgb, var(--ico) 50%, #fff) !important; }
[data-theme="dark"] .itx-mod-ico .itx-ico { background: color-mix(in srgb, var(--ico) 24%, transparent) !important; }

/* ITAXEstados.proceso(): la tarjeta de Toreto centrada sobre la pantalla (corridas, lotes). */
.es-ov { position: fixed; inset: 0; z-index: 155; background: rgba(53,74,95,.28); display: flex; align-items: center; justify-content: center; padding: 16px; }
.es-ov-c { width: min(520px, 100%); background: var(--card); border-radius: 12px; padding: 14px 14px 4px; box-shadow: 0 18px 48px rgba(0,0,0,.22); }
.es-ov-c .tr-pcard { border: 0; padding: 4px 4px 12px; margin: 0; }
.es-ov-c .es-pasos { padding: 0 8px 10px; margin: 0; }

/* Fechas que se escriben de corrido (js/core/fecha-texto.js): el input de fecha pasa a texto
   dd/mm/aaaa con el ícono del calendario a la derecha; en rojo si la fecha no existe. */
html body input.itx-fecha {
  font-family: var(--font-num);
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236B7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><rect x='3' y='4' width='18' height='18' rx='2'/><path d='M16 2v4M8 2v4M3 10h18'/></svg>") !important;
  background-repeat: no-repeat !important;
  background-position: right 8px center !important;
  background-size: 16px 16px !important;
  padding-right: 30px !important;
  cursor: text;
}
html body input.itx-fecha-mal {
  border-color: var(--neg) !important;
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--neg) 18%, transparent) !important;
}

/* =====================================================================
   MICROINTERACCIONES (MICROINTERACCIONES_HORIZON_SPECS.md §0, 07/10/2026)
   Todo el movimiento del ERP vive aquí; los módulos solo ponen la clase.
   Reglas: nada rebota ni gira; máximo 300 ms salvo toast y fila nueva;
   entrar = opacidad + 8px + escala 98 %; salir = solo opacidad, la mitad.
   ===================================================================== */
:root { --dur-1:80ms; --dur-2:120ms; --dur-3:180ms; --dur-4:200ms; --ease:cubic-bezier(.2,.8,.2,1); }
@keyframes itx-in { from { opacity:0; transform:translateY(8px) scale(.98) } to { opacity:1; transform:none } }
@keyframes itx-drawer { from { opacity:0; transform:translateX(24px) } to { opacity:1; transform:none } }
@keyframes itx-fila { from { background:#EBF3FF } to { background:transparent } }
@keyframes itx-toast { 0% { opacity:0; transform:translateY(12px) } 12%,85% { opacity:1; transform:none } 100% { opacity:0; transform:translateY(12px) } }
@keyframes itx-check { from { stroke-dashoffset:24 } to { stroke-dashoffset:0 } }
.itx-modal { animation: itx-in var(--dur-3) var(--ease) both }
.itx-modal.saliendo { animation: none; opacity:0; transition: opacity 90ms }
.itx-drawer { animation: itx-drawer var(--dur-4) var(--ease) both }
.itx-drawer.saliendo { opacity:0; transition: opacity 100ms }
tr.itx-nueva { animation: itx-fila 1.6s ease-out both }
tr.itx-actualizando { opacity:.5; transition: opacity var(--dur-4) }
.itx-chip { transition: background var(--dur-4), color var(--dur-4); min-width: var(--chip-min, 0) }
.itx-btn { transition: background var(--dur-2), border-color var(--dur-2), opacity var(--dur-2), transform var(--dur-1) }
.itx-btn:active { transform: scale(.98) }
.itx-btn.en-curso { opacity:.6; cursor:default; pointer-events:none }
.itx-btn.hecho { background:#256F3A !important; border-color:#256F3A !important; color:#fff !important }
.itx-btn .check { stroke-dasharray:24; animation: itx-check 350ms 100ms ease-out both }
tbody tr { transition: background var(--dur-2) }
:focus-visible { outline:2px solid #0070F2; outline-offset:2px }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration:.01ms !important; transition-duration:.01ms !important } }

/* Los modales que ya usaban itx-modal-in / itx-overlay-in (modal.js, §1d, F-28…) toman
   los mismos tiempos; al cerrar, el fondo y la tarjeta se van solo por opacidad. */
.itx-modal-in { animation: itx-in var(--dur-3) var(--ease) both }
.itx-overlay-in { animation-duration: var(--dur-3) }
.itx-modal-ov.saliendo, .itx-modal-ov.saliendo > * { animation: none !important; opacity:0; transition: opacity 90ms }
.itx-velo.saliendo { animation:none !important; opacity:0 !important; transition: opacity 100ms }
/* La animación de entrada (fill both) fija la opacidad: al salir hay que apagarla o no se ve. */
.itx-drawer.saliendo { animation:none }

/* Toast (§1.6, respuesta del diseñador 07/10/2026: opción B). La tarjeta blanca con borde
   izquierdo por tipo se queda; solo cambia el movimiento: abajo a la derecha, sube 12px,
   barra de tiempo de 2px. ok e info 3 s, aviso 6 s, error se queda hasta cerrarlo con ✕
   (sin barra). Uno a la vez; con un error visible el nuevo se apila debajo (máx. 2). */
@keyframes itx-toast-entra { from { opacity:0; transform:translateY(12px) } to { opacity:1; transform:none } }
@keyframes itx-toast-barra { from { transform:scaleX(1) } to { transform:scaleX(0) } }
#itx-toast-container .itx-toast { position:relative; overflow:hidden; animation: itx-toast-entra var(--dur-3) var(--ease) both;
  color:#32363A; box-shadow:0 8px 24px rgba(53,74,95,.18); }
[data-theme="dark"] #itx-toast-container .itx-toast { color: var(--texto); }
#itx-toast-container .itx-toast.saliendo { animation:none; opacity:0; transition: opacity 90ms }
#itx-toast-container .itx-toast .barra { position:absolute; left:0; right:0; bottom:0; height:2px; background:#4DB1FF;
  transform-origin:left; animation: itx-toast-barra var(--toast-dur, 3s) linear both }
#itx-toast-container .itx-toast .x { margin-left:4px; border:0; background:none; color:var(--suave); font-size:15px; line-height:1;
  cursor:pointer; padding:0 2px; flex:none }
#itx-toast-container .itx-toast .x:hover { color: var(--texto); }
.itx-toast[data-tipo="success"] { border-left-color:#256F3A !important; }
.itx-toast[data-tipo="error"] { border-left-color:#AA0808 !important; }
.itx-toast[data-tipo="warning"] { border-left-color:#8A5A00 !important; }
.itx-toast[data-tipo="info"] { border-left-color:#0070F2 !important; }
/* Lo que se está yendo no captura clics (los 90-100 ms de la salida). */
.saliendo { pointer-events: none !important; }

/* =====================================================================
   Aviso en línea · ITAXEstados.aviso (AUDITORIA_HORIZON_T2 · T9, 08/10/2026)
   Fondo plano, radio 8, 12.5px, SIN borde izquierdo: el filete de color es
   solo de los KPIs. .ref = detalle técnico (mono gris), aparte del mensaje.
   ===================================================================== */
:root {
  --aviso-warn-bg: #FBF3E3; --aviso-warn: #8A5A00;
  --aviso-error-bg: #FBECEC; --aviso-error: #AA0808;
  --aviso-info-bg: #EBF3FF; --aviso-info: #0070F2;
  --aviso-ok-bg: #EAF5EC; --aviso-ok: #256F3A;
}
[data-theme="dark"] {
  --aviso-warn-bg: rgba(242,193,78,.12); --aviso-warn: #F2C14E;
  --aviso-error-bg: rgba(255,107,107,.12); --aviso-error: #FF8A8A;
  --aviso-info-bg: rgba(77,177,255,.14); --aviso-info: #4DB1FF;
  --aviso-ok-bg: rgba(93,210,122,.12); --aviso-ok: #5DD27A;
}
.itx-aviso { padding: 10px 12px; border-radius: 8px; font-size: 12.5px; line-height: 1.45; border: 0; text-wrap: pretty; }
.itx-aviso b { font-weight: 600; }
.itx-aviso a { color: inherit; text-decoration: underline; }
.itx-aviso .ref { display: block; margin-top: 4px; font-family: var(--font-num); font-size: 11px; color: var(--secundario, #9AA0A8); }
.itx-aviso[data-tipo="warn"]  { background: var(--aviso-warn-bg);  color: var(--aviso-warn); }
.itx-aviso[data-tipo="error"] { background: var(--aviso-error-bg); color: var(--aviso-error); }
.itx-aviso[data-tipo="info"]  { background: var(--aviso-info-bg);  color: var(--aviso-info); }
.itx-aviso[data-tipo="ok"]    { background: var(--aviso-ok-bg);    color: var(--aviso-ok); }
