/* ShiftGate demo — wallet check-in / check-out */
:root {
  --paper: #F4F1EA;
  --paper-2: #ECE7DC;
  --card: #FFFFFF;
  --ink: #16191E;
  --ink-2: #3B4049;
  --muted: #5F6570;
  --line: #DDD6C8;
  --in: #0B8A5C;
  --in-2: #0E9F6E;
  --out: #D2462A;
  --out-2: #E4572E;
  --accent: #3B34C9;
  --amber: #B86E00;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(22,25,30,.06), 0 8px 24px rgba(22,25,30,.06);
  --mono: "IBM Plex Mono", ui-monospace, Consolas, monospace;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; display: flex; flex-direction: column;
  font: 400 16px/1.5 "Archivo", "Segoe UI", sans-serif; color: var(--ink);
  background:
    radial-gradient(900px 420px at 100% -10%, rgba(59,52,201,.07), transparent 60%),
    radial-gradient(700px 380px at -10% 110%, rgba(11,138,92,.07), transparent 60%),
    var(--paper);
}
main { flex: 1; width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 24px 40px; }
h1, h2, h3 { margin: 0 0 .4em; line-height: 1.1; letter-spacing: -.01em; }
h1 { font-size: clamp(2rem, 4.6vw, 3.3rem); font-weight: 800; }
h2 { font-size: 1.35rem; font-weight: 800; }
h3 { font-size: 1.02rem; font-weight: 700; }
p { margin: 0 0 1em; }
a { color: var(--accent); }
.mono { font-family: var(--mono); }
.muted { color: var(--muted); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
:focus-visible { outline: 3px solid #F2B400; outline-offset: 2px; }
[hidden] { display: none !important; }

/* ── Top bar / footer ───────────────────────────────────────────── */
.tc-top { display: flex; align-items: center; gap: 16px; max-width: 1180px; width: 100%; margin: 0 auto; padding: 18px 24px; }
.tc-brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); font-weight: 800; font-size: 1.25rem; letter-spacing: -.02em; }
.tc-brand svg { width: 32px; height: 32px; color: var(--ink); }
.tc-brand b { color: var(--in); font-weight: 800; }
.tc-brand .lg { stroke: #fff; } .tc-brand .lg2 { stroke: #3DDC97; }
.tc-top.dark .tc-brand .lg { stroke: #0E1116; } .tc-top.dark .tc-brand .lg2 { stroke: #0B8A5C; }
.tc-top-note { font-size: .8rem; color: var(--muted); padding-left: 14px; border-left: 1px solid var(--line); }
.tc-top-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.tc-top.dark .tc-brand, .tc-top.dark .tc-brand svg { color: #F4F1EA; }
.tc-top.dark .tc-brand b { color: #3DDC97; }
.tc-top.dark .tc-top-note { color: #9AA3B2; border-color: #2A303A; }
.tc-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px 18px; flex-wrap: wrap; max-width: 1180px; width: 100%; margin: 0 auto; padding: 18px 24px 26px; font-size: .78rem; color: var(--muted); border-top: 1px solid var(--line); }
.tc-foot-brand { display: flex; align-items: center; gap: 10px; }
.tc-foot-name { font-weight: 700; color: var(--ink-2); font-size: .82rem; }
.tc-foot-name span { color: #B34A0C; }
.tc-foot.dark .tc-foot-name { color: #C9CED6; }
.tc-foot.dark .tc-foot-name span { color: #F07A3A; }
.tc-foot-note { font-size: .75rem; }
.tc-foot-about { flex-basis: 100%; margin: 0; font-size: .74rem; opacity: .9; }
.logo-chip { display: inline-flex; align-items: center; background: #f3f5f8; border-radius: 6px; padding: 4px 8px; box-shadow: inset 0 0 0 1px rgba(0,0,0,.06); }
.logo-chip img { height: 15px; width: auto; display: block; }
.tc-foot.dark { color: #9AA3B2; border-color: #232933; }
.app-version { font-family: var(--mono); font-size: .72rem; opacity: .8; }

/* ── Buttons, chips, cards ───────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 10px 18px;
  border-radius: 10px; border: 1.5px solid var(--ink); background: var(--ink); color: #fff; font: inherit; font-weight: 700;
  text-decoration: none; cursor: pointer; transition: transform .12s, background .15s;
}
.btn:hover { transform: translateY(-1px); }
.btn.ghost { background: transparent; color: var(--ink); }
.btn.small { min-height: 34px; padding: 6px 12px; font-size: .86rem; border-radius: 8px; }
.btn.in { background: var(--in); border-color: var(--in); }
.btn.out { background: var(--out); border-color: var(--out); }
.btn[disabled] { opacity: .5; cursor: not-allowed; transform: none; }
.chip { display: inline-flex; align-items: center; gap: 6px; font-size: .76rem; font-weight: 700; padding: 3px 9px; border-radius: 999px; background: var(--paper-2); color: var(--ink-2); white-space: nowrap; }
.chip i { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.chip.ok { background: #DDF3E8; color: #075C3D; }
.chip.warn { background: #FCEBD2; color: #7A4600; }
.chip.bad { background: #FBE1DA; color: #8C2A15; }
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; }

/* ── Home: pick a site ───────────────────────────────────────────── */
.tc-hero { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 36px; align-items: center; padding: 28px 0 34px; }
.tc-hero p.lead { font-size: 1.12rem; color: var(--ink-2); max-width: 560px; }
.tc-hero .kicker { font-family: var(--mono); font-size: .78rem; letter-spacing: .14em; text-transform: uppercase; color: var(--in); margin-bottom: 12px; }
.tc-flow { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.tc-flow li { display: grid; grid-template-columns: 36px 1fr; gap: 12px; align-items: start; background: var(--card); border-radius: 12px; padding: 12px 14px; box-shadow: var(--shadow); }
.tc-flow li b { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; background: var(--ink); color: #fff; font-family: var(--mono); }
.tc-flow li span { font-size: .93rem; color: var(--ink-2); }
.tc-flow li strong { display: block; color: var(--ink); }
.sites { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.site {
  position: relative; display: flex; flex-direction: column; gap: 10px; text-decoration: none; color: var(--ink);
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; overflow: hidden;
  border-top: 5px solid var(--c, var(--ink)); transition: transform .15s;
}
.site:hover { transform: translateY(-2px); }
.site .code { font-family: var(--mono); font-size: .78rem; color: var(--c); font-weight: 600; letter-spacing: .06em; }
.site h3 { font-size: 1.25rem; margin: 0; }
.site .meta { font-size: .86rem; color: var(--muted); }
.site .now { display: flex; align-items: baseline; gap: 8px; margin-top: auto; }
.site .now strong { font-family: var(--mono); font-size: 2rem; line-height: 1; }
.site .go { font-weight: 700; color: var(--c); font-size: .9rem; }
.section-title { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 10px 0 14px; }

/* ── Kiosk (dark) ────────────────────────────────────────────────── */
body.kiosk { background: radial-gradient(1000px 500px at 50% -20%, rgba(61,220,151,.10), transparent 60%), #0E1116; color: #F4F1EA; }
.kiosk main { display: flex; flex-direction: column; align-items: center; text-align: center; padding-top: 10px; }
.k-site { font-family: var(--mono); font-size: .85rem; letter-spacing: .16em; text-transform: uppercase; color: #9AA3B2; }
.k-site b { color: color-mix(in srgb, var(--c, #3DDC97) 45%, #ffffff); }
.k-name { font-size: clamp(1.6rem, 4vw, 2.4rem); font-weight: 800; margin: 6px 0 2px; }
.k-clock { font-family: var(--mono); font-weight: 600; font-size: clamp(4.2rem, 15vw, 9rem); line-height: 1; letter-spacing: -.04em; margin: 18px 0 4px; }
.k-date { color: #9AA3B2; margin-bottom: 30px; }
.k-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; width: 100%; max-width: 760px; }
.k-btn {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; min-height: 170px; border-radius: 22px;
  border: 0; font: inherit; color: #fff; cursor: pointer; transition: transform .12s, box-shadow .15s;
}
.k-btn svg { width: 44px; height: 44px; }
.k-btn strong { font-size: 1.9rem; font-weight: 800; letter-spacing: -.01em; }
.k-btn span { font-size: .92rem; opacity: .9; }
.k-btn.in { background: linear-gradient(160deg, #13B47C, #0B8A5C); box-shadow: 0 14px 40px rgba(14,159,110,.35); }
.k-btn.out { background: linear-gradient(160deg, #EE6A42, #C93E22); box-shadow: 0 14px 40px rgba(228,87,46,.35); }
.k-btn:hover { transform: translateY(-2px); }
.k-stats { display: flex; gap: 28px; justify-content: center; flex-wrap: wrap; margin-top: 28px; color: #9AA3B2; font-size: .9rem; }
.k-stats strong { display: block; font-family: var(--mono); font-size: 1.7rem; color: #F4F1EA; }
.k-note { max-width: 520px; margin: 26px auto 0; font-size: .8rem; line-height: 1.55; color: #8C95A4; }
.k-links { margin-top: 14px; display: flex; gap: 18px; font-size: .82rem; }
.k-links a { color: #9AA3B2; }

/* Method sheet (native <dialog>) */
.sheet-dlg { border: 0; padding: 0; background: transparent; width: calc(100% - 32px); max-width: 600px; max-height: calc(100vh - 32px); overflow: visible; }
.sheet-dlg::backdrop { background: rgba(5,7,10,.66); }
.sheet { width: 100%; max-width: 600px; background: #F4F1EA; color: var(--ink); border-radius: 20px; padding: 24px; text-align: left; box-shadow: 0 30px 80px rgba(0,0,0,.4); max-height: calc(100vh - 32px); overflow: auto; }
.sheet h2 { font-size: 1.4rem; }
.sheet .act { font-family: var(--mono); font-size: .78rem; letter-spacing: .12em; text-transform: uppercase; font-weight: 600; }
.sheet .act.in { color: var(--in); } .sheet .act.out { color: var(--out); }
.opt { display: flex; gap: 12px; align-items: flex-start; padding: 14px; border-radius: 12px; border: 2px solid var(--line); background: #fff; cursor: pointer; margin-top: 10px; }
.opt input { margin: 4px 0 0; width: 20px; height: 20px; accent-color: var(--in); flex: none; }
.opt:has(input:checked) { border-color: var(--in); background: #F1FAF5; }
.opt.off { cursor: not-allowed; opacity: .6; }
.opt strong { display: block; }
.opt small { display: block; color: var(--muted); font-size: .86rem; margin-top: 2px; }
.opt .reads { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 8px; }
.sheet .row { display: flex; gap: 10px; margin-top: 18px; flex-wrap: wrap; }

/* ── Done page ───────────────────────────────────────────────────── */
.done { max-width: 620px; margin: 10px auto 0; text-align: center; }
.done .badge { width: 84px; height: 84px; border-radius: 26px; display: grid; place-items: center; margin: 0 auto 18px; color: #fff; font-size: 2.4rem; font-weight: 800; }
.done .badge.in { background: var(--in); } .done .badge.out { background: var(--out); } .done .badge.warn { background: var(--amber); }
.done h1 { font-size: clamp(1.9rem, 5vw, 2.7rem); }
.done .who { display: flex; align-items: center; gap: 14px; text-align: left; margin: 22px 0 6px; }
.done .avatar { width: 56px; height: 56px; border-radius: 16px; background: var(--ink); color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 1.2rem; flex: none; }
.done dl { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 16px 0 0; text-align: left; }
.done dl div { background: var(--paper-2); border-radius: 10px; padding: 10px 12px; }
.done dt { font-size: .75rem; color: var(--muted); }
.done dd { margin: 0; font-family: var(--mono); font-weight: 600; font-size: 1.05rem; }
.kiosk .done dl div { background: #1A1F27; border: 1px solid #2A303A; }
.kiosk .done dt { color: #9AA3B2; }
.kiosk .done dd { color: #F4F1EA; }
.done .note { margin-top: 16px; font-size: .92rem; color: var(--ink-2); }
.done .back { margin-top: 22px; display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; }
.countdown { font-family: var(--mono); font-size: .82rem; color: var(--muted); margin-top: 10px; }

/* ── Operator dashboard ──────────────────────────────────────────── */
.op-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin: 6px 0 18px; }
.op-filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.op-filters select, .op-filters input { font: inherit; font-size: .9rem; padding: 7px 10px; border-radius: 8px; border: 1.5px solid var(--line); background: #fff; color: var(--ink); min-height: 38px; }
.tabs { display: flex; gap: 4px; border-bottom: 1.5px solid var(--line); margin-bottom: 18px; overflow-x: auto; }
.tabs button { font: inherit; font-weight: 700; font-size: .92rem; padding: 10px 14px; border: 0; background: none; color: var(--muted); border-bottom: 3px solid transparent; margin-bottom: -1.5px; cursor: pointer; white-space: nowrap; }
.tabs button[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--ink); }
.tabs .count { font-family: var(--mono); font-size: .75rem; background: var(--out); color: #fff; border-radius: 999px; padding: 1px 6px; margin-left: 4px; }
.kpis { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }
.kpi { background: var(--card); border-radius: 12px; box-shadow: var(--shadow); padding: 14px; }
.kpi span { display: block; font-size: .76rem; color: var(--muted); }
.kpi strong { display: block; font-family: var(--mono); font-size: 1.6rem; line-height: 1.15; margin-top: 4px; }
.kpi small { font-size: .74rem; color: var(--muted); }
.grid2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; margin-bottom: 16px; }
.site-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-bottom: 16px; }
.site-stat { border-top: 5px solid var(--c); }
.site-stat .hdr { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-bottom: 10px; }
.site-stat .hdr .code { font-family: var(--mono); color: var(--c); font-size: .78rem; font-weight: 600; }
.site-stat dl { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 14px; margin: 0; }
.site-stat dt { font-size: .74rem; color: var(--muted); }
.site-stat dd { margin: 0; font-family: var(--mono); font-weight: 600; }
.chart { width: 100%; height: auto; display: block; }
.chart text { font-family: var(--mono); font-size: 10px; fill: var(--muted); }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: .8rem; color: var(--ink-2); margin-top: 8px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
.splitbar { display: flex; height: 14px; border-radius: 7px; overflow: hidden; background: var(--paper-2); margin-top: 6px; }
table.t { width: 100%; border-collapse: collapse; font-size: .9rem; }
table.t th, table.t td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.t th { font-size: .74rem; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
table.t td.num { font-family: var(--mono); }
table.t tr.click { cursor: pointer; }
table.t tr.click:hover td { background: #FAF8F3; }
.tablewrap { overflow-x: auto; }
.person { display: flex; align-items: center; gap: 10px; }
.person .av { width: 32px; height: 32px; border-radius: 9px; background: var(--ink); color: #fff; display: grid; place-items: center; font-weight: 800; font-size: .78rem; flex: none; }
.empty { color: var(--muted); font-style: italic; padding: 10px 0; }
.gate { max-width: 560px; margin: 30px auto; }
.gate .card { padding: 26px; }
.dbtable { margin-bottom: 18px; }
.dbtable h3 { font-family: var(--mono); }
.dbtable code { font-size: .78rem; }
.tc-toast:empty { display: none; }
.tc-toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 10px; font-size: .92rem; z-index: 40; max-width: calc(100% - 32px); }
.loading { text-align: center; padding: 60px 0; color: var(--muted); }
.spin { width: 40px; height: 40px; border: 4px solid var(--line); border-top-color: var(--in); border-radius: 50%; margin: 0 auto 14px; animation: spin .9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Responsive ──────────────────────────────────────────────────── */
@media (max-width: 980px) {
  .tc-hero { grid-template-columns: minmax(0, 1fr); gap: 22px; }
  .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .site-stats, .grid2 { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
  main { padding: 0 16px 32px; }
  .tc-top { padding: 14px 16px; flex-wrap: wrap; }
  .tc-top-note { display: none; }
  .tc-foot { padding: 16px; }
  .sites { grid-template-columns: minmax(0, 1fr); }
  .k-actions { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .k-btn { min-height: 120px; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .done dl { grid-template-columns: minmax(0, 1fr); }
  .sheet { padding: 18px; }
}

/* ── Identify sheet: "Show any one of these" ─────────────────────── */
.sheet { animation: sheetIn .22s ease-out; }
@keyframes sheetIn { from { transform: translateY(14px) scale(.98); opacity: 0; } to { transform: none; opacity: 1; } }
.sheet h2 { font-size: 1.55rem; margin-bottom: .2em; }
.sheet-sub { color: var(--muted); margin: 0 0 16px; font-size: .95rem; }
.docs { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) auto minmax(0, 1fr); align-items: stretch; gap: 6px; }
.docs-or { align-self: center; font-family: var(--mono); font-size: .72rem; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.doc {
  display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; padding: 14px 10px 12px;
  background: #fff; border-radius: 16px; border: 2px solid transparent; box-shadow: 0 1px 2px rgba(22,25,30,.06), 0 6px 18px rgba(22,25,30,.06);
  animation: docPop .35s cubic-bezier(.2,.9,.3,1.3) both; transition: transform .15s, border-color .15s;
}
.doc:hover { transform: translateY(-3px) rotate(-.6deg); border-color: var(--dc); }
@keyframes docPop { from { transform: translateY(10px) scale(.9); opacity: 0; } to { transform: none; opacity: 1; } }
.doc-ico { width: 84px; height: 56px; display: grid; place-items: center; }
.doc-ico svg { width: 72px; height: 48px; filter: drop-shadow(0 3px 6px rgba(22,25,30,.12)); transition: transform .2s; }
.doc-ico img { width: 76px; height: auto; display: block; }
.doc:hover .doc-ico svg, .doc:hover .doc-ico img { transform: rotate(-4deg) scale(1.05); }
.doc-txt { display: flex; flex-direction: column; align-items: center; gap: 3px; }
.doc-txt strong { font-size: 1rem; line-height: 1.15; }
.doc-tag { font-family: var(--mono); font-size: .68rem; font-weight: 600; color: var(--dc); background: var(--db); border-radius: 999px; padding: 1px 8px; }
.doc small { font-size: .76rem; color: var(--muted); line-height: 1.35; }
.sheet-privacy { display: flex; gap: 8px; align-items: flex-start; margin: 16px 0 0; padding: 10px 12px; border-radius: 12px; background: #EAF6EF; color: #22543D; font-size: .84rem; line-height: 1.45; }
.sheet-privacy svg { width: 18px; height: 18px; flex: none; margin-top: 1px; }
.btn.big { min-height: 52px; padding: 12px 22px; font-size: 1.05rem; border-radius: 12px; }
.btn svg { width: 22px; height: 22px; }
.sheet .row .btn.big { flex: 1; }
@media (max-width: 640px) {
  .docs { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .docs-or { justify-self: center; margin: -2px 0; }
  .doc { flex-direction: row; text-align: left; padding: 10px 12px; }
  .doc-txt { align-items: flex-start; }
  .doc-ico { width: 64px; height: 44px; flex: none; }
  .doc-ico svg { width: 60px; height: 40px; }
  .doc-ico img { width: 60px; }
}
@media (prefers-reduced-motion: reduce) { .sheet, .doc { animation: none; } .doc:hover { transform: none; } }

/* Name cell as a button (keyboard access to a person's details) */
.linkbtn { all: unset; cursor: pointer; border-radius: 8px; }
.linkbtn:focus-visible { outline: 3px solid #F2B400; outline-offset: 2px; }
