/* ============================================================
   Universal Books · Portal de clientes
   ============================================================ */
:root {
  --ink: #16224A;
  --navy: #2B3A78;
  --ub: #377FA0;
  --blue: #2F7DB0;
  --blue-d: #22668F;
  --sky: #CFEAFB;
  --sky-2: #E8F4FC;
  --bg: #F4F6FA;
  --card: #FFFFFF;
  --card-2: #F8FAFC;
  --line: #E3E8F0;
  --line-2: #EEF2F7;
  --text: #18213A;
  --muted: #5B6782;
  --faint: #8A95AD;
  --ok: #1F8A5B; --ok-bg: #E4F5EC;
  --warn: #A86A12; --warn-bg: #FDF1DC;
  --bad: #C2372B; --bad-bg: #FCE8E6;
  --violet: #6A4FC4; --violet-bg: #EEE9FB;
  --slate: #56627A; --slate-bg: #ECEFF4;
  --focus: 0 0 0 3px rgba(47, 125, 176, .28);
  --sh-1: 0 1px 2px rgba(22, 34, 74, .06), 0 1px 1px rgba(22, 34, 74, .04);
  --sh-2: 0 6px 20px -6px rgba(22, 34, 74, .18), 0 2px 6px rgba(22, 34, 74, .06);
  --sh-3: 0 24px 60px -12px rgba(22, 34, 74, .35);
  --r: 12px; --r-sm: 8px; --r-lg: 16px;
  --side: 252px;
  --top: 60px;
  --f-ui: "Instrument Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --f-display: "Young Serif", Georgia, serif;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #0E1428; --card: #151D36; --card-2: #19223F; --line: #263154; --line-2: #1E2846;
  --text: #E7ECF7; --muted: #A2AECB; --faint: #7783A3; --sky-2: #1A2B4D; --sky: #23406B;
  --ok-bg: #12352A; --warn-bg: #3A2C12; --bad-bg: #3B1A1A; --violet-bg: #29224A; --slate-bg: #222B45;
  --ok: #4CC38A; --warn: #E3A64A; --bad: #F07468; --violet: #A895F0; --slate: #AAB4CC;
  --blue: #4C9AD1; --blue-d: #6AB0E0;
  --sh-1: 0 1px 2px rgba(0,0,0,.3); --sh-2: 0 8px 24px -6px rgba(0,0,0,.5); --sh-3: 0 24px 60px -12px rgba(0,0,0,.7);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 15px/1.5 var(--f-ui); color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }
