/* ================= Goche brand fonts (self-hosted, SIL OFL; licences in /assets/fonts) ================= */
@font-face { font-family: "Quicksand"; font-style: normal; font-display: swap; font-weight: 300 700; src: url(fonts/quicksand-latin-wght-normal.woff2) format("woff2-variations"), url(fonts/quicksand-latin-wght-normal.woff2) format("woff2");
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: "Quicksand"; font-style: normal; font-display: swap; font-weight: 300 700; src: url(fonts/quicksand-latin-ext-wght-normal.woff2) format("woff2-variations"), url(fonts/quicksand-latin-ext-wght-normal.woff2) format("woff2");
  unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: "Source Sans 3"; font-style: normal; font-display: swap; font-weight: 200 900; src: url(fonts/source-sans-3-latin-wght-normal.woff2) format("woff2-variations"), url(fonts/source-sans-3-latin-wght-normal.woff2) format("woff2");
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: "Source Sans 3"; font-style: normal; font-display: swap; font-weight: 200 900; src: url(fonts/source-sans-3-latin-ext-wght-normal.woff2) format("woff2-variations"), url(fonts/source-sans-3-latin-ext-wght-normal.woff2) format("woff2");
  unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C4,U+2113,U+2C60-2C7F,U+A720-A7FF; }

/* ================= tokens ================= */
:root {
  color-scheme: light;
  /* brand + status */
  /* Goche: PRIMARY_FILL #347A75 for filled surfaces with white text, PRIMARY #469A96 for accents */
  --teal: #347a75; --teal-2: #469a96; --teal-bg: #e9f3f2; --teal-line: #c5dedb; --on-teal: #fff; --on-teal-bg: #204544;
  --brand-gradient: linear-gradient(90deg, #05a696 0%, #67308c 100%);
  --font-head: "Quicksand", system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
  --font-body: "Source Sans 3", system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
  --ok: #1f8a4c; --ok-bg: #e3f5ea; --warn: #b4531c; --warn-bg: #fdeede; --bad: #b3261e; --bad-bg: #fbe4e2;
  /* surfaces + text */
  --bg: #f1f4f3; --surface: #fff; --surface-2: #f6f9f8; --surface-press: #e9f3f2;
  --ink: #1c1b1f; --muted: #49545b; --line: #dde3e2; --field-line: #a9b4b8;
  --bar: #347a75; --toast: #202a30; --backdrop: rgba(16, 24, 32, .45);
  /* tier chips: background / text, tier card edge */
  /* guest tiers use the Goche secondary palette: purple, indigo, blue, bright teal, neutral */
  --vvip-bg: #efe4f7; --vvip: #67308c; --vvip-edge: #67308c;
  --vip-bg: #e5e6f4; --vip: #3f438c;
  --ext-bg: #ddeef6; --ext: #0378a6;
  --sup-bg: #d9f2ef; --sup: #037a6e;
  --int-bg: #eceeef; --int: #55606e;
  /* shape + size: one radius, three control heights, used by every button, tab and field */
  /* Material shape scale: small 8 for controls, medium 12 for cards, extra-large 28 for dialogs */
  --radius: 8px; --radius-lg: 12px; --radius-xl: 28px;
  --h: 44px; --h-sm: 36px; --h-lg: 56px;
  /* motion + depth */
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ring: 0 0 0 3px rgba(52, 122, 117, .3);
  /* Material elevation 1 (cards) and 5 (dialogs), softened */
  --shadow-1: 0 1px 2px rgba(0, 0, 0, .12), 0 1px 3px 1px rgba(0, 0, 0, .06);
  --shadow-2: 0 8px 12px 6px rgba(0, 0, 0, .12), 0 4px 4px rgba(0, 0, 0, .2);
  --panel-border: transparent;
  font-family: var(--font-body);
}
/* dark: near-black background so OLED phone screens draw little power */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --teal: #4fa9a2; --teal-2: #5fbab3; --teal-bg: #12302d; --teal-line: #24524e; --on-teal: #06201e;
    --ok: #5fd08f; --ok-bg: #0f2e1d; --warn: #f0a46b; --warn-bg: #36200f; --bad: #f2867c; --bad-bg: #3a1513;
    --bg: #000; --surface: #111618; --surface-2: #171e20; --surface-press: #1d2729;
    --ink: #e8eced; --muted: #9aa6ad; --line: #263033; --field-line: #3a474b;
    --bar: #0d1f1d; --toast: #263235; --backdrop: rgba(0, 0, 0, .65);
    --vvip-bg: #2c1a38; --vvip: #d4a6f2; --vvip-edge: #b77fe0;
    --vip-bg: #1d1f3d; --vip: #aeb2f4;
    --ext-bg: #0b2a38; --ext: #6cc6ef;
    --sup-bg: #08302c; --sup: #4fd8c8;
    --int-bg: #22282d; --int: #aeb8c1;
    --on-teal-bg: #bfe6e2; --panel-border: var(--line);
    --ring: 0 0 0 3px rgba(95, 186, 179, .35);
    --shadow-1: 0 0 0 1px rgba(255, 255, 255, .02);
    --shadow-2: 0 12px 40px rgba(0, 0, 0, .6);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --teal: #4fa9a2; --teal-2: #5fbab3; --teal-bg: #12302d; --teal-line: #24524e; --on-teal: #06201e;
  --ok: #5fd08f; --ok-bg: #0f2e1d; --warn: #f0a46b; --warn-bg: #36200f; --bad: #f2867c; --bad-bg: #3a1513;
  --bg: #000; --surface: #111618; --surface-2: #171e20; --surface-press: #1d2729;
  --ink: #e8eced; --muted: #9aa6ad; --line: #263033; --field-line: #3a474b;
  --bar: #0d1f1d; --toast: #263235; --backdrop: rgba(0, 0, 0, .65);
  --vvip-bg: #2c1a38; --vvip: #d4a6f2; --vvip-edge: #b77fe0;
  --vip-bg: #1d1f3d; --vip: #aeb2f4;
  --ext-bg: #0b2a38; --ext: #6cc6ef;
  --sup-bg: #08302c; --sup: #4fd8c8;
  --int-bg: #22282d; --int: #aeb8c1;
  --on-teal-bg: #bfe6e2; --panel-border: var(--line);
  --ring: 0 0 0 3px rgba(95, 186, 179, .35);
  --shadow-1: 0 0 0 1px rgba(255, 255, 255, .02);
  --shadow-2: 0 12px 40px rgba(0, 0, 0, .6);
}

