/* JoyaPOS v1.0 — hecho por FreddyDeveloper
   Zafiro de noche, nácar y oro. Titulares en Playfair Display, cifras en Frank Ruhl Libre; interfaz en Assistant. */

@font-face { font-family: "Playfair Display"; src: url("../fonts/playfair-display-latin-wght-normal.woff2") format("woff2"); font-weight: 400 900; font-style: normal; font-display: swap; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2212, U+2215; }
@font-face { font-family: "Playfair Display"; src: url("../fonts/playfair-display-latin-ext-wght-normal.woff2") format("woff2"); font-weight: 400 900; font-style: normal; font-display: swap; unicode-range: U+0100-02BA, U+1E00-1E9F, U+20A0-20AB; }
@font-face { font-family: "Playfair Display"; src: url("../fonts/playfair-display-latin-wght-italic.woff2") format("woff2"); font-weight: 400 900; font-style: italic; font-display: swap; unicode-range: U+0000-00FF, U+2000-206F; }
@font-face { font-family: "Frank Ruhl Libre"; src: url("../fonts/frank-ruhl-libre-hebrew-wght-normal.woff2") format("woff2"); font-weight: 300 900; font-display: swap; unicode-range: U+0590-05FF, U+200C-2010, U+20AA, U+FB1D-FB4F; }
@font-face { font-family: "Frank Ruhl Num"; src: url("../fonts/frank-ruhl-libre-latin-wght-normal.woff2") format("woff2"); font-weight: 300 900; font-display: swap; unicode-range: U+0020-007E, U+00A0-00FF, U+2000-206F; }
@font-face { font-family: "Assistant"; src: url("../fonts/assistant-latin-wght-normal.woff2") format("woff2"); font-weight: 200 800; font-display: swap; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215; }
@font-face { font-family: "Assistant"; src: url("../fonts/assistant-latin-ext-wght-normal.woff2") format("woff2"); font-weight: 200 800; font-display: swap; unicode-range: U+0100-02BA, U+1E00-1E9F, U+20A0-20AB; }
@font-face { font-family: "Assistant"; src: url("../fonts/assistant-hebrew-wght-normal.woff2") format("woff2"); font-weight: 200 800; font-display: swap; unicode-range: U+0590-05FF, U+200C-2010, U+20AA, U+FB1D-FB4F; }

