/* =========================================================
   Hồ Bơi – hệ thống nhận diện
   Lagoon (xanh hồ sâu) · Aqua (nước) · Sun (nắng) · Sand (nền)
   ========================================================= */
:root {
  --lagoon-900: #062A5C;
  --lagoon-800: #0B3E86;
  --lagoon-700: #0F52A8;
  --lagoon-600: #1673C9;
  --aqua-500: #22A447;
  --aqua-400: #3BC45E;
  --aqua-300: #8BE39A;
  --aqua-100: #DDF6E1;
  --aqua-50: #F0FBF2;
  --sun-500: #F2590F;
  --sun-400: #FF7A2E;
  --sun-100: #FFE9DC;
  --sand-50: #FBFAF7;
  --sand-100: #F4F1EA;
  --sand-200: #E9E4D8;
  --ink-900: #0B1F2A;
  --ink-700: #2B3F4A;
  --ink-500: #5B6E78;
  --ink-400: #85959D;
  --ink-300: #B4C0C5;
  --line: #E3E8E6;
  --ok: #0E9F6E;
  --ok-bg: #E3F8EF;
  --bad: #D9373A;
  --bad-bg: #FDECEC;
  --warn: #C27803;
  --warn-bg: #FFF5DB;
  --radius-sm: 10px;
  --radius: 16px;
  --radius-lg: 24px;
  --shadow-sm: 0 1px 2px rgba(3, 31, 43, .06), 0 1px 1px rgba(3, 31, 43, .04);
  --shadow: 0 10px 30px -12px rgba(3, 31, 43, .22), 0 2px 6px rgba(3, 31, 43, .05);
  --shadow-lg: 0 30px 60px -20px rgba(3, 31, 43, .35);
  --font: 'Be Vietnam Pro', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --safe-b: env(safe-area-inset-bottom, 0px);
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; font-family: var(--font); color: var(--ink-900); background: var(--sand-50);
  font-size: 15px; line-height: 1.55; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
img, svg { display: block; max-width: 100%; }
a { color: var(--lagoon-600); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0; line-height: 1.2; letter-spacing: -.01em; }
p { margin: 0; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--aqua-400); outline-offset: 2px; border-radius: 6px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--ink-500); }
.small { font-size: 13px; }
.tiny { font-size: 12px; }
.mono { font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace; letter-spacing: .02em; }
.row { display: flex; align-items: center; gap: 10px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.stack > * + * { margin-top: 12px; }
.grow { flex: 1; min-width: 0; }
.hidden { display: none !important; }
.center { text-align: center; }

/* ---------- Buttons ---------- */
.btn {
  --bg: var(--sand-100); --fg: var(--ink-900);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 0 18px; border-radius: 14px; border: 0; cursor: pointer;
  background: var(--bg); color: var(--fg); font-weight: 600; font-size: 15px;
  transition: transform .12s var(--ease), box-shadow .2s var(--ease), background .2s, opacity .2s;
  -webkit-tap-highlight-color: transparent; text-decoration: none !important; white-space: nowrap;
}
.btn svg { width: 20px; height: 20px; }
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .5; pointer-events: none; }
.btn.primary { --bg: var(--lagoon-800); --fg: #fff; box-shadow: 0 8px 20px -8px rgba(11, 62, 134, .55); }
.btn.primary:hover { --bg: var(--lagoon-700); }
.btn.aqua { --bg: var(--aqua-400); --fg: var(--lagoon-900); }
.btn.sun { --bg: var(--sun-400); --fg: #fff; box-shadow: 0 10px 24px -10px rgba(242, 89, 15, .6); }
.btn.sun:hover { --bg: #FF8C4A; }
.btn.danger { --bg: var(--bad); --fg: #fff; }
.btn.ok { --bg: var(--ok); --fg: #fff; }
.btn.ghost { --bg: transparent; --fg: var(--ink-700); box-shadow: inset 0 0 0 1.5px var(--line); }
.btn.ghost:hover { --bg: var(--sand-100); }
.btn.block { width: 100%; }
.btn.lg { min-height: 56px; font-size: 17px; border-radius: 16px; }
.btn.sm { min-height: 36px; padding: 0 12px; font-size: 13.5px; border-radius: 10px; }
.btn.sm svg { width: 16px; height: 16px; }
.icon-btn {
  width: 40px; height: 40px; display: inline-grid; place-items: center; border-radius: 12px; border: 0;
  background: transparent; cursor: pointer; color: var(--ink-500);
}
.icon-btn:hover { background: var(--sand-100); color: var(--ink-900); }
.icon-btn svg { width: 22px; height: 22px; }

/* ---------- Form ---------- */
.field { display: block; }
.field > span { display: block; font-size: 13px; font-weight: 600; color: var(--ink-700); margin-bottom: 6px; }
.input, select.input, textarea.input {
  width: 100%; min-height: 48px; padding: 12px 14px; border-radius: 12px; border: 1.5px solid var(--line);
  background: #fff; font: inherit; color: var(--ink-900); transition: border-color .15s, box-shadow .15s;
}
textarea.input { min-height: 84px; resize: vertical; }
.input:focus { outline: none; border-color: var(--aqua-500); box-shadow: 0 0 0 4px rgba(20, 184, 166, .15); }
.input.money { font-variant-numeric: tabular-nums; font-weight: 600; font-size: 18px; }
.form-grid { display: grid; gap: 14px; }
@media (min-width: 640px) { .form-grid.two { grid-template-columns: 1fr 1fr; } }
.hint { font-size: 12.5px; color: var(--ink-500); margin-top: 6px; }

/* ---------- Cards ---------- */
.card { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow-sm); border: 1px solid var(--line); }
.card-pad { padding: 18px; }
@media (min-width: 640px) { .card-pad { padding: 24px; } }
.card h3 { font-size: 17px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 600; background: var(--sand-100); color: var(--ink-700); white-space: nowrap; }
.chip.ok { background: var(--ok-bg); color: var(--ok); }
.chip.bad { background: var(--bad-bg); color: var(--bad); }
.chip.warn { background: var(--warn-bg); color: var(--warn); }
.chip.aqua { background: var(--aqua-100); color: var(--lagoon-700); }
.chip .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.chip .dot.pulse { animation: pulse 1.6s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 currentColor; } 70% { box-shadow: 0 0 0 6px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }

/* ---------- Toast / modal ---------- */
#toasts { position: fixed; left: 50%; top: 14px; transform: translateX(-50%); z-index: 200; display: grid; gap: 8px; width: min(92vw, 420px); pointer-events: none; }
.toast {
  padding: 12px 16px; border-radius: 14px; background: var(--ink-900); color: #fff; font-weight: 500; font-size: 14px;
  box-shadow: var(--shadow-lg); opacity: 0; transform: translateY(-10px); transition: all .25s var(--ease);
}
.toast.in { opacity: 1; transform: none; }
.toast-success { background: var(--ok); }
.toast-error { background: var(--bad); }
.modal-back {
  position: fixed; inset: 0; background: rgba(3, 31, 43, .5); backdrop-filter: blur(4px); z-index: 150;
  display: grid; place-items: end center; opacity: 0; transition: opacity .2s;
}
@media (min-width: 640px) { .modal-back { place-items: center; } }
.modal-back.in { opacity: 1; }
.modal {
  width: min(100%, 460px); max-height: 92vh; overflow: auto; background: #fff; border-radius: 24px 24px 0 0;
  transform: translateY(30px); transition: transform .25s var(--ease); padding-bottom: var(--safe-b);
}
.modal-wide { width: min(100%, 720px); }
@media (min-width: 640px) { .modal { border-radius: 24px; } }
.modal-back.in .modal { transform: none; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 18px 6px 22px; }
.modal-head h3 { font-size: 18px; }
.modal-body { padding: 8px 22px 6px; }
.modal-foot { display: flex; gap: 10px; padding: 16px 22px 22px; }
.modal-foot .btn { flex: 1; }

/* ---------- Stepper số lượng ---------- */
.stepper { display: inline-flex; align-items: center; background: var(--sand-100); border-radius: 14px; padding: 4px; }
.stepper button { width: 40px; height: 40px; border-radius: 10px; border: 0; background: #fff; cursor: pointer; display: grid; place-items: center; box-shadow: var(--shadow-sm); }
.stepper button:disabled { opacity: .35; }
.stepper button svg { width: 18px; height: 18px; }
.stepper output { min-width: 40px; text-align: center; font-weight: 700; font-size: 17px; font-variant-numeric: tabular-nums; }

/* ---------- Floating contact ---------- */
.fab-contact { position: fixed; right: 14px; bottom: calc(16px + var(--safe-b)); display: grid; gap: 10px; justify-items: end; z-index: 60; }
.fab { display: inline-flex; align-items: center; gap: 8px; height: 52px; min-width: 52px; justify-content: center; border-radius: 999px; box-shadow: var(--shadow); text-decoration: none !important; font-weight: 700; }
.fab svg { width: 26px; height: 26px; }
.fab-call { background: var(--sun-400); color: #fff; padding: 0 18px 0 14px; animation: ring 4s infinite; }
.fab-zalo { background: #fff; color: #0068FF; padding: 0; width: 52px; }
.fab-zalo svg { width: 34px; height: 34px; }
@media (max-width: 520px) { .fab-call span { display: none; } .fab-call { padding: 0; width: 52px; } }
@keyframes ring { 0%, 90%, 100% { transform: none; } 92% { transform: rotate(-6deg); } 94% { transform: rotate(6deg); } 96% { transform: rotate(-4deg); } 98% { transform: rotate(3deg); } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* =========================================================
   TRANG KHÁCH
   ========================================================= */
.site-head {
  position: sticky; top: 0; z-index: 50; background: rgba(251, 250, 247, .86); backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid rgba(227, 232, 230, .7);
}
.site-head .inner { max-width: 1120px; margin: 0 auto; padding: 10px 18px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink-900); text-decoration: none !important; min-width: 0; }
.brand .logo-mark { width: 38px; height: 38px; flex: none; }
.brand b { font-size: 16.5px; font-weight: 800; letter-spacing: -.02em; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand small { display: block; font-size: 12px; color: var(--ink-500); margin-top: -1px; }
.head-call { display: none; }
@media (min-width: 720px) { .head-call { display: inline-flex; } }

.hero {
  position: relative; overflow: hidden; color: #fff;
  background:
    radial-gradient(1200px 400px at 85% -10%, rgba(94, 234, 212, .35), transparent 60%),
    radial-gradient(700px 300px at -10% 110%, rgba(255, 200, 87, .25), transparent 60%),
    linear-gradient(160deg, var(--lagoon-800), var(--lagoon-900) 70%);
}
.hero::before { /* gạch men hồ bơi */
  content: ''; position: absolute; inset: 0; opacity: .09;
  background-image: linear-gradient(rgba(255, 255, 255, .7) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, .7) 1px, transparent 1px);
  background-size: 28px 28px; mask-image: linear-gradient(180deg, transparent, #000 40%, #000);
}
.hero .caustics { position: absolute; inset: -20%; opacity: .18; background: repeating-radial-gradient(circle at 30% 40%, transparent 0 18px, rgba(94, 234, 212, .5) 19px 20px, transparent 21px 44px); filter: blur(1px); animation: drift 18s linear infinite; }
@keyframes drift { from { transform: translate(0, 0) rotate(0); } to { transform: translate(-4%, 3%) rotate(8deg); } }
.hero .inner { position: relative; max-width: 1120px; margin: 0 auto; padding: 34px 18px 84px; }
@media (min-width: 900px) { .hero .inner { padding: 64px 18px 110px; display: grid; grid-template-columns: 1.1fr .9fr; gap: 40px; align-items: center; } }
.hero h1 { font-size: clamp(30px, 6.4vw, 52px); font-weight: 800; letter-spacing: -.035em; line-height: 1.05; }
.hero h1 em { font-style: normal; color: var(--sun-400); }
.hero p.lead { margin-top: 14px; font-size: 16.5px; color: rgba(255, 255, 255, .82); max-width: 520px; }
.hero .status { margin-top: 18px; display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 999px; background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .16); font-weight: 600; font-size: 14px; }
.hero .status .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--aqua-300); box-shadow: 0 0 0 4px rgba(94, 234, 212, .22); }
.hero .status.closed .dot { background: var(--sun-400); box-shadow: 0 0 0 4px rgba(255, 200, 87, .2); }
.hero .wave { position: absolute; left: 0; right: 0; bottom: -1px; height: 46px; color: var(--sand-50); }
.hero .wave svg { width: 100%; height: 100%; }
.price-tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 24px; }
@media (min-width: 900px) { .price-tiles { margin-top: 0; } }
.price-tile { position: relative; padding: 18px; border-radius: 20px; background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .14); }
.price-tile .label { font-size: 13px; color: rgba(255, 255, 255, .7); font-weight: 600; text-transform: uppercase; letter-spacing: .08em; }
.price-tile .price { font-size: clamp(26px, 5vw, 36px); font-weight: 800; letter-spacing: -.03em; margin-top: 4px; }
.price-tile .price small { font-size: 15px; font-weight: 600; opacity: .7; }
.price-tile.hours { grid-column: 1 / -1; display: grid; gap: 6px; }
.price-tile.hours div { display: flex; justify-content: space-between; gap: 10px; font-size: 14.5px; }
.price-tile.hours b { font-weight: 700; }

.page { max-width: 1120px; margin: 0 auto; padding: 0 18px 120px; }
.book-wrap { margin-top: -54px; position: relative; display: grid; gap: 18px; }
@media (min-width: 900px) { .book-wrap { grid-template-columns: 1.25fr .75fr; align-items: start; } }
.book-wrap > * { min-width: 0; }
.book { padding: 22px; border-radius: var(--radius-lg); background: #fff; box-shadow: var(--shadow); }
@media (min-width: 640px) { .book { padding: 28px; } }
.book h2 { font-size: 22px; font-weight: 800; letter-spacing: -.02em; }
.step-title { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 15px; margin: 22px 0 12px; }
.step-title i { font-style: normal; width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; background: var(--aqua-100); color: var(--lagoon-700); font-size: 13px; font-weight: 800; }
.tt-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 0; border-bottom: 1px dashed var(--line); }
.tt-row:last-child { border-bottom: 0; }
.tt-row b { font-size: 16px; }
.tt-row .muted { font-size: 13px; }
.dates { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
.dates::-webkit-scrollbar { display: none; }
.date-chip {
  flex: none; width: 68px; padding: 10px 0; border-radius: 14px; border: 1.5px solid var(--line); background: #fff; cursor: pointer; text-align: center;
  transition: all .15s var(--ease);
}
.date-chip span { display: block; font-size: 12px; color: var(--ink-500); font-weight: 600; }
.date-chip b { display: block; font-size: 19px; font-weight: 800; letter-spacing: -.02em; }
.date-chip[aria-pressed="true"] { border-color: var(--lagoon-800); background: var(--lagoon-800); color: #fff; box-shadow: 0 8px 18px -8px rgba(11, 62, 134, .55); }
.date-chip[aria-pressed="true"] span { color: rgba(255, 255, 255, .75); }
.summary-bar {
  margin-top: 22px; padding: 16px; border-radius: 18px; background: var(--sand-100); display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.summary-bar .total { font-size: 26px; font-weight: 800; letter-spacing: -.03em; }
.side-card { padding: 20px; border-radius: var(--radius-lg); background: #fff; border: 1px solid var(--line); }
.side-card h3 { font-size: 16px; margin-bottom: 12px; }
.info-line { display: flex; gap: 12px; padding: 10px 0; align-items: flex-start; }
.info-line svg { width: 20px; height: 20px; flex: none; color: var(--lagoon-600); margin-top: 2px; }
.how { counter-reset: s; display: grid; gap: 12px; }
.how li { list-style: none; position: relative; padding-left: 36px; font-size: 14px; color: var(--ink-700); min-height: 24px; }
.how li::before { position: absolute; left: 0; top: 0; counter-increment: s; content: counter(s); width: 24px; height: 24px; border-radius: 50%; background: var(--sun-100); color: var(--warn); font-weight: 800; font-size: 12.5px; display: grid; place-items: center; }
.how { padding: 0; margin: 0; }
.my-orders a { display: flex; justify-content: space-between; padding: 10px 12px; border-radius: 12px; background: var(--sand-50); margin-top: 8px; color: var(--ink-900); }
.site-foot { border-top: 1px solid var(--line); padding: 26px 18px 110px; text-align: center; color: var(--ink-500); font-size: 13px; }

/* ---------- Trang đơn ---------- */
.order-page { max-width: 560px; margin: 0 auto; padding: 18px 16px 120px; }
.pay-card { overflow: hidden; border-radius: var(--radius-lg); background: #fff; box-shadow: var(--shadow); }
.pay-top { padding: 22px 22px 18px; background: linear-gradient(160deg, var(--lagoon-800), var(--lagoon-900)); color: #fff; }
.pay-top .amount { font-size: 36px; font-weight: 800; letter-spacing: -.035em; }
.pay-top .muted { color: rgba(255, 255, 255, .7); }
.qr-frame { margin: 18px auto 6px; width: min(78vw, 280px); padding: 14px; background: #fff; border-radius: 22px; box-shadow: 0 0 0 6px var(--aqua-100), var(--shadow); }
.qr-frame .qr { width: 100%; height: auto; }
.bank-rows { padding: 6px 22px 18px; }
.bank-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.bank-row:last-child { border-bottom: 0; }
.bank-row .k { font-size: 12.5px; color: var(--ink-500); }
.bank-row .v { font-weight: 700; font-size: 16px; word-break: break-all; }
.bank-row .v.hl { color: var(--bad); font-size: 19px; letter-spacing: .04em; }
.waiting { display: flex; gap: 12px; align-items: center; padding: 14px 16px; margin: 0 22px 22px; border-radius: 14px; background: var(--warn-bg); color: #7A4A00; font-size: 14px; }
.spinner { width: 20px; height: 20px; border-radius: 50%; border: 2.5px solid currentColor; border-right-color: transparent; animation: spin .8s linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }
.tickets { display: grid; gap: 16px; margin-top: 16px; }
.ticket {
  position: relative; border-radius: 24px; background: #fff; box-shadow: var(--shadow); overflow: hidden;
  --notch: 14px;
}
.ticket-head { padding: 16px 20px; background: linear-gradient(135deg, var(--aqua-400), var(--aqua-300)); color: var(--lagoon-900); display: flex; justify-content: space-between; align-items: center; }
.ticket-head b { font-size: 18px; font-weight: 800; }
.ticket-body { padding: 18px 20px 20px; text-align: center; }
.ticket-body .qr { width: min(70vw, 240px); margin: 4px auto 10px; }
.ticket-tear { position: relative; height: 0; border-top: 2px dashed var(--line); margin: 0 16px; }
.ticket-tear::before, .ticket-tear::after { content: ''; position: absolute; top: calc(-1 * var(--notch) - 1px); width: calc(var(--notch) * 2); height: calc(var(--notch) * 2); border-radius: 50%; background: var(--sand-50); }
.ticket-tear::before { left: calc(-16px - var(--notch)); }
.ticket-tear::after { right: calc(-16px - var(--notch)); }
.ticket-foot { padding: 12px 20px 16px; display: flex; justify-content: space-between; font-size: 13px; color: var(--ink-500); }
.ticket.used .ticket-head { background: var(--sand-200); }
.ticket.used .ticket-body { opacity: .5; }
.stamp { display: inline-block; padding: 6px 14px; border: 2.5px solid var(--bad); color: var(--bad); border-radius: 10px; font-weight: 800; letter-spacing: .1em; transform: rotate(-6deg); margin: 30px 0; }
.big-status { text-align: center; padding: 34px 22px; }
.big-status .ico { width: 64px; height: 64px; border-radius: 20px; display: grid; place-items: center; margin: 0 auto 14px; }
.big-status .ico svg { width: 34px; height: 34px; }
.big-status h2 { font-size: 22px; font-weight: 800; }

/* =========================================================
   APP NHÂN VIÊN & QUẢN TRỊ
   ========================================================= */
.auth-screen { min-height: 100dvh; display: grid; place-items: center; padding: 24px; background: linear-gradient(160deg, var(--lagoon-800), var(--lagoon-900)); }
.auth-card { width: min(100%, 400px); background: #fff; border-radius: 26px; padding: 28px; box-shadow: var(--shadow-lg); }
.auth-card .logo-mark { width: 52px; height: 52px; margin-bottom: 16px; }
.auth-card h1 { font-size: 24px; font-weight: 800; }

.app { min-height: 100dvh; display: flex; flex-direction: column; background: var(--sand-50); }
.app-top { position: sticky; top: 0; z-index: 40; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 14px; background: #fff; border-bottom: 1px solid var(--line); }
.app-top .who { display: flex; align-items: center; gap: 10px; min-width: 0; }
.avatar { width: 36px; height: 36px; border-radius: 12px; background: var(--aqua-100); color: var(--lagoon-700); display: grid; place-items: center; font-weight: 800; flex: none; }
.app-main > * { min-width: 0; }
.app-main { flex: 1; min-width: 0; padding: 16px 14px calc(96px + var(--safe-b)); max-width: 760px; width: 100%; margin: 0 auto; }
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 45; display: grid; grid-template-columns: repeat(4, 1fr);
  background: rgba(255, 255, 255, .94); backdrop-filter: blur(12px); border-top: 1px solid var(--line); padding: 6px 6px calc(6px + var(--safe-b));
}
.tabbar button { border: 0; background: none; display: grid; justify-items: center; gap: 2px; padding: 6px 0; font-size: 11.5px; font-weight: 600; color: var(--ink-400); cursor: pointer; border-radius: 12px; position: relative; }
.tabbar button svg { width: 24px; height: 24px; }
.tabbar button[aria-selected="true"] { color: var(--lagoon-800); }
.tabbar button[aria-selected="true"]::before { content: ''; position: absolute; top: -6px; width: 26px; height: 3px; border-radius: 3px; background: var(--aqua-500); }
.tabbar .badge { position: absolute; top: 2px; left: 55%; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--bad); color: #fff; font-size: 11px; display: grid; place-items: center; }
.section-title { font-size: 20px; font-weight: 800; letter-spacing: -.02em; margin: 4px 0 14px; }

/* Máy quét */
.scanner { position: fixed; inset: 0; z-index: 100; background: #000; display: flex; flex-direction: column; }
.scanner video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.scanner .frame { position: absolute; left: 50%; top: 44%; width: min(72vw, 300px); aspect-ratio: 1; transform: translate(-50%, -50%); border-radius: 28px; box-shadow: 0 0 0 100vmax rgba(0, 0, 0, .55); }
.scanner .frame::before { content: ''; position: absolute; inset: -3px; border-radius: 30px; padding: 3px; background: conic-gradient(from 0deg, var(--aqua-300) 0 12%, transparent 12% 38%, var(--aqua-300) 38% 62%, transparent 62% 88%, var(--aqua-300) 88%); -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; }
.scanner .laser { position: absolute; left: 8%; right: 8%; height: 2px; background: var(--aqua-300); box-shadow: 0 0 12px var(--aqua-300); animation: laser 2.2s ease-in-out infinite; }
@keyframes laser { 0%, 100% { top: 10%; } 50% { top: 88%; } }
.scanner .top, .scanner .bottom { position: relative; z-index: 2; display: flex; justify-content: space-between; align-items: center; padding: 14px; color: #fff; }
.scanner .top { padding-top: calc(14px + env(safe-area-inset-top, 0px)); }
.scanner .bottom { margin-top: auto; padding-bottom: calc(18px + var(--safe-b)); justify-content: center; gap: 12px; flex-wrap: wrap; }
.scanner .glass { background: rgba(255, 255, 255, .14); backdrop-filter: blur(10px); color: #fff; border: 1px solid rgba(255, 255, 255, .2); }
.scanner .stats { font-weight: 700; font-size: 14px; padding: 8px 14px; border-radius: 999px; }
.scan-result {
  position: absolute; inset: 0; z-index: 5; display: grid; place-items: center; text-align: center; padding: 24px; color: #fff;
  opacity: 0; pointer-events: none; transition: opacity .15s;
}
.scan-result.show { opacity: 1; pointer-events: auto; }
.scan-result.ok { background: rgba(14, 159, 110, .96); }
.scan-result.bad { background: rgba(217, 55, 58, .96); }
.scan-result.warn { background: rgba(194, 120, 3, .96); }
.scan-result .big { width: 120px; height: 120px; margin: 0 auto 18px; border-radius: 50%; display: grid; place-items: center; background: rgba(255, 255, 255, .18); animation: pop .35s var(--ease); }
.scan-result .big svg { width: 70px; height: 70px; stroke-width: 2.6; }
@keyframes pop { from { transform: scale(.6); opacity: 0; } to { transform: none; opacity: 1; } }
.scan-result h2 { font-size: clamp(26px, 7vw, 40px); font-weight: 800; letter-spacing: -.02em; }
.scan-result p { font-size: 17px; margin-top: 8px; opacity: .92; }
.scan-hero { padding: 26px 20px; border-radius: var(--radius-lg); text-align: center; color: #fff; background: linear-gradient(160deg, var(--lagoon-800), var(--lagoon-900)); position: relative; overflow: hidden; }
.scan-hero .btn { margin-top: 18px; }
.scan-hero h2 { font-size: 22px; font-weight: 800; }
.kpis { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
@media (min-width: 900px) { .kpis { grid-template-columns: repeat(4, 1fr); } }
.kpi { padding: 16px; border-radius: var(--radius); background: #fff; border: 1px solid var(--line); }
.kpi .k { font-size: 12.5px; color: var(--ink-500); font-weight: 600; }
.kpi .v { font-size: clamp(20px, 4vw, 26px); font-weight: 800; letter-spacing: -.03em; margin-top: 4px; font-variant-numeric: tabular-nums; }
.kpi .s { font-size: 12.5px; color: var(--ink-500); margin-top: 2px; }
.kpi.accent { background: var(--lagoon-800); color: #fff; border-color: transparent; }
.kpi.accent .k, .kpi.accent .s { color: rgba(255, 255, 255, .7); }
.list-item { display: flex; gap: 12px; align-items: center; padding: 14px; border-radius: 16px; background: #fff; border: 1px solid var(--line); }
.list-item + .list-item { margin-top: 10px; }
.sale-total { position: sticky; bottom: calc(76px + var(--safe-b)); margin-top: 16px; padding: 14px; border-radius: 20px; background: var(--lagoon-900); color: #fff; display: flex; align-items: center; justify-content: space-between; gap: 12px; box-shadow: var(--shadow-lg); }
.sale-total .t { font-size: 26px; font-weight: 800; letter-spacing: -.03em; }
.change-box { margin-top: 12px; padding: 14px; border-radius: 14px; background: var(--ok-bg); color: var(--ok); font-weight: 700; display: flex; justify-content: space-between; }
.change-box.neg { background: var(--bad-bg); color: var(--bad); }
.quick-cash { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.quick-cash button { border: 1.5px solid var(--line); background: #fff; border-radius: 10px; padding: 8px 12px; font-weight: 600; cursor: pointer; }
.print-tickets { display: grid; gap: 12px; }
.print-ticket { display: grid; grid-template-columns: 130px 1fr; gap: 14px; align-items: center; padding: 12px; border: 1.5px dashed var(--line); border-radius: 16px; }
.print-ticket .qr { width: 130px; }

/* ---------- Admin layout ---------- */
.admin { display: grid; min-height: 100dvh; }
@media (min-width: 1000px) { .admin { grid-template-columns: 248px 1fr; } }
.sidebar { display: none; background: var(--lagoon-900); color: #fff; padding: 18px 14px; position: sticky; top: 0; height: 100dvh; overflow: auto; }
@media (min-width: 1000px) { .sidebar { display: flex; flex-direction: column; } }
.sidebar .brand { color: #fff; padding: 4px 8px 18px; }
.sidebar .brand small { color: rgba(255, 255, 255, .6); }
.nav-btn { display: flex; align-items: center; gap: 12px; width: 100%; padding: 11px 12px; border: 0; border-radius: 12px; background: none; color: rgba(255, 255, 255, .72); font-weight: 600; font-size: 14.5px; cursor: pointer; text-align: left; position: relative; }
.nav-btn svg { width: 20px; height: 20px; }
.nav-btn:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.nav-btn[aria-current="page"] { background: rgba(94, 234, 212, .14); color: var(--aqua-300); }
.nav-btn .badge { margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--sun-400); color: var(--lagoon-900); font-size: 12px; font-weight: 800; display: grid; place-items: center; }
.admin-main { min-width: 0; }
.admin-top { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 18px; background: rgba(251, 250, 247, .9); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.admin-top h1 { font-size: 20px; font-weight: 800; letter-spacing: -.02em; }
.admin-body { padding: 18px; max-width: 1240px; }
.mobile-nav { display: flex; gap: 6px; overflow-x: auto; padding: 10px 14px; background: var(--lagoon-900); scrollbar-width: none; }
.mobile-nav::-webkit-scrollbar { display: none; }
.mobile-nav .nav-btn { width: auto; flex: none; padding: 8px 12px; font-size: 13.5px; }
@media (min-width: 1000px) { .mobile-nav { display: none; } }
.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: end; margin-bottom: 16px; }
.filters .field { min-width: 140px; }
.filters .input { min-height: 42px; padding: 8px 12px; }
.seg { display: inline-flex; padding: 4px; border-radius: 12px; background: var(--sand-100); gap: 2px; }
.seg button { border: 0; background: none; padding: 8px 12px; border-radius: 9px; font-weight: 600; font-size: 13.5px; cursor: pointer; color: var(--ink-500); }
.seg button[aria-pressed="true"] { background: #fff; color: var(--ink-900); box-shadow: var(--shadow-sm); }
.grid-2 { display: grid; gap: 16px; }
.grid-2 > * { min-width: 0; }
@media (min-width: 1000px) { .grid-2 { grid-template-columns: 1.4fr 1fr; } }
.table-wrap { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--line); background: #fff; }
table.t { width: 100%; border-collapse: collapse; font-size: 14px; }
table.t th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-500); font-weight: 700; padding: 12px 14px; background: var(--sand-50); border-bottom: 1px solid var(--line); white-space: nowrap; }
table.t td { padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.t tr:last-child td { border-bottom: 0; }
table.t td.r, table.t th.r { text-align: right; }
table.t tbody tr:hover { background: var(--aqua-50); }
.bars { display: flex; align-items: flex-end; gap: 6px; height: 200px; padding-top: 10px; }
.bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 0; height: 100%; justify-content: flex-end; }
.bar-stack { width: 100%; max-width: 38px; display: flex; flex-direction: column-reverse; border-radius: 8px 8px 3px 3px; overflow: hidden; background: var(--sand-100); min-height: 3px; transition: height .5s var(--ease); }
.bar-stack .cash { background: var(--sun-400); }
.bar-stack .transfer { background: var(--lagoon-600); }
.bar-col .lbl { font-size: 11px; color: var(--ink-400); white-space: nowrap; }
.legend { display: flex; gap: 14px; font-size: 12.5px; color: var(--ink-500); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.alert-item { display: flex; gap: 12px; padding: 14px; border-radius: 14px; background: #fff; border: 1px solid var(--line); border-left: 4px solid var(--ink-300); }
.alert-item + .alert-item { margin-top: 10px; }
.alert-item.high { border-left-color: var(--bad); }
.alert-item.medium { border-left-color: var(--sun-500); }
.alert-item.info { border-left-color: var(--lagoon-600); }
.alert-item svg { width: 22px; height: 22px; flex: none; }
.empty { text-align: center; padding: 40px 20px; color: var(--ink-400); }
.empty svg { width: 44px; height: 44px; margin: 0 auto 10px; opacity: .6; }
.skeleton { background: linear-gradient(90deg, var(--sand-100), #fff, var(--sand-100)); background-size: 200% 100%; animation: sk 1.2s infinite; border-radius: 12px; min-height: 80px; }
@keyframes sk { to { background-position: -200% 0; } }
.fade-in { animation: fadein .35s var(--ease); }
@keyframes fadein { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

@media print {
  body { background: #fff; }
  .no-print, .fab-contact, .tabbar, .app-top, .site-head, #toasts { display: none !important; }
  .ticket, .print-ticket { break-inside: avoid; box-shadow: none; border: 1px solid #999; }
}

.img-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; }
.img-slot { padding: 10px; border: 1px solid var(--line); border-radius: 16px; background: #fff; }
.img-prev { aspect-ratio: 4 / 3; border-radius: 12px; background: var(--sand-100) center / cover no-repeat; display: grid; place-items: center; }
.img-slot label.btn { cursor: pointer; }
