/* DinePlay Desk — Theme A "Counter" (matches the POS) with automatic dark mode ("Night shift"). */
:root {
  --bg: #EFE6D8; --panel: #FBF7F0; --ink: #0F2A2E; --muted: #5E6E6A; --line: #DDD1BE;
  --side: #0F2A2E; --sideInk: #EFE6D8; --sideMuted: #9FB5B1; --accent: #E8A33D; --accentInk: #0F2A2E;
  --good: #4C7A5E; --bad: #B23A3A; --chip: #F3E6CF; --game: #9C8A4C; --shadow: 0 1px 0 rgba(15, 42, 46, .04);
  --head: 'Fraunces', Georgia, serif; --body: 'Manrope', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --radius: 14px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0E1416; --panel: #162024; --ink: #ECE7DE; --muted: #8FA09C; --line: #24323A;
    --side: #0A0F11; --sideInk: #ECE7DE; --sideMuted: #6F817D; --accent: #F0B24A; --accentInk: #14100A;
    --good: #6FBF8E; --bad: #E06A5F; --chip: #1E2B30; --game: #B9AE6E; --shadow: none;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--body); font-size: 15px; }
body { min-height: 100vh; -webkit-font-smoothing: antialiased; }
button, input, select { font: inherit; color: inherit; }
a { color: inherit; }
.boot { display: grid; place-items: center; height: 100vh; font: 700 28px var(--head); color: var(--muted); }

/* ---------- shell */
.shell { display: grid; grid-template-columns: 220px 1fr; min-height: 100vh; }
.side { background: var(--side); color: var(--sideInk); padding: 20px 14px; position: sticky; top: 0; height: 100vh;
        display: flex; flex-direction: column; }
.brand { font: 700 21px var(--head); display: flex; align-items: center; gap: 9px; margin: 0 6px 24px; }
.brand .mark { width: 28px; height: 28px; border-radius: 8px; background: var(--accent); color: var(--accentInk);
               display: grid; place-items: center; font: 800 15px var(--body); }
.nav a { display: flex; align-items: center; justify-content: space-between; padding: 10px 12px; border-radius: 10px;
         color: var(--sideMuted); text-decoration: none; font-weight: 600; margin-bottom: 2px; }
.nav a:hover { color: var(--sideInk); }
.nav a.on { background: var(--accent); color: var(--accentInk); }
.side .venue { margin-top: auto; padding: 12px; border-radius: 10px; font-size: 12px; color: var(--sideMuted);
               border: 1px solid rgba(159, 181, 177, .3); }
.side .venue strong { display: block; color: var(--sideInk); font-size: 13px; margin-bottom: 2px; }
.side .venue button { margin-top: 10px; background: none; border: 1px solid rgba(159, 181, 177, .4); color: var(--sideInk);
                      border-radius: 8px; padding: 6px 10px; cursor: pointer; font-size: 12px; font-weight: 600; }

main { padding: 24px 28px 40px; min-width: 0; max-width: 1240px; }
.tabbar { display: none; }

.top { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.top h1 { font: 700 27px var(--head); margin: 0; }
.top p { margin: 4px 0 0; color: var(--muted); font-size: 13px; }
.top .tools { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

.live { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; color: var(--good);
        background: color-mix(in srgb, var(--good) 14%, transparent); padding: 6px 10px; border-radius: 999px; }
.live i { width: 8px; height: 8px; border-radius: 50%; background: var(--good); }
.live.off { color: var(--bad); background: color-mix(in srgb, var(--bad) 14%, transparent); }
.live.off i { background: var(--bad); }

/* ---------- cards & kpis */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; min-width: 0;
        box-shadow: var(--shadow); }
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 14px; }
.kpi small { color: var(--muted); font-size: 12px; font-weight: 600; }
.kpi .v { font: 800 26px var(--body); margin-top: 4px; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi .d { font-size: 12px; font-weight: 700; color: var(--muted); margin-top: 2px; }
.kpi .d.up { color: var(--good); } .kpi .d.down { color: var(--bad); }
.kpi.hero { background: var(--accent); color: var(--accentInk); border-color: transparent; }
.kpi.hero small, .kpi.hero .d { color: inherit; opacity: .85; }
.modes { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.modes span { font-size: 12px; font-weight: 700; background: var(--chip); border-radius: 8px; padding: 3px 8px; }

.grid2 { display: grid; grid-template-columns: 1.25fr 1fr; gap: 14px; }
.stack { display: grid; gap: 14px; align-content: start; }
h2 { font: 700 15px var(--body); margin: 0 0 12px; display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
h2 span { font-weight: 600; color: var(--muted); font-size: 12px; }

/* ---------- bars */
.bars .row { display: grid; grid-template-columns: 130px 1fr 84px; gap: 10px; align-items: center; font-size: 13px; margin: 8px 0; }
.bars .name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bars .tag { font-size: 10px; color: var(--muted); display: block; font-weight: 600; }
.bars .track { height: 10px; background: var(--chip); border-radius: 999px; overflow: hidden; }
.bars .fill { height: 100%; background: var(--accent); border-radius: 999px; min-width: 2px; }
.bars .fill.game { background: var(--game); }
.bars .amt { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }
.bars .row.zero { opacity: .5; }

.hours { display: grid; grid-template-columns: repeat(24, 1fr); gap: 3px; align-items: end; height: 90px; margin-top: 6px; }
.hours div { background: var(--accent); border-radius: 3px 3px 0 0; min-height: 2px; opacity: .9; }
.hours div.empty { background: var(--chip); }
.hours-axis { display: flex; justify-content: space-between; font-size: 10px; color: var(--muted); margin-top: 4px; }

/* ---------- tables */
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { text-align: left; color: var(--muted); font-weight: 600; font-size: 11px; text-transform: uppercase; letter-spacing: .05em;
     padding: 0 8px 8px 0; border-bottom: 1px solid var(--line); }
td { padding: 10px 8px 10px 0; border-bottom: 1px solid var(--line); font-variant-numeric: tabular-nums; }
tr:last-child td { border-bottom: none; }
td.r, th.r { text-align: right; padding-right: 0; }
tr.click { cursor: pointer; }
tr.click:hover td { background: color-mix(in srgb, var(--accent) 7%, transparent); }
.pill { font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: var(--chip); white-space: nowrap; }
.pill.disc { background: color-mix(in srgb, var(--bad) 14%, transparent); color: var(--bad); }
.pill.ok { background: color-mix(in srgb, var(--good) 16%, transparent); color: var(--good); }
.pill.off { background: color-mix(in srgb, var(--bad) 14%, transparent); color: var(--bad); }
.muted { color: var(--muted); }
.empty-state { color: var(--muted); font-size: 13px; padding: 18px 0; text-align: center; }

/* ---------- counters */
.ctr { display: flex; justify-content: space-between; align-items: center; gap: 10px; font-size: 13px; padding: 11px 12px;
       background: var(--chip); border-radius: 10px; margin-top: 8px; }
.ctr b { font-weight: 700; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; background: var(--good); }
.dot.off { background: var(--bad); }

/* ---------- forms & buttons */
.btn { font-weight: 700; font-size: 13px; padding: 9px 14px; border-radius: 10px; border: 1px solid var(--line);
       background: var(--panel); color: var(--ink); cursor: pointer; }
.btn:hover { border-color: var(--muted); }
.btn.p { background: var(--accent); color: var(--accentInk); border-color: transparent; }
.btn.danger { color: var(--bad); }
.btn.sm { padding: 6px 10px; font-size: 12px; }
.btn:disabled { opacity: .5; cursor: default; }
input, select { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 9px 12px; min-width: 0; }
input:focus, select:focus, .btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
label.f { display: grid; gap: 5px; font-size: 12px; font-weight: 700; color: var(--muted); }
label.f input, label.f select { font-size: 15px; color: var(--ink); font-weight: 500; }
.form { display: grid; gap: 12px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.err { color: var(--bad); font-size: 13px; font-weight: 600; min-height: 1em; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.filters input[type=search] { flex: 1; min-width: 160px; }

/* ---------- login */
.login { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.login .card { width: min(380px, 100%); padding: 28px; }
.login .brand { color: var(--ink); margin: 0 0 6px; font-size: 26px; }
.login p { color: var(--muted); margin: 0 0 22px; font-size: 14px; }
.login .btn { width: 100%; padding: 12px; font-size: 15px; }

/* ---------- modal */
.overlay { position: fixed; inset: 0; background: rgba(8, 18, 20, .55); display: grid; place-items: center; padding: 16px; z-index: 50; }
.modal { background: var(--panel); border-radius: 16px; width: min(560px, 100%); max-height: 90vh; overflow: auto; padding: 22px;
         border: 1px solid var(--line); }
.modal h3 { font: 700 20px var(--head); margin: 0 0 4px; }
.modal .sub { color: var(--muted); font-size: 13px; margin-bottom: 14px; }
.modal .actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 18px; flex-wrap: wrap; }
.totals { margin-top: 10px; display: grid; gap: 4px; font-size: 13px; }
.totals div { display: flex; justify-content: space-between; }
.totals .grand { font-weight: 800; font-size: 16px; border-top: 1px solid var(--line); padding-top: 8px; margin-top: 4px; }
.bigcode { font: 800 34px ui-monospace, 'SF Mono', Consolas, monospace; letter-spacing: .12em; text-align: center; padding: 18px;
           background: var(--chip); border-radius: 12px; margin: 10px 0; user-select: all; }
.steps { font-size: 13px; color: var(--muted); padding-left: 18px; margin: 8px 0 0; }
.steps li { margin: 4px 0; }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--ink); color: var(--bg);
         padding: 10px 16px; border-radius: 10px; font-weight: 600; font-size: 14px; z-index: 60; }

/* ---------- phone / small screens */
@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .side { display: none; }
  main { padding: 16px 14px calc(84px + env(safe-area-inset-bottom)); }
  .top h1 { font-size: 22px; }
  .kpis { grid-template-columns: 1fr 1fr; gap: 10px; }
  .kpi .v { font-size: 21px; }
  .grid2 { grid-template-columns: 1fr; }
  .bars .row { grid-template-columns: 100px 1fr 70px; }
  .hide-sm { display: none; }
  .form-row { grid-template-columns: 1fr; }
  .top .tools { width: 100%; }
  .top .tools input[type=date] { flex: 1; }
  .top .tools .live { order: -1; width: 100%; justify-content: center; }
  .tabbar { display: flex; justify-content: space-around; position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
            background: var(--panel); border-top: 1px solid var(--line); padding: 8px 4px calc(8px + env(safe-area-inset-bottom)); }
  .tabbar a { text-decoration: none; font-size: 11px; font-weight: 700; color: var(--muted); display: grid; justify-items: center; gap: 3px;
              padding: 4px 8px; }
  .tabbar a.on { color: var(--ink); }
  .tabbar a svg { width: 22px; height: 22px; }
  .tabbar a.on svg { color: var(--accent); }
  .mobile-venue { display: block !important; }
}
.mobile-venue { display: none; }

/* setup screens */
label.check { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; color: var(--ink); align-self: end; padding-bottom: 10px; }
label.check input { width: 18px; height: 18px; accent-color: var(--accent); }
.small { font-size: 12px; }
.card .actions { display: flex; justify-content: flex-end; gap: 8px; }
a.btn { text-decoration: none; display: inline-block; }
a.ctr { text-decoration: none; color: inherit; }
a.ctr svg { width: 18px; height: 18px; vertical-align: -4px; color: var(--accent); }
.pill.role-owner { background: color-mix(in srgb, var(--accent) 30%, transparent); }
.pill.role-manager { background: color-mix(in srgb, var(--good) 18%, transparent); color: var(--good); }
input:disabled { opacity: .6; }
td.r, th.r { padding-left: 14px; }

/* support mode banner (DinePlay staff inside a venue) */
.support-banner { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; align-items: center; margin: -8px 0 16px;
  padding: 10px 14px; border-radius: 12px; background: #2F4A7A; color: #fff; font-size: 13px; }
.support-banner a { color: #fff; font-weight: 700; }

/* ---------- super admin */
.admin-pill { background: #2F4A7A; color: #fff; font-size: 11px; vertical-align: middle; }
.admin-side { background: #10213A; }
.admin-tag { font-size: 10px; font-weight: 800; letter-spacing: .14em; color: #8FA6CF; margin: -14px 6px 18px 45px; }
.section-h { margin: 22px 0 10px; font-size: 16px; }
.vgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; }
.vcard { text-decoration: none; color: inherit; display: grid; gap: 8px; transition: transform .08s, border-color .08s; }
.vcard:hover { transform: translateY(-1px); border-color: var(--accent); }
.vcard.off { opacity: .65; }
.vtop { display: flex; justify-content: space-between; gap: 8px; align-items: flex-start; }
.vnum { font: 800 22px var(--body); }
.warn-t { color: var(--bad); font-weight: 700; }
.daychart { display: flex; align-items: flex-end; gap: 6px; height: 150px; padding-top: 8px; }
.daychart .col { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; height: 100%; gap: 4px; min-width: 0; }
.daychart .bar { width: 100%; max-width: 38px; background: var(--accent); border-radius: 5px 5px 0 0; }
.daychart span { font-size: 10px; color: var(--muted); white-space: nowrap; }
.kv { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.kv:last-child { border-bottom: none; }
.kv > span:last-child { text-align: right; }
details.menu-d { border-bottom: 1px solid var(--line); padding: 8px 0; }
details.menu-d summary { cursor: pointer; font-size: 13px; list-style-position: inside; }
details.menu-d table { margin: 6px 0 2px; }
.credrow { display: flex; justify-content: space-between; gap: 10px; align-items: center; padding: 10px 12px; background: var(--chip); border-radius: 10px; margin-top: 8px; font-size: 14px; }
.credrow .big { font-size: 20px; letter-spacing: .06em; }
.mono { font-family: ui-monospace, 'SF Mono', Consolas, monospace; }
.warn-card { border-color: color-mix(in srgb, var(--bad) 40%, var(--line)); }
textarea { width: 100%; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; font: inherit; color: var(--ink); resize: vertical; }
@media (max-width: 860px) { .admin-tag { display: none; } }

/* stage 4 */
.disc-row { padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.disc-row:last-child { border-bottom: none; }
.disc-row.click { cursor: pointer; }
.approval { display: flex; justify-content: space-between; gap: 12px; align-items: center; flex-wrap: wrap; padding: 12px; border-radius: 10px; background: var(--chip); margin-top: 8px; }
.ok-t { color: var(--good); }
.nav .count { background: var(--bad); color: #fff; border-radius: 999px; font-size: 11px; padding: 1px 7px; }

/* sign-up + get started */
.login .alt { margin: 18px 0 0; text-align: center; font-size: 14px; }
.login .alt a { color: var(--accent, inherit); font-weight: 700; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.setup { margin-bottom: 14px; }
.setup-h { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 10px; font-size: 16px; }
.setup ol { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.setup li a { display: flex; gap: 10px; align-items: center; padding: 12px; border: 1px solid var(--line); border-radius: 10px; color: inherit; text-decoration: none; height: 100%; }
.setup li a:hover { border-color: var(--ink); }
.setup li small { display: block; color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.setup .tick { flex: none; width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--line); display: grid; place-items: center; font-size: 13px; font-weight: 800; }
.setup li.ok .tick { background: var(--good, #1f8a4c); border-color: var(--good, #1f8a4c); color: #fff; }
.setup li.ok b { color: var(--muted); }
.setup .go { margin-left: auto; color: var(--muted); }
@media (max-width: 900px) { .setup ol { grid-template-columns: 1fr; } }
.logincard { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 12px 0 16px; padding: 14px; border: 1px dashed var(--line); border-radius: 10px; }
.logincard small { display: block; color: var(--muted); font-size: 12px; }
.logincard b { font-size: 18px; font-family: ui-monospace, monospace; }
textarea { width: 100%; font: inherit; padding: 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); color: var(--ink); resize: vertical; }
.cat-row td { background: var(--chip); font-weight: 800; font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink); padding-top: 8px; padding-bottom: 8px; }
.showpw { font-size: 13px; color: var(--muted); margin-top: -4px; }
.pwcell { white-space: nowrap; } .pwval { display: inline-block; min-width: 64px; font-weight: 700; letter-spacing: 1px; }
tr.void td { opacity: .55; } tr.void td:nth-child(2) { opacity: 1; }
