/* Saneze · Licencias y portal de clientes
   IBM Plex Sans (SIL OFL 1.1, ver fonts/OFL.txt) alojada localmente por la CSP. */
@font-face { font-family: "Plex"; src: url("fonts/plex-sans-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Plex"; src: url("fonts/plex-sans-500.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Plex"; src: url("fonts/plex-sans-600.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Plex"; src: url("fonts/plex-sans-700.woff2") format("woff2"); font-weight: 700; font-display: swap; }

:root {
    --ink: #16202B;
    --ink-2: #4A5866;
    --ink-3: #7B8794;
    --paper: #F3F5F7;
    --sheet: #FFFFFF;
    --line: #DDE3E8;
    --line-2: #EDF0F3;
    --teal: #0B6E78;
    --teal-soft: #E3F1F2;
    --amber: #B06F10;
    --amber-soft: #FBF0DE;
    --amber-line: #EFD3A6;
    --red: #B8433A;
    --red-soft: #F8E4E2;
    --green: #2E8A5C;
    --green-soft: #E2F2EA;
    --night: #16202B;
    --night-2: #1E2A36;
    --night-line: #2A3642;
    --night-text: #B9C7D3;
    --night-dim: #8FA2B3;
    --radius: 14px;
    --font: "Plex", "Segoe UI", -apple-system, system-ui, sans-serif;
    color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 400 15px/1.5 var(--font); }
a { color: var(--teal); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0; line-height: 1.2; font-weight: 600; }
p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; }
code { font-family: Consolas, "SFMono-Regular", monospace; font-size: 12px; }
.n { font-variant-numeric: tabular-nums; font-feature-settings: "tnum"; letter-spacing: -.01em; }
.muted { color: var(--ink-2); }
.small { font-size: 13px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.stack > * + * { margin-top: 14px; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* ---------- Botones ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 40px; padding: 8px 14px; border-radius: 10px; border: 1px solid var(--line); background: var(--sheet); color: var(--ink); font-weight: 600; font-size: 14px; cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn:hover { text-decoration: none; border-color: #C4CDD5; }
.btn--primary { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn--primary:hover { background: #24313F; border-color: #24313F; }
.btn--danger { color: var(--red); border-color: #E9C3BF; }
.btn--danger:hover { background: var(--red-soft); border-color: var(--red); }
.btn--small { min-height: 32px; padding: 5px 10px; font-size: 13px; }
.btn--block { width: 100%; }
.link-btn { background: none; border: 0; padding: 0; color: var(--teal); font-weight: 600; font-size: 13px; cursor: pointer; }
.link-btn:hover { text-decoration: underline; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* ---------- Etiquetas de estado ---------- */
.tag { display: inline-block; padding: 3px 9px; border-radius: 99px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.tag--ok { background: var(--green-soft); color: var(--green); }
.tag--warn { background: var(--amber-soft); color: var(--amber); }
.tag--bad { background: var(--red-soft); color: var(--red); }
.tag--neutral { background: var(--line-2); color: var(--ink-2); }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--ink-3); flex: none; }
.dot--ok { background: var(--green); }
.dot--warn { background: #D9912A; }
.dot--bad { background: var(--red); }
.signal { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; white-space: nowrap; }

/* ---------- Tarjetas, tablas y formularios ---------- */
.card { background: var(--sheet); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; min-width: 0; }
.card--flush { padding: 0; overflow: hidden; }
.card__head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.card--flush .card__head { padding: 16px 18px 0; }
.card__head h2 { font-size: 16px; }
.card__head span { font-size: 13px; color: var(--ink-2); }
.card__hint { font-size: 13px; color: var(--ink-2); margin: -4px 0 14px; }
.empty { padding: 26px 18px; text-align: center; color: var(--ink-2); }
.empty strong { display: block; color: var(--ink); font-size: 15px; margin-bottom: 4px; }

.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-2); font-weight: 600; padding: 10px 16px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 12px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table td small { display: block; color: var(--ink-2); font-size: 12px; }
.table .num { text-align: right; }
.table a strong { color: var(--ink); }
.table tbody tr:hover { background: #FAFBFC; }

.form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; }
.form .full { grid-column: 1 / -1; }
.field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 600; color: var(--ink); min-width: 0; }
.field small, .hint { font-weight: 400; font-size: 12px; color: var(--ink-2); line-height: 1.45; }
.field input, .field select, .field textarea, .input { width: 100%; min-height: 42px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--sheet); font-weight: 400; font-size: 15px; }
.field textarea { min-height: 96px; resize: vertical; line-height: 1.5; }
.field input:focus, .field select:focus, .field textarea:focus, .input:focus { border-color: var(--teal); outline: none; box-shadow: 0 0 0 3px var(--teal-soft); }
.field input[readonly] { background: var(--paper); font-family: Consolas, monospace; font-size: 13px; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; font-weight: 400; line-height: 1.4; }
.check input { margin-top: 3px; width: 17px; height: 17px; accent-color: var(--teal); flex: none; }
.form__foot { grid-column: 1 / -1; display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; padding-top: 4px; }

/* Interruptor accesible basado en checkbox */
.switch { position: relative; display: inline-flex; flex: none; }
.switch input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.switch span { width: 42px; height: 24px; border-radius: 99px; background: #CDD5DC; position: relative; transition: background .15s; }
.switch span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.2); transition: left .15s; }
.switch input:checked + span { background: var(--teal); }
.switch input:checked + span::after { left: 21px; }
.switch input:focus-visible + span { outline: 2px solid var(--teal); outline-offset: 2px; }

.row { display: flex; justify-content: space-between; align-items: center; gap: 14px; padding: 12px 0; border-top: 1px solid var(--line); }
.row:first-child { border-top: 0; padding-top: 0; }
.row > div { min-width: 0; }
.row strong { display: block; font-size: 14px; }
.row small { display: block; font-size: 12px; color: var(--ink-2); }

.flash { border-radius: 12px; padding: 12px 14px; margin-bottom: 16px; font-size: 14px; border: 1px solid var(--line); background: var(--sheet); }
.flash--success { background: var(--green-soft); border-color: #BFE0CE; }
.flash--warning, .flash--license-key { background: var(--amber-soft); border-color: var(--amber-line); }
.flash--danger { background: var(--red-soft); border-color: #EAC1BC; }
.flash--license-key { font-family: Consolas, monospace; font-size: 14px; overflow-wrap: anywhere; }

.copy { display: flex; gap: 8px; align-items: flex-end; }
.copy .field { flex: 1; }
.toast:not(:empty) { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); max-width: min(440px, calc(100vw - 32px)); background: var(--ink); color: #fff; padding: 12px 16px; border-radius: 12px; font-size: 14px; z-index: 20; box-shadow: 0 12px 30px rgba(0,0,0,.25); }

.pager { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 16px; border-top: 1px solid var(--line); font-size: 13px; color: var(--ink-2); }

.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 99px; background: var(--line-2); color: var(--ink); font-size: 13px; font-weight: 500; white-space: nowrap; }
.chip:hover { text-decoration: none; background: #E2E7EB; }
.chip.is-on { background: var(--ink); color: #fff; }
.chip em { font-style: normal; font-size: 11px; opacity: .75; }

.searchbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.searchbar .input { flex: 1 1 220px; width: auto; min-height: 38px; font-size: 14px; background: var(--paper); }

/* ---------- Administración: estructura ---------- */
.admin { min-height: 100vh; display: grid; grid-template-columns: 220px minmax(0, 1fr); }
.side { position: sticky; top: 0; height: 100vh; background: var(--sheet); border-right: 1px solid var(--line); padding: 20px 14px; display: flex; flex-direction: column; gap: 2px; }
.logo { display: flex; gap: 10px; align-items: center; padding: 0 6px 20px; color: var(--ink); }
.logo:hover { text-decoration: none; }
.logo i { width: 32px; height: 32px; border-radius: 9px; background: var(--ink); color: #fff; display: grid; place-items: center; font-style: normal; font-weight: 700; }
.logo b { display: block; font-size: 15px; }
.logo small { display: block; color: var(--ink-2); font-size: 11px; }
.side nav { display: flex; flex-direction: column; gap: 2px; }
.side nav a { display: flex; justify-content: space-between; align-items: center; padding: 9px 10px; border-radius: 9px; font-size: 14px; color: var(--ink); font-weight: 500; }
.side nav a:hover { background: var(--paper); text-decoration: none; }
.side nav a.is-on { background: var(--paper); font-weight: 600; box-shadow: inset 3px 0 0 var(--teal); }
.side nav em { font-style: normal; font-size: 11px; background: var(--red); color: #fff; border-radius: 99px; padding: 1px 7px; }
.side__foot { margin-top: auto; padding: 14px 10px 0; border-top: 1px solid var(--line); font-size: 13px; }
.side__foot span { display: block; font-weight: 600; margin-bottom: 4px; }
.side__legal { display: flex; flex-wrap: wrap; gap: 4px 10px; margin-top: 10px; font-size: 11px; }
.side__legal a { color: var(--ink-3); }
.main { padding: 26px clamp(16px, 3vw, 36px) 48px; min-width: 0; max-width: 1240px; }
.head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.head h1 { font-size: 26px; letter-spacing: -.01em; }
.head p { margin-top: 4px; color: var(--ink-2); font-size: 14px; }
.head .crumb { display: block; font-size: 13px; color: var(--ink-2); margin-bottom: 6px; font-weight: 500; }
.topbar { display: none; }

.tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }
.tile { background: var(--sheet); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; color: var(--ink); display: block; }
a.tile:hover { text-decoration: none; border-color: #C4CDD5; }
.tile small { font-size: 12px; color: var(--ink-2); font-weight: 500; }
.tile strong { display: block; font-size: 30px; font-weight: 600; line-height: 1.15; margin-top: 4px; }
.tile--warn strong { color: var(--amber); }
.tile--bad strong { color: var(--red); }
.tile--zero strong { color: var(--ink-3); }
.tile.is-on { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }

.seats { display: flex; gap: 3px; flex-wrap: wrap; max-width: 90px; }
.seats i { width: 10px; height: 10px; border-radius: 3px; background: var(--teal); }
.seats i.off { background: #E1E6EA; }

.grid-2 { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.grid-2 + .grid-2, .grid-2 + .card, .card + .card, .card + .grid-2 { margin-top: 16px; }

.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { display: grid; grid-template-columns: 118px minmax(0, 1fr); gap: 12px; padding: 11px 0; border-top: 1px solid var(--line); font-size: 14px; }
.timeline li:first-child { border-top: 0; }
.timeline time { color: var(--ink-2); font-size: 12px; padding-top: 2px; }
.timeline strong { display: block; font-size: 14px; }
.timeline span { color: var(--ink-2); font-size: 13px; overflow-wrap: anywhere; }

.feed { list-style: none; margin: 0; padding: 0; }
.feed li { display: grid; grid-template-columns: 10px minmax(0, 1fr) auto; gap: 14px; padding: 14px 18px; border-top: 1px solid var(--line); align-items: start; }
.feed li:first-child { border-top: 0; }
.feed li .dot { margin-top: 7px; }
.feed li.is-read { opacity: .62; }
.feed h3 { font-size: 14px; }
.feed p { font-size: 13px; color: var(--ink-2); margin-top: 2px; overflow-wrap: anywhere; }
.feed .meta { font-size: 12px; color: var(--ink-3); margin-top: 6px; display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }

.features { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 8px; margin-top: 10px; }
.feature { display: flex; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; font-size: 13px; font-weight: 400; cursor: pointer; }
.feature:has(input:checked) { border-color: var(--teal); background: var(--teal-soft); }
.feature input { margin-top: 2px; accent-color: var(--teal); flex: none; }
.feature strong { display: block; font-size: 13px; }
.feature small { display: block; color: var(--ink-2); font-size: 12px; line-height: 1.4; }
.feature code { color: var(--ink-3); font-size: 11px; }
.fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
.fieldset legend { font-size: 13px; font-weight: 600; padding: 0; }

.device { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.device:first-child { border-top: 0; padding-top: 0; }
.device strong { display: block; font-size: 14px; }
.device small { display: block; font-size: 12px; color: var(--ink-2); }
.device code { color: var(--ink-3); }

.lanes { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); gap: 14px; margin-bottom: 16px; }
.lane h2 { font-size: 20px; }
.lane .version { font-size: 28px; font-weight: 600; margin: 8px 0 2px; }
.meter { height: 8px; border-radius: 8px; background: var(--line-2); overflow: hidden; margin: 14px 0 8px; }
.meter svg { display: block; width: 100%; height: 8px; }
.hash { color: var(--ink-3); }

/* ---------- Pantallas de acceso ---------- */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 32px 16px; background: var(--paper); }
.auth__card { width: min(420px, 100%); background: var(--sheet); border: 1px solid var(--line); border-radius: 20px; padding: 30px 28px; box-shadow: 0 24px 60px rgba(22, 32, 43, .08); }
.auth__card .logo { padding: 0 0 22px; }
.auth__card h1 { font-size: 24px; letter-spacing: -.01em; }
.auth__card > p { color: var(--ink-2); margin: 6px 0 20px; font-size: 14px; }
.auth__card form { display: grid; gap: 14px; }
.auth__foot { margin-top: 18px; font-size: 12px; color: var(--ink-3); text-align: center; line-height: 1.6; }
.auth__foot a { color: var(--ink-2); }

/* ---------- Portal del cliente ---------- */
.portal { min-height: 100vh; }
.p-bar { position: sticky; top: 0; z-index: 5; background: rgba(243, 245, 247, .92); backdrop-filter: blur(8px); border-bottom: 1px solid transparent; }
.p-bar__in { max-width: 1120px; margin: 0 auto; padding: 12px 16px; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.p-bar b { display: block; font-size: 15px; line-height: 1.25; }
.p-bar small { display: block; color: var(--ink-2); font-size: 12px; }
.p-bar form { margin: 0; }
.p-main { max-width: 1120px; margin: 0 auto; padding: 4px 16px 32px; }
.p-products { margin: 4px 0 14px; overflow-x: auto; flex-wrap: nowrap; padding-bottom: 2px; }
.p-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }

/* Firma: el pulso del local */
.pulse { background: var(--night); color: #fff; border-radius: 20px; padding: 18px 18px 16px; }
.pulse__state { display: flex; align-items: center; gap: 9px; font-size: 13px; color: var(--night-text); }
.pulse__state .dot { width: 9px; height: 9px; background: #46C98A; box-shadow: 0 0 0 4px rgba(70, 201, 138, .2); }
.pulse__label { font-size: 12px; letter-spacing: .07em; text-transform: uppercase; color: var(--night-dim); margin-top: 16px; font-weight: 500; }
.pulse__amount { font-size: clamp(38px, 11vw, 52px); font-weight: 600; line-height: 1.05; margin: 2px 0 6px; }
.pulse__amount sup { font-size: .42em; vertical-align: top; margin-right: 4px; color: var(--night-dim); position: relative; top: .35em; }
.pulse__compare { display: flex; gap: 6px 16px; font-size: 13px; color: var(--night-text); flex-wrap: wrap; }
.up { color: #6BE0A6; }
.down { color: #FF9B8F; }
.pulse__trio { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; background: var(--night-line); border-radius: 12px; overflow: hidden; margin-top: 16px; }
.pulse__trio div { background: var(--night-2); padding: 10px 12px; min-width: 0; }
.pulse__trio small { display: block; font-size: 11px; color: var(--night-dim); }
.pulse__trio strong { display: block; font-size: 18px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pulse--stale { background: #3A2A12; }
.pulse--stale .pulse__state { color: #F1CF95; }
.pulse--stale .pulse__state .dot { background: #F2A73B; box-shadow: 0 0 0 4px rgba(242, 167, 59, .25); }
.pulse--stale .pulse__label, .pulse--stale .pulse__amount sup { color: #D8B57A; }
.pulse--stale .pulse__trio { background: #54401F; }
.pulse--stale .pulse__trio div { background: #45331A; }
.pulse--stale .pulse__trio small { color: #D8B57A; }
.pulse--idle { background: var(--sheet); color: var(--ink); border: 1px solid var(--line); }
.pulse--idle .pulse__state { color: var(--ink-2); }
.pulse--idle .pulse__state .dot { background: var(--ink-3); box-shadow: none; }
.pulse--idle h2 { font-size: 20px; margin-top: 12px; }
.pulse--idle p { color: var(--ink-2); font-size: 14px; margin-top: 6px; }

.restock { display: flex; gap: 14px; align-items: center; background: var(--amber-soft); border: 1px solid var(--amber-line); border-radius: var(--radius); padding: 12px 16px; color: var(--ink); }
.restock:hover { text-decoration: none; border-color: var(--amber); }
.restock strong.n { font-size: 30px; font-weight: 600; color: var(--amber); min-width: 42px; text-align: center; }
.restock p { font-size: 13px; line-height: 1.4; }
.restock p b { font-size: 14px; }
.restock span { margin-left: auto; font-size: 13px; font-weight: 600; white-space: nowrap; }
.restock--ok { background: var(--green-soft); border-color: #BFE0CE; }
.restock--ok strong.n { color: var(--green); }

.chart svg { display: block; width: 100%; height: 110px; margin-top: 6px; }
.chart .bar { fill: #C9D3DB; }
.chart .bar--today { fill: var(--teal); }
.chart .bar--weekend { fill: #DCE2E7; }
.chart__axis { display: flex; justify-content: space-between; font-size: 11px; color: var(--ink-2); margin-top: 4px; }
.chart details { margin-top: 12px; font-size: 13px; }
.chart summary { cursor: pointer; color: var(--teal); font-weight: 600; }
.chart .table { margin-top: 8px; font-size: 13px; }
.chart .table td, .chart .table th { padding: 7px 4px; }

.box { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 11px 0; border-top: 1px solid var(--line); }
.box:first-of-type { border-top: 0; padding-top: 0; }
.box strong { display: block; font-size: 14px; }
.box small { display: block; font-size: 12px; color: var(--ink-2); }
.box__right { text-align: right; }
.box__right .n { display: block; font-size: 17px; font-weight: 600; }

.stock-search { display: flex; gap: 8px; margin: 12px 0 4px; }
.stock-search .input { min-height: 40px; background: var(--paper); font-size: 14px; }
.item { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 12px; padding: 10px 0; border-top: 1px solid var(--line); font-size: 14px; }
.item:first-child { border-top: 0; }
.item b { display: block; font-weight: 600; overflow-wrap: anywhere; }
.item small { color: var(--ink-2); font-size: 12px; }
.item .qty { text-align: right; white-space: nowrap; }
.item .qty strong { font-size: 16px; }
.item svg { grid-column: 1 / -1; display: block; width: 100%; height: 4px; margin-top: 4px; }
.level-bg { fill: var(--line-2); }
.level--ok { fill: var(--green); }
.level--low { fill: #D9912A; }
.level--out { fill: var(--red); }
.p-pager { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding-top: 12px; border-top: 1px solid var(--line); margin-top: 4px; font-size: 13px; color: var(--ink-2); }
.p-foot { max-width: 1120px; margin: 0 auto; padding: 8px 16px 28px; font-size: 12px; color: var(--ink-2); line-height: 1.6; }
.p-foot nav { display: flex; gap: 6px 14px; flex-wrap: wrap; margin-top: 6px; }
.p-foot a { color: var(--ink-2); text-decoration: underline; }
.notice { border-radius: var(--radius); padding: 12px 16px; font-size: 14px; background: var(--sheet); border: 1px solid var(--line); }
.notice--warning { background: var(--amber-soft); border-color: var(--amber-line); }
.notice--danger { background: var(--red-soft); border-color: #EAC1BC; }
.notice--info { background: var(--teal-soft); border-color: #BEDDE0; }

@media (min-width: 900px) {
    .p-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; }
    .p-grid .span { grid-column: 1 / -1; }
    .pulse { padding: 24px 26px 22px; }
    .p-stock { grid-column: 2; grid-row: 1 / span 4; }
}

/* ---------- Descargas y páginas legales ---------- */
.page { max-width: 880px; margin: 0 auto; padding: 24px 16px 56px; }
.page__bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 36px; flex-wrap: wrap; }
.downloads { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); gap: 14px; margin: 20px 0 28px; }
.download h2 { font-size: 22px; }
.download .notes { white-space: pre-line; overflow-wrap: anywhere; font-size: 14px; color: var(--ink-2); margin: 10px 0 16px; }
.download details { margin-top: 14px; font-size: 12px; color: var(--ink-2); }
.download summary { cursor: pointer; }
.download code { display: block; overflow-wrap: anywhere; margin-top: 4px; }
.legal { background: var(--sheet); border: 1px solid var(--line); border-radius: 18px; padding: clamp(20px, 4vw, 40px); }
.legal h1 { font-size: 28px; letter-spacing: -.01em; }
.legal .updated { color: var(--ink-2); font-size: 13px; margin: 6px 0 24px; }
.legal h2 { font-size: 18px; margin: 28px 0 8px; }
.legal p, .legal li { font-size: 15px; line-height: 1.65; color: #2A3642; }
.legal p + p { margin-top: 10px; }
.legal ul { padding-left: 20px; margin: 8px 0; }
.legal table { width: 100%; border-collapse: collapse; font-size: 14px; margin: 10px 0; }
.legal th, .legal td { text-align: left; border-bottom: 1px solid var(--line); padding: 8px 6px; vertical-align: top; }
.legal-nav { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 16px; }

/* ---------- Adaptación a pantallas chicas ---------- */
@media (max-width: 980px) {
    .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .grid-2 { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 820px) {
    .admin { grid-template-columns: minmax(0, 1fr); }
    .side { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px 12px; border-right: 0; border-bottom: 1px solid var(--line); }
    .side .logo { padding: 0 8px 0 0; }
    .side .logo small { display: none; }
    .side nav { flex-direction: row; overflow-x: auto; flex: 1 1 100%; order: 3; }
    .side nav a { padding: 7px 10px; white-space: nowrap; gap: 6px; }
    .side nav a.is-on { box-shadow: inset 0 -2px 0 var(--teal); }
    .side__foot { margin: 0 0 0 auto; padding: 0; border: 0; display: flex; align-items: center; gap: 10px; }
    .side__foot span { display: none; }
    .side__legal { display: none; }
    .main { padding-top: 18px; }
    .head h1 { font-size: 22px; }
    .form { grid-template-columns: minmax(0, 1fr); }
    .table--cards thead { display: none; }
    .table--cards tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
    .table--cards td { padding: 0; border: 0; }
    .table--cards td.hide-sm { display: none; }
    .timeline li { grid-template-columns: minmax(0, 1fr); gap: 2px; }
    .copy { flex-wrap: wrap; }
    .copy .field { flex-basis: 100%; }
}
.grow { flex: 1; min-width: 0; }
.row.row--bare { padding: 0; border: 0; }
.card .copy { margin-top: 14px; }
.notice + .p-grid, .p-products + .notice { margin-top: 12px; }
.flush-hint { padding: 10px 18px 16px; margin: 0; border-top: 1px solid var(--line); }
.row > .actions { flex-wrap: nowrap; }
.auth__legal { font-size: 12px; color: var(--ink-3); text-align: center; margin: 16px 0 0; }
.auth__legal a { color: var(--ink-2); }
.auth { grid-template-rows: 1fr auto; align-content: center; }
.check a { font-weight: 600; }
/* Portal: pestañas Hoy / Historial */
.p-nav { display: flex; flex-direction: column; gap: 10px; margin: 2px 0 14px; }
.p-tabs { display: inline-flex; align-self: flex-start; background: var(--line-2); border-radius: 12px; padding: 3px; gap: 2px; }
.p-tab { padding: 7px 16px; border-radius: 9px; font-size: 14px; font-weight: 600; color: var(--ink-2); }
.p-tab:hover { text-decoration: none; color: var(--ink); }
.p-tab.is-on { background: var(--sheet); color: var(--ink); box-shadow: 0 1px 2px rgba(22, 32, 43, .12); }
.p-nav .p-products { margin: 0; }
.range-form { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-bottom: 14px; }
.range-totals { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; margin-bottom: 10px; }
.range-totals div { background: var(--sheet); padding: 10px 12px; min-width: 0; }
.range-totals small { display: block; font-size: 11px; color: var(--ink-2); }
.range-totals strong { display: block; font-size: 17px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card details { margin: 8px 0; font-size: 14px; }
.card summary { cursor: pointer; color: var(--teal); font-weight: 600; margin-bottom: 6px; }
.card .table td small { display: inline; margin-left: 4px; }
@media (max-width: 820px) { .range-form { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.table .num { white-space: nowrap; }
.pulse__trio strong { font-size: clamp(15px, 4.4vw, 18px); }
.range-totals { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.range-totals div:first-child { grid-column: 1 / -1; }
.range-totals div:first-child strong { font-size: 22px; }
/* Portal esquema 2: cobros, movimientos y ranking */
.pay { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 12px; padding: 10px 0; border-top: 1px solid var(--line); font-size: 14px; }
.card__head + .pay { border-top: 0; padding-top: 0; }
.pay b { display: block; font-weight: 600; }
.pay small { color: var(--ink-2); font-size: 12px; }
.pay__amount { font-weight: 600; font-size: 16px; white-space: nowrap; }
.pay svg { grid-column: 1 / -1; display: block; width: 100%; height: 4px; margin-top: 4px; }
.move { display: grid; grid-template-columns: 46px minmax(0, 1fr) auto; gap: 10px; align-items: baseline; padding: 10px 0; border-top: 1px solid var(--line); font-size: 14px; }
.card__head + .move { border-top: 0; padding-top: 0; }
.move time { color: var(--ink-2); font-size: 13px; }
.move b { display: block; font-weight: 600; }
.move small { color: var(--ink-2); font-size: 12px; overflow-wrap: anywhere; }
.move__amount { color: var(--red); font-weight: 600; white-space: nowrap; }
.rank { list-style: none; margin: 4px 0 8px; padding: 0; counter-reset: rank; }
.rank li { display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; gap: 8px; align-items: baseline; padding: 8px 0; border-top: 1px solid var(--line); font-size: 14px; counter-increment: rank; }
.rank li::before { content: counter(rank); color: var(--ink-3); font-weight: 600; font-size: 13px; }
.rank li:first-child { border-top: 0; }
.rank b { display: block; font-weight: 600; overflow-wrap: anywhere; }
.rank small { color: var(--ink-2); font-size: 12px; }
.rank .n { text-align: right; white-space: nowrap; }
.rank .n small { display: block; }
/* Alta en un solo paso */
.signup { max-width: 720px; }
.signup__new[hidden] { display: none; }
.signup__new { padding: 14px; border: 1px dashed var(--line); border-radius: 12px; background: var(--paper); }
.choices { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 8px; }
.choice { position: relative; flex: 1 1 160px; }
.choice input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.choice span { display: block; padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; font-weight: 600; text-align: center; background: var(--sheet); }
.choice input:checked + span { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.choice input:focus-visible + span { outline: 2px solid var(--teal); outline-offset: 2px; }
.advanced summary { cursor: pointer; font-size: 13px; font-weight: 600; color: var(--ink-2); }
.advanced .form { margin-top: 12px; }
.created { max-width: 720px; text-align: center; padding: 26px; }
.created__label { font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-2); font-weight: 600; }
.created__key code { display: block; font-size: clamp(15px, 2.6vw, 22px); font-weight: 600; letter-spacing: .02em; color: var(--ink); background: var(--paper); border: 1px solid var(--line); border-radius: 12px; padding: 14px; margin: 10px 0 16px; overflow-wrap: anywhere; user-select: all; }
.created .actions { justify-content: center; }
.created__warn { margin: 16px 0 0; text-align: left; }
.created__saved { justify-content: center; margin-top: 14px; font-weight: 600; }
.created__message { margin-top: 14px; text-align: left; }
.created__message summary { cursor: pointer; font-size: 14px; color: var(--ink-2); }
.created__message textarea { width: 100%; margin-top: 8px; font: inherit; font-size: 14px; }
.copy-buffer { position: fixed; top: 0; left: 0; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.steps { margin: 0 0 14px; padding-left: 20px; line-height: 1.8; }
.side .side__legal { flex-direction: row; flex-wrap: wrap; gap: 4px 10px; }
.side .side__legal a { padding: 0; font-size: 11px; font-weight: 400; color: var(--ink-3); display: inline; }
.side .side__legal a:hover { background: none; text-decoration: underline; }
