/*
 * Liquidador FTC · tema negro, dorado y gris.
 * Estructura inspirada en barra lateral oscura + contenido claro: tarjetas blancas de 16 px, controles de 10 px,
 * tipografía Inter con títulos compactos. El dorado se reserva para acentos (botón principal, ítem activo, cifras clave).
 */
:root {
  /* Negros */
  --tinta: #141416;          /* barra lateral, títulos de tabla oscuros */
  --tinta-2: #1f1f23;        /* superficies oscuras secundarias */
  --tinta-3: #2c2c31;        /* hover en la barra lateral */
  /* Dorados (del logo) */
  --oro: #d9b04c;            /* acento principal */
  --oro-claro: #f2d27a;      /* brillo / gradiente */
  --oro-osc: #a8802a;        /* texto dorado sobre fondo claro */
  --oro-suave: #faf3df;      /* fondos dorados tenues */
  --oro-borde: #ecd9a4;
  /* Grises */
  --fondo: #f6f5f2;          /* lienzo cálido */
  --superficie: #ffffff;
  --gris-50: #fafaf8;
  --divisor: #e7e5df;
  --gris-300: #cfcdc6;
  --tenue: #6b6a70;          /* texto secundario */
  --texto: #141416;
  --sobre-tinta: #f4f2ec;
  --sobre-tinta-tenue: #a9a7a1;
  /* Estados */
  --ok: #1f7a4a; --ok-bg: #e7f4ec;
  --warn: #8a5a00; --warn-bg: #fdf3dc;
  --bad: #b42318; --bad-bg: #fdeceb;
  --info: #3b3a40; --info-bg: #f0efeb;
  --r-tarjeta: 16px; --r-control: 10px;
  --lateral: 248px;
  /* Compatibilidad con estilos anteriores */
  --primary: var(--oro-osc); --primary-d: var(--tinta); --line: var(--divisor); --muted: var(--tenue); --card: var(--superficie); --text: var(--texto); --bg: var(--fondo); --radius: var(--r-tarjeta);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--fondo); color: var(--texto); font: 15px/1.5 Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; -webkit-font-smoothing: antialiased; }