h1, h2, h3, h4 { margin: 0; line-height: 1.2; font-weight: 600; }
h1 { font: 400 26px/1.15 var(--f-display); letter-spacing: -.01em; color: var(--ink); }
:root[data-theme="dark"] h1 { color: var(--text); }
h2 { font-size: 17px; }
h3 { font-size: 15px; }
p { margin: 0 0 10px; }
small, .small { font-size: 13px; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.num, .tnum { font-variant-numeric: tabular-nums; }
.right { text-align: right; }
.center { text-align: center; }
.nowrap { white-space: nowrap; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hidden, [hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.icon { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; vertical-align: -3px; }
.icon.sm { width: 15px; height: 15px; }
.icon.lg { width: 22px; height: 22px; }
kbd { font: 600 11px/1 var(--f-ui); padding: 3px 6px; border-radius: 5px; border: 1px solid var(--line); border-bottom-width: 2px; background: var(--card); color: var(--muted); }
hr { border: 0; border-top: 1px solid var(--line); margin: 18px 0; }
::selection { background: var(--sky); }

/* ---------- Shell ---------- */
.app { display: grid; grid-template-columns: var(--side) 1fr; min-height: 100vh; }
.side { position: sticky; top: 0; height: 100vh; background: #16224A; color: #C9D4EA; display: flex; flex-direction: column; z-index: 40; }
.side__brand { display: flex; align-items: center; gap: 11px; padding: 18px 18px 14px; color: #fff; text-decoration: none !important; }
.side__brand img { width: 40px; height: 40px; background: #fff; border-radius: 10px; padding: 4px; object-fit: contain; }
.side__brand b { display: block; font: 400 18px/1.1 var(--f-display); color: #fff; }
.side__brand span { font-size: 12px; color: #8FA0C4; }
.side__nav { flex: 1; overflow-y: auto; padding: 6px 10px 14px; scrollbar-width: thin; scrollbar-color: #2B3A78 transparent; }
.side__group { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: #6F80A8; padding: 16px 10px 6px; }
.side__link { display: flex; align-items: center; gap: 11px; padding: 8px 10px; border-radius: 9px; color: #C9D4EA; font-weight: 500; text-decoration: none !important; transition: background .12s, color .12s; position: relative; }
.side__link:hover { background: rgba(207, 234, 251, .07); color: #fff; }
.side__link.is-on { background: linear-gradient(90deg, rgba(55,127,160,.38), rgba(55,127,160,.12)); color: #fff; }
.side__link.is-on::before { content: ""; position: absolute; left: -10px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: #7FC3EA; }
.side__link .icon { opacity: .85; }
.side__count { margin-left: auto; min-width: 22px; padding: 1px 7px; border-radius: 99px; background: #E5A93B; color: #2A1B00; font-size: 12px; font-weight: 700; text-align: center; }
.side__count.blue { background: #7FC3EA; color: #0C2236; }
.side__count.red { background: #F07468; color: #2D0905; }
.side__foot { padding: 12px; border-top: 1px solid rgba(255,255,255,.07); }
.side__cta { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; margin-bottom: 10px; }
.me { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 10px; color: #E3E9F6; background: none; border: 0; width: 100%; text-align: left; cursor: pointer; font: inherit; }
.me:hover { background: rgba(255,255,255,.06); }
.me__av { width: 34px; height: 34px; border-radius: 50%; background: #377FA0; color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 13px; flex: none; }
.me__t { min-width: 0; flex: 1; }
.me__t b { display: block; font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.me__t span { font-size: 12px; color: #8FA0C4; }

.main { min-width: 0; display: flex; flex-direction: column; }
.top { position: sticky; top: 0; z-index: 30; height: var(--top); display: flex; align-items: center; gap: 12px; padding: 0 28px; background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid transparent; transition: border-color .15s; }
.top.is-scrolled { border-bottom-color: var(--line); }
.top .top__burger { display: none; }
.top__search { flex: 1; max-width: 560px; display: flex; align-items: center; gap: 10px; height: 40px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--card); color: var(--faint); cursor: text; font: inherit; text-align: left; box-shadow: var(--sh-1); }
.top__search:hover { border-color: #C9D3E2; }
.top__search span { flex: 1; }
.top__actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.content { padding: 22px 28px 60px; width: 100%; max-width: 1480px; }
.content--wide { max-width: none; }

.ph { display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.ph__t { flex: 1; min-width: 240px; }
.ph__t p { margin: 6px 0 0; color: var(--muted); }
.ph__a { display: flex; gap: 8px; flex-wrap: wrap; }
.crumb { font-size: 13px; color: var(--muted); margin-bottom: 6px; display: flex; gap: 6px; align-items: center; }

/* ---------- Botones ---------- */
.btn { --b: var(--card); --c: var(--text); --bd: var(--line); display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 38px; padding: 0 15px; border-radius: 9px; border: 1px solid var(--bd); background: var(--b); color: var(--c); font: 600 14px/1 var(--f-ui); cursor: pointer; white-space: nowrap; text-decoration: none !important; transition: background .12s, border-color .12s, transform .06s, box-shadow .12s; user-select: none; }
.btn:hover { border-color: #C3CEDE; background: var(--card-2); }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: 0; box-shadow: var(--focus); }
.btn[disabled], .btn.is-busy { opacity: .55; pointer-events: none; }
.btn.is-busy::after { content: ""; width: 13px; height: 13px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }
.btn--primary { --b: var(--blue); --c: #fff; --bd: var(--blue); box-shadow: 0 1px 0 rgba(255,255,255,.18) inset, 0 2px 6px -2px rgba(47,125,176,.6); }
.btn--primary:hover { background: var(--blue-d); border-color: var(--blue-d); }
.btn--ink { --b: var(--ink); --c: #fff; --bd: var(--ink); }
.btn--ink:hover { background: var(--navy); border-color: var(--navy); }
.btn--ok { --b: var(--ok); --c: #fff; --bd: var(--ok); }
.btn--ok:hover { background: #18734B; border-color: #18734B; }
.btn--danger { --c: var(--bad); }
.btn--danger:hover { background: var(--bad-bg); border-color: color-mix(in srgb, var(--bad) 40%, transparent); }
.btn--solid-danger { --b: var(--bad); --c: #fff; --bd: var(--bad); }
.btn--ghost { --b: transparent; --bd: transparent; --c: var(--muted); }
.btn--ghost:hover { background: var(--line-2); border-color: transparent; color: var(--text); }
.btn--sm { height: 32px; padding: 0 11px; font-size: 13px; border-radius: 8px; }
.btn--xs { height: 26px; padding: 0 8px; font-size: 12px; border-radius: 7px; gap: 5px; }
.btn--lg { height: 46px; padding: 0 22px; font-size: 15px; border-radius: 11px; }
.btn--icon { width: 38px; padding: 0; }
.btn--icon.btn--sm { width: 32px; }
.btn--icon.btn--xs { width: 26px; }
.btn--block { width: 100%; }
.side .btn--primary { box-shadow: 0 4px 14px -4px rgba(47,125,176,.9); }
.btns { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* ---------- Tarjetas ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--sh-1); min-width: 0; }
.card__h { display: flex; align-items: center; gap: 10px; padding: 15px 18px; border-bottom: 1px solid var(--line-2); }
.card__h h2 { flex: 1; font-size: 15px; }
.card__h .muted { font-size: 13px; }
.card__b { padding: 16px 18px; }
.card__f { padding: 12px 18px; border-top: 1px solid var(--line-2); background: var(--card-2); border-radius: 0 0 var(--r) var(--r); }
.card--flush .card__b { padding: 0; }
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g-main { grid-template-columns: minmax(0, 1fr) 380px; align-items: start; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row--between { justify-content: space-between; }
.spacer { flex: 1; }
.mt { margin-top: 16px; } .mt-s { margin-top: 8px; } .mb { margin-bottom: 16px; } .mb-s { margin-bottom: 8px; }

/* KPIs */
.kpis { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); margin-bottom: 18px; }
.kpi { position: relative; padding: 16px 18px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--sh-1); overflow: hidden; text-decoration: none !important; color: inherit; display: block; transition: border-color .12s, transform .12s, box-shadow .12s; }
a.kpi:hover { border-color: #BFD3E6; box-shadow: var(--sh-2); transform: translateY(-1px); }
.kpi__l { font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 7px; }
.kpi__v { font: 400 27px/1.15 var(--f-display); color: var(--ink); margin-top: 6px; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
:root[data-theme="dark"] .kpi__v { color: var(--text); }
.kpi__s { font-size: 13px; color: var(--muted); margin-top: 4px; }
.kpi__ic { position: absolute; right: 14px; top: 14px; width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--sky-2); color: var(--blue); }
.kpi--warn .kpi__ic { background: var(--warn-bg); color: var(--warn); }
.kpi--bad .kpi__ic { background: var(--bad-bg); color: var(--bad); }
.kpi--ok .kpi__ic { background: var(--ok-bg); color: var(--ok); }
.kpi--hero { background: linear-gradient(135deg, #16224A 0%, #2B3A78 60%, #377FA0 130%); border: 0; color: #DDE7F7; }
.kpi--hero .kpi__l, .kpi--hero .kpi__s { color: #A9BBDD; }
.kpi--hero .kpi__v { color: #fff; }
.kpi--hero .kpi__ic { background: rgba(255,255,255,.1); color: #CFEAFB; }

/* ---------- Formularios ---------- */
.f { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.f > label, .lbl { font-size: 13px; font-weight: 600; color: var(--muted); }
.f .hint { font-size: 12px; color: var(--faint); }
.fs { display: grid; gap: 14px; }
.fs.c2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.fs.c3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.span2 { grid-column: span 2; } .span3 { grid-column: 1 / -1; }
.in, select.in, textarea.in { width: 100%; height: 40px; padding: 0 12px; border-radius: 9px; border: 1px solid var(--line); background: var(--card); color: var(--text); font: 15px var(--f-ui); transition: border-color .12s, box-shadow .12s; }
textarea.in { height: auto; min-height: 84px; padding: 10px 12px; resize: vertical; line-height: 1.45; }
select.in { padding-right: 32px; appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%235B6782' stroke-width='2.4' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 11px center; }
.in:hover { border-color: #C9D3E2; }
.in:focus { outline: 0; border-color: var(--blue); box-shadow: var(--focus); }
.in--sm { height: 32px; font-size: 14px; padding: 0 9px; border-radius: 8px; }
.in--num { text-align: right; font-variant-numeric: tabular-nums; }
.in-wrap { position: relative; display: flex; align-items: center; }
.in-wrap > .icon { position: absolute; left: 11px; color: var(--faint); pointer-events: none; }
.in-wrap > .in { padding-left: 36px; }
.in-wrap > kbd { position: absolute; right: 9px; }
.chk { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; font-size: 14px; }
.chk input { width: 17px; height: 17px; margin: 2px 0 0; accent-color: var(--blue); flex: none; }
.switch { position: relative; display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-size: 14px; }
.switch input { appearance: none; width: 38px; height: 22px; border-radius: 99px; background: #CBD3E0; position: relative; cursor: pointer; transition: background .15s; flex: none; margin: 0; }
.switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.25); transition: transform .15s; }
.switch input:checked { background: var(--blue); }
.switch input:checked::after { transform: translateX(16px); }
.seg { display: inline-flex; padding: 3px; gap: 2px; border-radius: 10px; background: var(--line-2); border: 1px solid var(--line); }
.seg button, .seg a, .seg label { border: 0; background: none; padding: 6px 13px; border-radius: 7px; font: 600 13px var(--f-ui); color: var(--muted); cursor: pointer; text-decoration: none !important; white-space: nowrap; }
.seg input { display: none; }
.seg .is-on, .seg input:checked + span { background: var(--card); color: var(--text); box-shadow: var(--sh-1); }
.seg label span { display: block; padding: 0; }
.seg label:has(input:checked) { background: var(--card); color: var(--text); box-shadow: var(--sh-1); }

/* ---------- Pestañas / filtros ---------- */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 16px; overflow-x: auto; scrollbar-width: none; }
.tabs a, .tabs button { display: inline-flex; align-items: center; gap: 7px; padding: 10px 14px; border: 0; background: none; font: 600 14px var(--f-ui); color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; cursor: pointer; white-space: nowrap; text-decoration: none !important; }
.tabs a:hover, .tabs button:hover { color: var(--text); }
.tabs .is-on { color: var(--ink); border-bottom-color: var(--blue); }
:root[data-theme="dark"] .tabs .is-on { color: var(--text); }
.tabs .c { font-size: 12px; padding: 1px 7px; border-radius: 99px; background: var(--line-2); color: var(--muted); font-weight: 700; }
.tabs .is-on .c { background: var(--sky-2); color: var(--blue); }
.tabs .c.warn { background: var(--warn-bg); color: var(--warn); }
.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.filters .in { width: auto; }
.filters .in-wrap { flex: 1; min-width: 220px; max-width: 420px; }
.filters .in-wrap .in { width: 100%; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 11px; border-radius: 99px; border: 1px solid var(--line); background: var(--card); font: 600 13px var(--f-ui); color: var(--muted); cursor: pointer; white-space: nowrap; }
.chip:hover { border-color: #C3CEDE; color: var(--text); }
.chip.is-on { background: var(--ink); border-color: var(--ink); color: #fff; }
.chip .x { opacity: .7; }

/* ---------- Tablas ---------- */
.tbl-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.tbl { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 14px; }
.tbl th { position: sticky; top: 0; z-index: 1; text-align: left; font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; padding: 10px 14px; background: var(--card-2); border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl th[data-sort] { cursor: pointer; user-select: none; }
.tbl th[data-sort]:hover { color: var(--text); }
.tbl th.is-asc::after { content: " ↑"; } .tbl th.is-desc::after { content: " ↓"; }
.tbl td { padding: 11px 14px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.tbl tbody tr { transition: background .08s; }
.tbl tbody tr:hover { background: color-mix(in srgb, var(--sky-2) 55%, transparent); }
.tbl tbody tr.is-click { cursor: pointer; }
.tbl tbody tr.is-sel { background: var(--sky-2); }
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl tfoot td { padding: 11px 14px; border-top: 1px solid var(--line); font-weight: 700; background: var(--card-2); }
.tbl .num, .tbl .right { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tbl .t-main { font-weight: 600; color: var(--text); }
.tbl .t-sub { font-size: 12.5px; color: var(--muted); }
.tbl .act { text-align: right; white-space: nowrap; width: 1%; }
.tbl--compact td { padding: 7px 12px; }
.tbl--compact th { padding: 8px 12px; }
.card .tbl th:first-child { border-top-left-radius: var(--r); }
.card .tbl th:last-child { border-top-right-radius: var(--r); }
.card__h + .card__b .tbl th, .card__h + .tbl-wrap .tbl th { border-radius: 0 !important; }
.tbl-scroll { max-height: 520px; overflow: auto; }
.pager { display: flex; align-items: center; gap: 8px; justify-content: flex-end; padding: 12px 16px; font-size: 13px; color: var(--muted); }
.edit-cell { cursor: text; border-radius: 6px; padding: 3px 6px; margin: -3px -6px; display: inline-block; min-width: 48px; transition: background .1s, box-shadow .1s; }
.edit-cell:hover { background: var(--line-2); box-shadow: inset 0 0 0 1px var(--line); }
.edit-cell input { width: 96px; height: 28px; border: 1px solid var(--blue); border-radius: 6px; padding: 0 6px; font: inherit; text-align: right; box-shadow: var(--focus); background: var(--card); color: var(--text); }
.edit-cell.saved { animation: flash 1s; }
@keyframes flash { 0% { background: var(--ok-bg); } 100% { background: transparent; } }

/* ---------- Insignias ---------- */
.badge { --c: var(--slate); --b: var(--slate-bg); display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 9px; border-radius: 99px; background: var(--b); color: var(--c); font-size: 12.5px; font-weight: 600; white-space: nowrap; line-height: 1; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge--plain::before { display: none; }
.b-Pendiente, .b-warn { --c: var(--warn); --b: var(--warn-bg); }
.b-Nuevo, .b-info { --c: var(--blue); --b: var(--sky-2); }
.b-Procesando { --c: var(--violet); --b: var(--violet-bg); }
.b-Completado, .b-ok { --c: var(--ok); --b: var(--ok-bg); }
.b-Devuelto { --c: var(--slate); --b: var(--slate-bg); }
.b-Cancelado { --c: var(--faint); --b: var(--line-2); }
.b-Denegado, .b-bad { --c: var(--bad); --b: var(--bad-bg); }
.tag { display: inline-flex; align-items: center; height: 21px; padding: 0 7px; border-radius: 6px; font-size: 12px; font-weight: 600; background: var(--line-2); color: var(--muted); white-space: nowrap; }
.tag--muestra { background: var(--violet-bg); color: var(--violet); }
.tag--warn { background: var(--warn-bg); color: var(--warn); }
.tag--bad { background: var(--bad-bg); color: var(--bad); }
.tag--ok { background: var(--ok-bg); color: var(--ok); }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; background: var(--faint); }
.stock { font-variant-numeric: tabular-nums; font-weight: 600; }
.stock.is-low { color: var(--warn); }
.stock.is-out { color: var(--bad); }

/* ---------- Medidor de cupo ---------- */
.meter { height: 8px; border-radius: 99px; background: var(--line-2); overflow: hidden; }
.meter > i { display: block; height: 100%; border-radius: 99px; background: var(--blue); transition: width .35s cubic-bezier(.2,.8,.2,1); }
.meter.is-warn > i { background: #D99A2B; }
.meter.is-bad > i { background: var(--bad); }
.meter--sm { height: 5px; width: 90px; display: inline-block; vertical-align: middle; }
.cupo { padding: 16px 18px; }
.cupo__row { display: flex; justify-content: space-between; font-size: 13px; color: var(--muted); margin-top: 8px; }
.cupo__big { font: 400 26px/1.1 var(--f-display); color: var(--ink); font-variant-numeric: tabular-nums; }
:root[data-theme="dark"] .cupo__big { color: var(--text); }

/* ---------- Listas ---------- */
.list { list-style: none; margin: 0; padding: 0; }
.list > li { display: flex; align-items: center; gap: 12px; padding: 12px 18px; border-bottom: 1px solid var(--line-2); }
.list > li:last-child { border-bottom: 0; }
.list a.li-link { display: flex; align-items: center; gap: 12px; color: inherit; text-decoration: none !important; flex: 1; min-width: 0; }
.list .li-t { flex: 1; min-width: 0; }
.list .li-t b { display: block; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list .li-t span { font-size: 13px; color: var(--muted); }
.av { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; font-weight: 700; font-size: 13px; flex: none; background: var(--sky-2); color: var(--blue); }
.av--round { border-radius: 50%; }
.empty { text-align: center; padding: 42px 20px; color: var(--muted); }
.empty .icon { width: 38px; height: 38px; color: var(--faint); margin: 0 auto 10px; display: block; stroke-width: 1.4; }
.empty b { display: block; color: var(--text); font-size: 15px; margin-bottom: 4px; }

/* ---------- Avisos ---------- */
.alert { display: flex; gap: 12px; align-items: flex-start; padding: 13px 16px; border-radius: 10px; background: var(--sky-2); color: var(--ink); border: 1px solid color-mix(in srgb, var(--blue) 25%, transparent); font-size: 14px; margin-bottom: 14px; }
:root[data-theme="dark"] .alert { color: var(--text); }
.alert .icon { margin-top: 1px; color: var(--blue); }
.alert--warn { background: var(--warn-bg); border-color: color-mix(in srgb, var(--warn) 30%, transparent); }
.alert--warn .icon { color: var(--warn); }
.alert--bad { background: var(--bad-bg); border-color: color-mix(in srgb, var(--bad) 30%, transparent); }
.alert--bad .icon { color: var(--bad); }
.alert--ok { background: var(--ok-bg); border-color: color-mix(in srgb, var(--ok) 30%, transparent); }
.alert--ok .icon { color: var(--ok); }
.alert b { font-weight: 700; }

/* ---------- Toasts ---------- */
.toasts { position: fixed; z-index: 200; bottom: 20px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; width: min(520px, calc(100% - 32px)); }
.toast { pointer-events: auto; display: flex; align-items: flex-start; gap: 10px; padding: 12px 16px; border-radius: 12px; background: #16224A; color: #fff; box-shadow: var(--sh-3); font-size: 14px; animation: toastIn .28s cubic-bezier(.2,.9,.3,1.2); max-width: 100%; white-space: pre-line; }
.toast .icon { color: #7FC3EA; margin-top: 1px; }
.toast--bad { background: #8E2018; }
.toast--bad .icon { color: #FFB4AA; }
.toast--ok .icon { color: #6EE0A7; }
.toast.out { animation: toastOut .2s forwards; }
@keyframes toastIn { from { opacity: 0; transform: translateY(14px) scale(.96); } }
@keyframes toastOut { to { opacity: 0; transform: translateY(8px); } }

/* ---------- Drawer y modal ---------- */
.scrim { position: fixed; inset: 0; background: rgba(12, 20, 44, .42); z-index: 90; opacity: 0; transition: opacity .2s; backdrop-filter: blur(2px); }
.scrim.is-on { opacity: 1; }
.drawer { position: fixed; z-index: 100; top: 0; right: 0; bottom: 0; width: min(760px, 100%); background: var(--bg); box-shadow: var(--sh-3); display: flex; flex-direction: column; transform: translateX(104%); transition: transform .26s cubic-bezier(.2,.8,.2,1); }
.drawer.is-on { transform: none; }
.drawer--sm { width: min(520px, 100%); }
.drawer__h { display: flex; align-items: center; gap: 10px; padding: 14px 18px; background: var(--card); border-bottom: 1px solid var(--line); min-height: 62px; }
.drawer__h h2 { flex: 1; font: 400 21px/1.2 var(--f-display); color: var(--ink); }
:root[data-theme="dark"] .drawer__h h2 { color: var(--text); }
.drawer__b { flex: 1; overflow-y: auto; padding: 18px; }
.drawer__f { padding: 12px 18px; border-top: 1px solid var(--line); background: var(--card); display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.drawer__loading { display: grid; place-items: center; height: 200px; color: var(--muted); }
.spin { width: 26px; height: 26px; border: 3px solid var(--line); border-top-color: var(--blue); border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
dialog.modal { border: 0; padding: 0; border-radius: var(--r-lg); background: var(--card); color: var(--text); box-shadow: var(--sh-3); width: min(480px, calc(100% - 32px)); max-height: calc(100vh - 40px); }
dialog.modal--lg { width: min(720px, calc(100% - 32px)); }
dialog.modal::backdrop { background: rgba(12, 20, 44, .45); backdrop-filter: blur(2px); }
dialog.modal[open] { animation: pop .2s cubic-bezier(.2,.9,.3,1.2); }
@keyframes pop { from { opacity: 0; transform: scale(.95) translateY(8px); } }
.modal__h { padding: 18px 20px 6px; display: flex; align-items: flex-start; gap: 10px; }
.modal__h h2 { flex: 1; font: 400 20px/1.25 var(--f-display); color: var(--ink); }
:root[data-theme="dark"] .modal__h h2 { color: var(--text); }
.modal__b { padding: 8px 20px 18px; color: var(--muted); font-size: 14.5px; white-space: pre-line; }
.modal__b.form { white-space: normal; color: var(--text); }
.modal__f { padding: 12px 20px; display: flex; justify-content: flex-end; gap: 8px; background: var(--card-2); border-top: 1px solid var(--line-2); }

/* ---------- Paleta de comandos ---------- */
.pal { position: fixed; inset: 0; z-index: 150; display: flex; justify-content: center; align-items: flex-start; padding-top: 11vh; background: rgba(12, 20, 44, .42); backdrop-filter: blur(3px); }
.pal__box { width: min(680px, calc(100% - 24px)); background: var(--card); border-radius: 16px; box-shadow: var(--sh-3); overflow: hidden; border: 1px solid var(--line); animation: pop .16s ease-out; }
.pal__in { display: flex; align-items: center; gap: 12px; padding: 0 18px; border-bottom: 1px solid var(--line); }
.pal__in .icon { color: var(--blue); width: 20px; height: 20px; }
.pal__in input { flex: 1; height: 58px; border: 0; outline: 0; font: 17px var(--f-ui); background: none; color: var(--text); }
.pal__res { max-height: min(60vh, 520px); overflow-y: auto; padding: 6px; }
.pal__g { font-size: 11.5px; text-transform: uppercase; letter-spacing: .07em; color: var(--faint); padding: 10px 12px 5px; font-weight: 600; }
.pal__it { display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 9px; cursor: pointer; color: var(--text); text-decoration: none !important; }
.pal__it.is-on { background: var(--sky-2); }
.pal__it .av { width: 32px; height: 32px; border-radius: 8px; font-size: 12px; }
.pal__it .t { flex: 1; min-width: 0; }
.pal__it .t b { display: block; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 14.5px; }
.pal__it .t > span { display: block; font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pal__it .r { font-size: 13px; color: var(--muted); text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.pal__foot { display: flex; gap: 16px; padding: 9px 16px; border-top: 1px solid var(--line); font-size: 12px; color: var(--faint); background: var(--card-2); }
.pal__foot span { display: inline-flex; gap: 5px; align-items: center; }
mark { background: color-mix(in srgb, #F7D774 55%, transparent); color: inherit; border-radius: 3px; padding: 0 1px; }

/* ---------- Constructor de pedidos ---------- */
.builder { display: grid; grid-template-columns: minmax(0, 1fr) 400px; gap: 18px; align-items: start; }
.finder { min-width: 0; }
.finder__bar { position: sticky; top: calc(var(--top) + 6px); z-index: 5; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--sh-2); padding: 12px; }
.finder__q { display: flex; align-items: center; gap: 10px; }
.finder__q .in-wrap { flex: 1; }
.finder__q .in { height: 48px; font-size: 16.5px; border-radius: 11px; }
.finder__q .in-wrap > .icon { left: 14px; width: 20px; height: 20px; color: var(--blue); }
.finder__q .in-wrap > .in { padding-left: 44px; padding-right: 92px; }
.finder__q .in-wrap > .count { position: absolute; right: 12px; font-size: 12.5px; color: var(--faint); }
.finder__f { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; align-items: center; }
.finder__f select.in { width: auto; height: 32px; font-size: 13.5px; border-radius: 8px; max-width: 220px; }
.finder__hint { font-size: 12px; color: var(--faint); margin-left: auto; display: flex; gap: 10px; align-items: center; }
.results { margin-top: 12px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--sh-1); overflow: hidden; }
.res { display: grid; grid-template-columns: 46px minmax(0, 1fr) auto auto; align-items: center; gap: 14px; padding: 10px 14px; border-bottom: 1px solid var(--line-2); cursor: pointer; transition: background .06s; }
.res:last-child { border-bottom: 0; }
.res:hover { background: var(--card-2); }
.res.is-on { background: var(--sky-2); box-shadow: inset 3px 0 0 var(--blue); }
.res.in-cart .res__cover::after { content: "✓"; position: absolute; right: -5px; bottom: -5px; width: 18px; height: 18px; border-radius: 50%; background: var(--ok); color: #fff; font-size: 11px; display: grid; place-items: center; border: 2px solid var(--card); }
.res__cover { position: relative; width: 46px; height: 46px; border-radius: 9px; display: grid; place-items: center; font: 700 12px var(--f-ui); color: #fff; letter-spacing: .02em; }
.res__t { min-width: 0; }
.res__t b { display: block; font-weight: 600; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.res__t > span { display: block; font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.res__p { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.res__p b { display: block; font-size: 15px; }
.res__p span { font-size: 12px; color: var(--muted); }
.res__add { display: flex; gap: 6px; align-items: center; }
.qty { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 9px; background: var(--card); overflow: hidden; height: 34px; }
.qty button { width: 30px; height: 100%; border: 0; background: none; cursor: pointer; color: var(--muted); font: 600 16px var(--f-ui); }
.qty button:hover { background: var(--line-2); color: var(--text); }
.qty input { width: 52px; height: 100%; border: 0; border-left: 1px solid var(--line-2); border-right: 1px solid var(--line-2); text-align: center; font: 600 14px var(--f-ui); font-variant-numeric: tabular-nums; background: none; color: var(--text); -moz-appearance: textfield; }
.qty input::-webkit-inner-spin-button { -webkit-appearance: none; }
.qty input:focus { outline: 0; background: var(--sky-2); }
.qty--sm { height: 30px; }
.qty--sm input { width: 44px; }
.results__more { padding: 12px; text-align: center; font-size: 13px; color: var(--muted); }
.cart { position: sticky; top: calc(var(--top) + 6px); display: flex; flex-direction: column; max-height: calc(100vh - var(--top) - 24px); overflow-y: auto; overscroll-behavior: contain; }
.cart__h { position: sticky; top: 0; z-index: 2; background: var(--card); border-radius: var(--r) var(--r) 0 0; padding: 14px 16px; border-bottom: 1px solid var(--line-2); display: flex; align-items: center; gap: 10px; }
.cart__h h2 { flex: 1; font: 400 19px var(--f-display); color: var(--ink); }
:root[data-theme="dark"] .cart__h h2 { color: var(--text); }
.cart__items { flex: none; overflow-y: auto; min-height: 90px; max-height: 46vh; }
.ci { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 10px; padding: 10px 16px; border-bottom: 1px solid var(--line-2); align-items: center; }
.ci.is-new { animation: flash 1.2s; }
.ci__t b { display: block; font-size: 14px; font-weight: 600; line-height: 1.3; }
.ci__t > span { font-size: 12px; color: var(--muted); }
.ci__r { display: flex; align-items: center; gap: 8px; }
.ci__v { grid-column: 1 / -1; display: flex; justify-content: space-between; font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.ci__v .warn { color: var(--warn); font-weight: 600; }
.ci__x { width: 26px; height: 26px; border: 0; background: none; color: var(--faint); border-radius: 6px; cursor: pointer; display: grid; place-items: center; }
.ci__x:hover { background: var(--bad-bg); color: var(--bad); }
.cart__sum { padding: 14px 16px; border-top: 1px solid var(--line); background: var(--card-2); }
.sum-row { display: flex; justify-content: space-between; font-size: 14px; color: var(--muted); padding: 2px 0; font-variant-numeric: tabular-nums; }
.sum-row.total { color: var(--text); font-size: 18px; font-weight: 700; padding-top: 8px; margin-top: 6px; border-top: 1px dashed var(--line); }
.cart__empty { padding: 36px 20px; text-align: center; color: var(--muted); font-size: 14px; }
.cart__empty > .icon { width: 34px; height: 34px; margin: 0 auto 8px; display: block; color: var(--faint); stroke-width: 1.4; }
.cart-fab { display: none; }
.cart-close { display: none !important; }
.prog { display: flex; gap: 0; margin: 4px 0 2px; }
.prog > div { flex: 1; text-align: center; position: relative; font-size: 12px; color: var(--faint); padding-top: 24px; }
.prog > div::before { content: ""; position: absolute; top: 6px; left: 50%; width: 14px; height: 14px; margin-left: -7px; border-radius: 50%; background: var(--card); border: 2px solid var(--line); z-index: 1; }
.prog > div::after { content: ""; position: absolute; top: 12px; left: -50%; width: 100%; height: 2px; background: var(--line); }
.prog > div:first-child::after { display: none; }
.prog > .done { color: var(--text); }
.prog > .done::before { background: var(--blue); border-color: var(--blue); box-shadow: 0 0 0 4px var(--sky-2); }
.prog > .done::after { background: var(--blue); }
.prog > .now { font-weight: 700; color: var(--ink); }
:root[data-theme="dark"] .prog > .now { color: var(--text); }
.prog.is-bad > .now::before { background: var(--bad); border-color: var(--bad); box-shadow: 0 0 0 4px var(--bad-bg); }

/* ---------- Detalle ---------- */
.dl { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px 18px; }
.dl div > span { display: block; font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; margin-bottom: 3px; }
.dl div > b { font-weight: 600; font-size: 14.5px; }
.timeline { list-style: none; margin: 0; padding: 0 0 0 4px; }
.timeline li { position: relative; padding: 0 0 16px 22px; font-size: 14px; }
.timeline li::before { content: ""; position: absolute; left: 0; top: 6px; width: 10px; height: 10px; border-radius: 50%; background: var(--card); border: 2px solid var(--blue); }
.timeline li::after { content: ""; position: absolute; left: 5px; top: 18px; bottom: 0; width: 2px; background: var(--line); }
.timeline li:last-child::after { display: none; }
.timeline li.t-bad::before { border-color: var(--bad); }
.timeline li.t-ok::before { border-color: var(--ok); background: var(--ok); }
.timeline li.t-warn::before { border-color: var(--warn); }
.timeline li.t-legado::before { border-color: var(--faint); }
.timeline .when { font-size: 12px; color: var(--faint); }
.timeline .note { margin-top: 4px; padding: 8px 10px; background: var(--card-2); border: 1px solid var(--line-2); border-radius: 8px; font-size: 13px; color: var(--muted); white-space: pre-line; }
.ledger td.cargo { color: var(--text); }
.ledger td.abono { color: var(--ok); }
.saldo-neg { color: var(--ok); }

/* ---------- Gráficas ---------- */
.chart { position: relative; width: 100%; }
.chart svg { display: block; width: 100%; overflow: visible; }
.chart .grid-l { stroke: var(--line-2); stroke-width: 1; }
.chart .axis-t { fill: var(--faint); font-size: 11.5px; font-family: var(--f-ui); }
.chart .bar { transition: opacity .12s; }
.chart .hit:hover + .bar, .chart .bar.is-hover { opacity: .78; }
.chart-tip { position: absolute; pointer-events: none; background: #16224A; color: #fff; padding: 8px 11px; border-radius: 9px; font-size: 12.5px; box-shadow: var(--sh-2); white-space: nowrap; transform: translate(-50%, -100%); margin-top: -8px; opacity: 0; transition: opacity .1s; z-index: 5; }
.chart-tip.is-on { opacity: 1; }
.chart-tip b { display: block; margin-bottom: 2px; }
.chart-tip i { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 6px; }
.legend { display: flex; gap: 14px; font-size: 12.5px; color: var(--muted); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }

/* ---------- Login ---------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1.05fr 1fr; background: var(--card); }
.auth__art { position: relative; overflow: hidden; background: radial-gradient(120% 90% at 0% 0%, #2B3A78 0%, #16224A 55%, #0E1733 100%); color: #DCE6F6; padding: 44px 52px; display: flex; flex-direction: column; }
.auth__art::after { content: ""; position: absolute; inset: auto -20% -38% auto; width: 620px; height: 620px; border-radius: 50%; background: radial-gradient(circle, rgba(55,127,160,.55), transparent 65%); filter: blur(10px); }
.auth__logo { display: flex; align-items: center; gap: 12px; position: relative; z-index: 1; }
.auth__logo img { width: 52px; height: 52px; background: #fff; border-radius: 13px; padding: 5px; }
.auth__logo b { font: 400 22px var(--f-display); color: #fff; display: block; }
.auth__logo span { font-size: 13px; color: #9EB0D3; }
.auth__pitch { margin-top: auto; position: relative; z-index: 1; max-width: 520px; }
.auth__pitch h2 { font: 400 42px/1.08 var(--f-display); color: #fff; letter-spacing: -.015em; margin-bottom: 16px; }
.auth__pitch h2 em { font-style: normal; color: #9FD6F5; }
.auth__pitch p { color: #A9BADA; font-size: 16px; max-width: 440px; }
.auth__feats { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 28px; }
.auth__feat { padding: 13px 14px; border-radius: 12px; background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.08); font-size: 13.5px; color: #C7D4EC; display: flex; gap: 10px; align-items: flex-start; }
.auth__feat .icon { color: #7FC3EA; margin-top: 1px; }
.auth__books { position: absolute; right: 44px; top: 110px; display: flex; gap: 10px; transform: rotate(-8deg); opacity: .9; z-index: 0; }
.auth__books i { display: block; width: 46px; border-radius: 4px 6px 6px 4px; box-shadow: inset 4px 0 0 rgba(0,0,0,.18), 0 10px 24px rgba(0,0,0,.35); }
.auth__form { display: flex; align-items: center; justify-content: center; padding: 40px 24px; background: var(--bg); }
.auth__card { width: 100%; max-width: 410px; }
.auth__card h1 { font-size: 32px; margin-bottom: 6px; }
.auth__card > p { color: var(--muted); margin-bottom: 26px; }
.auth__card .in { height: 48px; font-size: 16px; border-radius: 11px; }
.auth__card .btn--lg { width: 100%; height: 50px; }
.auth__who { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 12px; background: var(--card); border: 1px solid var(--line); margin-bottom: 18px; }
.auth__who .av { width: 40px; height: 40px; }
.auth__who b { display: block; }
.auth__who span { font-size: 13px; color: var(--muted); }
.auth__links { display: flex; justify-content: space-between; margin-top: 16px; font-size: 14px; }
.auth__links button { background: none; border: 0; padding: 0; color: var(--blue); font: inherit; cursor: pointer; }
.auth__msg { min-height: 22px; margin: 10px 0 0; font-size: 14px; color: var(--bad); }
.auth__foot { margin-top: 36px; font-size: 12.5px; color: var(--faint); text-align: center; }
.step { animation: stepIn .3s cubic-bezier(.2,.8,.2,1); }
@keyframes stepIn { from { opacity: 0; transform: translateX(14px); } }
.code-in { letter-spacing: .5em; text-align: center; font-weight: 700; font-size: 22px !important; }

/* ---------- Varios ---------- */
.hero-hi { display: flex; gap: 18px; align-items: center; padding: 22px 24px; border-radius: var(--r-lg); background: linear-gradient(120deg, #16224A, #2B3A78 70%, #377FA0); color: #DCE6F6; margin-bottom: 18px; position: relative; overflow: hidden; }
.hero-hi::after { content: ""; position: absolute; right: -60px; top: -80px; width: 280px; height: 280px; border-radius: 50%; background: radial-gradient(circle, rgba(207,234,251,.22), transparent 65%); }
.hero-hi h1 { color: #fff; font-size: 28px; }
.hero-hi p { margin: 6px 0 0; color: #AFC0DF; }
.hero-hi .btn { position: relative; z-index: 1; }
.cover { border-radius: 8px; display: grid; place-items: center; color: #fff; font-weight: 700; }
.section-t { font-size: 12px; text-transform: uppercase; letter-spacing: .07em; color: var(--faint); font-weight: 600; margin: 4px 0 10px; }
.box { padding: 14px 16px; border-radius: 10px; background: var(--card); border: 1px solid var(--line); }
.box--soft { background: var(--card-2); }
.split { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; }
.big { font: 400 24px/1.1 var(--f-display); color: var(--ink); font-variant-numeric: tabular-nums; }
:root[data-theme="dark"] .big { color: var(--text); }
.menu { position: absolute; z-index: 60; min-width: 210px; background: var(--card); border: 1px solid var(--line); border-radius: 11px; box-shadow: var(--sh-3); padding: 6px; animation: pop .14s ease-out; }
.menu a, .menu button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border-radius: 7px; border: 0; background: none; font: 500 14px var(--f-ui); color: var(--text); cursor: pointer; text-align: left; text-decoration: none !important; }
.menu a:hover, .menu button:hover { background: var(--line-2); }
.menu .danger { color: var(--bad); }
.menu hr { margin: 5px 0; }
.drop { border: 2px dashed var(--line); border-radius: 12px; padding: 24px; text-align: center; color: var(--muted); background: var(--card-2); }
.drop.is-over { border-color: var(--blue); background: var(--sky-2); }
.skel { background: linear-gradient(90deg, var(--line-2), var(--line), var(--line-2)); background-size: 200% 100%; animation: skel 1.2s infinite; border-radius: 6px; height: 14px; }
@keyframes skel { to { background-position: -200% 0; } }
.foot { padding: 20px 28px 30px; font-size: 12.5px; color: var(--faint); display: flex; gap: 12px; flex-wrap: wrap; margin-top: auto; }

/* ---------- Responsive ---------- */
@media (max-width: 1180px) {
  .builder { grid-template-columns: minmax(0, 1fr) 340px; }
  .g-main { grid-template-columns: 1fr; }
  .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 960px) {
  .app { grid-template-columns: 1fr; }
  .side { position: fixed; left: 0; top: 0; bottom: 0; width: 272px; transform: translateX(-100%); transition: transform .24s cubic-bezier(.2,.8,.2,1); box-shadow: var(--sh-3); }
  .side.is-on { transform: none; }
  .top .top__burger { display: inline-flex; }
  .top { padding: 0 14px; }
  .content { padding: 16px 16px 90px; }
  .builder { grid-template-columns: 1fr; }
  .cart { position: fixed; z-index: 80; left: 0; right: 0; bottom: 0; top: auto; max-height: 82vh; border-radius: 18px 18px 0 0; transform: translateY(105%); transition: transform .26s cubic-bezier(.2,.8,.2,1); box-shadow: var(--sh-3); }
  .cart.is-on { transform: none; }
  .cart-close { display: inline-flex !important; }
  .cart-fab { display: flex; position: fixed; z-index: 70; left: 16px; right: 16px; bottom: 14px; height: 54px; border-radius: 14px; background: var(--ink); color: #fff; align-items: center; gap: 12px; padding: 0 18px; box-shadow: var(--sh-3); border: 0; font: 600 15px var(--f-ui); cursor: pointer; }
  .cart-fab .n { min-width: 26px; height: 26px; border-radius: 99px; background: #7FC3EA; color: #0C2236; display: grid; place-items: center; font-size: 13px; padding: 0 6px; }
  .cart-fab .v { margin-left: auto; font-variant-numeric: tabular-nums; }
  .g2, .g3 { grid-template-columns: 1fr; }
  .auth { grid-template-columns: 1fr; }
  .auth__art { display: none; }
  .finder__hint { display: none; }
}
@media (max-width: 640px) {
  body { font-size: 14.5px; }
  h1 { font-size: 23px; }
  .g4 { grid-template-columns: 1fr 1fr; }
  .kpis { grid-template-columns: 1fr 1fr; gap: 10px; }
  .kpi { padding: 13px 14px; }
  .kpi__v { font-size: 21px; }
  .kpi__ic { display: none; }
  .fs.c2, .fs.c3 { grid-template-columns: 1fr; }
  .span2 { grid-column: auto; }
  .top__search span { font-size: 14px; }
  .top__search kbd { display: none; }
  .res { grid-template-columns: 40px minmax(0, 1fr) auto; gap: 10px; padding: 10px 12px; }
  .res__cover { width: 40px; height: 40px; }
  .res__p { display: none; }
  .tbl { font-size: 13.5px; }
  .tbl th, .tbl td { padding: 9px 10px; }
  .hide-m { display: none !important; }
  .ph__a .btn { flex: 1; }
  .drawer__b { padding: 14px; }
  .hero-hi { flex-direction: column; align-items: flex-start; }
}

/* ---------- Impresión ---------- */
@media print {
  body { background: #fff; font-size: 12px; }
  .side, .top, .foot, .ph__a, .noprint, .toasts, .filters, .tabs, .btn { display: none !important; }
  .app { display: block; }
  .content { padding: 0; max-width: none; }
  .card { box-shadow: none; border-color: #ccc; break-inside: avoid; }
  .tbl th { position: static; background: #f3f3f3 !important; }
  a { color: inherit; }
}
.drawer__h h2 .badge, .drawer__h h2 .tag, .modal__h h2 .badge { font-family: var(--f-ui); vertical-align: 3px; }
.grid > *, .stack > *, .g-main > * { min-width: 0; }
.list > li[data-ver] .row { flex-wrap: nowrap; }
@media (max-width: 960px) {
  .toasts { bottom: 82px; }
  .drawer__f .spacer { display: none; }
}
@media (max-width: 640px) {
  .ph__t p kbd, .only-desk { display: none; }
}

.b-cot { --c: var(--warn); --b: var(--warn-bg); }
.tag--cot { background: var(--warn-bg); color: var(--warn); }
.tag--venta { background: var(--sky-2); color: var(--blue); }
