/* ================================================================
   Cuadranza — Sistema de diseño
   Tema claro profesional: superficies blancas, sidebar azul marino,
   un acento cobalto, semánticos solo para estados.
   ================================================================ */

:root {
  --bg: #f4f6f9;
  --surface: #ffffff;
  --border: #e4e8ee;
  --border-strong: #cdd5e0;

  --sidebar-bg: #101b30;
  --sidebar-line: #1e2c47;
  --sidebar-text: #92a1ba;
  --sidebar-active: #ffffff;

  --accent: #2456e0;
  --accent-hover: #1c46bd;
  --accent-soft: #eaf0fe;
  --accent-ring: rgba(36, 86, 224, .18);

  --ink: #16202e;
  --ink-2: #51617a;
  --ink-3: #6a7688;

  --ok: #0e7a46;      --ok-bg: #e4f4eb;
  --warn: #9a5b00;    --warn-bg: #fcf1de;
  --bad: #c02626;     --bad-bg: #fceaea;
  --info: #0b6b85;    --info-bg: #e3f2f7;
  --violet: #6d3fc0;  --violet-bg: #f0e9fb;

  --radius: 12px;
  --radius-sm: 8px;
  --shadow-1: 0 1px 2px rgba(22, 32, 46, .05), 0 1px 3px rgba(22, 32, 46, .06);
  --shadow-2: 0 4px 14px rgba(22, 32, 46, .10);
  --shadow-3: 0 16px 48px rgba(16, 27, 48, .22);

  --font: "Segoe UI Variable Text", "Segoe UI", Inter, Roboto, system-ui, sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; }