:root {
  --f-display: "Playfair Display", "Frank Ruhl Libre", "Songti SC", "STSong", "Noto Serif CJK SC", "SimSun", Georgia, serif;
  --f-num: "Frank Ruhl Num", "Frank Ruhl Libre", "Songti SC", Georgia, serif;
  --f-text: "Assistant", "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", "Segoe UI", system-ui, sans-serif;

  --night: #0C1330;
  --night-2: #16205A;
  --night-ink: #E9ECF8;
  --night-mute: #9AA3C7;
  --gold: #C9A24B;
  --gold-hi: #EBD38C;
  --metal: linear-gradient(135deg, #8A6A1C 0%, #EBD38C 42%, #B88A2E 68%, #F3E2A8 100%);

  --bg: #F1F2F6;
  --surface: #FFFFFF;
  --surface-2: #F7F8FB;
  --line: #E1E4EE;
  --line-2: #C9CEDD;
  --ink: #131A30;
  --ink-2: #454D6B;
  --ink-3: #747C98;
  --accent: #1B2A75;
  --accent-ink: #FFFFFF;
  --gold-ink: #7E5E12;
  --gold-soft: #F6EED8;
  --ok: #0C7556; --ok-soft: #DDF3EA;
  --danger: #B0213D; --danger-soft: #FBE4E9;
  --warn: #9C5B00; --warn-soft: #FBECCD;
  --info: #2848BE; --info-soft: #E4EAFC;
  --shadow: 0 1px 0 rgba(12, 19, 48, .03), 0 12px 28px -18px rgba(12, 19, 48, .28);
  --shadow-pop: 0 24px 60px -20px rgba(12, 19, 48, .45);
  --r-s: 7px; --r-m: 12px; --r-l: 18px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #080C1D; --surface: #10162F; --surface-2: #151C3B; --line: #222A50; --line-2: #333D6C;
    --ink: #ECEEF8; --ink-2: #B3BAD6; --ink-3: #7E87AB; --accent: #D2AE5A; --accent-ink: #0C1330;
    --gold-ink: #E3C272; --gold-soft: #2A2412;
    --ok: #4FD0A4; --ok-soft: #0E2C25; --danger: #FF8298; --danger-soft: #3A1420;
    --warn: #F2BC5E; --warn-soft: #33260B; --info: #8FA8FF; --info-soft: #17204A;
    --shadow: 0 1px 0 rgba(0, 0, 0, .3), 0 14px 30px -18px rgba(0, 0, 0, .8);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #080C1D; --surface: #10162F; --surface-2: #151C3B; --line: #222A50; --line-2: #333D6C;
  --ink: #ECEEF8; --ink-2: #B3BAD6; --ink-3: #7E87AB; --accent: #D2AE5A; --accent-ink: #0C1330;
  --gold-ink: #E3C272; --gold-soft: #2A2412;
  --ok: #4FD0A4; --ok-soft: #0E2C25; --danger: #FF8298; --danger-soft: #3A1420;
  --warn: #F2BC5E; --warn-soft: #33260B; --info: #8FA8FF; --info-soft: #17204A;
  --shadow: 0 1px 0 rgba(0, 0, 0, .3), 0 14px 30px -18px rgba(0, 0, 0, .8);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 16px/1.5 var(--f-text); -webkit-font-smoothing: antialiased; }
h1, h2, h3, h4, p, figure { margin: 0; }
a { color: var(--accent); text-underline-offset: 3px; }
img, svg { max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; border-radius: 4px; }
[hidden] { display: none !important; }
.icon { flex: none; vertical-align: -3px; }
[dir="rtl"] .flip { transform: scaleX(-1); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Estructura ---------- */
.shell { display: grid; grid-template-columns: 268px minmax(0, 1fr); min-height: 100vh; }
.side {
  position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; color: var(--night-ink);
  background:
    url("../img/facets.svg") no-repeat calc(100% + 90px) calc(100% + 70px) / 330px,
    linear-gradient(175deg, #101A45 0%, var(--night) 46%, #070B1E 100%);
  border-inline-end: 1px solid rgba(201, 162, 75, .22);
}
[dir="rtl"] .side { background-position: -90px calc(100% + 70px), 0 0; }
.side-brand { display: flex; align-items: center; gap: 12px; padding: 18px 18px 12px; color: inherit; text-decoration: none; }
/* Marca: el logo y, a su lado, la versión en una etiqueta con la misma forma que las de quilates */
.brand { justify-content: space-between; gap: 12px; }
.brand-logo { display: block; height: auto; max-width: 100%; flex: 0 1 auto; min-width: 0; }
.brand-mark { display: inline-block; vertical-align: middle; }
.brand-ver { flex: none; font: 600 12px/1 var(--f-text); letter-spacing: .03em; color: var(--gold-hi); padding: 5px 9px; border: 1px solid rgba(235, 211, 140, .45); border-radius: 3px 10px 3px 10px; background: rgba(235, 211, 140, .07); white-space: nowrap; }
.side-biz { display: flex; align-items: center; gap: 11px; margin: 4px 14px 10px; padding: 10px; border: 1px solid rgba(255, 255, 255, .09); border-radius: var(--r-m); background: rgba(255, 255, 255, .04); min-width: 0; }
.side-biz span { min-width: 0; }
.side-biz b { display: block; font-size: 15px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-biz small { color: var(--night-mute); font-size: 13px; }
.avatar { flex: none; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--metal); color: var(--night); font: 700 16px/1 var(--f-display); overflow: hidden; }
.avatar img { width: 100%; height: 100%; object-fit: contain; background: #fff; }
.avatar-lg { width: 84px; height: 84px; font-size: 32px; }
.side-nav { flex: 1; overflow-y: auto; padding: 4px 10px 18px; scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, .18) transparent; }
.side-group { margin: 16px 12px 5px; font-size: 12.5px; font-weight: 600; color: var(--gold); letter-spacing: .02em; }
.side-link { display: flex; align-items: center; gap: 11px; padding: 8px 12px; border-radius: var(--r-s); color: #CBD1EA; text-decoration: none; font-size: 15.5px; border-inline-start: 2px solid transparent; }
.side-link:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.side-link.is-on { background: linear-gradient(90deg, rgba(201, 162, 75, .2), rgba(201, 162, 75, .04)); color: #fff; font-weight: 600; border-inline-start-color: var(--gold); }
[dir="rtl"] .side-link.is-on { background: linear-gradient(270deg, rgba(201, 162, 75, .2), rgba(201, 162, 75, .04)); }
.side-link .icon { color: var(--gold-hi); opacity: .85; }
.side-link .count { margin-inline-start: auto; background: var(--danger); color: #fff; border-radius: 99px; font-size: 12px; font-weight: 700; min-width: 21px; height: 21px; display: grid; place-items: center; padding: 0 6px; }
:root[data-theme="dark"] .side-link .count { background: #D8425F; }
.side-foot { padding: 12px 22px 16px; font-size: 12.5px; color: var(--night-mute); border-top: 1px solid rgba(255, 255, 255, .08); }
.side-foot a { color: var(--gold-hi); text-decoration: none; }
.side-foot a:hover { text-decoration: underline; }

.main { min-width: 0; display: flex; flex-direction: column; }
.top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 10px 14px; flex-wrap: wrap; min-height: 60px; padding: 10px 28px; background: color-mix(in srgb, var(--surface) 90%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.top .top-menu { display: none; }
.ticker { display: flex; align-items: center; gap: 6px 12px; flex-wrap: wrap; min-width: 0; }
.ticker-title { font-weight: 600; font-size: 15px; }
.hall { display: inline-flex; align-items: baseline; gap: 7px; white-space: nowrap; }
.hall i { font-style: normal; font-size: 12px; font-weight: 700; color: #3B2C05; background: var(--metal); padding: 1px 8px; border-radius: 3px 9px 3px 9px; }
.hall b { font: 600 17px/1.2 var(--f-display); font-variant-numeric: lining-nums; }
.ticker-src { font-size: 13px; color: var(--ink-3); }
.top-tools { display: flex; align-items: center; gap: 8px; margin-inline-start: auto; }
.top-tools form { display: flex; }
.top-tools select { width: auto; max-width: 150px; min-height: 36px; padding: 5px 10px; font-size: 14.5px; }
.top-user span { max-width: 14ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.top-user { display: flex; align-items: center; gap: 8px; text-decoration: none; color: var(--ink-2); font-size: 14.5px; padding: 5px 8px; border-radius: var(--r-s); }
.top-user:hover { background: var(--surface-2); }
.icon-btn { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: var(--r-s); border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); cursor: pointer; }
.icon-btn:hover { border-color: var(--line-2); color: var(--ink); }
.content { padding: 26px 28px 40px; flex: 1; max-width: 1480px; width: 100%; }
.foot { padding: 14px 28px 22px; font-size: 13px; color: var(--ink-3); display: flex; gap: 6px 18px; flex-wrap: wrap; border-top: 1px solid var(--line); }
.foot a { color: var(--ink-2); }

/* ---------- Encabezado de página ---------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.page-head h1 { font: 500 34px/1.1 var(--f-display); letter-spacing: -.005em; }
.page-head p { color: var(--ink-2); margin-top: 6px; max-width: 70ch; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.crumb { font-size: 14px; color: var(--ink-3); margin-bottom: 6px; display: block; text-decoration: none; }
.crumb:hover { color: var(--ink); }

/* ---------- Paneles ---------- */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-m); box-shadow: var(--shadow); }
.panel + .panel, .stack > * + * { margin-top: 18px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 15px 20px; border-bottom: 1px solid var(--line); }
.panel-head h2 { font-size: 17.5px; font-weight: 700; }
.panel-head p { font-size: 14px; color: var(--ink-3); }
.panel-body { padding: 20px; }
.panel-body.tight { padding: 0; }
.panel-gold { border-top: 2px solid var(--gold); }
.grid { display: grid; gap: 18px; }
.grid > .panel + .panel { margin-top: 0; }
.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.split { grid-template-columns: minmax(0, 1.65fr) minmax(300px, 1fr); align-items: start; }
.split > * { min-width: 0; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.between { justify-content: space-between; }
.mt { margin-top: 18px; } .mt-s { margin-top: 10px; } .mb { margin-bottom: 18px; }
.muted { color: var(--ink-3); } .small { font-size: 14px; } .strong { font-weight: 700; }
.end { text-align: end; } .center { text-align: center; } .nowrap { white-space: nowrap; }

.stat { padding: 18px 20px; }
.stat span { display: block; font-size: 14.5px; color: var(--ink-2); }
.stat b { display: block; font: 500 30px/1.15 var(--f-display); margin-top: 6px; font-variant-numeric: lining-nums; }
.stat small { display: block; font-size: 13.5px; color: var(--ink-3); margin-top: 4px; }

.kv { display: grid; grid-template-columns: minmax(120px, max-content) 1fr; gap: 8px 18px; }
.kv dt { color: var(--ink-3); font-size: 14.5px; }
.kv dd { margin: 0; font-weight: 600; min-width: 0; overflow-wrap: anywhere; }

/* ---------- Tablas ---------- */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 15px; }
.table th { text-align: start; font-size: 13.5px; font-weight: 600; color: var(--ink-3); padding: 10px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; background: var(--surface-2); }
.table td { padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: var(--surface-2); }
.table .num { text-align: end; font-variant-numeric: tabular-nums lining-nums; white-space: nowrap; direction: ltr; }
[dir="rtl"] .table .num { text-align: start; }
.table a.rowlink { font-weight: 600; text-decoration: none; }
.table a.rowlink:hover { text-decoration: underline; }
.table tfoot td { font-weight: 700; background: var(--surface-2); border-top: 1px solid var(--line-2); }
.thumb { width: 42px; height: 42px; border-radius: var(--r-s); object-fit: cover; border: 1px solid var(--line); background: var(--surface-2); display: grid; place-items: center; color: var(--ink-3); }

/* ---------- Formularios ---------- */
.field { display: block; min-width: 0; }
.field-label { display: block; font-size: 14.5px; font-weight: 600; margin-bottom: 5px; color: var(--ink-2); }
.field-hint { display: block; font-size: 13.5px; color: var(--ink-3); margin-top: 4px; }
input[type="text"], input[type="search"], input[type="email"], input[type="password"], input[type="number"], input[type="date"], input[type="tel"], input[type="url"], input[type="file"], input[type="datetime-local"], select, textarea {
  width: 100%; padding: 9px 12px; background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--r-s); min-height: 41px;
}
textarea { resize: vertical; min-height: 84px; line-height: 1.45; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px color-mix(in srgb, var(--gold) 28%, transparent); }
input[readonly] { background: var(--surface-2); color: var(--ink-2); }
input[type="number"] { font-variant-numeric: tabular-nums; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 14px 16px; }
.form-grid .wide { grid-column: 1 / -1; }
.check { display: flex; gap: 9px; align-items: flex-start; font-size: 15px; cursor: pointer; }
.check input { width: 18px; height: 18px; margin-top: 3px; accent-color: var(--accent); flex: none; }
.form-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 9px 16px; min-height: 41px; border-radius: var(--r-s); border: 1px solid var(--line-2); background: var(--surface); color: var(--ink); font-weight: 600; font-size: 15px; text-decoration: none; cursor: pointer; }
.btn:hover { border-color: var(--ink-3); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { filter: brightness(1.12); border-color: var(--accent); }
.btn-gold { background: var(--metal); border-color: #A9812A; color: #241A02; }
.btn-gold:hover { filter: brightness(1.05); border-color: #8A6A1C; }
.btn-danger { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 45%, var(--line)); }
.btn-danger:hover { background: var(--danger-soft); border-color: var(--danger); }
.btn-sm { padding: 5px 11px; min-height: 32px; font-size: 14px; }
/* Un botón nunca es más ancho que su columna: si el texto no cabe, se parte en dos líneas en lugar de salirse.
   Solo ocurre cuando falta espacio; en las tablas (que se desplazan dentro de su marco) y en las barras se mantiene en una línea. */
.btn { max-width: 100%; white-space: normal; text-align: center; line-height: 1.25; }
.table .btn, .top .btn, .site-nav .btn, .seg a { white-space: nowrap; }
.btn-lg { padding: 13px 24px; font-size: 17px; min-height: 52px; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.linkish { background: none; border: 0; padding: 0; color: var(--accent); text-decoration: underline; cursor: pointer; font-weight: 600; }

.badge { display: inline-flex; align-items: center; padding: 2px 10px; border-radius: 99px; font-size: 13px; font-weight: 600; white-space: normal; max-width: 100%; overflow-wrap: break-word; background: var(--surface-2); color: var(--ink-2); border: 1px solid var(--line); }
/* Una etiqueta larga parte el texto antes que salirse de su columna; en las tablas se mantiene en una línea */
.table .badge, .top .badge { white-space: nowrap; }
.badge-ok { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.badge-warn { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.badge-danger { background: var(--danger-soft); color: var(--danger); border-color: transparent; }
.badge-info { background: var(--info-soft); color: var(--info); border-color: transparent; }
.badge-gold { background: var(--gold-soft); color: var(--gold-ink); border-color: transparent; }

.alert { display: flex; gap: 12px; align-items: flex-start; padding: 13px 16px; border-radius: var(--r-m); border: 1px solid var(--line); background: var(--surface); margin-bottom: 16px; }
.alert .icon { margin-top: 3px; }
.alert b { display: block; }
.alert-ok { background: var(--ok-soft); border-color: transparent; color: var(--ok); }
.alert-warn { background: var(--warn-soft); border-color: transparent; color: var(--warn); }
.alert-danger { background: var(--danger-soft); border-color: transparent; color: var(--danger); }
.alert-info { background: var(--info-soft); border-color: transparent; color: var(--info); }
.alert p, .alert span { color: var(--ink); }
.alert .btn { margin-inline-start: auto; flex: none; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 20px; overflow-x: auto; }
.tab { padding: 10px 16px; text-decoration: none; color: var(--ink-2); font-weight: 600; border-bottom: 2px solid transparent; white-space: nowrap; margin-bottom: -1px; }
.tab:hover { color: var(--ink); }
.tab.is-on { color: var(--ink); border-bottom-color: var(--gold); }
.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; padding: 14px 20px; border-bottom: 1px solid var(--line); }
.filters .field { flex: 1 1 160px; max-width: 280px; }
.filters .field-label { font-size: 13.5px; }

.empty { text-align: center; padding: 44px 20px; color: var(--ink-2); }
.empty .icon { color: var(--gold); margin-bottom: 8px; }
.empty b { display: block; font: 500 22px/1.2 var(--f-display); color: var(--ink); margin-bottom: 6px; }
.empty p { max-width: 48ch; margin: 0 auto 14px; }

.pager { display: flex; align-items: center; justify-content: center; gap: 14px; padding: 14px; border-top: 1px solid var(--line); font-size: 14.5px; }
.pager-btn { padding: 5px 12px; border: 1px solid var(--line-2); border-radius: var(--r-s); text-decoration: none; color: var(--ink); }
.pager-btn.is-off { opacity: .4; }
.pager-pos { color: var(--ink-3); }

dialog.modal { border: 1px solid var(--line); border-radius: var(--r-l); padding: 0; width: min(560px, calc(100vw - 32px)); background: var(--surface); color: var(--ink); box-shadow: var(--shadow-pop); }
dialog.modal.wide { width: min(820px, calc(100vw - 32px)); }
dialog.modal::backdrop { background: rgba(8, 12, 29, .6); backdrop-filter: blur(3px); }
.modal-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.modal-head h2 { font: 500 23px/1.2 var(--f-display); }
.modal-body { padding: 20px; }

.picker { position: relative; }
.picker-list { position: absolute; z-index: 30; inset-inline: 0; top: calc(100% + 4px); background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--r-s); box-shadow: var(--shadow-pop); max-height: 280px; overflow-y: auto; }
.picker-opt { display: block; width: 100%; text-align: start; padding: 9px 12px; background: none; border: 0; border-bottom: 1px solid var(--line); cursor: pointer; }
.picker-opt:last-child { border-bottom: 0; }
.picker-opt:hover, .picker-opt:focus { background: var(--surface-2); }
.picker-opt small { display: block; color: var(--ink-3); font-size: 13.5px; }
.picker-note { margin-top: 6px; font-size: 14px; padding: 7px 10px; border-radius: var(--r-s); background: var(--danger-soft); color: var(--danger); font-weight: 600; }

.chart { width: 100%; height: auto; display: block; }
.chart text { font: 12px var(--f-text); fill: var(--ink-3); }
.chart .bar { fill: var(--accent); }
.chart .bar-gold { fill: var(--gold); }
.chart .grid-line { stroke: var(--line); }
.chart .line { fill: none; stroke: var(--gold); stroke-width: 2.2; }
.chart .area { fill: color-mix(in srgb, var(--gold) 16%, transparent); }

.steps { counter-reset: step; list-style: none; padding: 0; margin: 0; }
.steps li { counter-increment: step; position: relative; padding-inline-start: 46px; padding-bottom: 16px; }
.steps li::before { content: counter(step); position: absolute; inset-inline-start: 0; top: 0; width: 31px; height: 31px; border-radius: 50%; display: grid; place-items: center; font: 600 16px/1 var(--f-display); background: var(--gold-soft); color: var(--gold-ink); }
.steps li b { display: block; }
.steps li span { color: var(--ink-2); }

.paybox { border: 1px solid var(--line); border-radius: var(--r-m); padding: 14px 16px; background: var(--surface-2); display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.paybox span { display: block; font-size: 14px; color: var(--ink-2); }
.paybox b { font: 700 21px/1.25 var(--f-text); letter-spacing: .03em; font-variant-numeric: tabular-nums; direction: ltr; display: inline-block; }

/* ---------- Vender ---------- */
.pos { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(330px, 1fr); gap: 18px; align-items: start; }
.pos-results { border-top: 1px solid var(--line); margin-top: 14px; }
.pos-result { display: flex; width: 100%; gap: 12px; align-items: center; justify-content: space-between; padding: 10px 4px; background: none; border: 0; border-bottom: 1px solid var(--line); text-align: start; cursor: pointer; }
.pos-result:hover, .pos-result:focus { background: var(--surface-2); }
.pos-result small { display: block; color: var(--ink-3); }
.pos-result b.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.qty { width: 66px !important; text-align: center; }
.totals { display: grid; grid-template-columns: 1fr auto; gap: 8px 16px; font-size: 16px; }
.totals dd { margin: 0; text-align: end; font-variant-numeric: tabular-nums; }
.totals .grand { font: 500 34px/1.1 var(--f-display); padding-top: 12px; border-top: 2px solid var(--ink); margin-top: 6px; }
.totals dt.grand { font: 700 19px/1.9 var(--f-text); }
.payline { display: grid; grid-template-columns: minmax(104px, .8fr) minmax(90px, .7fr) minmax(0, 1fr) auto; gap: 8px; align-items: center; margin-bottom: 8px; }
.payline .check { grid-column: 1 / -1; font-size: 14.5px; color: var(--ink-2); }
.pay-state { font-weight: 600; margin: 10px 0; }
.pay-state.is-ok { color: var(--ok); } .pay-state.is-bad { color: var(--danger); }

/* ---------- Documentos imprimibles ---------- */
.doc-bar { display: flex; gap: 10px; justify-content: center; padding: 16px; flex-wrap: wrap; }
.doc { background: #fff; color: #111; margin: 0 auto 30px; padding: 30px 34px; width: min(100% - 24px, 760px); border: 1px solid #ddd; box-shadow: var(--shadow); font-size: 15px; }
.doc.slim { width: min(100% - 24px, 380px); padding: 20px 18px; font-size: 14px; }
.card-ack { margin-top: 16px; padding-top: 12px; border-top: 1px dashed #999; font-size: 13px; break-inside: avoid; }
.card-ack .ack-sign { display: grid; grid-template-columns: 1.4fr 1fr; gap: 26px; margin-top: 44px; }
.card-ack .ack-sign span { border-top: 1px solid #111; padding-top: 5px; text-align: center; font-size: 12px; }
.doc.slim .card-ack .ack-sign { grid-template-columns: 1fr; gap: 40px; }
.doc h1 { font: 600 24px/1.2 var(--f-display); }
.doc h2 { font-size: 16px; margin: 18px 0 6px; }
.doc-head { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; border-bottom: 1px solid #111; padding-bottom: 12px; margin-bottom: 14px; }
.doc.slim .doc-head { flex-direction: column; align-items: center; text-align: center; }
.doc-head img { max-height: 64px; max-width: 150px; }
.doc table { width: 100%; border-collapse: collapse; }
.doc th { text-align: start; border-bottom: 1px solid #999; padding: 5px 4px; font-size: 13px; }
.doc td { padding: 5px 4px; border-bottom: 1px dotted #bbb; vertical-align: top; }
.doc .num { text-align: end; white-space: nowrap; direction: ltr; }
.doc .tot td { border: 0; padding: 2px 4px; }
.doc .tot .big td { font-size: 19px; font-weight: 700; border-top: 1px solid #111; padding-top: 6px; }
.doc .fine { font-size: 12.5px; color: #444; margin-top: 12px; line-height: 1.45; }
.doc .sign { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; margin-top: 56px; }
.doc .sign div { border-top: 1px solid #111; padding-top: 5px; font-size: 13px; text-align: center; }
.doc .muted { color: #555; }
.labels { display: grid; grid-template-columns: repeat(auto-fill, 62mm); gap: 4mm; justify-content: center; padding: 6mm; }
.label { width: 62mm; height: 29mm; background: #fff; color: #000; border: 1px dashed #bbb; padding: 2mm 3mm; display: flex; flex-direction: column; justify-content: space-between; font-size: 10px; overflow: hidden; }
.label b { font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.label .barcode { height: 9mm; width: 100%; }
.label .row { justify-content: space-between; flex-wrap: nowrap; gap: 4px; }
.poster { background: #fff; color: #111; width: min(100% - 24px, 560px); margin: 0 auto 30px; padding: 46px 40px; text-align: center; border: 1px solid #ddd; }
.poster h1 { font: 500 44px/1.05 var(--f-display); margin: 18px 0 10px; }
.poster .qr { width: 250px; height: 250px; margin: 24px auto; }
.qr svg, .qr img { width: 100%; height: 100%; display: block; }

/* ---------- Acceso ---------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); }
.auth-art { color: var(--night-ink); padding: 44px 52px; display: flex; flex-direction: column; justify-content: space-between; background: url("../img/facets.svg") no-repeat 115% 108% / 560px, linear-gradient(160deg, #142060 0%, var(--night) 55%, #060918 100%); }
.auth-art h1 { font: 500 clamp(34px, 4vw, 56px)/1.04 var(--f-display); max-width: 14ch; margin-top: 12vh; }
.auth-art p { color: #BAC2E2; max-width: 44ch; margin-top: 16px; font-size: 18px; }
.auth-art .side-brand { padding: 0; justify-content: flex-start; gap: 18px; }
.auth-art footer { font-size: 13.5px; color: var(--night-mute); }
.auth-art footer a { color: var(--gold-hi); }
.auth-form { display: grid; place-items: center; padding: 40px 24px; }
.auth-card { width: min(100%, 470px); }
.auth-card.wide { width: min(100%, 640px); }
.auth-card h2 { font: 500 34px/1.1 var(--f-display); margin-bottom: 6px; }
.auth-card > p { color: var(--ink-2); margin-bottom: 22px; }
.auth-card .stack > * + * { margin-top: 14px; }
.auth-alt { margin-top: 20px; font-size: 15px; color: var(--ink-2); }
.auth-tools { display: flex; justify-content: flex-end; gap: 8px; margin-bottom: 30px; }
.auth-tools select { width: auto; }

/* ---------- Sitio público ---------- */
.site { background: var(--bg); }
.wrap { width: min(100% - 44px, 1180px); margin-inline: auto; }
.site-nav { position: absolute; inset: 0 0 auto 0; z-index: 5; }
.site-nav .wrap { display: flex; align-items: center; gap: 18px; padding: 20px 0; color: var(--night-ink); }
.site-nav .side-brand { padding: 0; margin-inline-end: auto; }
.site-nav a.navlink { color: #C9D0EC; text-decoration: none; font-weight: 600; font-size: 15.5px; }
.site-nav a.navlink:hover { color: #fff; }
.site-nav select { width: auto; background: rgba(255, 255, 255, .07); color: #fff; border-color: rgba(255, 255, 255, .22); padding: 6px 28px 6px 10px; min-height: 36px; font-size: 14.5px; }
.site-nav select option { color: #111; }
.hero { color: var(--night-ink); padding: calc(var(--site-nav-h, 94px) + 56px) 0 96px; background: url("../img/facets.svg") no-repeat calc(50% + 520px) 120% / 900px, radial-gradient(1100px 520px at 78% 8%, #22308A 0%, transparent 62%), linear-gradient(170deg, #111B4F 0%, var(--night) 50%, #050816 100%); overflow: hidden; }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.12fr) minmax(0, .88fr); gap: 56px; align-items: center; }
.hero h1 { font: 500 clamp(44px, 6.3vw, 86px)/1.02 var(--f-display); letter-spacing: -.012em; }
.hero h1 em { font-style: italic; background: var(--metal); -webkit-background-clip: text; background-clip: text; color: transparent; padding-inline-end: .08em; }
.hero p.lead { font-size: 20px; line-height: 1.5; color: #C2C9E8; max-width: 50ch; margin-top: 24px; }
.hero .actions { margin-top: 32px; }
.hero .btn-ghost { background: transparent; color: #fff; border-color: rgba(255, 255, 255, .35); }
.hero .btn-ghost:hover { border-color: #fff; }
.hero-note { margin-top: 16px; font-size: 15px; color: var(--night-mute); }
.quote { background: linear-gradient(180deg, rgba(27, 37, 92, .93), rgba(11, 17, 44, .95)); backdrop-filter: blur(6px); border: 1px solid rgba(235, 211, 140, .34); border-radius: var(--r-l); padding: 26px 28px; box-shadow: 0 40px 80px -40px #000; }
.quote-top { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 14px; }
.quote-top b { font-size: 17px; }
.quote-top span { font-size: 13.5px; color: var(--night-mute); }
.quote-row { display: grid; grid-template-columns: auto 1fr auto; gap: 14px; align-items: baseline; padding: 11px 0; border-top: 1px solid rgba(255, 255, 255, .1); }
.quote-row i { font-style: normal; font-weight: 700; font-size: 13px; color: #3B2C05; background: var(--metal); padding: 2px 10px; border-radius: 3px 10px 3px 10px; }
.quote-row small { color: var(--night-mute); font-size: 14px; }
.quote-row b { font: 500 29px/1 var(--f-display); direction: ltr; }
.quote-piece { margin-top: 16px; padding: 16px; border-radius: var(--r-m); background: rgba(8, 12, 29, .55); border: 1px dashed rgba(235, 211, 140, .4); }
.quote-piece span { display: block; color: #C2C9E8; font-size: 15px; }
.quote-piece b { display: block; font: 500 38px/1.1 var(--f-display); margin-top: 4px; background: var(--metal); -webkit-background-clip: text; background-clip: text; color: transparent; direction: ltr; text-align: start; }
[dir="rtl"] .quote-piece b { text-align: end; }
.band { padding: 84px 0; }
.band-alt { background: var(--surface); border-block: 1px solid var(--line); }
.band-title { font: 500 clamp(32px, 4vw, 50px)/1.05 var(--f-display); max-width: 20ch; }
.band .lead { font-size: 19px; color: var(--ink-2); max-width: 62ch; margin-top: 14px; }
/* Encabezado centrado: el título y su entrada van al centro; el contenido de la sección conserva su alineación */
.band-center .band-title, .band-center .wrap > .lead { text-align: center; margin-inline: auto; text-wrap: balance; }
.band-center .band-title { max-width: 24ch; }
/* Preguntas frecuentes centradas: el bloque, la pregunta y la respuesta; el signo queda al final de la fila */
.band-center .faq { margin-inline: auto; }
.band-center .faq summary { position: relative; justify-content: center; text-align: center; padding-inline: 34px; text-wrap: balance; }
.band-center .faq summary::after { position: absolute; inset-inline-end: 4px; top: 50%; transform: translateY(-50%); }
.band-center .faq p { text-align: center; margin-inline: auto; text-wrap: pretty; }
.shot { margin: 44px 0 0; }
.shot > a { display: block; border: 1px solid var(--line-2); border-top: 0; border-radius: 0 0 14px 14px; overflow: hidden; background: #F0F2F7; box-shadow: 0 34px 70px -34px rgba(12, 19, 48, .55), 0 2px 0 var(--gold) inset; }
.shot img { display: block; width: 100%; height: auto; }
.shot-bar { display: flex; align-items: center; gap: 7px; padding: 11px 16px; border-radius: 14px 14px 0 0; background: var(--night); border: 1px solid var(--night); direction: ltr; }
.shot-bar i { width: 10px; height: 10px; border-radius: 50%; background: rgba(255, 255, 255, .22); }
.shot-bar i:first-child { background: var(--gold); }
.shot-bar span { margin-inline: auto; padding: 3px 18px; border-radius: 999px; background: rgba(255, 255, 255, .08); color: var(--night-mute); font-size: 13px; letter-spacing: .02em; transform: translateX(-22px); }
.shot figcaption { margin-top: 16px; text-align: center; font-size: 15px; color: var(--ink-3); }
.feature-cols { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 44px 48px; margin-top: 46px; }
.feature h3 { font-size: 19px; font-weight: 700; display: flex; gap: 10px; align-items: center; padding-bottom: 10px; border-bottom: 1px solid var(--line-2); margin-bottom: 10px; }
.feature h3 .icon { color: var(--gold-ink); }
.feature ul { list-style: none; padding: 0; margin: 0; }
.feature li { padding: 6px 0; color: var(--ink-2); }
.feature li b { color: var(--ink); font-weight: 600; }
.duo { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 56px; align-items: center; }
.langs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border: 1px solid var(--line-2); border-radius: var(--r-l); overflow: hidden; margin-top: 40px; background: var(--surface); }
.langs div { padding: 28px 24px; min-width: 0; }
/* Cada casilla trae su propia dirección de escritura: el separador se fija por el lado físico, según la página */
.langs div + div { border-left: 1px solid var(--line); }
[dir="rtl"] .langs div + div { border-left: 0; border-right: 1px solid var(--line); }
.langs b { display: block; font: 500 clamp(26px, 7.4vw, 40px)/1.1 var(--f-display); overflow-wrap: anywhere; }
.langs span { color: var(--ink-3); font-size: 15px; }
.plans { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; margin-top: 44px; }
.plan { background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--r-l); padding: 34px; display: flex; flex-direction: column; }
.plan-main { background: linear-gradient(170deg, #142060, var(--night) 70%); color: var(--night-ink); border-color: rgba(235, 211, 140, .5); }
.plan h3 { font-size: 19px; font-weight: 700; }
.plan .price { font: 500 68px/1 var(--f-display); margin: 16px 0 4px; direction: ltr; text-align: start; }
[dir="rtl"] .plan .price { text-align: end; }
.plan .price small { font: 600 17px var(--f-text); color: var(--ink-3); white-space: nowrap; display: inline-block; }
.plan-main .price { background: var(--metal); -webkit-background-clip: text; background-clip: text; color: transparent; }
.plan-main .price small { color: var(--night-mute); -webkit-text-fill-color: var(--night-mute); }
.plan ul { list-style: none; padding: 0; margin: 20px 0 26px; flex: 1; }
.plan li { padding: 7px 0 7px 28px; position: relative; }
[dir="rtl"] .plan li { padding: 7px 28px 7px 0; }
.plan li::before { content: ""; position: absolute; inset-inline-start: 2px; top: 15px; width: 13px; height: 7px; border-inline-start: 2px solid var(--gold); border-bottom: 2px solid var(--gold); transform: rotate(-45deg); }
[dir="rtl"] .plan li::before { transform: rotate(45deg); }
.plan-main li { color: #D4D9EF; }
.faq { margin-top: 34px; border-top: 1px solid var(--line-2); max-width: 880px; }
.faq details { border-bottom: 1px solid var(--line-2); padding: 18px 0; }
.faq summary { font-size: 18.5px; font-weight: 700; cursor: pointer; list-style: none; display: flex; justify-content: space-between; gap: 16px; }
.faq summary::after { content: "+"; font: 400 26px/1 var(--f-display); color: var(--gold-ink); }
.faq details[open] summary::after { content: "–"; }
.faq p { margin-top: 10px; color: var(--ink-2); max-width: 70ch; }
.site-foot { background: var(--night); color: var(--night-mute); padding: 56px 0 30px; }
.site-foot-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 36px; }
.site-foot h4 { color: #fff; font-size: 15.5px; margin-bottom: 12px; }
.site-foot a { color: #C9D0EC; text-decoration: none; display: flex; gap: 8px; align-items: center; padding: 4px 0; }
.site-foot a:hover { color: var(--gold-hi); }
.site-foot .side-brand { padding: 0; margin-bottom: 16px; color: #fff; justify-content: flex-start; gap: 16px; }
.site-foot .legal { margin-top: 38px; padding-top: 20px; border-top: 1px solid rgba(255, 255, 255, .1); display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; font-size: 14px; }
.site-foot .legal a, .site-foot a.by { display: inline; color: var(--gold-hi); }
.prose { max-width: 760px; }
.prose h1 { font: 500 44px/1.08 var(--f-display); margin-bottom: 14px; }
.prose h2 { font-size: 21px; margin: 28px 0 8px; }
.prose p, .prose li { color: var(--ink-2); line-height: 1.65; }
.prose ul { padding-inline-start: 22px; }
.prose-legal .updated { font-size: 13px; letter-spacing: .12em; text-transform: uppercase; color: var(--gold-ink); margin-bottom: 18px; }
.prose-legal > p:nth-of-type(2) { font-size: 18px; color: var(--ink); }
.prose-legal h2 { font: 600 22px/1.25 var(--f-display); margin: 40px 0 12px; padding-top: 26px; border-top: 1px solid var(--line); }
.prose-legal p + p { margin-top: 10px; }
.prose-legal ul { margin: 6px 0 0; display: grid; gap: 8px; }
.prose-legal li::marker { color: var(--gold); }
.prose-legal li b { color: var(--ink); font-weight: 600; }
.prose-legal a { color: var(--gold-ink); text-decoration: underline; text-underline-offset: 3px; }
.page-plain { padding: 130px 0 80px; }
.page-plain-nav { background: var(--night); position: static; }

.lockwall { max-width: 1120px; }
.lock-hero { border: 1px solid color-mix(in srgb, var(--danger) 40%, var(--line)); background: linear-gradient(180deg, var(--danger-soft), var(--surface) 70%); border-radius: var(--r-l); padding: 30px; }
.lock-hero h1 { font: 500 38px/1.08 var(--f-display); margin: 10px 0 8px; }
.lock-hero p { color: var(--ink-2); max-width: 64ch; }

/* Las cifras van en Frank Ruhl Libre: números alineados y parejos, fáciles de leer en precios */
.hall b, .stat b, .totals dd.grand, .quote-row b, .quote-piece b, .plan .price, .figure { font-family: var(--f-num); font-weight: 500; font-variant-numeric: lining-nums; letter-spacing: -.005em; }

/* ---------- Piezas pequeñas ---------- */
.karat { display: inline-block; font-size: 12.5px; font-weight: 700; color: #3B2C05; background: var(--metal); padding: 1px 9px; border-radius: 3px 9px 3px 9px; }
.seg { display: inline-flex; border: 1px solid var(--line-2); border-radius: var(--r-s); overflow: hidden; }
.seg a { padding: 5px 12px; font-size: 14px; font-weight: 600; text-decoration: none; color: var(--ink-2); border-inline-end: 1px solid var(--line-2); }
.seg a:last-child { border-inline-end: 0; }
.seg a:hover { background: var(--surface-2); }
.seg a.is-on { background: var(--accent); color: var(--accent-ink); }
.logo-box { display: flex; gap: 16px; align-items: center; padding: 16px; border: 1px dashed var(--line-2); border-radius: var(--r-m); background: var(--surface-2); }
.logo-box .avatar { box-shadow: 0 0 0 3px var(--surface), 0 0 0 4px var(--gold); }

/* ---------- Adaptación ---------- */
@media (max-width: 1500px) { .ticker-from { display: none; } }
@media (max-width: 1240px) { .top-user span { display: none; } .ticker-title { display: none; } }
@media (max-width: 1180px) {
  .cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .feature-cols { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 980px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .side { position: fixed; z-index: 50; inset-block: 0; inset-inline-start: 0; width: min(86vw, 300px); transform: translateX(-102%); transition: transform .2s ease; }
  [dir="rtl"] .side { transform: translateX(102%); }
  body.nav-open .side { transform: none; box-shadow: var(--shadow-pop); }
  .top .top-menu { display: inline-grid; }
  .top { padding: 10px 16px; }
  .content { padding: 20px 16px 34px; }
  .foot { padding: 14px 16px 20px; }
  .split, .pos, .cols-3, .cols-2, .duo, .hero-grid, .plans, .auth { grid-template-columns: minmax(0, 1fr); }
  .auth-art { display: none; }
  .hero { padding: calc(var(--site-nav-h, 94px) + 26px) 0 64px; }
  .band { padding: 60px 0; }
  .langs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .langs div:nth-child(3), [dir="rtl"] .langs div:nth-child(3) { border-left: 0; border-right: 0; }
  .langs div:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .site-foot-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .site-nav a.navlink { display: none; }
}
@media (max-width: 620px) {
  .cols-4, .feature-cols { grid-template-columns: minmax(0, 1fr); }
  .page-head h1 { font-size: 28px; }
  .ticker-src { display: none; }
  .payline { grid-template-columns: 1fr 1fr; }
  .plan { padding: 26px 22px; }
  .plan .price { font-size: clamp(40px, 13.5vw, 54px); }
  .langs div { padding: 22px 16px; }
  .site-foot-grid { grid-template-columns: minmax(0, 1fr); }
  .kv { grid-template-columns: 1fr; gap: 2px 0; }
  .kv dd { margin-bottom: 8px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }

@media print {
  @page { margin: 10mm; }
  body { background: #fff; }
  .side, .top, .foot, .doc-bar, .hide-print, .page-head .actions { display: none !important; }
  .shell { display: block; }
  .content { padding: 0; max-width: none; }
  .doc, .poster { border: 0; box-shadow: none; margin: 0 auto; width: 100%; padding: 0; }
  .doc.slim { width: 72mm; margin: 0; }
  .panel { box-shadow: none; break-inside: avoid; }
  .labels { padding: 0; gap: 2mm; }
  .label { border: 0; break-inside: avoid; }
}

/* ---------- Compra de oro ---------- */
.lines td { vertical-align: top; padding-inline: 6px; }
.lines th { padding-inline: 6px; }
.lines th:first-child, .lines td:first-child { padding-inline-start: 20px; }
.lines th:last-child, .lines td:last-child { padding-inline-end: 14px; }
.lines tbody tr:hover td { background: none; }
.lines select { min-width: 78px; }
.lines input[type="number"] { min-width: 88px; }
.lines .line-desc { width: 38%; }
.lines .line-desc input { min-width: 130px; }
.lines [data-t] { display: block; padding-top: 9px; }
.lines .icon-btn { margin-top: 2px; }
@media (max-width: 620px) {
  .lines thead { display: none; }
  .lines tr { display: grid; grid-template-columns: 1fr 1fr 36px; gap: 8px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
  .lines td:nth-child(3) { grid-column: 2 / -1; }
  .lines tr:last-child { border-bottom: 0; }
  .lines td, .lines td:first-child, .lines td:last-child { padding: 0; border: 0; }
  .lines .line-desc { grid-column: 1 / -1; width: auto; }
  .lines [data-t] { padding-top: 8px; text-align: end; font-size: 17px; }
}

/* ---------- Marketing ---------- */
.map-frame { display: block; width: 100%; height: 340px; border: 0; background: var(--surface-2); }
.rating { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.rating > b { font: 500 54px/1 var(--f-num); font-variant-numeric: lining-nums; }
.stars { color: var(--gold); font-size: 19px; letter-spacing: 2px; white-space: nowrap; }
.stars i { font-style: normal; color: var(--line-2); }
.review { border: 1px solid var(--line); border-radius: var(--r-m); padding: 14px 16px; background: var(--surface-2); display: flex; flex-direction: column; gap: 8px; }
.review p { color: var(--ink-2); }
.qr-box { width: 190px; height: 190px; background: #fff; padding: 8px; border: 1px solid var(--line); border-radius: var(--r-m); }
.sub-title { font: 500 26px/1.15 var(--f-display); display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.copy-line { flex-wrap: nowrap; align-items: flex-start; }
.field-label.mt { margin-top: 18px; }
.poster-logo { max-height: 96px; max-width: 240px; width: auto; }
.poster-lead { font-size: 22px; }
.poster-fine { margin-top: 26px; color: #666; }

/* ---------- Empeño ---------- */
.table.pawn-mici th, .table.pawn-mici th.num { white-space: normal; vertical-align: bottom; line-height: 1.25; }
.table.pawn-mici th.num { min-width: 92px; }

/* ---------- Reputación telefónica ---------- */
textarea.msg { background: var(--surface-2); line-height: 1.5; min-height: 240px; }
.timeline li { padding-bottom: 14px; }
.timeline li::after { content: ""; position: absolute; inset-inline-start: 15px; top: 35px; bottom: 3px; width: 1px; background: var(--line-2); }
.timeline li:last-child::after { display: none; }
.timeline li.is-done::before { background: var(--ok-soft); color: var(--ok); }
.timeline li.is-now::before { background: var(--metal); color: #241A02; }
.timeline li.is-todo::before { background: var(--surface-2); color: var(--ink-3); }
.timeline li.is-todo b { color: var(--ink-3); font-weight: 600; }
.timeline + .table-wrap { border-top: 1px solid var(--line); margin: 6px -20px -20px; }
.evidence { display: block; max-height: 420px; border: 1px solid var(--line); border-radius: var(--r-m); }
.notes { color: var(--ink-2); }

/* ---------- Estudio de posts ---------- */
@media (min-width: 981px) {
  .split.studio { grid-template-columns: minmax(330px, 430px) minmax(0, 1fr); }
}
.tabs-in { margin: 0; padding: 0 12px; }
.prompt-box textarea { width: 100%; min-height: 150px; font-size: 14.5px; line-height: 1.5; resize: vertical; }
.prompt-box textarea[readonly] { background: var(--surface-2); }
.prompt-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.prompt-item { border: 1px solid var(--line); border-radius: var(--r-m); padding: 12px 14px; background: var(--surface); }
.prompt-item[open] { border-color: var(--line-2); }
.prompt-item summary { cursor: pointer; list-style: none; display: grid; gap: 2px; padding-inline-end: 26px; position: relative; }
.prompt-item summary::-webkit-details-marker { display: none; }
.prompt-item summary::after { content: "+"; position: absolute; inset-inline-end: 2px; top: 0; font: 400 22px/1 var(--f-display); color: var(--gold-ink); }
.prompt-item[open] summary::after { content: "–"; }
.prompt-title { font-weight: 600; overflow-wrap: anywhere; }
.post-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.post-card { display: flex; flex-direction: column; gap: 6px; padding: 10px 10px 12px; border: 1px solid var(--line); border-radius: var(--r-m); background: var(--surface); color: var(--ink); text-decoration: none; min-width: 0; }
.post-card:hover { border-color: var(--gold); box-shadow: var(--shadow); }
.post-card img, .post-noimg { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: var(--r-s); background: var(--surface-2); display: block; }
.post-noimg { display: grid; place-items: center; align-content: center; gap: 6px; color: var(--ink-3); }
.post-meta { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 2px 8px; color: var(--ink-3); min-width: 0; }
.post-card b { font-weight: 600; font-size: 15px; line-height: 1.35; overflow-wrap: anywhere; }
.post-image { display: block; width: 100%; max-height: 640px; object-fit: contain; border-radius: var(--r-m); background: var(--surface-2); }
.engines { border-top: 1px solid var(--line); padding-top: 16px; }
.engines dt small { color: var(--ink-3); }

/* ---------- Traslados y conteos ---------- */

/* Bloques que solo salen en papel: casillas de recibido y líneas de firma */
.print-only { display: none; }
.sign-lines { grid-template-columns: 1fr 1fr; gap: 40px; margin-top: 64px; }
.sign-lines div { border-top: 1px solid currentColor; padding-top: 6px; font-size: 13px; text-align: center; }

/* Filas con diferencia en un conteo */
.table tr.is-short td { background: color-mix(in srgb, var(--danger-soft) 60%, var(--surface)); }
.table tr.is-over td { background: color-mix(in srgb, var(--info-soft) 60%, var(--surface)); }
.table tbody tr.is-short:hover td { background: var(--danger-soft); }
.table tbody tr.is-over:hover td { background: var(--info-soft); }

/* Avance del conteo */
progress.meter { display: block; width: 100%; height: 8px; margin-top: 10px; border: 0; border-radius: 99px; overflow: hidden; background: var(--line); accent-color: var(--gold); appearance: none; -webkit-appearance: none; }
progress.meter::-webkit-progress-bar { background: var(--line); }
progress.meter::-webkit-progress-value { background: var(--metal); }
progress.meter::-moz-progress-bar { background: var(--gold); }

/* El lector y los botones de guardar siguen a la vista mientras se recorre una lista larga */
@media (min-width: 981px) {
  .count-side { position: sticky; top: 124px; }
}

@media print {
  .print-only { display: revert; }
  .sign-lines.print-only { display: grid; break-inside: avoid; }
  .print-stack { grid-template-columns: minmax(0, 1fr); }
  .table input.qty { border-color: #999; background: #fff; }
}

/* ---------- Sitio público en teléfonos ---------- */
@media (max-width: 620px) {
  .site-nav .wrap { flex-wrap: wrap; gap: 10px 12px; padding: 14px 0; }
  .site-nav .side-brand { flex: 1 1 auto; }
  .site-nav a.navlink[href$="/entrar"] { display: inline-block; margin-inline-start: auto; }
  .site-nav select + .btn { margin-inline-start: auto; }
  .site-nav .btn { white-space: nowrap; }
  .site-nav select { order: 0; }
  .site-nav a.navlink[href$="/entrar"], .site-nav .btn { order: 2; }
  .site-nav .wrap::after { content: ""; order: 1; flex: 0 0 100%; height: 0; margin-block: -5px; }
  .hero { padding-top: calc(var(--site-nav-h, 124px) + 26px); }
}
/* Teléfonos angostos: el logo y el idioma deben caber en la primera fila del encabezado */
@media (max-width: 420px) {
  .site-nav .brand-logo { height: 40px; width: auto; }
  .site-nav select { padding: 5px 24px 5px 8px; min-height: 34px; font-size: 14px; }
  .site-nav .btn { padding-inline: 10px; }
}

/* ---------- Estudio de posts en teléfonos ---------- */
/* Estudio en teléfonos: dos posts por fila. Con minmax(150px, 1fr) a 390 px de ancho ya no caben dos columnas
   y cada post ocupaba la pantalla entera (la lista de 12 posts medía más de 5,000 px de alto). */
@media (max-width: 620px) {
  .post-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .post-card { padding: 8px 8px 10px; }
  .post-meta { flex-wrap: wrap; gap: 2px 8px; }
}

/* ---------- Mensaje para Truecaller ---------- */
/* El mensaje para Truecaller se muestra entero, sin barra de desplazamiento interna: en un teléfono las líneas
   se parten y las filas calculadas en el servidor no alcanzan. Los navegadores sin field-sizing conservan
   el alto por filas y el desplazamiento. */
textarea.msg { field-sizing: content; }

/* ---------- Conteo en tabletas y teléfonos ---------- */
/* Conteo en tabletas y teléfonos: el lector y los botones de guardar van antes de la lista,
   no después de todas las filas de la sucursal */
@media (max-width: 980px) {
  .count-side { order: -1; }
}

/* Conteo en teléfonos: celdas más compactas para que «Contado» quede a la vista sin desplazar la tabla */
@media (max-width: 620px) {
  .count-table th, .count-table td { padding-inline: 6px; }
  .count-table th:first-child, .count-table td:first-child { padding-inline-start: 14px; }
  .count-table th:last-child, .count-table td:last-child { padding-inline-end: 14px; }
}

/* ---------- Pestañas con desplazamiento ---------- */
.tabs { scrollbar-width: none; scroll-snap-type: x proximity; }
.tabs::-webkit-scrollbar { display: none; }
.tab { scroll-snap-align: start; }

/* ---------- Barra superior en teléfonos ---------- */
@media (max-width: 620px) {
  .top-tools { min-width: 0; gap: 6px; }
  .top-tools select { max-width: 86px; min-width: 0; padding-inline: 8px; }
  .ticker { order: 3; flex-basis: 100%; }
}

/* ---------- Portada: la IA en JoyaPOS ---------- */
.band-night { color: var(--night-ink); background: url("../img/facets.svg") no-repeat calc(50% - 860px) 50% / 760px, linear-gradient(175deg, #111B4F 0%, var(--night) 55%, #060918 100%); border-block: 1px solid rgba(201, 162, 75, .3); }
.band-night .band-title { max-width: 16ch; }
.band-night .lead { color: #C2C9E8; }
.engines-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 26px; }
.engines-row span { padding: 6px 16px; border: 1px solid rgba(235, 211, 140, .5); border-radius: 3px 12px 3px 12px; color: var(--gold-hi); font-weight: 600; font-size: 15.5px; }
.ai-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid rgba(255, 255, 255, .14); }
.ai-list li { display: flex; gap: 18px; padding: 22px 0; border-bottom: 1px solid rgba(255, 255, 255, .14); }
.ai-list .icon { color: var(--gold-hi); margin-top: 3px; }
.ai-list b { display: block; font-size: 19px; font-weight: 700; color: #fff; }
.ai-list span { display: block; color: #C2C9E8; margin-top: 4px; max-width: 52ch; }
.ai-note { margin-top: 20px; font-size: 15.5px; color: var(--night-mute); max-width: 56ch; }