a { color: var(--oro-osc); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--tinta); }
h1 { font-size: 30px; line-height: 1.15; font-weight: 800; letter-spacing: -0.02em; margin: 0 0 6px; }
h2 { font-size: 1.05rem; font-weight: 700; letter-spacing: -0.01em; margin: 0 0 12px; }
.muted { color: var(--tenue); }
.small { font-size: .84rem; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.wrap { max-width: 1240px; margin: 0 auto; padding: 0 16px; }
code { background: var(--info-bg); padding: 1px 6px; border-radius: 6px; font-size: .85em; }

/* ---------- Estructura: barra lateral + contenido ---------- */
.app .lateral { position: fixed; inset: 0 auto 0 0; width: var(--lateral); background: var(--tinta); color: var(--sobre-tinta); display: flex; flex-direction: column; padding: 22px 12px 14px; z-index: 40; border-right: 1px solid #000; }
.marca { display: flex; align-items: center; gap: 12px; padding: 0 8px 18px; margin-bottom: 6px; color: var(--sobre-tinta); text-decoration: none; border-bottom: 1px solid var(--tinta-3); }
.marca img { width: 44px; height: 44px; filter: drop-shadow(0 2px 6px rgba(217,176,76,.25)); }
.marca span { display: flex; flex-direction: column; font-weight: 800; font-size: 1.12rem; letter-spacing: .02em; line-height: 1.1; }
.marca small { font-weight: 500; font-size: .7rem; letter-spacing: .14em; color: var(--oro); text-transform: uppercase; margin-top: 3px; }
.marca:hover { color: #fff; }
.menu { flex: 1; min-height: 0; overflow-y: auto; padding-top: 6px; scrollbar-width: thin; scrollbar-color: var(--tinta-3) transparent; }
.menu-sec { font-size: .66rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--sobre-tinta-tenue); opacity: .75; padding: 14px 12px 4px; }
.menu-item { display: flex; align-items: center; gap: 12px; min-height: 38px; white-space: nowrap; padding: 0 12px; border-radius: var(--r-control); color: var(--sobre-tinta-tenue); text-decoration: none; font-size: .93rem; font-weight: 500; margin-bottom: 2px; transition: background .15s, color .15s; }
.menu-item .ico { width: 19px; height: 19px; flex: none; }
.menu-item:hover { background: var(--tinta-3); color: #fff; }
.menu-item.activo { background: linear-gradient(135deg, var(--oro-claro), var(--oro)); color: var(--tinta); font-weight: 650; box-shadow: 0 4px 14px rgba(217,176,76,.22); }
.lateral-pie { border-top: 1px solid var(--tinta-3); padding-top: 12px; }
.cab-logo { display: none; }
.pie-emp { display: block; text-decoration: none; padding: 2px 12px 10px; font-size: .82rem; font-weight: 600; color: var(--sobre-tinta); line-height: 1.3; }
.pie-emp small { display: block; font-weight: 500; color: var(--oro); font-size: .74rem; }
.app .principal { margin-left: var(--lateral); min-height: 100vh; display: flex; flex-direction: column; }
.cabecera { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 14px; min-height: 72px; padding: 12px clamp(20px, 3vw, 48px); background: rgba(255,255,255,.92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--divisor); }
.selector-emp { display: flex; align-items: center; gap: 10px; min-height: 46px; padding: 0 14px; border: 1px solid var(--divisor); border-radius: var(--r-control); background: var(--superficie); color: var(--texto); text-decoration: none; max-width: 520px; }
.selector-emp span { display: flex; flex-direction: column; font-weight: 650; font-size: .92rem; line-height: 1.2; min-width: 0; }
.selector-emp span, .selector-emp small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.selector-emp small { font-weight: 500; color: var(--tenue); font-size: .74rem; }
.selector-emp .ico { width: 18px; height: 18px; color: var(--oro-osc); flex: none; }
.selector-emp .ico:last-child { color: var(--tenue); }
.selector-emp:hover { border-color: var(--oro); color: var(--texto); }
.cab-der { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.rol-pill { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 99px; background: var(--oro-suave); color: var(--oro-osc); border: 1px solid var(--oro-borde); font-size: .78rem; font-weight: 650; white-space: nowrap; }
.rol-pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--oro); }
.avatar { width: 40px; height: 40px; border-radius: 50%; background: var(--tinta); color: var(--oro-claro); display: grid; place-items: center; font-weight: 700; font-size: .85rem; letter-spacing: .03em; border: 2px solid var(--oro); }
.menu-btn { display: none; background: none; border: 1px solid var(--divisor); border-radius: var(--r-control); width: 44px; height: 44px; color: var(--texto); cursor: pointer; place-items: center; }
.menu-btn .ico { width: 22px; height: 22px; }
.velo { display: none; }
.app main.wrap { width: 100%; max-width: 1680px; padding: 32px clamp(20px, 3vw, 48px) 56px; margin: 0 auto; }
@media (max-width: 980px) {
  .app .lateral { transform: translateX(-100%); transition: transform .2s; box-shadow: 0 0 40px rgba(0,0,0,.4); }
  body.nav-open .lateral { transform: none; }
  body.nav-open .velo { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 35; }
  .app .principal { margin-left: 0; }
  .menu-btn { display: grid; }
  .cabecera { padding: 10px 16px; min-height: 64px; background: var(--tinta); border-bottom: 2px solid var(--oro); backdrop-filter: none; }
  .cab-logo { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; font-weight: 800; letter-spacing: .03em; order: -1; }
  .cab-logo img { width: 36px; height: 36px; }
  .cabecera .selector-emp { display: none; }
  .menu-btn { order: 3; margin-left: 4px; color: #fff; border-color: var(--tinta-3); }
  .cab-der { margin-left: auto; }
  .rol-pill { display: none; }
  .app main.wrap { padding: 22px 16px 40px; }
  h1 { font-size: 26px; }
}

/* ---------- Páginas públicas (ingreso, recuperar clave) ---------- */
.publica .banda { background: var(--tinta); color: var(--sobre-tinta); display: flex; align-items: center; justify-content: center; gap: 14px; padding: 22px 16px; border-bottom: 3px solid var(--oro); }
.publica .banda img { width: 54px; height: 54px; }
.publica .banda span { display: flex; flex-direction: column; font-weight: 800; font-size: 1.35rem; letter-spacing: .08em; line-height: 1.05; }
.publica .banda small { font-weight: 500; font-size: .72rem; letter-spacing: .22em; color: var(--oro); margin-top: 4px; }
.publica main.wrap { padding-top: 7vh; padding-bottom: 40px; }
.login-box { max-width: 420px; margin: 0 auto; }
.login-box .card { padding: 32px; }
.login-box h1 { text-align: center; font-size: 26px; }
.login-box .logo { display: none !important; }

/* ---------- Encabezado de página ---------- */
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.page-head > div:first-child > .muted { font-size: 1rem; }
.toolbar { max-width: 1100px; margin: 0 auto 14px; }

/* ---------- Tarjetas e indicadores ---------- */
.card { background: var(--superficie); border: 1px solid var(--divisor); border-radius: var(--r-tarjeta); padding: 24px; margin-bottom: 20px; }
.grid { display: grid; gap: 20px; }
.grid > * { min-width: 0; }
.cols-2 { grid-template-columns: 1fr 1fr; }
@media (max-width: 980px) { .cols-2 { grid-template-columns: 1fr; } }
.kpis { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); margin-bottom: 20px; }
.kpi { background: var(--superficie); border: 1px solid var(--divisor); border-radius: var(--r-tarjeta); padding: 20px 22px; position: relative; }
.kpi .label { color: var(--tenue); font-size: .76rem; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; }
.kpi .value { font-size: clamp(1.2rem, 1.9vw, 1.7rem); font-weight: 800; letter-spacing: -0.02em; margin-top: 4px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.kpi.main .label { padding-right: 22px; }
.kpi.main { background: var(--tinta); border-color: var(--tinta); color: var(--sobre-tinta); }
.kpi.main .label { color: var(--oro); }
.kpi.main .value { color: #fff; }
.kpi.main .muted, .kpi.main .small { color: var(--sobre-tinta-tenue); }
.kpi.main::after { content: ""; position: absolute; right: 18px; top: 18px; width: 10px; height: 10px; border-radius: 50%; background: var(--oro); box-shadow: 0 0 0 5px rgba(217,176,76,.18); }
.kpi.low .value { color: var(--bad); }
.bar { height: 8px; background: var(--info-bg); border-radius: 99px; overflow: hidden; margin-top: 6px; }
.bar > span { display: block; height: 100%; background: linear-gradient(90deg, var(--oro), var(--oro-claro)); border-radius: 99px; }

/* ---------- Tablas ---------- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 11px 12px; border-bottom: 1px solid var(--divisor); text-align: left; vertical-align: top; }
th { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--tenue); background: var(--gris-50); }
tbody tr:hover td { background: #fcfbf7; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
tr.anulado td { color: var(--tenue); text-decoration: line-through; }
tfoot td { font-weight: 700; border-top: 2px solid var(--tinta); background: var(--gris-50); }
.empty { text-align: center; color: var(--tenue); padding: 32px; }

/* ---------- Formularios ---------- */
form .row { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px 18px; }
label { display: block; font-size: .84rem; font-weight: 600; margin-bottom: 6px; }
input[type=text], input[type=email], input[type=password], input[type=date], input[type=number], input[type=search], input[type=month], input[type=file], select, textarea {
  width: 100%; min-height: 44px; padding: 9px 12px; border: 1px solid var(--divisor); border-radius: var(--r-control); font: inherit; font-size: .93rem; background: var(--superficie); color: inherit; transition: border-color .15s, box-shadow .15s;
}
input[type=file] { padding: 8px; background: var(--gris-50); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--oro); box-shadow: 0 0 0 3px rgba(217,176,76,.22); }
input[type=checkbox], input[type=radio] { accent-color: var(--oro-osc); width: 16px; height: 16px; vertical-align: -3px; }
textarea { min-height: 80px; resize: vertical; }
.field { margin-bottom: 14px; }
.help { font-size: .8rem; color: var(--tenue); margin-top: 4px; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-top: 10px; }
.filters { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; }
.filters .field { margin: 0; min-width: 150px; flex: 1; }
.filters .field.grow { flex: 2; }
.inline { display: inline; }
details > summary { cursor: pointer; }

/* ---------- Botones ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 20px; border-radius: var(--r-control); border: 1px solid transparent; background: linear-gradient(135deg, var(--oro-claro), var(--oro)); color: var(--tinta); font: inherit; font-weight: 650; font-size: .93rem; text-decoration: none; cursor: pointer; line-height: 1.2; transition: filter .15s, box-shadow .15s, background .15s; }
.btn:hover { color: var(--tinta); filter: brightness(1.04); box-shadow: 0 6px 16px rgba(217,176,76,.28); }
.btn.sec { background: var(--superficie); color: var(--texto); border-color: var(--divisor); }
.btn.sec:hover { border-color: var(--oro); box-shadow: none; filter: none; }
.btn.ok { background: var(--tinta); color: var(--oro-claro); }
.btn.ok:hover { box-shadow: 0 6px 16px rgba(0,0,0,.2); }
.btn.danger { background: var(--bad); color: #fff; }
.btn.sm { min-height: 34px; padding: 0 12px; font-size: .82rem; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* ---------- Avisos y etiquetas ---------- */
.alert { padding: 13px 16px; border-radius: var(--r-control); margin-bottom: 16px; border: 1px solid; font-size: .92rem; }
.alert-ok { background: var(--ok-bg); border-color: #c4e5d1; color: var(--ok); }
.alert-error { background: var(--bad-bg); border-color: #f6c9c4; color: var(--bad); }
.alert-warn { background: var(--warn-bg); border-color: #f0dca8; color: var(--warn); }
.alert-info { background: var(--info-bg); border-color: var(--divisor); color: var(--info); }
.badge { display: inline-block; padding: 3px 10px; border-radius: 99px; font-size: .72rem; font-weight: 700; white-space: nowrap; letter-spacing: .01em; }
.b-pendiente { background: var(--warn-bg); color: var(--warn); }
.b-legalizado { background: var(--oro-suave); color: var(--oro-osc); border: 1px solid var(--oro-borde); }
.b-reembolsado { background: var(--ok-bg); color: var(--ok); }
.b-anulado { background: var(--info-bg); color: var(--tenue); }
.b-vencida { background: var(--bad-bg); color: var(--bad); }
.diff-ok { color: var(--ok); font-weight: 700; }
.diff-bad { color: var(--bad); font-weight: 700; }
.atajos { flex-basis: 100%; display: flex; gap: 14px; flex-wrap: wrap; }
.atajos a { text-decoration: none; font-weight: 600; }

/* ---------- Selección de empresa ---------- */
.empresas-list { display: grid; gap: 12px; }
.empresa-op { display: flex; justify-content: space-between; align-items: center; gap: 12px; width: 100%; text-align: left; background: var(--superficie); border: 1px solid var(--divisor); border-radius: var(--r-tarjeta); padding: 18px 20px; font: inherit; color: inherit; cursor: pointer; transition: border-color .15s, box-shadow .15s; }
.empresa-op:hover { border-color: var(--oro); box-shadow: 0 8px 22px rgba(20,20,22,.06), inset 4px 0 0 var(--oro); }
.empresa-op strong { display: block; font-size: 1.05rem; }

/* ---------- Liquidación ---------- */
.renglones tr.sec td, .matriz tr.sec td { background: var(--tinta); color: var(--oro-claro); font-weight: 700; font-size: .74rem; text-transform: uppercase; letter-spacing: .08em; }
.matriz tr.sec td { text-transform: none; letter-spacing: 0; font-size: .9rem; background: var(--tinta-2); color: var(--sobre-tinta); }
.renglones tr.r-sub td { font-weight: 650; }
.renglones tr.r-tot td { font-weight: 800; border-top: 2px solid var(--tinta); background: var(--oro-suave); }
.renglones tr.r-info td, .renglones tr.r-base td { color: var(--tenue); font-size: .9rem; }
.cas { display: inline-block; min-width: 32px; padding: 1px 7px; border-radius: 6px; background: var(--tinta); color: var(--oro-claro); font-size: .74rem; font-weight: 700; text-align: center; }
.liq { align-items: start; }
.carga-in { display: grid; grid-template-columns: 1fr minmax(260px, 380px); gap: 20px; align-items: start; }
@media (max-width: 980px) { .carga-in { grid-template-columns: 1fr; } }
.req { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.req li { padding-left: 24px; position: relative; }
.req li::before { position: absolute; left: 0; font-weight: 800; }
.req li.ok::before { content: "✓"; color: var(--ok); }
.req li.falta::before { content: "!"; color: var(--bad); }
.req li.opc::before { content: "○"; color: var(--tenue); }
.carga-form { display: grid; gap: 10px; background: var(--gris-50); border: 1px dashed var(--gris-300); border-radius: var(--r-control); padding: 16px; }
.zona-peligro { border-color: #f6c9c4; }
fieldset.ro { border: 0; padding: 0; margin: 0; min-width: 0; }
fieldset.ro[disabled] .actions, fieldset.ro[disabled] button { display: none; }
fieldset.ro[disabled] input, fieldset.ro[disabled] select, fieldset.ro[disabled] textarea { background: var(--gris-50); color: var(--texto); }

/* ---------- Importación ---------- */
.preview td, .preview th { white-space: nowrap; max-width: 220px; overflow: hidden; text-overflow: ellipsis; }
select.mapped { border-color: var(--oro); background: var(--oro-suave); }
tr.devolucion td { color: var(--bad); }
tr.hecho td { color: var(--tenue); }
.venc input[type=date] { min-width: 140px; padding: 6px 8px; min-height: 38px; }
.acceso { display: flex; align-items: center; gap: 6px; margin-bottom: 2px; }
.link-x { background: none; border: 0; color: var(--bad); font-size: 1rem; cursor: pointer; padding: 0 4px; line-height: 1; }
form.enlazar { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
form.enlazar select { width: auto; min-height: 34px; padding: 4px 8px; font-size: .82rem; }
.matriz th, .matriz td { white-space: nowrap; }

/* ---------- Tablero de ventas ---------- */
.tablero { background: var(--superficie); border: 1px solid var(--divisor); border-radius: var(--r-tarjeta); overflow: hidden; margin-bottom: 20px; }
.tb-titulo { background: var(--tinta); color: #fff; text-align: center; font-weight: 800; font-size: 1.3rem; letter-spacing: .02em; padding: 18px 12px 6px; }
.tb-sub { background: var(--tinta); color: var(--sobre-tinta-tenue); text-align: center; font-size: .84rem; padding: 0 12px 16px; border-bottom: 3px solid var(--oro); }
.tb-seccion { background: var(--tinta-2); color: var(--oro-claro); text-align: center; font-weight: 700; padding: 9px; margin-top: 22px; font-size: .82rem; letter-spacing: .1em; }
.tb th { background: #3a3a40; color: #fff; font-size: .72rem; }
.tb td { padding: 8px 12px; font-variant-numeric: tabular-nums; }
.tb tbody tr:nth-child(even) td { background: var(--gris-50); }
.tb tfoot td { border-top: 0; }
.tb .tb-total td { background: var(--tinta); color: #fff; font-weight: 700; }
.tb .tb-neto td { background: #0b0b0c; color: var(--oro-claro); font-weight: 700; }
.tb .tb-dorado { color: var(--oro-claro) !important; }
.tb tr.tb-fuera td { color: var(--gris-300); }
.tb .tb-cat { text-align: center; font-size: .86rem; }
.tb-tops { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 0 16px; }

/* ---------- Documentos imprimibles ---------- */
.doc { background: var(--superficie); border: 1px solid var(--divisor); border-radius: var(--r-tarjeta); padding: 32px; max-width: 900px; margin: 0 auto; }
.doc-head { display: flex; justify-content: space-between; gap: 16px; border-bottom: 3px solid var(--oro); padding-bottom: 12px; margin-bottom: 16px; }
.doc-head h1 { font-size: 1.25rem; }
.doc-no { text-align: right; }
.doc-no strong { font-size: 1.3rem; display: block; }
.doc table td, .doc table th { padding: 7px 9px; }
.doc-print-head { display: none; }
.signs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; margin-top: 60px; }
.signs div { border-top: 1px solid var(--texto); padding-top: 6px; font-size: .84rem; text-align: center; }

/* Formulario 350 */
.f350 { background: #fff; border: 2px solid var(--tinta); max-width: 1100px; margin: 0 auto 20px; font-size: .82rem; border-radius: 4px; }
.f350 table { width: 100%; border-collapse: collapse; }
.f350 td, .f350 th { border: 1px solid #3a3a40; padding: 4px 6px; }
.f-head .f-dian { font-size: 1.8rem; font-weight: 300; letter-spacing: .25em; width: 22%; }
.f-head .f-titulo { text-align: center; font-weight: 700; font-size: 1.05rem; }
.f-head .f-num { background: var(--tinta); color: var(--oro-claro); font-size: 2.4rem; font-weight: 800; text-align: center; width: 18%; }
.f-grid .f-lbl { color: var(--tenue); font-size: .74rem; width: 14%; }
.f-grid .f-dato { font-weight: 700; }
.f-cuerpo th { background: #f0efeb; color: var(--texto); font-size: .72rem; text-transform: none; letter-spacing: 0; text-align: center; }
.f-cuerpo .f-con { width: 26%; }
.f-cuerpo .f-cas { width: 34px; text-align: center; color: var(--tenue); font-size: .74rem; background: var(--gris-50); }
.f-cuerpo .f-val { text-align: right; font-variant-numeric: tabular-nums; font-weight: 650; min-width: 90px; }
.f-cuerpo .f-gris { background: #cfcdc6; }
.f-cuerpo .f-sec td { background: #f0efeb; font-weight: 700; }
.f-totales .f-tot td { font-weight: 800; }
.f350 .signs { padding: 0 16px 16px; }

/* ---------- Impresión ---------- */
@media print {
  .no-print, .lateral, .cabecera, .toolbar, .alert, .velo { display: none !important; }
  .app .principal { margin: 0; }
  body { background: #fff; font-size: 11.5px; }
  .app main.wrap, main.wrap { padding: 0; max-width: none; }
  .doc, .card, .tablero, .kpi { border: 0; padding: 0; border-radius: 0; }
  .doc-print-head { display: block; margin-bottom: 10px; }
  .kpis { grid-template-columns: repeat(4, 1fr); }
  .table-wrap { overflow: visible; }
  .matriz { font-size: 10px; }
  .tb-tops { grid-template-columns: 1fr 1fr; }
  .f350 { border-width: 1px; font-size: 9px; max-width: none; }
  .f350 td, .f350 th { padding: 2px 4px; }
  .kpi.main, .tb-titulo, .tb-sub, .tb-seccion, .tb th, .tb .tb-total td, .tb .tb-neto td, .f-head .f-num, .f-cuerpo .f-gris, .renglones tr.sec td, .cas { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  a { color: inherit; text-decoration: none; }
  @page { margin: 12mm; }
}

/* ---------- Resumen (centro de operación) ---------- */
.kpis-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 1180px) { .kpis-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .kpis-4 { grid-template-columns: 1fr; } }
.kpi .small { margin-top: 6px; }
.kpi .value.diff-ok { color: var(--ok); }
.kpi .value.diff-bad { color: var(--bad); }
.kpi-alerta { border-color: #f6c9c4; background: var(--bad-bg); }
.kpi-alerta .value { color: var(--bad); }
.dash { grid-template-columns: minmax(0, 1.65fr) minmax(320px, 1fr); align-items: start; }
@media (max-width: 1100px) { .dash { grid-template-columns: 1fr; } }
.dash-lado > .card:last-child { margin-bottom: 0; }
.dash > .card { margin-bottom: 0; }
.dash { margin-bottom: 20px; }
.card-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 14px; }
.card-head h2 { margin: 0; }
.card-head a { text-decoration: none; font-weight: 600; }
/* Gráfico de columnas */
.columnas { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 10px; align-items: end; height: 260px; padding: 8px 4px 0; border-bottom: 1px solid var(--divisor); }
.col { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; min-width: 0; }
.col-barra { width: 100%; max-width: 46px; min-height: 3px; border-radius: 8px 8px 3px 3px; background: linear-gradient(180deg, #e9e6dd, #d9d5ca); transition: background .15s; }
.col.actual .col-barra { background: linear-gradient(180deg, var(--oro-claro), var(--oro)); box-shadow: 0 6px 16px rgba(217,176,76,.3); }
.col:hover .col-barra { background: linear-gradient(180deg, #3a3a40, var(--tinta)); }
.col-valor { font-size: .68rem; font-weight: 700; color: var(--tenue); margin-bottom: 6px; white-space: nowrap; }
.col.actual .col-valor { color: var(--oro-osc); }
.col-mes { font-size: .74rem; color: var(--tenue); padding: 8px 0 6px; font-weight: 600; }
.col.actual .col-mes { color: var(--texto); }
.col.vacia .col-barra { background: repeating-linear-gradient(45deg, #f0efeb, #f0efeb 4px, #f7f6f3 4px, #f7f6f3 8px); }
@media (max-width: 640px) { .columnas { gap: 4px; height: 200px; } .col-valor { display: none; } }
.mini-tabla { margin-top: 18px; }
.mini-fila { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(60px, 1fr) auto; gap: 12px; align-items: center; padding: 7px 0; border-bottom: 1px solid var(--divisor); font-size: .9rem; }
.mini-fila:last-child { border-bottom: 0; }
.mini-fila > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini-fila .bar { margin: 0; }
.mini-fila strong { font-variant-numeric: tabular-nums; white-space: nowrap; }
/* Vencimientos */
.venc-item { display: grid; grid-template-columns: 52px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 10px 8px; border-radius: var(--r-control); color: var(--texto); text-decoration: none; }
.venc-item + .venc-item { border-top: 1px solid var(--divisor); border-radius: 0; }
.venc-item:hover { background: var(--gris-50); color: var(--texto); }
.venc-fecha { display: flex; flex-direction: column; align-items: center; justify-content: center; height: 52px; border-radius: 12px; background: var(--tinta); color: var(--oro-claro); font-size: .7rem; text-transform: uppercase; letter-spacing: .06em; font-weight: 600; }
.venc-fecha strong { font-size: 1.15rem; line-height: 1; color: #fff; letter-spacing: 0; }
.venc-fecha.urgente { background: var(--bad); color: #ffe1dd; }
.venc-txt { display: flex; flex-direction: column; min-width: 0; }
.venc-txt strong { font-size: .92rem; }
.venc-txt small { color: var(--tenue); font-size: .78rem; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--divisor); }
.chip { display: inline-flex; align-items: center; padding: 6px 12px; border-radius: 99px; border: 1px solid var(--divisor); background: var(--gris-50); color: var(--texto); font-size: .8rem; font-weight: 600; text-decoration: none; }
.chip:hover { border-color: var(--oro); background: var(--oro-suave); color: var(--texto); }
/* Requiere atención */
.atencion .aten-item { display: flex; justify-content: space-between; align-items: center; gap: 14px; padding: 12px 14px; border-radius: var(--r-control); margin-bottom: 8px; font-size: .92rem; border-left: 4px solid; }
.aten-bad { background: var(--bad-bg); border-color: var(--bad) !important; }
.aten-warn { background: var(--warn-bg); border-color: var(--oro) !important; }
.aten-info { background: var(--gris-50); border-color: var(--gris-300) !important; }
.soportes { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--divisor); display: grid; gap: 8px; }
.soporte { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--divisor); border-radius: var(--r-control); background: var(--gris-50); color: var(--texto); text-decoration: none; }
.soporte:hover { border-color: var(--oro); background: var(--oro-suave); color: var(--texto); }
.soporte-ico { width: 32px; height: 32px; border-radius: 8px; background: var(--tinta); color: var(--oro-claro); display: grid; place-items: center; flex: none; }
.soporte span:last-child { display: flex; flex-direction: column; min-width: 0; }
.soporte strong { font-size: .88rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.soporte small { color: var(--tenue); font-size: .76rem; }
