/* Píldora POS · sistema visual */
:root {
  --teal: #0E5E5A;
  --teal-deep: #0A3F3C;
  --teal-ink: #072E2C;
  --teal-soft: #DCEBE8;
  --pill: #FFC93C;
  --pill-deep: #E8AE12;
  --bg: #EEF1EF;
  --surface: #FFFFFF;
  --line: #D7DEDB;
  --line-soft: #E7ECEA;
  --ink: #17211F;
  --ink-2: #4B5A57;
  --ink-3: #7D8B88;
  --red: #D64545;
  --red-soft: #FBE7E5;
  --green: #1F8A55;
  --green-soft: #E1F3E8;
  --amber-soft: #FFF3CF;
  --display: "Bricolage Grotesque", "Figtree", system-ui, sans-serif;
  --body: "Figtree", system-ui, -apple-system, "Segoe UI", sans-serif;
  --r-sm: 8px; --r-md: 12px; --r-lg: 18px; --r-pill: 999px;
  --shadow-pop: 0 18px 50px -18px rgba(7, 46, 44, .35);
  --side: 232px;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font: 15px/1.45 var(--body); color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased; font-variant-numeric: tabular-nums; }
h1, h2, h3 { font-family: var(--display); font-weight: 700; letter-spacing: -.015em; line-height: 1.12; margin: 0; }
h1 { font-size: 28px; } h2 { font-size: 21px; } h3 { font-size: 16px; }
p { margin: 0; }
a { color: var(--teal); }
code { background: var(--teal-soft); padding: 1px 6px; border-radius: 6px; font-size: .92em; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--pill); outline-offset: 2px; }
.muted { color: var(--ink-2); }
.subtle { color: var(--ink-3); font-size: 13px; }
.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.right { text-align: right; }
.hidden { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- Botones (cápsulas) ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; padding: 0 18px; border-radius: var(--r-pill); border: 1px solid var(--line); background: var(--surface); color: var(--ink); font-weight: 600; cursor: pointer; text-decoration: none; transition: background .15s, border-color .15s, transform .08s; white-space: nowrap; }
.btn:hover { border-color: var(--ink-3); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn svg { width: 18px; height: 18px; flex: none; }
.btn-primary { background: var(--teal); border-color: var(--teal); color: #fff; }
.btn-primary:hover { background: var(--teal-deep); border-color: var(--teal-deep); }
.btn-pay { background: var(--pill); border-color: var(--pill-deep); color: var(--teal-ink); }
.btn-pay:hover { background: var(--pill-deep); border-color: var(--pill-deep); }
.btn-danger { color: var(--red); border-color: #EFC2BE; }
.btn-danger:hover { background: var(--red-soft); border-color: var(--red); }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-ghost:hover { background: rgba(14, 94, 90, .07); border-color: transparent; }
.btn-sm { min-height: 34px; padding: 0 13px; font-size: 14px; }
.btn-lg { min-height: 56px; padding: 0 26px; font-size: 18px; }
.btn-block { width: 100%; }
.icon-btn { width: 38px; height: 38px; padding: 0; border-radius: 50%; border: 1px solid transparent; background: transparent; display: inline-grid; place-items: center; cursor: pointer; color: var(--ink-2); }
.icon-btn:hover { background: var(--line-soft); color: var(--ink); }
.icon-btn svg { width: 18px; height: 18px; }

/* ---------- Formularios ---------- */
.form { display: grid; gap: 14px; }
label { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px; font-size: 13.5px; font-weight: 600; color: var(--ink-2); }
label > input, label > select, label > textarea, label > div { flex: 1 1 100%; }
input, select, textarea { width: 100%; min-height: 44px; padding: 10px 13px; border-radius: var(--r-md); border: 1px solid var(--line); background: var(--surface); font-weight: 400; color: var(--ink); font-size: 15px; }
textarea { min-height: 80px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--teal); box-shadow: 0 0 0 3px rgba(14, 94, 90, .15); }
label.check { display: flex; flex-wrap: nowrap; align-items: center; gap: 10px; font-weight: 500; color: var(--ink); }
label.check > input { flex: none; }
.inline-label { flex-wrap: nowrap; align-items: center; gap: 8px; }
.inline-label > input { flex: none; width: auto; }
label.check input { width: 20px; min-height: 20px; height: 20px; accent-color: var(--teal); }
fieldset { border: 0; padding: 0; margin: 0; display: grid; gap: 12px; }
legend { font-family: var(--display); font-weight: 700; font-size: 16px; color: var(--ink); padding: 0; margin-bottom: 4px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.field-hint { font-weight: 400; color: var(--ink-3); font-size: 12.5px; }
.input-money { position: relative; }
.input-money::before { content: "$"; position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--ink-3); pointer-events: none; }
.input-money input { padding-left: 26px; }

.alert { padding: 12px 14px; border-radius: var(--r-md); font-size: 14px; }
.alert-error { background: var(--red-soft); color: #8E2424; }
.alert-warn { background: var(--amber-soft); color: #6B4C00; }
.alert-info { background: var(--teal-soft); color: var(--teal-ink); }

/* ---------- Acceso ---------- */
.auth-body { background: var(--teal-deep); background-image: radial-gradient(circle at 12% 18%, rgba(255, 201, 60, .14), transparent 32%), radial-gradient(circle at 88% 92%, rgba(255, 255, 255, .07), transparent 35%); }
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 460px); align-items: center; gap: 48px; max-width: 1080px; margin: 0 auto; padding: 40px 24px; }
.auth-card { background: var(--surface); border-radius: 26px; padding: 34px; display: grid; gap: 18px; box-shadow: var(--shadow-pop); }
.auth-card--wide { grid-column: 1 / -1; max-width: 620px; justify-self: center; width: 100%; }
.auth-pitch { color: #EAF3F1; display: grid; gap: 20px; }
.auth-pitch h1 { font-size: clamp(34px, 5vw, 54px); color: #fff; max-width: 13ch; }
.auth-pitch p { font-size: 17px; max-width: 42ch; color: #C9DEDA; }
.auth-points { display: grid; gap: 10px; padding: 0; margin: 4px 0 0; list-style: none; }
.auth-points li { display: flex; gap: 12px; align-items: center; font-size: 15.5px; }
.auth-points li::before { content: ""; width: 22px; height: 11px; border-radius: 99px; background: linear-gradient(90deg, #fff 50%, var(--pill) 50%); flex: none; transform: rotate(-35deg); }
.auth-switch { text-align: center; font-size: 14px; color: var(--ink-2); }
.auth-switch button { background: none; border: 0; color: var(--teal); font-weight: 600; cursor: pointer; padding: 0; text-decoration: underline; }
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--display); font-size: 20px; font-weight: 500; }
.brand b { font-weight: 700; }
.brand-pill { width: 34px; height: 17px; border-radius: 99px; background: linear-gradient(90deg, var(--teal) 50%, var(--pill) 50%); transform: rotate(-35deg); display: inline-block; }
.auth-pitch .brand { color: #fff; }
.auth-pitch .brand-pill { background: linear-gradient(90deg, #fff 50%, var(--pill) 50%); }

/* ---------- Estructura ---------- */
.app { display: grid; grid-template-columns: var(--side) minmax(0, 1fr); min-height: 100vh; }
.side { background: var(--teal-ink); color: #D3E3E0; display: flex; flex-direction: column; padding: 20px 14px; gap: 6px; position: sticky; top: 0; height: 100vh; }
.side .brand { color: #fff; padding: 2px 10px 18px; }
.side .brand-pill { background: linear-gradient(90deg, #fff 50%, var(--pill) 50%); }
.nav { display: grid; gap: 2px; }
.nav a { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-radius: var(--r-pill); color: inherit; text-decoration: none; font-weight: 500; font-size: 15px; }
.nav a svg { width: 19px; height: 19px; opacity: .8; }
.nav a:hover { background: rgba(255, 255, 255, .07); color: #fff; }
.nav a.active { background: #fff; color: var(--teal-ink); font-weight: 600; }
.nav a.active svg { opacity: 1; color: var(--teal); }
.nav-badge { margin-left: auto; background: var(--pill); color: var(--teal-ink); font-size: 11.5px; font-weight: 700; padding: 1px 7px; border-radius: 99px; }
.side-foot { margin-top: auto; display: grid; gap: 10px; padding: 12px 6px 0; border-top: 1px solid rgba(255, 255, 255, .1); }
.who { display: flex; align-items: center; gap: 10px; padding: 0 6px; }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--pill); color: var(--teal-ink); display: grid; place-items: center; font-weight: 700; font-family: var(--display); flex: none; }
.who-name { color: #fff; font-weight: 600; font-size: 14px; line-height: 1.2; }
.who-role { font-size: 12.5px; color: #93B2AD; }
.side .btn { background: transparent; color: #D3E3E0; border-color: rgba(255, 255, 255, .16); }
.side .btn:hover { border-color: rgba(255, 255, 255, .4); color: #fff; }
.main { min-width: 0; display: flex; flex-direction: column; }
.banner { padding: 10px 24px; font-size: 14px; display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.banner-warn { background: var(--amber-soft); color: #6B4C00; }
.banner-error { background: var(--red); color: #fff; }
.page { padding: 28px 32px 48px; display: grid; gap: 22px; align-content: start; width: 100%; max-width: 1360px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.page-head .muted { margin-top: 6px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* ---------- Paneles y tablas ---------- */
.panel { background: var(--surface); border-radius: var(--r-lg); border: 1px solid var(--line-soft); }
.panel-pad { padding: 20px 22px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 22px; border-bottom: 1px solid var(--line-soft); }
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--line-soft); }
.toolbar .search { flex: 1 1 240px; }
.search { position: relative; }
.search svg { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--ink-3); pointer-events: none; }
.search input { padding-left: 40px; border-radius: var(--r-pill); }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
th { text-align: left; font-weight: 600; color: var(--ink-3); font-size: 13px; padding: 11px 16px; border-bottom: 1px solid var(--line-soft); white-space: nowrap; background: #FAFBFB; }
td { padding: 12px 16px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
tbody tr.clickable { cursor: pointer; }
tbody tr.clickable:hover td { background: #F6F9F8; }
td.actions-cell { text-align: right; white-space: nowrap; }
.empty { padding: 48px 24px; text-align: center; display: grid; gap: 12px; justify-items: center; color: var(--ink-2); }
.empty h3 { color: var(--ink); }
.tag { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: var(--r-pill); font-size: 12.5px; font-weight: 600; background: var(--line-soft); color: var(--ink-2); white-space: nowrap; }
.tag-dot::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--dot, var(--teal)); }
.tag-green { background: var(--green-soft); color: var(--green); }
.tag-red { background: var(--red-soft); color: var(--red); }
.tag-amber { background: var(--amber-soft); color: #7A5600; }
.tag-teal { background: var(--teal-soft); color: var(--teal); }
.low { color: var(--red); font-weight: 600; }
.pos { color: var(--green); }
.neg { color: var(--red); }

/* ---------- Indicadores ---------- */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.kpi { background: var(--surface); border-radius: var(--r-lg); border: 1px solid var(--line-soft); padding: 18px 20px; display: grid; gap: 4px; }
.kpi-label { font-size: 13.5px; color: var(--ink-2); font-weight: 500; }
.kpi-value { font-family: var(--display); font-size: 30px; font-weight: 700; letter-spacing: -.02em; line-height: 1.1; }
.kpi-foot { font-size: 13px; color: var(--ink-3); }
.kpi--hero { background: var(--teal); border-color: var(--teal); color: #fff; }
.kpi--hero .kpi-label, .kpi--hero .kpi-foot { color: #BFDAD5; }
.split { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.chart { width: 100%; height: auto; display: block; }
.chart text { font: 10px var(--body); fill: var(--ink-3); }
.list { display: grid; }
.list-row { display: flex; align-items: center; gap: 12px; padding: 12px 22px; border-bottom: 1px solid var(--line-soft); }
.list-row:last-child { border-bottom: 0; }
.list-row .grow { flex: 1; min-width: 0; }
.list-row .name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-track { height: 8px; background: var(--line-soft); border-radius: 99px; overflow: hidden; margin-top: 6px; }
.bar-fill { height: 100%; background: var(--teal); border-radius: 99px; }

/* ---------- Vender ---------- */
.sell { display: grid; grid-template-columns: minmax(0, 1fr) 400px; height: 100vh; min-height: 0; }
.sell-left { display: flex; flex-direction: column; min-width: 0; min-height: 0; padding: 20px 22px 0; gap: 14px; }
.sell-top { display: flex; gap: 10px; align-items: center; }
.sell-top .search { flex: 1; }
.sell-top .search input { min-height: 52px; font-size: 17px; background: var(--surface); }
.chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
.chip { flex: none; display: inline-flex; align-items: center; gap: 8px; min-height: 38px; padding: 0 16px; border-radius: var(--r-pill); border: 1px solid var(--line); background: var(--surface); cursor: pointer; font-weight: 600; font-size: 14px; color: var(--ink-2); }
.chip::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--dot, var(--ink-3)); }
.chip.all::before { display: none; }
.chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }
.tiles { flex: 1; overflow-y: auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(158px, 1fr)); gap: 10px; align-content: start; padding-bottom: 22px; }
.tile { position: relative; text-align: left; background: var(--surface); border: 1px solid var(--line-soft); border-radius: var(--r-md); padding: 14px 14px 12px; cursor: pointer; display: grid; gap: 8px; min-height: 112px; align-content: space-between; transition: border-color .12s, box-shadow .12s; }
.tile:hover { border-color: var(--teal); box-shadow: 0 0 0 1px var(--teal); }
.tile:active { transform: scale(.985); }
.tile::before { content: ""; position: absolute; left: 14px; top: 0; width: 26px; height: 5px; border-radius: 0 0 99px 99px; background: var(--dot, var(--ink-3)); }
.tile-name { font-weight: 600; font-size: 14.5px; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tile-foot { display: flex; align-items: baseline; justify-content: space-between; gap: 6px; }
.tile-price { font-family: var(--display); font-weight: 700; font-size: 19px; letter-spacing: -.01em; }
.tile-stock { font-size: 12px; color: var(--ink-3); }
.tile-stock.low { color: var(--red); }
.tile--add { border-style: dashed; border-color: var(--line); background: transparent; color: var(--ink-2); place-content: center; justify-items: center; text-align: center; }
.tile--add::before { display: none; }
.tile--add svg { width: 22px; height: 22px; }
.tile.flash { animation: flash .35s ease; }
@keyframes flash { 0% { box-shadow: 0 0 0 3px var(--pill); } 100% { box-shadow: 0 0 0 0 transparent; } }

/* El ticket de papel */
.ticket-col { background: var(--bg); padding: 20px 20px 20px 4px; display: flex; min-height: 0; }
.ticket { position: relative; flex: 1; display: flex; flex-direction: column; min-height: 0; background: var(--surface); border-radius: 4px 4px 0 0; filter: drop-shadow(0 10px 24px rgba(7, 46, 44, .12)); }
.ticket::after { content: ""; position: absolute; left: 0; right: 0; bottom: -10px; height: 10px; background: radial-gradient(circle at 10px -2px, transparent 9px, var(--surface) 9.5px) 0 0 / 20px 10px repeat-x; }
.ticket-head { padding: 18px 20px 12px; display: grid; gap: 10px; border-bottom: 2px dashed var(--line); }
.ticket-title { display: flex; justify-content: space-between; align-items: center; }
.ticket-title h2 { font-size: 19px; }
.ticket-client { display: flex; align-items: center; gap: 8px; width: 100%; padding: 8px 12px; border-radius: var(--r-pill); border: 1px dashed var(--line); background: transparent; cursor: pointer; font-size: 14px; color: var(--ink-2); text-align: left; }
.ticket-client svg { width: 16px; height: 16px; }
.ticket-client.set { border-style: solid; border-color: var(--teal-soft); background: var(--teal-soft); color: var(--teal-ink); font-weight: 600; }
.ticket-client .x { margin-left: auto; }
.ticket-lines { flex: 1; overflow-y: auto; padding: 6px 0; }
.line { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 10px; padding: 10px 20px; border-bottom: 1px dotted var(--line); }
.line:last-child { border-bottom: 0; }
.line-name { font-weight: 600; font-size: 14.5px; line-height: 1.3; }
.line-total { font-weight: 700; text-align: right; }
.line-meta { grid-column: 1 / -1; display: flex; align-items: center; gap: 8px; color: var(--ink-3); font-size: 13px; }
.qty { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: var(--r-pill); overflow: hidden; }
.qty button { width: 30px; height: 30px; border: 0; background: transparent; cursor: pointer; display: grid; place-items: center; color: var(--ink-2); }
.qty button:hover { background: var(--line-soft); }
.qty button svg { width: 14px; height: 14px; }
.qty input { width: 54px; min-height: 30px; height: 30px; border: 0; padding: 0 2px; text-align: center; font-weight: 600; border-radius: 0; font-size: 14px; }
.qty input:focus { box-shadow: none; background: var(--amber-soft); }
.line-meta .icon-btn { width: 30px; height: 30px; margin-left: auto; }
.ticket-empty { display: grid; place-items: center; text-align: center; gap: 10px; padding: 40px 28px; color: var(--ink-3); height: 100%; align-content: center; }
.ticket-empty svg { width: 40px; height: 40px; color: var(--line); }
.ticket-foot { padding: 14px 20px 20px; border-top: 2px dashed var(--line); display: grid; gap: 10px; }
.sum-row { display: flex; justify-content: space-between; font-size: 14px; color: var(--ink-2); }
.sum-row button { background: none; border: 0; padding: 0; color: var(--teal); font-weight: 600; cursor: pointer; font-size: 14px; }
.sum-total { display: flex; justify-content: space-between; align-items: baseline; padding-top: 4px; }
.sum-total span:first-child { font-family: var(--display); font-size: 18px; font-weight: 700; }
.sum-total .num { font-family: var(--display); font-size: 38px; font-weight: 700; letter-spacing: -.03em; line-height: 1; }
.ticket-btns { display: grid; grid-template-columns: auto auto 1fr; gap: 8px; }
.ticket-btns .btn-pay { min-height: 56px; font-size: 18px; }
.kbd { font-size: 11px; font-weight: 700; padding: 1px 6px; border-radius: 5px; background: rgba(7, 46, 44, .12); }
.held { display: flex; gap: 6px; flex-wrap: wrap; }
.held button { font-size: 12.5px; padding: 4px 10px; border-radius: 99px; border: 1px solid var(--line); background: var(--amber-soft); cursor: pointer; font-weight: 600; color: #6B4C00; }
.caja-closed { position: absolute; inset: 0; z-index: 5; background: rgba(238, 241, 239, .82); backdrop-filter: blur(3px); display: grid; place-items: center; padding: 20px; }
.caja-closed .panel { max-width: 400px; width: 100%; padding: 28px; display: grid; gap: 16px; box-shadow: var(--shadow-pop); }
.mobile-ticket-bar { display: none; }
.mobile-only { display: none; }
.ticket-title .subtle { margin-left: auto; }
.ticket-title { gap: 10px; }

/* ---------- Cobro ---------- */
.pay-total { text-align: center; display: grid; gap: 2px; padding: 4px 0 8px; }
.pay-total .num { font-family: var(--display); font-size: 48px; font-weight: 700; letter-spacing: -.03em; }
.seg { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; background: var(--bg); padding: 5px; border-radius: var(--r-pill); }
.seg button { border: 0; background: transparent; padding: 10px 4px; border-radius: var(--r-pill); font-weight: 600; font-size: 14px; cursor: pointer; color: var(--ink-2); display: grid; justify-items: center; gap: 2px; }
.seg button svg { width: 18px; height: 18px; }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--teal-ink); box-shadow: 0 1px 4px rgba(7, 46, 44, .14); }
.bills { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.bills button { min-height: 46px; border-radius: var(--r-md); border: 1px solid var(--line); background: var(--surface); font-weight: 700; cursor: pointer; font-size: 15px; }
.bills button:hover { border-color: var(--teal); color: var(--teal); }
.big-input input { min-height: 60px; font-size: 26px; font-weight: 700; font-family: var(--display); text-align: right; }
.big-input.input-money::before { font-size: 22px; left: 16px; }
.change { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; border-radius: var(--r-lg); background: var(--teal-soft); }
.change .num { font-family: var(--display); font-size: 30px; font-weight: 700; color: var(--teal-ink); }
.change.short { background: var(--red-soft); }
.change.short .num { color: var(--red); }
.done { text-align: center; display: grid; gap: 10px; justify-items: center; }
.done-mark { width: 64px; height: 64px; border-radius: 50%; background: var(--green-soft); color: var(--green); display: grid; place-items: center; }
.done-mark svg { width: 32px; height: 32px; }

/* ---------- Modales y avisos ---------- */
.overlay { position: fixed; inset: 0; z-index: 50; background: rgba(7, 46, 44, .42); display: grid; place-items: center; padding: 20px; animation: fade .15s ease; }
@keyframes fade { from { opacity: 0; } }
.modal { background: var(--surface); border-radius: 22px; width: 100%; max-width: 520px; max-height: calc(100vh - 40px); display: flex; flex-direction: column; box-shadow: var(--shadow-pop); animation: pop .18s ease; }
.modal--wide { max-width: 760px; }
.modal--narrow { max-width: 420px; }
@keyframes pop { from { transform: translateY(8px) scale(.985); opacity: 0; } }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 20px 24px 0; }
.modal-body { padding: 18px 24px; overflow-y: auto; display: grid; gap: 16px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 0 24px 22px; flex-wrap: wrap; }
.modal-foot .spacer { flex: 1; }
.toasts { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); z-index: 80; display: grid; gap: 8px; justify-items: center; pointer-events: none; }
.toast { background: var(--ink); color: #fff; padding: 11px 18px; border-radius: var(--r-pill); font-weight: 500; font-size: 14.5px; box-shadow: var(--shadow-pop); animation: pop .2s ease; max-width: min(520px, 90vw); }
.toast-error { background: var(--red); }
.loading { padding: 60px; text-align: center; color: var(--ink-3); }
.denoms { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 8px; }
.denom { display: flex; align-items: center; gap: 8px; border: 1px solid var(--line-soft); border-radius: var(--r-md); padding: 6px 8px 6px 12px; }
.denom span { font-weight: 700; min-width: 48px; font-size: 14px; }
.denom input { min-height: 36px; padding: 4px 8px; text-align: center; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 1px; background: var(--line-soft); border-radius: var(--r-md); overflow: hidden; border: 1px solid var(--line-soft); }
.stat { background: var(--surface); padding: 14px 16px; display: grid; gap: 2px; }
.stat b { font-family: var(--display); font-size: 20px; }
.stat span { font-size: 13px; color: var(--ink-2); }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); }
.tabs button { border: 0; background: none; padding: 10px 14px; font-weight: 600; color: var(--ink-3); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs button[aria-selected="true"] { color: var(--teal-ink); border-color: var(--teal); }
.ticket-preview { background: #fff; border: 1px solid var(--line); border-radius: 6px; padding: 16px; font-size: 12.5px; max-width: 300px; margin: 0 auto; width: 100%; }

/* ---------- Ticket impreso ---------- */
#print-area { display: none; }
.pt { font-family: "Courier New", monospace; font-size: 12px; color: #000; line-height: 1.35; }
.pt .c { text-align: center; }
.pt .b { font-weight: 700; }
.pt .big { font-size: 15px; font-weight: 700; }
.pt hr { border: 0; border-top: 1px dashed #000; margin: 6px 0; }
.pt table { font-size: 12px; width: 100%; }
.pt td { padding: 1px 0; border: 0; vertical-align: top; }
.pt td.r { text-align: right; white-space: nowrap; }
@media print {
  body { background: #fff; }
  body > *:not(#print-area) { display: none !important; }
  #print-area { display: block; padding: 3mm 4mm; }
}

/* ---------- Responsivo ---------- */
@media (max-width: 1180px) {
  .sell { grid-template-columns: minmax(0, 1fr) 360px; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  :root { --side: 0px; }
  .app { grid-template-columns: 1fr; padding-bottom: 68px; }
  .side { position: fixed; bottom: 0; top: auto; left: 0; right: 0; height: 64px; z-index: 30; flex-direction: row; padding: 6px 8px; }
  .side .brand, .side-foot { display: none; }
  .nav { grid-auto-flow: column; grid-auto-columns: minmax(64px, 1fr); width: 100%; overflow-x: auto; gap: 0; }
  .nav a { flex-direction: column; gap: 3px; padding: 6px 4px; font-size: 11px; border-radius: 12px; justify-content: center; }
  .nav-badge { display: none; }
  .page { padding: 20px 16px 40px; }
  .split { grid-template-columns: 1fr; }
  .sell { grid-template-columns: 1fr; height: calc(100vh - 64px); }
  .sell-left { padding: 14px 16px 0; }
  .ticket-col { position: fixed; inset: 0 0 64px 0; z-index: 25; padding: 12px; background: rgba(7, 46, 44, .4); display: none; }
  .ticket-col.open { display: flex; }
  .mobile-only { display: inline-grid; order: 3; }
  .ticket-btns .kbd { display: none; }
  .mobile-ticket-bar { display: flex; position: fixed; left: 12px; right: 12px; bottom: 76px; z-index: 20; }
  .mobile-ticket-bar .btn { width: 100%; justify-content: space-between; min-height: 54px; box-shadow: var(--shadow-pop); }
  .tiles { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); padding-bottom: 140px; }
  .auth { grid-template-columns: 1fr; gap: 28px; padding: 28px 16px; }
  .auth-pitch h1 { font-size: 34px; }
  .auth-points { display: none; }
}
@media (max-width: 560px) {
  .kpis { grid-template-columns: 1fr 1fr; gap: 10px; }
  .kpi-value { font-size: 24px; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .bills { grid-template-columns: repeat(3, 1fr); }
  .seg { grid-template-columns: repeat(3, 1fr); border-radius: var(--r-lg); }
  .modal { border-radius: 20px 20px 0 0; max-height: 92vh; }
  .overlay { align-items: end; padding: 0; }
  .auth-card { padding: 24px; }
  th, td { padding: 10px 12px; }
  .hide-sm { display: none; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