body {
  font-family: var(--font);
  font-size: 14px;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
.hidden { display: none !important; }
button { font-family: inherit; }
::selection { background: var(--accent-ring); }

/* ================= LOGIN ================= */

/* ---- Tipografía de marca (auto-alojada, funciona sin internet) ---- */
@font-face { font-family:'Sora'; font-style:normal; font-weight:600; font-display:swap; src:url('fonts/sora-600.woff2') format('woff2'); }
@font-face { font-family:'Sora'; font-style:normal; font-weight:700; font-display:swap; src:url('fonts/sora-700.woff2') format('woff2'); }
@font-face { font-family:'Sora'; font-style:normal; font-weight:800; font-display:swap; src:url('fonts/sora-800.woff2') format('woff2'); }

/* Titulares con la tipografía de marca (unifica app + login) */
h1, h2, h3 { font-family: 'Sora', var(--font); }

/* ================= LOGIN (pantalla dividida) ================= */
.login-screen {
  min-height: 100vh; display: grid;
  grid-template-columns: 1.55fr 1fr;
  background: var(--bg);
}

/* ---- Panel de marca (navy) ---- */
.login-brandside {
  position: relative; overflow: hidden;
  display: flex; padding: clamp(36px, 4.6vw, 68px);
  color: #eaf0fb;
  background: linear-gradient(158deg, #0a1120 0%, #101b30 46%, #16264a 100%);
}
.lb-aurora {
  position: absolute; z-index: 0; width: 640px; height: 640px; right: -170px; top: -190px; pointer-events: none;
  background: radial-gradient(circle, rgba(36,86,224,.45) 0%, rgba(36,86,224,.10) 42%, transparent 70%);
  animation: lbFloat 15s ease-in-out infinite;
}
.lb-grid {
  position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background-image:
    linear-gradient(rgba(125,155,225,.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(125,155,225,.08) 1px, transparent 1px);
  background-size: 44px 44px;
  -webkit-mask-image: radial-gradient(120% 100% at 22% 12%, #000 28%, transparent 82%);
          mask-image: radial-gradient(120% 100% at 22% 12%, #000 28%, transparent 82%);
}
.lb-inner {
  position: relative; z-index: 2; width: 100%; max-width: 560px;
  display: flex; flex-direction: column; justify-content: space-between; gap: 34px;
}
@keyframes lbFloat { 0%,100% { transform: translate(0,0); } 50% { transform: translate(-26px,24px); } }

.lb-head { display: flex; align-items: center; gap: 13px; }
/* 54px: por debajo de ~50 el grabado del anillo se empasta y pierde el motivo */
.lb-head .brand-mark { width: 54px; height: 54px; margin: 0; }
.lb-word { font-family:'Sora',var(--font); font-size: 23px; font-weight: 700; letter-spacing: -.3px; color: #fff; }
.lb-word b { font-weight: 500; color: #9db8ff; }

.lb-hero h1 { font-family:'Sora',var(--font); font-size: clamp(31px, 3.7vw, 47px); line-height: 1.04; letter-spacing: -1.4px; font-weight: 800; color: #fff; }
.lb-hero > p { margin-top: 18px; font-size: 15.5px; line-height: 1.62; color: #a9b7d6; max-width: 46ch; }

/* Motivo animado: Recibos -> Depósito -> Conciliado */
.lb-flow { margin-top: 36px; display: flex; align-items: center; max-width: 470px; }
.fn {
  display: flex; flex-direction: column; align-items: center; gap: 10px; flex-shrink: 0; text-align: center;
  animation: fnIn .6s cubic-bezier(.2,.7,.2,1) both; animation-delay: calc(.25s + var(--d) * .26s);
}
.fn-ic {
  width: 56px; height: 56px; display: grid; place-items: center; border-radius: 15px;
  background: rgba(120,150,230,.10); border: 1px solid rgba(140,165,235,.22); color: #a9c0ff;
}
.fn-ic svg { width: 25px; height: 25px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.fn em { font-size: 12.5px; font-style: normal; font-weight: 600; color: #c2cee6; letter-spacing: .2px; }
.fn-ok .fn-ic {
  background: rgba(36,86,224,.20); border-color: rgba(90,130,245,.6); color: #d3ddff;
  box-shadow: 0 0 0 4px rgba(36,86,224,.12), 0 10px 26px rgba(36,86,224,.34);
}
.fl { flex: 1; min-width: 24px; height: 2px; margin: 0 8px 24px; position: relative; border-radius: 2px; background: rgba(140,165,235,.18); overflow: hidden; }
.fl::after { content:''; position: absolute; top: 0; left: 0; height: 100%; width: 42%; border-radius: 2px;
  background: linear-gradient(90deg, transparent, #5a86ff, transparent); animation: flMove 2.3s linear infinite; }
@keyframes fnIn { from { opacity: 0; transform: translateY(12px); } }
@keyframes flMove { from { transform: translateX(-120%); } to { transform: translateX(320%); } }

.lb-credit { font-size: 12.5px; color: #93a5c6; }
.lb-credit b { color: #c7d3ec; font-weight: 600; }

/* ---- Formulario (claro) ---- */
.login-formside {
  position: relative; display: grid; place-items: center; padding: clamp(28px, 5vw, 56px);
  background:
    radial-gradient(720px 380px at 80% 4%, rgba(36,86,224,.07), transparent 68%),
    radial-gradient(560px 420px at 18% 108%, rgba(36,86,224,.05), transparent 70%),
    var(--bg);
}
.login-card-head { text-align: center; }
.login-card-head .lc-mark { width: 64px; height: 64px; margin: 0 auto 14px; filter: drop-shadow(0 6px 16px rgba(36,86,224,.28)); }
.login-card-head .lc-mark img { width: 100%; height: 100%; object-fit: contain; display: block; }
.brand-mark { width: 66px; height: 66px; filter: drop-shadow(0 8px 22px rgba(36, 86, 224, .45)); }
.brand-mark svg, .brand-mark img { width: 100%; height: 100%; display: block; object-fit: contain; }
/* 46px: el grabado de la marca necesita ese mínimo para no volverse una mancha */
.brand-mark.sm { width: 46px; height: 46px; margin: 0; filter: none; }
.login-card {
  position: relative; width: 100%; max-width: 400px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 18px;
  padding: 38px 34px 30px; display: grid; gap: 16px;
  box-shadow: 0 26px 64px rgba(16,27,48,.15), 0 4px 14px rgba(16,27,48,.06);
  animation: cardIn .55s cubic-bezier(.2,.7,.2,1) both; animation-delay: .1s;
}
.login-card::before {
  content:''; position: absolute; top: 0; left: 28px; right: 28px; height: 3px; border-radius: 0 0 3px 3px;
  background: linear-gradient(90deg, var(--accent), #6f97ff);
}
@keyframes cardIn { from { opacity: 0; transform: translateY(14px); } }
.login-card-head h2 { font-family:'Sora',var(--font); font-size: 23px; letter-spacing: -.4px; color: var(--ink); font-weight: 700; }
.login-card-head p { margin-top: 5px; font-size: 13.5px; color: var(--ink-2); }
.login-error {
  background: var(--bad-bg); color: var(--bad);
  border-radius: var(--radius-sm);
  padding: 10px 12px; font-size: 13px;
}
.login-formfoot { text-align: center; font-size: 11.5px; color: var(--ink-3); margin-top: 2px; }

@media (prefers-reduced-motion: reduce) {
  .lb-aurora, .fl::after { animation: none; }
  .fn, .login-card { animation: none; }
}

/* ---- Login responsive ---- */
@media (max-width: 900px) {
  .login-screen { grid-template-columns: 1fr; }
  .login-brandside { padding: 30px 24px; }
  .lb-inner { gap: 22px; max-width: none; }
  .lb-hero h1 { font-size: 30px; letter-spacing: -1px; }
  .lb-hero > p { font-size: 14px; margin-top: 12px; }
  .lb-flow { margin-top: 24px; max-width: none; }
  .fn-ic { width: 48px; height: 48px; }
  .login-formside { padding: 26px 22px 42px; }
  .login-card { box-shadow: var(--shadow-2); }
}
@media (max-width: 430px) {
  .fn em { font-size: 11px; }
  .fn-ic { width: 42px; height: 42px; border-radius: 12px; }
  .fl { margin: 0 4px 20px; }
}

/* ================= FORM FIELDS ================= */

.fld { display: grid; gap: 6px; }
.fld > span {
  font-size: 12px; font-weight: 600; color: var(--ink-2);
  letter-spacing: .2px;
}
.fld > span .req { color: var(--bad); }
input, select, textarea {
  font-family: inherit; font-size: 14px; color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 9px 12px;
  outline: none;
  transition: border-color .12s, box-shadow .12s;
  width: 100%;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-ring);
}
input:disabled, select:disabled { background: #f1f4f8; color: var(--ink-3); }
input[type="number"] { text-align: right; font-variant-numeric: tabular-nums; }
.fld-hint { font-size: 12px; color: var(--ink-3); }

/* ================= BOTONES ================= */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-size: 13.5px; font-weight: 600;
  border-radius: var(--radius-sm);
  padding: 9px 16px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background .12s, border-color .12s, color .12s, box-shadow .12s;
  white-space: nowrap;
}
.btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.btn-primary { background: var(--accent); color: #fff; box-shadow: var(--shadow-1); }
.btn-primary:hover { background: var(--accent-hover); }
.btn-secondary { background: var(--surface); color: var(--ink); border-color: var(--border-strong); }
.btn-secondary:hover { border-color: var(--ink-3); background: #fafbfd; }
.btn-success { background: var(--ok); color: #fff; }
.btn-success:hover { background: #0a6238; }
.btn-danger-ghost { background: transparent; color: var(--bad); border-color: transparent; }
.btn-danger-ghost:hover { background: var(--bad-bg); }
.btn-danger { background: var(--bad); color: #fff; border-color: var(--bad); }
.btn-danger:hover { background: #a11f1f; border-color: #a11f1f; }
/* mensaje de las confirmaciones: respeta los saltos de línea del texto */
.confirm-msg { font-size: 14px; line-height: 1.6; color: var(--ink); white-space: pre-line; }
.btn-block { width: 100%; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.icon-btn {
  display: grid; place-items: center;
  width: 34px; height: 34px;
  background: transparent; border: none; border-radius: 8px;
  color: var(--sidebar-text); cursor: pointer;
  transition: background .12s, color .12s;
}
.icon-btn svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.icon-btn:hover { background: rgba(255,255,255,.08); color: #fff; }

/* ================= SHELL ================= */

.app-shell { display: flex; min-height: 100vh; }

.sidebar {
  width: 236px; flex-shrink: 0;
  background: var(--sidebar-bg);
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh;
}
.sidebar-brand {
  display: flex; align-items: center; gap: 11px;
  padding: 20px 18px;
  border-bottom: 1px solid var(--sidebar-line);
}
.sidebar-brand strong { font-family: 'Sora', var(--font); color: #fff; font-size: 16px; font-weight: 700; display: block; letter-spacing: -.2px; }
.sidebar-brand em { color: #64769a; font-size: 11px; font-style: normal; display: block; }
.sidebar-brand .brand-by { color: #7f8fb0; font-size: 10.5px; letter-spacing: .3px; margin-top: 1px; }

/* ---------- Integración de depósitos ----------
   El depósito ocupa una celda con rowspan sobre sus recibos: aparece una sola
   vez por más renglones que tenga. */
/* 10 columnas no caben cómodas: fuente y padding reducidos para que el folio y
   el importe del recibo queden a la vista sin tener que barrer a lo ancho. */
.dep-tabla { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.dep-tabla th, .dep-tabla td {
  border: 1px solid var(--border); padding: 5px 7px; vertical-align: top;
}
.dep-tabla .mono, .dep-tabla .td-num { white-space: nowrap; }
.dep-cell:nth-child(3) { max-width: 130px; }   /* nombres de banco largos */
.dep-tabla thead th {
  position: sticky; top: 0; z-index: 2;
  background: var(--sidebar-bg); color: #fff;
  font-size: 10.5px; text-transform: uppercase; letter-spacing: .5px; font-weight: 700;
}
.dep-tabla .dep-grupos th {
  top: 0; background: var(--accent); text-align: center; font-size: 11.5px;
}
/* la segunda fila del encabezado se pega debajo de la primera */
.dep-tabla thead tr:last-child th { top: 30px; }
.dep-cell { background: var(--bg); }
.dep-cell em {
  display: block; font-style: normal; color: var(--text-muted, #5b6b80);
  font-size: 11px; margin-top: 2px; font-weight: 500;
}
.dep-cell .dep-dif { color: var(--bad); font-weight: 700; }
.dep-tabla tr.dep-ini td { border-top: 2px solid var(--border-strong); }
.dep-tabla tfoot td {
  background: var(--accent-soft); border-top: 2px solid var(--accent);
  position: sticky; bottom: 0;
}
@media print { .dep-tabla thead th, .dep-tabla tfoot td { position: static; } }

#empresa-switcher { padding: 0 14px 4px; }
.empresa-fija {
  font-size: 11px; color: #7f8fb0; font-weight: 600;
  padding: 6px 10px; background: rgba(255,255,255,.04);
  border-radius: 8px; line-height: 1.3;
}
.empresa-switch { display: grid; gap: 3px; }
.empresa-switch > span { font-size: 10px; color: #64769a; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; }
.empresa-sel {
  background: rgba(255,255,255,.06); color: #e7ecf5;
  border: 1px solid var(--sidebar-line); border-radius: 8px;
  padding: 7px 9px; font-size: 12.5px; font-weight: 600; width: 100%;
}
.empresa-sel option { background: var(--sidebar-bg); color: #e7ecf5; }

.nav { padding: 14px 10px; display: grid; gap: 2px; flex: 1; overflow-y: auto; }
.nav-section {
  font-size: 10.5px; font-weight: 700; letter-spacing: 1px;
  color: #4d5f80; text-transform: uppercase;
  padding: 14px 10px 6px;
}
.nav-item {
  display: flex; align-items: center; gap: 11px;
  padding: 9px 12px;
  border-radius: 8px; border: none;
  background: transparent;
  color: var(--sidebar-text);
  font-size: 13.5px; font-weight: 500;
  cursor: pointer; text-align: left;
  transition: background .12s, color .12s;
  width: 100%;
}
.nav-item svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
.nav-item:hover { color: #dbe3f0; background: rgba(255,255,255,.05); }
.nav-item.active { background: var(--accent); color: #fff; }

.sidebar-user {
  display: flex; align-items: center; gap: 10px;
  padding: 14px;
  border-top: 1px solid var(--sidebar-line);
}
.avatar {
  width: 36px; height: 36px; border-radius: 50%;
  display: grid; place-items: center;
  background: linear-gradient(135deg, #6d3fc0, #4f2d91);
  color: #fff; font-size: 12.5px; font-weight: 700;
  flex-shrink: 0;
}
.sidebar-user-info { flex: 1; min-width: 0; }
.sidebar-user-info strong { color: #e7ecf5; font-size: 13px; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-user-info em { color: #64769a; font-size: 11.5px; font-style: normal; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  display: flex; align-items: center; gap: 16px;
  padding: 20px 30px 16px;
  border-bottom: 1px solid var(--border);
  max-width: 1400px; width: 100%; margin-inline: auto;
  position: sticky; top: 0; z-index: 30; background: var(--bg);
}
.topbar-titles { min-width: 0; }
.topbar-empresa { margin-left: auto; display: flex; align-items: center; min-width: 0; }
.empresa-chip {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 6px 12px; max-width: min(340px, 42vw);
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); font-size: 13px; font-weight: 600; color: var(--ink);
}
.empresa-chip .te-ico { width: 16px; height: 16px; flex-shrink: 0; fill: none;
  stroke: var(--ink-2); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.empresa-chip > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* sucursal: lo que evita que se mezcle el dinero entre sucursales, siempre visible */
.suc-chip {
  flex-shrink: 0; margin-left: 2px; padding: 3px 9px; border-radius: 99px;
  background: var(--accent); color: #fff;
  font-size: 11.5px; font-weight: 700; letter-spacing: .3px; white-space: nowrap;
}
.suc-chip.suc-falta { background: var(--bad); }
.empresa-chip-sel { padding-right: 6px; gap: 5px; }
.empresa-top-sel, .puesto-sel {
  border: none; background: transparent; color: var(--ink);
  font-size: 13px; font-weight: 600; font-family: inherit;
  padding: 4px 2px; cursor: pointer; max-width: min(300px, 38vw);
}
/* sin puesto asignado no se puede operar: se avisa, no se esconde */
.empresa-chip.puesto-falta { border-color: var(--bad); color: var(--bad); background: var(--bad-bg); }
.empresa-chip.puesto-falta .te-ico { stroke: var(--bad); }

/* asignar puestos (empresa — sucursal) a una persona */
.puestos-lista {
  display: grid; gap: 10px; max-height: 260px; overflow-y: auto;
  border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px;
  background: var(--bg);
}
.puestos-emp { display: grid; gap: 6px; }
.puestos-emp-nom {
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .6px;
  color: var(--ink-2);
}
.puesto-chk {
  display: flex; align-items: center; gap: 8px; padding: 5px 8px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm);
  font-size: 13px; cursor: pointer;
}
.puesto-chk input { width: auto; margin: 0; }
.puesto-chk:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); font-weight: 600; }
/* puestos en la tabla de usuarios */
.puesto-linea { font-size: 12.5px; line-height: 1.5; }
.puesto-linea b { font-weight: 600; }
.puesto-linea span { color: var(--ink-2); }
.topbar h1 { font-size: 21px; font-weight: 700; letter-spacing: -.4px; }
.topbar p { color: var(--ink-2); font-size: 13px; margin-top: 3px; }
.topbar-right { display: flex; gap: 10px; align-items: center; }
.view { padding: 22px 30px 40px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; align-content: start; max-width: 1400px; width: 100%; margin-inline: auto; }

.nav-toggle { display: none; align-items: center; justify-content: center;
  width: 40px; height: 40px; flex-shrink: 0;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--ink); cursor: pointer; }
.nav-toggle svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.nav-backdrop { display: none; }
@media (max-width: 900px) {
  .nav-toggle { display: inline-flex; }
  .sidebar { position: fixed; top: 0; left: 0; height: 100vh; z-index: 60;
    transform: translateX(-100%); transition: transform .22s ease; box-shadow: var(--shadow-3); }
  .app-shell.nav-open .sidebar { transform: none; }
  .nav-backdrop { display: block; position: fixed; inset: 0; z-index: 55;
    background: rgba(10,16,28,.5); opacity: 0; pointer-events: none; transition: opacity .22s; }
  .app-shell.nav-open .nav-backdrop { opacity: 1; pointer-events: auto; }
}

/* ================= CARDS / KPI ================= */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-1);
}
.card-pad { padding: 20px; }
.card-title { font-family: 'Sora', var(--font); font-size: 15.5px; font-weight: 700; letter-spacing: -.2px; margin-bottom: 14px; }

.kpi-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; }
.kpi {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-1);
  padding: 18px 20px;
  display: grid; gap: 5px;
  transition: box-shadow .16s ease, transform .16s ease, border-color .16s ease;
}
.kpi:hover { box-shadow: var(--shadow-2); transform: translateY(-2px); border-color: var(--border-strong); }
.kpi-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 2px; }
.kpi-label { font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
.kpi-chip {
  width: 34px; height: 34px; border-radius: 10px;
  display: grid; place-items: center;
}
.kpi-chip svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.kpi-value { font-family: 'Sora', var(--font); font-size: 27px; font-weight: 800; line-height: 1.1; letter-spacing: -.6px; font-variant-numeric: tabular-nums; color: var(--ink); }
.kpi-sub { font-size: 12px; color: var(--ink-3); }

/* KPI protagonista (Total del Día) — navy de marca, impacto donde cuenta */
.kpi.kpi-hero {
  position: relative; overflow: hidden;
  background: linear-gradient(145deg, #16264a 0%, #101b30 55%, #0d1626 100%);
  border-color: #1e2c47;
}
.kpi.kpi-hero::after {
  content: ""; position: absolute; width: 190px; height: 190px; right: -55px; top: -75px;
  background: radial-gradient(circle, rgba(36,86,224,.42), transparent 70%); pointer-events: none;
}
.kpi.kpi-hero > * { position: relative; z-index: 1; }
.kpi-hero .kpi-label { color: #aebbd9; }
.kpi-hero .kpi-value { color: #fff; }
.kpi-hero .kpi-sub { color: #8fa0bd; }
.kpi-hero .kpi-chip { background: rgba(120,150,230,.22); color: #cdd9ff; }
.kpi.kpi-hero:hover { border-color: #2a3d63; box-shadow: 0 10px 26px rgba(16,27,48,.28); }

.chip-accent { background: var(--accent-soft); color: var(--accent); }
.chip-ok { background: var(--ok-bg); color: var(--ok); }
.chip-warn { background: var(--warn-bg); color: var(--warn); }
.chip-bad { background: var(--bad-bg); color: var(--bad); }
.chip-info { background: var(--info-bg); color: var(--info); }
.chip-violet { background: var(--violet-bg); color: var(--violet); }

/* ================= TABLAS ================= */

.table-wrap { overflow: auto; max-height: calc(100vh - 188px); }
table { width: 100%; border-collapse: collapse; }
thead th {
  font-size: 11px; font-weight: 700; letter-spacing: .7px;
  text-transform: uppercase; color: var(--ink-3);
  text-align: left;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-strong);
  background: #f8fafc;
  white-space: nowrap;
  position: sticky; top: 0; z-index: 2;
}
tbody td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  font-size: 13.5px;
  vertical-align: middle;
}
tbody tr:last-child td { border-bottom: none; }
tbody tr { transition: background .1s; }
tbody tr:hover { background: #f7f9fc; }
tbody tr.clickable { cursor: pointer; }
.td-num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.td-strong { font-weight: 600; }
.td-muted { color: var(--ink-3); }
.table-empty {
  padding: 46px 24px; text-align: center; color: var(--ink-3); font-size: 14px;
  display: flex; flex-direction: column; align-items: center; gap: 12px;
}
.table-empty::before {
  content: ""; width: 46px; height: 46px; opacity: .5;
  background: center / contain no-repeat
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236a7688' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'><path d='M22 12h-6l-2 3h-4l-2-3H2'/><path d='M5.5 5.5 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.5-6.5A2 2 0 0 0 16.7 4.5H7.3A2 2 0 0 0 5.5 5.5z'/></svg>");
}
/* vacío que en realidad es buena noticia (0 faltantes, 0 diferencias) */
.table-empty.vacio-ok { color: var(--ok); font-weight: 600; }
.table-empty.vacio-ok::before {
  opacity: .9;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230e7a46' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'><circle cx='12' cy='12' r='9.2'/><path d='M8.2 12.3l2.6 2.6 5-5.5'/></svg>");
}

/* ================= BADGES ================= */

.badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11.5px; font-weight: 700;
  padding: 3px 9px; border-radius: 99px;
  letter-spacing: .3px;
}
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge-ok { background: var(--ok-bg); color: var(--ok); }
.badge-warn { background: var(--warn-bg); color: var(--warn); }
.badge-bad { background: var(--bad-bg); color: var(--bad); }
.badge-info { background: var(--info-bg); color: var(--info); }
.badge-muted { background: #eef1f5; color: var(--ink-2); }

/* ================= FILTROS / TOOLBAR ================= */

.toolbar {
  display: flex; flex-wrap: wrap; gap: 12px; align-items: end;
}
.toolbar .fld { min-width: 130px; }
.toolbar-spacer { flex: 1; }
.result-line { font-size: 13px; color: var(--ink-2); }
.result-line strong { color: var(--ink); font-variant-numeric: tabular-nums; }

/* ================= FORM GRID (registrar) ================= */

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: start; }
@media (max-width: 1100px) { .grid-2 { grid-template-columns: 1fr; } }
/* minmax(0,1fr): sin esto el grid crece con su contenido y una tabla ancha
   empuja la página en vez de scrollear dentro de su propio contenedor */
.form-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }
.form-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }

.cuadre {
  display: flex; align-items: center; gap: 8px;
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 13px; font-weight: 600;
}
.cuadre-ok { background: var(--ok-bg); color: var(--ok); }
.cuadre-warn { background: var(--warn-bg); color: var(--warn); }
.cuadre-bad { background: var(--bad-bg); color: var(--bad); }

.recibo-row {
  display: grid; grid-template-columns: 28px 1fr 130px 34px;
  gap: 10px; align-items: center;
}
.recibo-idx { font-size: 12px; font-weight: 700; color: var(--ink-3); text-align: center; }
.recibo-del {
  display: grid; place-items: center;
  width: 34px; height: 34px;
  border: none; border-radius: 8px;
  background: transparent; color: var(--ink-3);
  cursor: pointer; font-size: 15px;
}
.recibo-del:hover { background: var(--bad-bg); color: var(--bad); }

/* ================= TABS ================= */

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); padding: 0 6px; }
.tab {
  border: none; background: transparent;
  font-size: 13.5px; font-weight: 600; color: var(--ink-2);
  padding: 12px 14px;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  cursor: pointer;
  display: inline-flex; align-items: center; gap: 7px;
}
.tab:hover { color: var(--ink); }
.tab.active { color: var(--accent); border-bottom-color: var(--accent); }
.tab .count {
  background: #eef1f5; color: var(--ink-2);
  border-radius: 99px; font-size: 11px; padding: 1px 7px;
}
.tab.active .count { background: var(--accent-soft); color: var(--accent); }

/* ================= MODAL ================= */

.modal-overlay {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(16, 27, 48, .45);
  backdrop-filter: blur(2px);
  display: grid; place-items: center;
  padding: 24px;
  animation: fadeIn .15s ease;
}
.modal {
  background: var(--surface);
  border-radius: 16px;
  box-shadow: var(--shadow-3);
  width: 100%; max-width: 560px;
  max-height: 90vh;
  display: flex; flex-direction: column;
  animation: pop .18s ease;
}
.modal-lg { max-width: 720px; }
.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 22px;
  border-bottom: 1px solid var(--border);
}
.modal-head h3 { font-size: 16px; }
.modal-close {
  border: none; background: transparent; cursor: pointer;
  font-size: 20px; color: var(--ink-3);
  width: 30px; height: 30px; border-radius: 8px;
}
.modal-close:hover { background: #eef1f5; color: var(--ink); }
.modal-body { padding: 20px 22px; overflow-y: auto; display: grid; gap: 14px; }
.modal-foot {
  display: flex; justify-content: flex-end; gap: 10px;
  padding: 16px 22px;
  border-top: 1px solid var(--border);
}
@keyframes fadeIn { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: scale(.96) translateY(6px); } }

.detail-list { display: grid; gap: 0; border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; }
.detail-list > div {
  display: grid; grid-template-columns: 170px 1fr;
  padding: 9px 14px; font-size: 13px;
  border-bottom: 1px solid var(--border);
}
.detail-list > div:last-child { border-bottom: none; }
.detail-list > div:nth-child(odd) { background: #f8fafc; }
.detail-list dt { color: var(--ink-2); font-weight: 600; }
.detail-list dd { font-variant-numeric: tabular-nums; }

/* ================= TOASTS ================= */

.toast-root {
  position: fixed; top: 18px; right: 18px; z-index: 100;
  display: grid; gap: 10px;
}
.toast {
  display: flex; align-items: center; gap: 10px;
  background: #16202e; color: #fff;
  border-radius: 10px;
  padding: 12px 16px;
  font-size: 13.5px;
  box-shadow: var(--shadow-2);
  animation: slideIn .2s ease;
  max-width: 380px;
}
.toast.ok { background: #0e5a37; }
.toast-btn {
  margin-left: 10px;
  background: rgba(255,255,255,.14);
  border: 1px solid rgba(255,255,255,.45);
  color: #fff; border-radius: 7px;
  padding: 4px 12px;
  font-size: 12.5px; font-weight: 700;
  cursor: pointer; white-space: nowrap;
}
.toast-btn:hover { background: rgba(255,255,255,.28); }
.toast.bad { background: #a02020; }
@keyframes slideIn { from { opacity: 0; transform: translateX(24px); } }

/* ================= UPLOAD ================= */

.upload-zone {
  border: 2px dashed var(--border-strong);
  border-radius: var(--radius);
  padding: 30px;
  text-align: center;
  color: var(--ink-2);
  cursor: pointer;
  transition: border-color .12s, background .12s;
}
.upload-zone:hover, .upload-zone.drag { border-color: var(--accent); background: var(--accent-soft); }
.upload-zone strong { color: var(--accent); }
.upload-zone .file-ok { color: var(--ok); font-weight: 600; }

/* ---- Nuevo corte: pasos + zona de carga grande ---- */
.corte-nuevo { display: grid; gap: 20px; }
.cn-paso { display: grid; gap: 10px; }
.cn-paso .pos-step { margin-bottom: 0; }
.cn-paso-carga .upload-zone {
  display: grid; justify-items: center; gap: 5px;
  padding: 34px 24px; font-size: 14px;
}
.cn-paso-carga .upload-zone b { font-size: 15px; font-weight: 700; color: var(--ink); }
.cn-paso-carga .upload-zone .uz-ico {
  width: 34px; height: 34px; margin-bottom: 6px; fill: none; stroke: var(--accent);
  stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round;
}
.cn-paso-carga .upload-zone .file-ok { font-size: 14.5px; }
/* Barra de contexto al abrir un corte guardado (no pide archivo) */
.corte-ctx { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.corte-ctx .cx-ico {
  width: 44px; height: 44px; border-radius: 12px; flex-shrink: 0;
  display: grid; place-items: center; background: var(--accent-soft); color: var(--accent);
}
.corte-ctx .cx-ico svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.corte-ctx .cx-info { display: grid; gap: 2px; min-width: 0; }
.corte-ctx .cx-info strong { font-family: 'Sora', var(--font); font-size: 16px; font-weight: 700; letter-spacing: -.2px; }
.corte-ctx .cx-info span { font-size: 12.5px; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.corte-ctx .cx-acciones { margin-left: auto; display: flex; gap: 10px; flex-wrap: wrap; }

.cn-accion { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.btn-lg { padding: 12px 26px; font-size: 14.5px; font-weight: 700; }

/* ================= ESTACIÓN DE COBRO ================= */

.pos-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  gap: 18px;
  align-items: start;
}
@media (max-width: 1150px) { .pos-layout { grid-template-columns: 1fr; } }

.pos-step {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 12px;
}
.step-num {
  width: 24px; height: 24px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--accent); color: #fff;
  font-size: 12px; font-weight: 700;
  flex-shrink: 0;
}
.pos-step h3 { font-size: 15px; }
.pos-step .muted { margin-left: auto; }

.pos-section {
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
}

.metodo-chips { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 12px; }
.metodo-chip {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 7px 12px;
  border: 1.5px solid var(--border-strong);
  border-radius: 9px;
  background: var(--surface);
  cursor: pointer;
  font-size: 12.5px; font-weight: 600; color: var(--ink-2);
  white-space: nowrap;
  transition: border-color .12s, background .12s, color .12s;
}
.metodo-chip kbd {
  font-size: 9.5px; color: var(--ink-3);
  background: #eef1f5; border-radius: 4px; padding: 1px 5px;
  font-family: inherit;
}
.metodo-chip:hover { border-color: var(--accent); color: var(--accent); }
.metodo-chip.active { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.metodo-chip.active span { font-weight: 700; }
.metodo-chip.active kbd { background: #dbe6fd; color: var(--accent); }

/* folio repetido: aviso sin bloquear (puede ser legítimo) */
.recibo-row input.dup { border-color: var(--warn); background: var(--warn-bg); }
.recibo-aviso {
  grid-column: 2 / -1; font-size: 11.5px; font-weight: 600; color: var(--warn);
  margin-top: -2px;
}

.pago-row {
  display: flex; gap: 10px; align-items: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
}
.pago-row select, .pago-row input { height: 38px; }
.pago-row .sel-metodo { width: 175px; flex-shrink: 0; }
/* con una sola forma de pago, el método se elige con los chips F1–F8 → oculta el select redundante */
#lista-pagos.solo-pago .sel-metodo { display: none; }
.pago-row .sel-banco { flex: 1; min-width: 140px; }
.pago-row .sel-terminal { width: 125px; flex-shrink: 0; }
.pago-row .inp-importe { width: 125px; flex-shrink: 0; font-weight: 700; }
.pago-row .inp-usd, .pago-row .inp-tc { width: 95px; flex-shrink: 0; }
.pago-metodo { font-size: 13.5px; font-weight: 600; color: var(--ink); white-space: nowrap; }
.pago-metodo.vacio { font-weight: 500; color: var(--ink-3); font-style: italic; }
.pago-hint { font-size: 11.5px; color: var(--ink-3); flex: 1; }

.pos-footer {
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  margin-top: 18px; padding-top: 18px;
  border-top: 1px solid var(--border);
}
/* El cuadre es el control de la cajera: se lee de un vistazo y cambia de color */
.pos-cuadre {
  flex: 1; min-width: 300px;
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  padding: 14px 18px; border-radius: var(--radius);
  background: var(--bg); border: 1px solid var(--border);
  transition: background .16s, border-color .16s;
}
.pos-cuadre.cuadra { background: var(--ok-bg); border-color: #b8e2c9; }
.pos-cuadre.difiere { background: var(--warn-bg); border-color: #f0d9ae; }
.pos-vs { font-size: 11.5px; font-weight: 700; color: var(--ink-3); text-transform: uppercase; letter-spacing: .5px; }
.pos-total { display: grid; gap: 1px; }
.pos-total span { font-size: 11px; color: var(--ink-2); font-weight: 600; text-transform: uppercase; letter-spacing: .4px; }
.pos-total strong {
  font-family: 'Sora', var(--font); font-size: 26px; font-weight: 800;
  line-height: 1.1; letter-spacing: -.7px; font-variant-numeric: tabular-nums; color: var(--ink);
}
.pos-estado { margin-left: auto; font-size: 15px; font-weight: 800; letter-spacing: -.2px; white-space: nowrap; }
.pos-cuadre.cuadra .pos-estado { color: var(--ok); }
.pos-cuadre.difiere .pos-estado { color: var(--warn); }

/* Métodos: agrupados por naturaleza pero fluyendo en línea, sin gastar renglones */
.metodo-grupo { display: contents; }
.mg-lbl { display: none; }
.mg-chips { display: contents; }
/* separador sutil entre grupos (en caja | terminal | a cuenta) */
.metodo-grupo + .metodo-grupo .mg-chips > .metodo-chip:first-child {
  margin-left: 10px; border-left-color: var(--border-strong);
  box-shadow: -11px 0 0 -10px var(--border-strong);
}
.btn-cobrar {
  margin-left: auto;
  background: linear-gradient(135deg, #2456e0, #1c46bd);
  color: #fff; border: none;
  font-size: 15px; font-weight: 700;
  padding: 13px 30px; border-radius: 11px;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(36, 86, 224, .35);
  transition: transform .1s, box-shadow .15s;
}
.btn-cobrar:hover { box-shadow: 0 8px 24px rgba(36, 86, 224, .45); transform: translateY(-1px); }
.btn-cobrar:active { transform: translateY(0); }
.btn-cobrar small { display: block; font-size: 10.5px; font-weight: 500; opacity: .75; }

/* Historial lateral */
.hist-rail { position: sticky; top: 18px; display: grid; gap: 0; overflow: hidden; }
/* Cabecera del riel: resumen del día siempre visible, aunque no haya cobros */
.hist-head {
  display: grid; gap: 2px;
  padding: 16px 18px 14px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, var(--accent-soft), transparent);
}
.hist-lbl { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .6px; color: var(--ink-2); }
.hist-total {
  font-family: 'Sora', var(--font); font-size: 25px; font-weight: 800;
  line-height: 1.1; letter-spacing: -.6px; color: var(--ink); font-variant-numeric: tabular-nums;
}
.hist-n { font-size: 12px; color: var(--ink-3); }
.hist-resumen {
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  background: #f8fafc;
  display: grid; gap: 5px;
}
.hist-res-row {
  display: flex; align-items: center; gap: 8px;
  font-size: 12px;
}
.hist-res-dot { width: 8px; height: 8px; border-radius: 2px; flex-shrink: 0; }
.hist-res-label { color: var(--ink-2); font-weight: 600; }
.hist-res-n { color: var(--ink-3); font-size: 11px; }
.hist-res-monto {
  margin-left: auto; font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.hist-list { max-height: 52vh; overflow-y: auto; }
.hist-item {
  display: grid;
  grid-template-columns: 4px 1fr auto;
  gap: 12px; align-items: center;
  padding: 10px 14px 10px 10px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background .1s;
}
.hist-item:hover { background: #f4f7fb; }
.hist-item:last-child { border-bottom: none; }
.hist-bar { width: 4px; height: 34px; border-radius: 2px; }
.hist-mid { min-width: 0; }
.hist-metodo { font-size: 12.5px; font-weight: 700; }
.hist-folios {
  font-size: 11.5px; color: var(--ink-3);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.hist-right { text-align: right; }
.hist-importe { font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; }
.hist-hora { font-size: 10.5px; color: var(--ink-3); }
.hist-empty { padding: 34px 20px; text-align: center; color: var(--ink-3); font-size: 12.5px; }
.hist-foot {
  padding: 10px 16px; border-top: 1px solid var(--border);
  font-size: 11.5px; color: var(--ink-3); text-align: center;
}

.inp-motivo { width: 200px; height: 34px; font-size: 12.5px; padding: 5px 10px; }

/* Grupos de cancelación en el corte */
.grupo-head td {
  background: #fdf3df; color: #8a5a00;
  font-size: 12.5px; font-weight: 600;
  padding: 8px 14px;
}
.grupo-head .btn-mini { margin-left: 10px; }
tr.en-grupo td { background: #fffdf6; }
tr.en-grupo td:first-child { border-left: 3px solid var(--warn); }
.btn-mini { padding: 3px 10px; font-size: 11.5px; height: auto; }

/* Carátula del corte (documento formal) */
.caratula { max-width: 820px; margin: 0 auto; padding: 20px 10px 34px; }
.car-actions { display: flex; justify-content: flex-end; margin-bottom: 12px; }
.car-doc {
  background: #fff;
  border: 1px solid var(--border-strong);
  border-top: 3px solid var(--accent);
  border-radius: 4px;
  padding: 34px 44px;
  box-shadow: var(--shadow-2);
}
.car-letterhead { display: flex; justify-content: space-between; gap: 24px; align-items: flex-start; }
.car-empresa { font-family: 'Sora', var(--font); font-size: 18px; font-weight: 800; letter-spacing: -.2px; color: var(--ink); }
.car-sub { font-size: 11.5px; color: var(--ink-3); margin-top: 3px; }
.car-lh-right { text-align: right; }
.car-titulo { font-family: 'Sora', var(--font); font-size: 15px; font-weight: 800; letter-spacing: 2px; color: var(--accent); margin-bottom: 5px; }
.car-meta { font-size: 11.5px; color: var(--ink-2); }
.car-rule { border-top: 2px solid var(--ink); margin: 14px 0 20px; }
.car-sec { margin-bottom: 16px; }
.car-sec h4 {
  font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 1.2px;
  color: var(--accent);
  border-bottom: 1px solid var(--border-strong);
  padding-bottom: 5px; margin-bottom: 7px;
}
.car-row {
  display: flex; align-items: baseline; gap: 8px;
  padding: 3px 2px; font-size: 13px;
}
.car-fill { flex: 1; border-bottom: 1px dotted var(--border-strong); }
.car-row b { font-variant-numeric: tabular-nums; white-space: nowrap; }
.car-total {
  border-top: 1px solid var(--ink-2);
  margin-top: 6px; padding-top: 7px;
  font-weight: 700; font-size: 13.5px;
}
.car-ok { color: var(--ok); }
.car-alerta { color: var(--bad); }
.car-vacio { font-size: 12px; color: var(--ink-3); padding: 4px 2px; }
/* constancia de las cancelaciones que se anulan solas (no se listan una por una) */
.car-nota { font-size: 10.5px; color: var(--ink-3); margin-top: 7px; font-style: italic; line-height: 1.45; }
/* renglón de subtotal dentro de la comprobación (el resultado de la resta) */
.car-subt { border-top: 1px solid var(--border-strong); margin-top: 4px; padding-top: 5px; font-weight: 700; }

/* aclaración del folio en el corte: lista desplegable + agregar nuevas */
.motivo-celda { display: flex; gap: 6px; align-items: center; flex-wrap: nowrap; }
/* sin alto fijo: el padding global (9px) más una altura chica cortaba el texto */
/* ancho fijo: así los desplegables quedan alineados aunque la fila no lleve el
   botón de relacionar (dentro de una cancelación agrupada no aplica) */
.motivo-celda .sel-motivo,
.motivo-celda .inp-motivo {
  width: 210px; flex: 0 0 210px; min-width: 0;
  padding: 5px 8px; font-size: 12.5px;
  text-overflow: ellipsis;
}
.motivo-celda .btn-mini { flex: 0 0 auto; }
/* folio sin aclarar: se distingue por el texto, no pintando toda la celda */
tr.sin-aclarar .sel-motivo { border-color: var(--warn); color: var(--warn); font-weight: 600; }

/* buscador dentro de una pestaña del corte con mucho volumen */
.tab-tools {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 14px; border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 3; background: var(--surface);
}
.tab-buscar {
  flex: 1; max-width: 340px; height: 34px;
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  padding: 0 11px; font-size: 13px; font-family: inherit; color: var(--ink);
}
.tab-buscar:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring); }
.car-veredicto {
  display: flex; align-items: center; gap: 13px;
  margin-top: 14px; padding: 13px 18px; border-radius: 10px;
}
.car-veredicto .cv-ico { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-size: 17px; font-weight: 800; color: #fff; flex-shrink: 0; }
.car-veredicto .cv-label { font-family: 'Sora', var(--font); font-size: 14.5px; font-weight: 800; letter-spacing: .3px; }
.car-veredicto .cv-monto { margin-left: auto; font-size: 15px; font-weight: 800; font-variant-numeric: tabular-nums; }
.car-cuadra { background: var(--ok-bg); color: var(--ok); }
.car-cuadra .cv-ico { background: var(--ok); }
.car-descuadra { background: var(--bad-bg); color: var(--bad); }
.car-descuadra .cv-ico { background: var(--bad); }

/* Estado inicial de Trazabilidad — enseña a usar la pantalla */
.tz-hero { text-align: center; padding: 46px 32px 40px; display: grid; justify-items: center; gap: 12px; }
.tz-hero-ico {
  width: 62px; height: 62px; border-radius: 18px; display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent); margin-bottom: 4px;
}
.tz-hero-ico svg { width: 28px; height: 28px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.tz-hero h3 { font-size: 20px; font-weight: 700; letter-spacing: -.3px; color: var(--ink); }
.tz-hero > p { max-width: 60ch; font-size: 14px; line-height: 1.62; color: var(--ink-2); }
.tz-hero > p b { color: var(--ink); font-weight: 600; }
.tz-ejemplos { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: center; margin-top: 6px; }
.tz-ejemplos > span { font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .6px; color: var(--ink-3); }
.tz-ejemplos .btn { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; padding: 6px 13px; }
.tz-hero small { font-size: 12px; color: var(--ink-3); margin-top: 4px; }

/* Pie de la póliza (Cargos / Abonos / veredicto) */
.poliza-foot {
  display: flex; align-items: center; gap: 24px; flex-wrap: wrap;
  padding: 14px 18px; border-top: 1px solid var(--border);
}
.pf-tot { display: flex; flex-direction: column; gap: 1px; }
.pf-tot span { font-size: 11px; color: var(--ink-3); text-transform: uppercase; letter-spacing: .4px; font-weight: 600; }
.pf-tot b { font-family: 'Sora', var(--font); font-size: 17px; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--ink); }
.poliza-foot .car-veredicto { margin-left: auto; }
.car-firmas { display: flex; gap: 70px; justify-content: center; margin-top: 34px; }
.car-firmas div { text-align: center; font-size: 12px; color: var(--ink-2); }
.car-firmas b { display: block; font-size: 12.5px; color: var(--ink); margin-bottom: 2px; }
.car-firmas span {
  display: block; width: 220px; height: 34px;
  border-bottom: 1px solid var(--ink-2); margin-bottom: 7px;
}
.car-foot { margin-top: 24px; text-align: center; font-size: 10.5px; color: var(--ink-3); }

/* ================= MISC ================= */

.muted { color: var(--ink-3); font-size: 12.5px; }
.mono { font-variant-numeric: tabular-nums; }
.right { text-align: right; }
.pager { display: flex; align-items: center; gap: 12px; justify-content: flex-end; padding: 12px 14px; }
.pager span { font-size: 12.5px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.info-strip {
  display: flex; gap: 10px; align-items: start;
  background: var(--info-bg); color: var(--info);
  border-radius: var(--radius-sm);
  padding: 12px 14px; font-size: 13px;
}
.info-strip svg {
  width: 18px; height: 18px; flex-shrink: 0;
  fill: none; stroke: currentColor; stroke-width: 2;
  stroke-linecap: round; stroke-linejoin: round;
}