/* ================= base ================= */
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font-body); font-size: 16px; line-height: 1.5; letter-spacing: .1px; -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; }
h1, h2, h3, .brand, .stat b, .counter .big, .card h2 { font-family: var(--font-head); }
h1, h2, h3 { margin: 0 0 .5rem; line-height: 1.25; font-weight: 600; }
h1 { font-size: 1.75rem; } h2 { font-size: 1.375rem; }
h3 { font-size: 1.125rem; color: var(--ink); margin-top: 1.5rem; font-weight: 600; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--teal); }
[hidden] { display: none !important; }
.muted { color: var(--muted); }
.mono, td.mono { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .85rem; }
td, .tiers, .results .sub, .stat b, .counter .big { font-variant-numeric: tabular-nums; }

/* ================= header bar ================= */
.bar { background: var(--bar); color: #fff; padding: .7rem 1rem; border-bottom: 4px solid transparent; border-image: var(--brand-gradient) 1; display: flex; align-items: center; justify-content: space-between; gap: 1rem; position: sticky; top: 0; z-index: 5; }
.brand { font-weight: 700; font-size: 1.1rem; min-width: 0; letter-spacing: .2px; }
.brand span { font-weight: 500; opacity: .9; }
.bar .who { font-size: .9rem; display: flex; gap: .8rem; align-items: center; }
.bar .who > * { white-space: nowrap; }
.bar a, .linkbtn { color: #fff; background: none; border: 0; text-decoration: underline; cursor: pointer; padding: 0; }
.themebtn { display: inline-grid; place-items: center; width: var(--h-sm); height: var(--h-sm); border-radius: var(--radius); border: 1px solid rgba(255, 255, 255, .35); background: transparent; color: #fff; cursor: pointer; padding: 0; transition: transform 160ms var(--ease-out), background-color 150ms ease; }
.themebtn svg { width: 18px; height: 18px; }
.themebtn:active { transform: scale(.94); }
.themebtn.floating { position: fixed; top: .8rem; right: .8rem; color: var(--ink); border-color: var(--line); background: var(--surface); }
@media (max-width: 480px) {
  .bar { padding: .5rem .8rem; }
  .brand { font-size: .95rem; }
  .bar .who { gap: .6rem; font-size: .85rem; }
}

/* ================= buttons: one radius, three heights ================= */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  min-height: var(--h); padding: 0 1.1rem; border: 2px solid transparent; border-radius: var(--radius);
  background: var(--teal); color: var(--on-teal); font-family: var(--font-body); font-size: .9375rem; font-weight: 600; letter-spacing: .1px; line-height: 1.1;
  text-decoration: none; white-space: nowrap; cursor: pointer; user-select: none;
  transition: transform 160ms var(--ease-out), filter 150ms ease, background-color 150ms ease, border-color 150ms ease;
}
.btn:active:not(:disabled) { transform: scale(.97); }
.btn:disabled { opacity: .5; cursor: default; }
.btn.small { min-height: var(--h-sm); padding: 0 .8rem; font-size: .875rem; }
.btn.big { min-height: var(--h-lg); padding: 0 1.4rem; font-family: var(--font-head); font-size: 1.3rem; font-weight: 700; letter-spacing: .5px; width: 100%; background: var(--ok); }
.btn.ghost { background: var(--surface); color: var(--teal); border-color: var(--teal); }
.btn.danger { background: var(--bad); color: #fff; }
:root[data-theme="dark"] .btn.danger { color: #1a0605; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .btn.danger { color: #1a0605; } }
.btn.big { color: #fff; }
:root[data-theme="dark"] .btn.big { color: #04170c; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .btn.big { color: #04170c; } }

/* ================= fields: same radius and heights as buttons ================= */
.f + input, .f + select, .f + textarea, input.fi, select.fi, textarea.fi, .filters input, .filters select, .gtools input, .searchrow input[type=search] {
  min-height: var(--h); padding: 0 .8rem; border: 1px solid var(--field-line); border-radius: var(--radius); background: var(--surface); color: var(--ink);
  transition: box-shadow 150ms ease, border-color 150ms ease;
}
.f + input, .f + select, .f + textarea, input.fi, select.fi, textarea.fi { width: 100%; }
.f + input:focus, .f + select:focus, .f + textarea:focus, input.fi:focus, select.fi:focus, .filters input:focus, .filters select:focus, .gtools input:focus, .searchrow input[type=search]:focus {
  outline: none; border-color: var(--teal); box-shadow: var(--ring);
}
label.f { display: block; margin: .6rem 0 .15rem; font-size: .9rem; color: var(--muted); }
.btn:focus-visible, .tab:focus-visible, .seg button:focus-visible, .linkbtn:focus-visible, .themebtn:focus-visible, .results .main:focus-visible, .pager button:focus-visible { outline: none; box-shadow: var(--ring); }
.bar .linkbtn:focus-visible, .bar .themebtn:focus-visible { box-shadow: 0 0 0 3px rgba(255, 255, 255, .5); border-radius: 4px; }

/* ================= staff screen ================= */
main { max-width: 860px; margin: 0 auto; padding: 1rem; }
.counter { background: var(--surface); border-bottom: 1px solid var(--line); padding: .75rem 1rem; box-shadow: var(--shadow-1); }
.counter .inner { max-width: 860px; margin: 0 auto; }
.counter .big { font-size: 1.6rem; font-weight: 700; letter-spacing: -.01em; }
.counter .big small { font-size: .95rem; font-weight: 400; color: var(--muted); margin-left: .5rem; }
.progress { height: 8px; background: var(--line); border-radius: 99px; overflow: hidden; margin: .35rem 0 .45rem; }
.progress > i { display: block; height: 100%; background: var(--brand-gradient); background-size: var(--bar-w, 100%) 100%; width: 0; border-radius: inherit; }
.tiers { display: flex; flex-wrap: wrap; gap: .4rem; font-size: .85rem; }

.searchrow { display: flex; gap: .5rem; flex-wrap: wrap; }
.searchrow input[type=search] { flex: 1 1 260px; min-height: var(--h-lg); padding: 0 1rem; font-size: 1.15rem; border: 2px solid var(--teal-2); }
.searchrow .btn { min-height: var(--h-lg); }
.auto { display: block; margin: .6rem 0; color: var(--muted); font-size: .95rem; }

.cam { position: relative; margin: .8rem 0; background: #000; border-radius: var(--radius-lg); overflow: hidden; }
.cam video { width: 100%; max-height: 52vh; object-fit: cover; display: block; }
.cam .btn { position: absolute; right: .6rem; top: .6rem; }
.cam .aim { position: absolute; inset: 18% 22%; border: 3px solid rgba(255, 255, 255, .85); border-radius: var(--radius-lg); pointer-events: none; }

.card { background: var(--surface); border: 2px solid var(--line); border-left-width: 10px; border-radius: var(--radius-lg); padding: 1rem 1.1rem; margin: 1rem 0; box-shadow: var(--shadow-1); }
.card h2 { font-size: 1.5rem; }
.card .meta { color: var(--muted); margin: .15rem 0; }
.card .banner { margin: .8rem 0 .2rem; padding: .7rem .9rem; border-radius: var(--radius); font-weight: 600; }
.card .btn.big { margin-top: .8rem; }
.banner.ok { background: var(--ok-bg); color: var(--ok); }
.banner.warn { background: var(--warn-bg); color: var(--warn); }
.banner.bad { background: var(--bad-bg); color: var(--bad); }
.card.error { border-color: var(--bad); }
.card.tier-vvip { border-left-color: var(--vvip-edge); } .card.tier-vip { border-left-color: var(--vip); }
.card.tier-external-guest { border-left-color: var(--ext); } .card.tier-supplier { border-left-color: var(--sup); }
.card.tier-internal-guest { border-left-color: var(--int); }

.chip { display: inline-block; font-size: .75rem; font-weight: 600; letter-spacing: .4px; padding: .15rem .6rem; border-radius: 99px; white-space: nowrap; }
.chip.tier-vvip { background: var(--vvip-bg); color: var(--vvip); } .chip.tier-vip { background: var(--vip-bg); color: var(--vip); }
.chip.tier-external-guest { background: var(--ext-bg); color: var(--ext); } .chip.tier-supplier { background: var(--sup-bg); color: var(--sup); }
.chip.tier-internal-guest { background: var(--int-bg); color: var(--int); } .chip.walkin { background: transparent; border: 1px solid var(--warn); color: var(--warn); }

.results { list-style: none; margin: 0; padding: 0; background: var(--surface); border: 1px solid var(--panel-border); border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-1); }
.results:empty { display: none; }
.results li { display: flex; gap: .7rem; align-items: center; padding: .65rem .9rem; border-bottom: 1px solid var(--line); transition: background-color 120ms ease; }
.results li:last-child { border-bottom: 0; }
.results li.in { background: var(--ok-bg); }
.results .main { flex: 1; min-width: 0; cursor: pointer; }
.results .nm { font-weight: 600; }
.results .sub { color: var(--muted); font-size: .88rem; overflow: hidden; text-overflow: ellipsis; }
.results.small li { padding: .4rem .9rem; font-size: .92rem; }
.results li:active:not(.in) { background: var(--surface-press); }
.empty { color: var(--muted); padding: .6rem 0; }

/* ================= toast + dialogs ================= */
.toast { position: fixed; left: 50%; bottom: 1.2rem; transform: translateX(-50%); background: var(--toast); color: #fff; padding: .7rem 1.1rem; border-radius: var(--radius); z-index: 20; max-width: 90vw; box-shadow: var(--shadow-2); transition: transform 220ms var(--ease-out), opacity 220ms var(--ease-out); }
.toast.bad { background: var(--bad); color: #fff; }
:root[data-theme="dark"] .toast.bad { background: #8c2019; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .toast.bad { background: #8c2019; } }
dialog { border: 1px solid var(--panel-border); border-radius: var(--radius-xl); padding: 1.5rem 1.5rem 1.25rem; width: min(480px, 94vw); background: var(--surface); color: var(--ink); box-shadow: var(--shadow-2); }
dialog::backdrop { background: var(--backdrop); }
.row { display: flex; gap: .6rem; justify-content: flex-end; flex-wrap: wrap; margin-top: 1rem; }
.err { color: var(--bad); margin-top: .5rem; min-height: 1.2em; }

/* ================= sign-in pages ================= */
.center { min-height: 100vh; display: grid; place-items: center; padding: 1.5rem; text-align: center; }
.center .box { background: var(--surface); border-radius: var(--radius-lg); padding: 2rem; max-width: 420px; border: 1px solid var(--panel-border); box-shadow: var(--shadow-1); }

/* ================= admin ================= */
.wide { max-width: 1180px; }
.tabs { display: flex; gap: .4rem; flex-wrap: wrap; margin-bottom: 1rem; }
.tab { min-height: var(--h-sm); padding: 0 1rem; background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: var(--radius); cursor: pointer; transition: transform 160ms var(--ease-out), background-color 150ms ease, border-color 150ms ease, color 150ms ease; }
.tab:active { transform: scale(.97); }
.tab.on { background: var(--teal); color: var(--on-teal); border-color: var(--teal); }
.panel { background: var(--surface); border: 1px solid var(--panel-border); border-radius: var(--radius-lg); padding: 1.5rem; margin-bottom: 1rem; box-shadow: var(--shadow-1); }
table { width: 100%; border-collapse: collapse; font-size: .92rem; }
th, td { text-align: left; padding: .55rem .6rem; border-bottom: 1px solid var(--line); vertical-align: top; }
td .btn.small { vertical-align: middle; }
th { background: var(--teal-bg); color: var(--on-teal-bg); font-weight: 600; position: sticky; top: 0; z-index: 1; }
tbody tr:last-child td { border-bottom: 0; }
.tablewrap { max-height: 62vh; overflow: auto; border: 1px solid var(--line); border-radius: var(--radius); }
.filters { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: .7rem; align-items: center; }
.stat { display: inline-block; margin: 0 1.4rem .4rem 0; }
.stat b { display: block; font-size: 1.7rem; letter-spacing: -.01em; }
.linkbox { background: var(--teal-bg); border: 1px dashed var(--teal); border-radius: var(--radius); padding: .8rem; margin-top: .7rem; word-break: break-all; }
.linkcell { white-space: nowrap; }
.linktext { display: inline-block; max-width: 260px; overflow: hidden; text-overflow: ellipsis; vertical-align: middle; }
@media (max-width: 700px) { .linktext { max-width: 120px; } }

/* ---------- guest list: filter chips, pages, cards on phones ---------- */
.gtools { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin-bottom: .8rem; }
.gtools input[type=search] { flex: 1 1 280px; }
.seg { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: .6rem; }
.seg button { display: inline-flex; align-items: center; gap: .45rem; min-height: var(--h-sm); padding: 0 .85rem; background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: var(--radius); cursor: pointer; font-size: .9rem; transition: transform 160ms var(--ease-out), background-color 150ms ease, border-color 150ms ease, color 150ms ease; }
.seg button:active { transform: scale(.97); }
.seg button .n { font-size: .78rem; font-weight: 700; padding: .05rem .45rem; border-radius: 99px; background: var(--surface-2); color: var(--muted); font-variant-numeric: tabular-nums; }
.seg button.on { background: var(--teal); color: var(--on-teal); border-color: var(--teal); }
.seg button.on .n { background: rgba(255, 255, 255, .22); color: inherit; }
.seg .lbl { align-self: center; font-size: .82rem; color: var(--muted); margin-right: .2rem; min-width: 3.2rem; }
.gtable { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.gtable tr.removed td { opacity: .5; }
.gtable .acts { white-space: nowrap; text-align: right; }
.gtable .acts .btn + .btn { margin-left: .35rem; }
.gtable .nm { font-weight: 600; }
.gtable .st-in { color: var(--ok); font-weight: 600; }
.pager { display: flex; flex-wrap: wrap; gap: .35rem; align-items: center; justify-content: space-between; margin-top: .8rem; }
.pager .pages { display: flex; gap: .35rem; flex-wrap: wrap; }
.pager button { min-width: var(--h-sm); min-height: var(--h-sm); padding: 0 .6rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--ink); cursor: pointer; font-variant-numeric: tabular-nums; transition: transform 160ms var(--ease-out), background-color 150ms ease; }
.pager button:active:not(:disabled) { transform: scale(.97); }
.pager button.on { background: var(--teal); color: var(--on-teal); border-color: var(--teal); }
.pager button:disabled { opacity: .45; cursor: default; }
.nores { padding: 2rem 1rem; text-align: center; color: var(--muted); }
@media (max-width: 760px) {
  .gtable { border: 0; overflow: visible; }
  .gtable thead { display: none; }
  .gtable, .gtable tbody, .gtable tr, .gtable td { display: block; }
  .gtable tr { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: .7rem .8rem; margin-bottom: .6rem; display: grid; grid-template-columns: 1fr auto; gap: .15rem .6rem; }
  .gtable td { border: 0; padding: 0; }
  .gtable td.c-sn { grid-column: 2; grid-row: 1; color: var(--muted); font-size: .85rem; }
  .gtable td.c-sn::before { content: "S/N "; }
  .gtable td.c-name { grid-column: 1; grid-row: 1; }
  .gtable td.c-tier { grid-column: 1 / -1; }
  .gtable td.c-co, .gtable td.c-st { grid-column: 1 / -1; font-size: .9rem; }
  .gtable td.c-qr { grid-column: 1 / -1; color: var(--muted); }
  .gtable td.acts { grid-column: 1 / -1; text-align: left; margin-top: .5rem; display: flex; gap: .4rem; }
  .gtable td.acts .btn { flex: 1; margin: 0; }
  .gtable td.acts .btn + .btn { margin-left: 0; }
}

/* ================= hover (mouse only), motion ================= */
@media (hover: hover) and (pointer: fine) {
  .btn:hover:not(:disabled) { filter: brightness(1.08); }
  .btn.ghost:hover:not(:disabled) { filter: none; background: var(--teal-bg); }
  .tab:hover:not(.on), .seg button:hover:not(.on), .pager button:hover:not(.on):not(:disabled) { background: var(--teal-bg); border-color: var(--teal-line); }
  .results li:hover:not(.in) { background: var(--surface-2); }
  tbody tr:hover td { background: var(--surface-2); }
  .themebtn:hover { background: rgba(255, 255, 255, .12); }
}

/* dialogs open from slightly smaller (modals stay centred) */
dialog[open] { opacity: 1; transform: scale(1); transition: opacity 200ms var(--ease-out), transform 200ms var(--ease-out); }
dialog[open]::backdrop { opacity: 1; transition: opacity 200ms ease; }
@starting-style {
  dialog[open] { opacity: 0; transform: scale(.96); }
  dialog[open]::backdrop { opacity: 0; }
}
/* toast rises in; exit is instant so it never lingers */
@starting-style { .toast { opacity: 0; transform: translate(-50%, 8px); } }
/* occasional reveals */
.linkbox, .cam { transition: opacity 200ms var(--ease-out), transform 200ms var(--ease-out); }
@starting-style {
  .linkbox { opacity: 0; transform: translateY(4px); }
  .cam { opacity: 0; }
}
/* scan results, check-in card and guest pages appear instantly on purpose: they are used hundreds of times */

@media (prefers-reduced-motion: reduce) {
  .btn:active:not(:disabled), .tab:active, .seg button:active, .pager button:active, .themebtn:active { transform: none; }
  dialog[open] { transform: none; }
  @starting-style {
    dialog[open] { transform: none; }
    .toast { transform: translateX(-50%); }
    .linkbox { transform: none; }
  }
}
@media (max-width: 560px) { .btn.big { font-size: 1.2rem; } .card h2 { font-size: 1.3rem; } }

/* phones: staff result rows put the type chip under the name so names get the full width */
@media (max-width: 560px) {
  #results li { display: grid; grid-template-columns: 1fr auto; column-gap: .7rem; row-gap: .3rem; align-items: center; }
  #results li > .main { grid-column: 1; grid-row: 1; }
  #results li > .chip { grid-column: 1; grid-row: 2; justify-self: start; }
  #results li > .btn, #results li > .sub { grid-column: 2; grid-row: 1 / span 2; }
  #results .sub { white-space: normal; }
}
/* phones: compact admin guest cards */
@media (max-width: 760px) {
  .gtable td.c-co { color: var(--muted); }
  .gtable td.c-co .muted { display: inline; }
  .gtable td.c-co .muted::before { content: " · "; }
  .gtable td.c-qr { display: none; }
  .gtable td.c-tier { grid-column: 1; }
  .gtable td.c-st { grid-column: 2; grid-row: 2; text-align: right; }
  .gtable td.acts .btn { min-height: var(--h-sm); }
}

/* ================= Goche logo on sign-in surfaces ================= */
.brandmark { display: block; width: 120px; height: auto; margin: 0 auto 1.25rem; }
.brandmark.on-dark { display: none; }
:root[data-theme="dark"] .brandmark.on-light { display: none; }
:root[data-theme="dark"] .brandmark.on-dark { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .brandmark.on-light { display: none; }
  :root:not([data-theme="light"]) .brandmark.on-dark { display: block; }
}
#loginBox h2 { text-align: center; }

/* ================= live dashboard ================= */
.dash-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.dash-head h2 { margin: 0; }
.live { display: inline-flex; align-items: center; gap: .5rem; font-size: .875rem; color: var(--muted); font-variant-numeric: tabular-nums; min-height: var(--h-sm); }
.live .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); flex: none; }
.live.paused .dot { background: var(--muted); }
.live.error { color: var(--warn); }
.live.error .dot { background: var(--warn); }
/* a gentle pulse only while live and only for people who allow motion */
@media (prefers-reduced-motion: no-preference) {
  .live.on .dot { animation: livepulse 2s ease-in-out infinite; }
  @keyframes livepulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
}
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 1rem; margin-bottom: 1rem; }
.kpi { background: var(--surface); border: 1px solid var(--panel-border); border-radius: var(--radius-lg); padding: 1.25rem 1.5rem; box-shadow: var(--shadow-1); }
.kpi .lab { font-size: .875rem; color: var(--muted); letter-spacing: .1px; }
.kpi .val { font-family: var(--font-head); font-size: 2.25rem; font-weight: 700; line-height: 1.2; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.kpi .val small { font-size: 1rem; font-weight: 600; color: var(--muted); margin-left: .25rem; }
.kpi .sub { font-size: .8125rem; color: var(--muted); }
.kpi.hero { position: relative; overflow: hidden; }
.kpi.hero::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 4px; background: var(--brand-gradient); }
.tierbars { display: grid; gap: .75rem; }
.tierbar { display: grid; grid-template-columns: 9rem 1fr 4.5rem; align-items: center; gap: .75rem; font-size: .9375rem; }
.tierbar .n { text-align: right; font-variant-numeric: tabular-nums; color: var(--muted); }
.tierbar .track { height: 10px; border-radius: 99px; background: var(--surface-2); border: 1px solid var(--line); overflow: hidden; }
.tierbar .fill { display: block; height: 100%; border-radius: inherit; width: 0; transition: width 400ms var(--ease-out); }
.tierbar .fill.tier-vvip { background: var(--vvip); } .tierbar .fill.tier-vip { background: var(--vip); }
.tierbar .fill.tier-external-guest { background: var(--ext); } .tierbar .fill.tier-supplier { background: var(--sup); }
.tierbar .fill.tier-internal-guest { background: var(--int); }
.dash-cols { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); gap: 1rem; }
.dash-cols .panel { margin-bottom: 0; }
@media (max-width: 900px) { .dash-cols { grid-template-columns: 1fr; } .tierbar { grid-template-columns: 7.5rem 1fr 4rem; } }
/* new activity rows: a short tint that fades out, colour only (no movement), so it is calm at 5-second refreshes */
tr.fresh td { transition: background-color 1600ms ease; }
@starting-style { tr.fresh td { background-color: var(--teal-bg); } }
.act { font-weight: 600; }
@media (prefers-reduced-motion: reduce) { .tierbar .fill { transition: none; } }

/* ================= offline banner + saved-offline check-in ================= */
.netbar { position: sticky; top: 62px; z-index: 4; padding: .75rem 1rem; font-weight: 600; text-align: center; font-size: .9375rem; }
.netbar.off { background: var(--warn-bg); color: var(--warn); border-bottom: 2px solid var(--warn); }
.netbar.sync { background: var(--teal-bg); color: var(--on-teal-bg); border-bottom: 2px solid var(--teal-2); }
.banner.queued { background: var(--teal-bg); color: var(--on-teal-bg); border: 2px dashed var(--teal-2); }
@media (max-width: 480px) { .netbar { top: 56px; font-size: .875rem; } }

/* ================= bulk check-in dialog ================= */
.f + textarea, textarea.fi { min-height: 6.5rem; padding: .6rem .8rem; resize: vertical; line-height: 1.5; }
dialog:has(.bulklist) { width: min(640px, 94vw); }
.bulk-h { font-size: 1rem; margin: 1rem 0 .4rem; }
.bulk-h.ok { color: var(--ok); } .bulk-h.warn { color: var(--warn); }
.bulklist { list-style: none; margin: 0; padding: 0; max-height: 30vh; overflow: auto; border: 1px solid var(--line); border-radius: var(--radius); }
.bulklist li { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; padding: .45rem .7rem; border-bottom: 1px solid var(--line); font-size: .9375rem; }
.bulklist li:last-child { border-bottom: 0; }
.bulklist .sn { color: var(--muted); font-variant-numeric: tabular-nums; min-width: 4.2rem; }
.bulklist .nm { font-weight: 600; }
.bulk-note { margin: .6rem 0 0; font-size: .9375rem; }
/* long dialogs scroll inside; the action buttons stay pinned at the bottom so Confirm is always visible */
dialog { max-height: calc(100dvh - 2rem); overflow: auto; overscroll-behavior: contain; }
dialog .row:last-child { position: sticky; bottom: -1.25rem; margin: 1rem -1.5rem -1.25rem; padding: .875rem 1.5rem 1.25rem; background: var(--surface); border-top: 1px solid var(--line); z-index: 1; }

/* numbered how-to steps in admin panels */
.steps { margin: .25rem 0 .75rem; padding-left: 1.25rem; } .steps li { margin: .2rem 0; }
