/* D'Sara Pool — the counter desk. Tablet first (landscape or portrait), works on a phone too. */
:root {
  --bg: #eef8fc; --card: #fff; --line: #d7ecf5; --ink: #0c3446; --ink2: #2c5566; --muted: #6b8b99;
  --sea: #0ea5e9; --sea2: #0284c7; --deep: #075985; --sun: #fbbf24; --green: #10b981; --red: #e11d48; --amber: #f59e0b;
  --r: 20px; --fun: 'Fredoka', 'Nunito', system-ui, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font-family: 'Nunito', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif; background: var(--bg); color: var(--ink); -webkit-tap-highlight-color: transparent; }
button { font: inherit; color: inherit; cursor: pointer; }
input, select, textarea { font: inherit; color: inherit; }
.grow { flex: 1; min-width: 0; }
.muted { color: var(--muted); }
.tiny { font-size: 12px; }
[hidden] { display: none !important; }

.boot { position: fixed; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  background: linear-gradient(180deg, #38bdf8, #0369a1); color: #fff; font-family: var(--fun); }
.boot b { font-size: 30px; } .boot span { opacity: .85; }
.boot-ring { width: 70px; height: 70px; border-radius: 50%; border: 14px solid #fb7185; border-top-color: #fff; border-bottom-color: #fff; animation: spin 1.2s linear infinite; }

/* ── Top bar ─────────────────────────────────────────────────────────── */
.top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 14px; padding: 10px max(14px, env(safe-area-inset-left));
  background: linear-gradient(90deg, #075985, #0284c7); color: #fff; box-shadow: 0 2px 12px rgba(7,89,133,.25); }
.brand { display: flex; align-items: center; gap: 10px; }
.brand b { display: block; font: 600 19px var(--fun); }
.brand small { font-weight: 800; opacity: .8; font-variant-numeric: tabular-nums; }
.ring { width: 32px; height: 32px; border-radius: 50%; border: 7px solid #fb7185; position: relative; }
.ring::after { content: ''; position: absolute; inset: -7px; border-radius: 50%; border: 7px solid transparent; border-top-color: #fff; border-bottom-color: #fff; }
.pill { display: inline-flex; align-items: center; gap: 8px; border: 0; border-radius: 999px; padding: 8px 14px; background: rgba(255,255,255,.16); color: #fff; font: 600 14px var(--fun); }
.pill .dot { width: 10px; height: 10px; border-radius: 50%; background: #94a3b8; }
.pill.open .dot { background: #4ade80; box-shadow: 0 0 0 3px rgba(74,222,128,.3); }
.pill.closed { background: rgba(225,29,72,.85); } .pill.closed .dot { background: #fff; }
.inside { display: grid; grid-template-columns: auto 1fr; align-items: center; column-gap: 8px; min-width: 150px; }
.inside-n b { font: 700 28px/1 var(--fun); }
.inside-n small { font-weight: 800; opacity: .8; }
.inside-l { font-size: 12px; font-weight: 800; opacity: .85; line-height: 1.1; }
.inside-bar { grid-column: 1 / -1; height: 5px; background: rgba(255,255,255,.2); border-radius: 4px; margin-top: 4px; overflow: hidden; }
.inside-bar i { display: block; height: 100%; width: 0; background: #4ade80; transition: width .4s, background .4s; }
.inside.full .inside-bar i { background: #fb7185; }
.me { width: 40px; height: 40px; border-radius: 50%; border: 2px solid rgba(255,255,255,.5); background: rgba(255,255,255,.15); color: #fff; font: 700 16px var(--fun); }

.banner { margin: 10px 14px 0; padding: 10px 14px; border-radius: 14px; font-weight: 800; font-size: 14px; }
.banner.warn { background: #fef3c7; color: #92400e; }
.banner.bad { background: #ffe4e6; color: #9f1239; }

/* ── Tabs: down the side on a tablet, along the bottom on a phone ────── */
.tabs { position: fixed; z-index: 15; left: 0; top: 62px; bottom: 0; width: 92px; padding: 12px 8px; display: flex; flex-direction: column; gap: 6px; background: #fff; border-right: 1px solid var(--line); }
.tabs button { position: relative; border: 0; background: none; border-radius: 16px; padding: 10px 4px; display: flex; flex-direction: column; align-items: center; gap: 2px; font: 600 13px var(--fun); color: var(--muted); }
.tabs button.on { background: #e0f2fe; color: var(--deep); }
.tabs .ti { font-size: 24px; }
.badge { position: absolute; top: 4px; right: 12px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px; background: var(--red); color: #fff; font: 700 11px/20px var(--fun); }
main { margin-left: 92px; padding: 16px; padding-bottom: 40px; max-width: 1400px; }
@media (max-width: 760px) {
  .tabs { top: auto; width: auto; right: 0; flex-direction: row; justify-content: space-around; padding: 6px 6px max(6px, env(safe-area-inset-bottom)); border-right: 0; border-top: 1px solid var(--line); }
  .tabs button { flex: 1; padding: 6px 2px; }
  main { margin-left: 0; padding: 12px; padding-bottom: 96px; }
  .top { gap: 10px; } .brand small { display: none; } .inside { min-width: 0; } .inside-l { display: none; }
  .pill { padding: 7px 10px; }
}

/* ── Cards & bits ────────────────────────────────────────────────────── */
.card { background: var(--card); border-radius: var(--r); padding: 16px; box-shadow: 0 1px 0 var(--line), 0 6px 18px rgba(12,52,70,.05); }
.card + .card { margin-top: 14px; }
.h { font: 600 20px var(--fun); margin: 0 0 10px; display: flex; align-items: center; gap: 8px; }
.h small { font: 700 13px 'Nunito', sans-serif; color: var(--muted); }
.row { display: flex; gap: 10px; align-items: center; }
.wrap { flex-wrap: wrap; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; border-radius: 16px; padding: 12px 18px; font: 600 16px var(--fun); background: #e0f2fe; color: var(--deep); text-decoration: none; }
.btn:active { transform: translateY(2px); }
.btn-go { background: linear-gradient(180deg, #34d399, #059669); color: #fff; box-shadow: 0 4px 0 #047857; }
.btn-go:active { box-shadow: 0 1px 0 #047857; }
.btn-sea { background: linear-gradient(180deg, #38bdf8, #0284c7); color: #fff; box-shadow: 0 4px 0 #075985; }
.btn-sun { background: linear-gradient(180deg, #fcd34d, #f59e0b); color: #78350f; box-shadow: 0 4px 0 #b45309; }
.btn-line { background: #fff; border: 2px solid var(--line); }
.btn-red { background: #ffe4e6; color: #9f1239; }
.btn-xl { padding: 18px 22px; font-size: 21px; border-radius: 20px; width: 100%; }
.btn-sm { padding: 7px 12px; font-size: 14px; border-radius: 12px; }
.btn[disabled] { opacity: .55; pointer-events: none; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; font: 700 12px 'Nunito', sans-serif; background: #e0f2fe; color: var(--deep); }
.chip.green { background: #d1fae5; color: #065f46; } .chip.amber { background: #fef3c7; color: #92400e; } .chip.red { background: #ffe4e6; color: #9f1239; } .chip.grey { background: #f1f5f9; color: #475569; }
.empty { text-align: center; padding: 30px 10px; color: var(--muted); font-weight: 700; }
.empty .e { font-size: 44px; }

/* ── Counter screen ──────────────────────────────────────────────────── */
.counter-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 14px; align-items: start; }
@media (max-width: 1020px) { .counter-grid { grid-template-columns: 1fr; } }
.scanbox { background: linear-gradient(135deg, #0ea5e9, #075985); color: #fff; border-radius: 24px; padding: 18px; position: relative; overflow: hidden; }
.scanbox::after { content: ''; position: absolute; width: 220px; height: 220px; border-radius: 50%; border: 36px solid rgba(255,255,255,.08); right: -80px; top: -90px; }
.scanbox h2 { font: 600 22px var(--fun); margin: 0 0 4px; }
.scanbox p { margin: 0 0 14px; opacity: .85; font-weight: 700; font-size: 14px; }
.scan-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; position: relative; z-index: 1; }
.scan-big { display: flex; align-items: center; justify-content: center; gap: 10px; border: 0; border-radius: 18px; padding: 18px 12px; font: 600 19px var(--fun); background: #fff; color: var(--deep); box-shadow: 0 5px 0 rgba(0,0,0,.18); }
.scan-big.walk { background: var(--sun); color: #78350f; }
.scan-big span { font-size: 26px; }
.search { position: relative; margin-top: 12px; z-index: 1; }
.search input { width: 100%; border: 0; border-radius: 16px; padding: 15px 16px 15px 46px; font-weight: 800; font-size: 17px; background: rgba(255,255,255,.95); color: var(--ink); outline: none; }
.search::before { content: '🔍'; position: absolute; left: 16px; top: 50%; transform: translateY(-50%); }
.search input:focus { box-shadow: 0 0 0 4px rgba(251,191,36,.6); }
.wedge { position: relative; z-index: 1; margin-top: 8px; font-size: 12px; font-weight: 800; opacity: .75; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-top: 14px; }
.stat { background: #fff; border-radius: 18px; padding: 12px; box-shadow: 0 1px 0 var(--line); }
.stat small { display: block; font-weight: 800; font-size: 12px; color: var(--muted); }
.stat b { font: 700 26px var(--fun); }
@media (max-width: 560px) { .stats { grid-template-columns: repeat(2, 1fr); } }

.rooms { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.room { position: relative; text-align: left; border: 0; border-radius: 18px; padding: 12px 12px 10px; background: #fff; box-shadow: 0 1px 0 var(--line), 0 4px 10px rgba(12,52,70,.05); border-left: 6px solid #38bdf8; }
.room:active { transform: scale(.98); }
.room b { display: block; font: 600 17px var(--fun); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.room .who { font-weight: 800; font-size: 13px; color: var(--ink2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.room .dots { display: flex; gap: 3px; margin-top: 8px; flex-wrap: wrap; }
.room .dots i { width: 10px; height: 10px; border-radius: 50%; background: #bae6fd; }
.room .dots i.on { background: var(--green); }
.room .u { position: absolute; top: 10px; right: 10px; font: 700 12px var(--fun); color: var(--muted); }
.room.part { border-left-color: var(--green); }
.room.full { border-left-color: #94a3b8; background: #f8fafc; }
.room.unpaid { border-left-color: var(--amber); }
.room.other { border-left-color: #cbd5e1; opacity: .85; }

/* ── Sheets (the admit / sell panels) ────────────────────────────────── */
.shade { position: fixed; inset: 0; z-index: 40; background: rgba(7,40,60,.45); display: flex; align-items: flex-end; justify-content: center; animation: fade .15s; }
@media (min-width: 761px) { .shade { align-items: center; } }
.sheet { width: 100%; max-width: 620px; max-height: 94vh; overflow: auto; background: #fff; border-radius: 28px 28px 0 0; padding: 18px 18px max(18px, env(safe-area-inset-bottom)); animation: up .2s ease-out; }
@media (min-width: 761px) { .sheet { border-radius: 28px; } }
.sheet-h { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 12px; }
.sheet-h .big { font: 600 25px/1.15 var(--fun); }
.sheet-h .x { border: 0; background: #f1f5f9; width: 40px; height: 40px; border-radius: 50%; font-size: 18px; flex: none; }
.meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.allow { display: flex; align-items: center; gap: 14px; background: #f0f9ff; border-radius: 18px; padding: 12px 14px; margin: 10px 0; }
.allow .n { font: 700 34px/1 var(--fun); color: var(--deep); }
.allow .seats { display: flex; gap: 5px; flex-wrap: wrap; }
.allow .seats i { width: 18px; height: 18px; border-radius: 50%; background: #bae6fd; }
.allow .seats i.used { background: #94a3b8; }
.allow .seats i.now { background: var(--green); box-shadow: 0 0 0 3px #a7f3d0; }
.steppers { display: grid; gap: 8px; margin: 10px 0; }
.stepper { display: flex; align-items: center; gap: 12px; background: #f8fbfd; border: 2px solid var(--line); border-radius: 18px; padding: 8px 10px 8px 14px; }
.stepper .e { font-size: 28px; }
.stepper b { display: block; font: 600 18px var(--fun); }
.stepper small { font-weight: 800; color: var(--muted); }
.stepper button { width: 54px; height: 54px; border-radius: 16px; border: 0; font: 700 28px/1 var(--fun); background: #fff; box-shadow: 0 3px 0 var(--line); color: var(--deep); }
.stepper button.plus { background: var(--sea); color: #fff; box-shadow: 0 3px 0 var(--sea2); }
.stepper output { min-width: 40px; text-align: center; font: 700 30px var(--fun); }
.calc { display: flex; justify-content: space-between; gap: 10px; align-items: center; padding: 12px 14px; border-radius: 16px; background: #ecfdf5; font-weight: 800; margin: 10px 0; }
.calc.pay { background: #fffbeb; }
.calc .amt { font: 700 28px var(--fun); }
.methods { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 10px 0; }
.methods button { border: 2px solid var(--line); background: #fff; border-radius: 16px; padding: 12px 6px; font: 600 16px var(--fun); }
.methods button.on { border-color: var(--sea); background: #e0f2fe; color: var(--deep); }
.methods button span { display: block; font-size: 24px; }
.cash { display: grid; gap: 8px; margin: 8px 0; }
.cash-quick { display: flex; gap: 6px; flex-wrap: wrap; }
.cash-quick button { border: 0; border-radius: 12px; padding: 9px 12px; background: #f1f5f9; font: 600 15px var(--fun); }
.field { display: grid; gap: 5px; margin: 8px 0; }
.field span { font-weight: 800; font-size: 13px; color: var(--muted); }
.field input, .field select, .field textarea { width: 100%; padding: 12px 14px; border-radius: 14px; border: 2px solid var(--line); background: #fff; font-weight: 700; font-size: 16px; outline: none; }
.field input:focus, .field textarea:focus, .field select:focus { border-color: var(--sea); }
.change { font: 700 22px var(--fun); color: #047857; }
.toggle { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 14px; background: #f8fafc; font-weight: 800; margin: 8px 0; cursor: pointer; }
.toggle input { width: 22px; height: 22px; accent-color: var(--sea); }
.warnbox { padding: 12px 14px; border-radius: 14px; background: #fef3c7; color: #92400e; font-weight: 800; margin: 8px 0; }
.errbox { padding: 12px 14px; border-radius: 14px; background: #ffe4e6; color: #9f1239; font-weight: 800; margin: 8px 0; }

/* ── Welcome burst ───────────────────────────────────────────────────── */
.welcome { position: fixed; inset: 0; z-index: 60; display: flex; align-items: center; justify-content: center; background: rgba(5,150,105,.92); color: #fff; text-align: center; animation: fade .15s; }
.welcome.paid { background: rgba(2,132,199,.94); }
.welcome .tick { width: 120px; height: 120px; border-radius: 50%; background: #fff; color: #059669; font: 700 76px/120px var(--fun); margin: 0 auto 14px; animation: pop .45s; }
.welcome h2 { font: 700 40px var(--fun); margin: 0; }
.welcome p { font-size: 19px; font-weight: 800; margin: 6px 0 0; opacity: .95; }
.welcome .chg { margin-top: 14px; display: inline-block; background: #fff; color: #065f46; border-radius: 18px; padding: 10px 20px; font: 700 30px var(--fun); }
.welcome .acts { margin-top: 20px; display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.welcome .acts .btn { background: rgba(255,255,255,.2); color: #fff; }
.welcome .drop { position: absolute; width: 14px; height: 14px; border-radius: 50%; background: rgba(255,255,255,.8); animation: drop 1s ease-out forwards; }

/* ── Lists (log, online) ─────────────────────────────────────────────── */
.list { display: grid; gap: 8px; }
.item { display: flex; gap: 12px; align-items: center; background: #fff; border-radius: 16px; padding: 10px 12px; box-shadow: 0 1px 0 var(--line); }
.item.void { opacity: .5; text-decoration: line-through; }
.item .k { font-size: 26px; width: 34px; text-align: center; }
.item b { font: 600 16px var(--fun); }
.item .time { font: 700 14px var(--fun); color: var(--muted); min-width: 64px; }
.item .ppl { font: 700 18px var(--fun); white-space: nowrap; }
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.toolbar input[type=date] { padding: 10px 12px; border-radius: 12px; border: 2px solid var(--line); font-weight: 800; background: #fff; }

/* ── Report ──────────────────────────────────────────────────────────── */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.kpi { background: #fff; border-radius: 18px; padding: 14px; box-shadow: 0 1px 0 var(--line); }
.kpi small { display: block; font-weight: 800; font-size: 12px; color: var(--muted); }
.kpi b { font: 700 28px var(--fun); }
.bars { display: flex; align-items: flex-end; gap: 6px; height: 140px; padding-top: 10px; }
.bars div { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 4px; height: 100%; }
.bars i { width: 100%; max-width: 38px; background: linear-gradient(180deg, #38bdf8, #0284c7); border-radius: 8px 8px 3px 3px; min-height: 3px; }
.bars span { font: 700 11px var(--fun); color: var(--muted); }
.bars em { font: 700 11px var(--fun); font-style: normal; color: var(--deep); }
table.t { width: 100%; border-collapse: collapse; font-size: 14px; }
table.t th { text-align: left; font-size: 12px; color: var(--muted); font-weight: 800; padding: 8px 6px; border-bottom: 2px solid var(--line); white-space: nowrap; }
table.t td { padding: 8px 6px; border-bottom: 1px solid #eef5f8; font-weight: 700; white-space: nowrap; }
table.t td.n, table.t th.n { text-align: right; font-variant-numeric: tabular-nums; }
table.t tr.sum td { border-top: 2px solid var(--line); font-weight: 800; }
.scroll-x { overflow-x: auto; }
.settings-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 6px 14px; }

/* ── Scanner ─────────────────────────────────────────────────────────── */
.scanner { position: fixed; inset: 0; z-index: 70; background: #000; }
.scanner video { width: 100%; height: 100%; object-fit: cover; }
.scanner .frame-wrap { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; }
.scanner .frame { width: min(70vw, 320px); aspect-ratio: 1; border-radius: 28px; box-shadow: 0 0 0 9999px rgba(0,0,0,.5); border: 4px solid #fff; position: relative; overflow: hidden; }
.scanner .line { position: absolute; left: 0; right: 0; height: 3px; background: #4ade80; box-shadow: 0 0 14px #4ade80; animation: scanline 1.8s ease-in-out infinite; }
.scanner .close { position: absolute; top: max(16px, env(safe-area-inset-top)); right: 16px; width: 48px; height: 48px; border-radius: 50%; border: 0; background: rgba(255,255,255,.2); color: #fff; font-size: 22px; }
.scanner .hint { position: absolute; bottom: max(30px, env(safe-area-inset-bottom)); left: 0; right: 0; text-align: center; color: #fff; font: 600 18px var(--fun); }
.scanner .msg { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: #fff; text-align: center; padding: 30px; }

.toast { position: fixed; left: 50%; bottom: 100px; transform: translateX(-50%) translateY(20px); opacity: 0; z-index: 90; background: #0c3446; color: #fff; padding: 12px 18px; border-radius: 14px; font-weight: 800; transition: all .2s; pointer-events: none; max-width: 90vw; text-align: center; }
.toast.on { opacity: 1; transform: translateX(-50%); }
.toast.bad { background: var(--red); }

.menu { position: fixed; top: 64px; right: 12px; z-index: 50; background: #fff; border-radius: 18px; padding: 8px; box-shadow: 0 14px 40px rgba(12,52,70,.25); min-width: 240px; }
.menu .who { padding: 10px 12px; border-bottom: 1px solid var(--line); margin-bottom: 6px; }
.menu button, .menu a { display: flex; width: 100%; align-items: center; gap: 10px; border: 0; background: none; padding: 11px 12px; border-radius: 12px; font-weight: 800; text-decoration: none; color: var(--ink); text-align: left; }
.menu button:hover, .menu a:hover { background: #f0f9ff; }

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes fade { from { opacity: 0; } }
@keyframes up { from { transform: translateY(40px); opacity: 0; } }
@keyframes pop { 0% { transform: scale(.3); } 70% { transform: scale(1.1); } }
@keyframes drop { to { transform: translate(var(--dx), var(--dy)) scale(.3); opacity: 0; } }
@keyframes scanline { 0%, 100% { top: 8%; } 50% { top: 90%; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; } }
