:root {
  --olive: #4B5340;
  --olive-2: #6B7356;
  --olive-3: #8A9372;
  --mint: #EEF5E4;
  --yellow: #FFDD57;
  --yellow-2: #F5C92E;
  --orange: #FF6B35;
  --orange-2: #FF8A5B;
  --bar: #C9D2B2;
  --line: #D5DCC5;
  --band: #F6FBEF;
  --field: #F3F7EC;
  --green-bg: #CDEFC2;
  --green-fg: #2F5D1E;
  --red-bg: #FBE3E3;
  --red-fg: #8A2B2B;
  --card-shadow: 0 8px 24px rgba(75, 83, 64, 0.07);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: 'Poppins', system-ui, sans-serif;
  color: var(--olive);
  background: linear-gradient(160deg, #F7FBF1 0%, var(--mint) 100%);
}
body.admin .app, body.admin footer { display: none; }
[hidden] { display: none !important; }

/* ---------- Shared pieces ---------- */
.badge {
  flex-shrink: 0;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.22), 0 0 0 4px rgba(255, 255, 255, 0.22);
}
.badge img { width: 52px; height: 52px; object-fit: contain; border-radius: 50%; mix-blend-mode: normal; }
.wordmark { width: 150px; max-width: 100%; height: auto; filter: invert(1) brightness(1.8); mix-blend-mode: screen; }
.title { font-size: 18px; font-weight: 700; margin: 0 0 4px; }
.subtitle { font-size: 13px; color: var(--olive-2); margin: 0 0 14px; line-height: 1.5; }
.crumb { font-size: 12px; color: var(--olive-3); }
.msg { margin-top: 12px; text-align: center; font-weight: 600; font-size: 14px; min-height: 18px; }
.msg.ok { color: #3f6212; }
.msg.err { color: var(--red-fg); }
.status {
  text-align: center;
  padding: 20px 16px;
  margin-top: 14px;
  border-radius: 18px;
  font-size: 15px;
  font-weight: 600;
  background: var(--band);
}
.status.err { background: var(--red-bg); color: var(--red-fg); }
.loading { text-align: center; color: var(--olive-2); padding: 24px 0; font-size: 14px; }
.hint { font-size: 12px; color: var(--olive-2); margin-top: 10px; line-height: 1.5; text-align: center; }
.sr-only {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

/* Generic controls (staff dashboard and card maker) */
label { display: block; margin-top: 12px; font-weight: 600; font-size: 13px; color: var(--olive-2); }
input, select, textarea {
  width: 100%;
  margin-top: 6px;
  padding: 13px 16px;
  font-size: 15px;
  font-family: inherit;
  color: var(--olive);
  background: var(--field);
  border: 1px solid transparent;
  border-radius: 16px;
  box-shadow: inset 3px 3px 7px rgba(75, 83, 64, 0.08), inset -3px -3px 7px #fff;
  outline: none;
  transition: box-shadow 0.2s, border-color 0.2s;
}
textarea { resize: vertical; min-height: 92px; line-height: 1.5; }
input:focus, select:focus, textarea:focus {
  border-color: var(--yellow-2);
  box-shadow: inset 3px 3px 7px rgba(75, 83, 64, 0.1), 0 0 0 3px rgba(255, 221, 87, 0.35);
}
button {
  width: 100%;
  margin-top: 20px;
  padding: 15px;
  font-size: 15px;
  font-weight: 700;
  font-family: inherit;
  letter-spacing: 0.5px;
  color: var(--olive);
  background: linear-gradient(180deg, #FFE377 0%, var(--yellow) 100%);
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(245, 201, 46, 0.35);
  transition: transform 0.1s, box-shadow 0.2s;
}
button:hover { box-shadow: 0 10px 22px rgba(245, 201, 46, 0.45); }
button:active { transform: scale(0.98); }
button:disabled { opacity: 0.55; cursor: default; transform: none; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, a:focus-visible {
  outline: 3px solid var(--yellow-2);
  outline-offset: 2px;
}
button.dark {
  color: #fff;
  background: linear-gradient(180deg, var(--olive-2) 0%, var(--olive) 100%);
  box-shadow: 0 8px 18px rgba(75, 83, 64, 0.3);
}
button.ghost {
  margin-top: 0;
  color: var(--olive);
  background: #fff;
  box-shadow: inset 2px 2px 6px rgba(75, 83, 64, 0.08), 0 4px 10px rgba(75, 83, 64, 0.1);
}
button.small { width: auto; margin: 0; padding: 9px 16px; font-size: 12px; }
.seg {
  display: inline-flex;
  background: var(--field);
  border-radius: 999px;
  padding: 4px;
  gap: 4px;
  flex-wrap: wrap;
}
.seg button {
  margin: 0; width: auto; padding: 7px 14px; font-size: 12px;
  background: transparent; box-shadow: none; color: var(--olive-2); border-radius: 999px;
}
.seg button[aria-pressed="true"] {
  background: var(--olive); color: #fff; box-shadow: 0 4px 10px rgba(75, 83, 64, 0.28);
}

/* ---------- Public pages: full screen split layout ---------- */
body:not(.admin) footer { display: none; }
body:not(.admin) .app {
  display: grid;
  grid-template-columns: 40% 1fr;
  min-height: 100vh;
  width: 100%;
  margin: 0;
  background: #fff;
}
body:not(.admin) .app .hero {
  position: relative;
  height: auto;
  min-height: 100vh;
  padding: 56px 40px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 26px;
  text-align: center;
  border-radius: 0;
  background: linear-gradient(160deg, #8A9372 0%, #4B5340 100%);
}
body:not(.admin) .app .hero .badge { width: 132px; height: 132px; }
body:not(.admin) .app .hero .badge img { width: 104px; height: 104px; }
body:not(.admin) .app .hero .wordmark { width: 260px; }
.hero-tag { color: rgba(255, 255, 255, 0.85); font-size: 14px; line-height: 1.6; max-width: 320px; margin: 0; }
.hero-foot {
  position: absolute; bottom: 24px; left: 0; right: 0;
  font-size: 12px; color: rgba(255, 255, 255, 0.7); letter-spacing: 0.3px;
}
body:not(.admin) .app .body {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 56px 7vw;
  min-width: 0;
}
body:not(.admin) .app .body > * { width: 100%; max-width: 460px; margin: 0 auto; }
#booking { max-width: 580px; }
body:not(.admin) .app .title { font-size: 28px; line-height: 1.2; margin: 0 0 6px; }
body:not(.admin) .app .subtitle { font-size: 14px; margin: 0 0 26px; }
body:not(.admin) .app .crumb {
  font-size: 11px; font-weight: 600; letter-spacing: 0.8px; text-transform: uppercase; margin-bottom: 10px;
}
.stepbar { display: flex; gap: 6px; margin: 0 0 26px; }
.stepbar i { flex: 1; height: 3px; border-radius: 3px; background: #E6EBDA; }
.stepbar i.on { background: var(--olive); }
.form-section + .form-section {
  margin-top: 28px;
  padding-top: 24px;
  border-top: 1px solid #E8EDDE;
}
.sect-head { margin: 0 0 2px; }
.sect-head h2 {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--olive);
}
.sect-head p { margin: 3px 0 0; font-size: 12px; line-height: 1.45; color: var(--olive-2); }
.fields { display: grid; grid-template-columns: 1fr 1fr; column-gap: 16px; row-gap: 2px; }
.f { min-width: 0; }
.f.full { grid-column: 1 / -1; }
.frow { grid-column: 1 / -1; display: grid; gap: 16px; align-items: start; }
.frow-21 { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.frow-11 { grid-template-columns: 1fr 1fr; }
.row3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
body:not(.admin) .app label {
  margin-top: 16px; font-size: 12px; font-weight: 600; letter-spacing: 0.2px; color: var(--olive-2);
}
body:not(.admin) .app input,
body:not(.admin) .app select,
body:not(.admin) .app textarea {
  margin-top: 8px;
  padding: 14px 16px;
  font-size: 15px;
  background: #F7F9F1;
  border: 1px solid #E3E9D6;
  border-radius: 12px;
  box-shadow: none;
  -webkit-appearance: none;
  appearance: none;
  transition: border-color 0.2s, background 0.2s;
}
body:not(.admin) .app input:focus,
body:not(.admin) .app select:focus,
body:not(.admin) .app textarea:focus {
  border-color: var(--olive-2);
  background: #fff;
  box-shadow: none;
}
body:not(.admin) .app select {
  background-image: linear-gradient(45deg, transparent 50%, var(--olive-2) 50%), linear-gradient(135deg, var(--olive-2) 50%, transparent 50%);
  background-position: calc(100% - 18px) 55%, calc(100% - 13px) 55%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-right: 36px;
}
.row3 select { margin-top: 8px; padding-right: 30px; }
.datebox { position: relative; margin-top: 8px; }
.datetxt {
  display: flex; justify-content: space-between; align-items: center;
  min-height: 50px; padding: 14px 16px;
  font-size: 15px; color: var(--olive);
  background: #F7F9F1; border: 1px solid #E3E9D6; border-radius: 12px;
  pointer-events: none;
}
.datetxt::after { content: '▾'; font-size: 12px; color: var(--olive-2); }
.datebox input {
  position: absolute; inset: 0; width: 100%; height: 100%;
  margin: 0; padding: 0; opacity: 0; cursor: pointer;
  border: 0; border-radius: 12px; box-shadow: none; background: transparent;
}
.hint-left { font-size: 12px; color: var(--olive-2); margin: 8px 0 0; text-align: left; }
body:not(.admin) .app button {
  margin-top: 22px;
  min-height: 52px;
  padding: 14px 18px;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.2px;
  color: #fff;
  background: var(--olive);
  border: 0;
  border-radius: 12px;
  box-shadow: none;
}
body:not(.admin) .app button:hover { background: #3d4331; box-shadow: none; }
body:not(.admin) .app button.ghost {
  margin-top: 10px;
  color: var(--olive);
  background: #fff;
  border: 1px solid #E3E9D6;
  box-shadow: none;
}
body:not(.admin) .app button.ghost:hover { background: #F7F9F1; }
body:not(.admin) .app .seg {
  background: #F3F6EC; border-radius: 12px; padding: 4px; gap: 4px; margin-top: 8px; width: 100%;
}
body:not(.admin) .app .seg button {
  margin: 0; min-height: 40px; padding: 10px 14px; font-size: 13px; font-weight: 600;
  background: transparent; color: var(--olive-2); border-radius: 9px; box-shadow: none;
}
body:not(.admin) .app .seg button[aria-pressed="true"] {
  background: #fff; color: var(--olive); box-shadow: 0 1px 3px rgba(75, 83, 64, 0.15);
}
body:not(.admin) .app .seg.full button { flex: 1; }
.reminder { margin-top: 14px; background: #FBF7E6; color: #5C4B12; font-size: 13px; }
#summary { margin-top: 14px; width: 100%; border-collapse: collapse; font-size: 14px; }
#summary td { padding: 12px 2px; border-bottom: 1px solid #ECEFE3; vertical-align: top; }
#summary td:last-child { text-align: right; font-weight: 600; }
#summary tr.total td { font-weight: 700; color: var(--olive); border-bottom: 0; font-size: 15px; }
#summary tr.group td {
  padding: 18px 2px 6px;
  border-bottom: 1px solid #E3E9D6;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--olive-3);
  text-align: left;
}
#summary tr.group:first-child td { padding-top: 4px; }
.value-big { font-size: 28px; font-weight: 700; margin-top: 4px; color: var(--olive); }
.qr {
  display: block;
  width: 240px;
  max-width: 80%;
  box-sizing: border-box;
  margin: 16px auto 0;
  padding: 14px;
  background: #fff;
  border: 1px solid #E3E9D6;
  border-radius: 14px;
}
#tapBody .title { font-size: 26px; }
@media (max-width: 860px) {
  body:not(.admin) .app { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  body:not(.admin) .app .hero {
    min-height: 0;
    flex-direction: row;
    justify-content: flex-start;
    text-align: left;
    gap: 14px;
    padding: 20px;
    border-radius: 0 0 26px 26px;
  }
  body:not(.admin) .app .hero .badge { width: 64px; height: 64px; }
  body:not(.admin) .app .hero .badge img { width: 52px; height: 52px; }
  body:not(.admin) .app .hero .wordmark { width: 150px; }
  .hero-tag, .hero-foot { display: none; }
  body:not(.admin) .app .body { align-items: flex-start; padding: 26px 20px 44px; }
  body:not(.admin) .app .title { font-size: 22px; }
}
@media (max-width: 480px) {
  .fields { grid-template-columns: 1fr; }
  .frow-21, .frow-11 { grid-template-columns: 1fr; }
  .row3 { grid-template-columns: 1fr 1fr; }
  .row3 > :last-child { grid-column: 1 / -1; }
  .form-section + .form-section { margin-top: 24px; padding-top: 20px; }
}

/* ---------- Admin sign in ---------- */
/* Same look as the dashboard: olive panel, stone page, white card, flat controls */
.signin {
  display: grid; grid-template-columns: minmax(280px, 38%) 1fr; min-height: 100vh;
  background: #F6F5F0; color: #23261F; font-family: 'Inter', system-ui, sans-serif;
}
.si-right {
  order: -1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 20px;
  padding: 32px; text-align: center; background: #3A4431; color: #D9DECF;
}
.si-right .badge { width: 112px; height: 112px; box-shadow: none; }
.si-right .badge img { width: 86px; height: 86px; }
.si-right .wordmark { width: 200px; filter: invert(1) brightness(1.8); mix-blend-mode: screen; }
.si-pill { margin: 0; font-size: 14px; line-height: 1.6; color: rgba(236, 240, 228, 0.72); max-width: 28ch; }
.si-left { display: flex; flex-direction: column; padding: 24px 32px; }
.si-back { font-size: 13px; font-weight: 500; color: #6E7065; text-decoration: none; padding: 8px 0; align-self: flex-start; }
.si-back:hover { color: #23261F; }
.si-form {
  width: 100%; max-width: 380px; margin: auto; padding: 32px;
  background: #fff; border: 1px solid #E6E4DC; border-radius: 14px;
}
.si-form .title { font-family: 'Poppins', sans-serif; font-size: 24px; font-weight: 600; letter-spacing: -0.01em; color: #23261F; margin: 0 0 4px; }
.si-form .subtitle { font-size: 14px; color: #6E7065; margin: 0 0 20px; }
.si-form label { margin: 0; font-size: 13px; font-weight: 500; color: #6E7065; }
.si-form input {
  margin-top: 6px; padding: 12px 14px; font-size: 16px; letter-spacing: 0.2em; color: #23261F;
  background: #fff; border: 1px solid #D6D3C8; border-radius: 10px; box-shadow: none;
}
.si-form input:focus { border-color: #3A4431; box-shadow: 0 0 0 3px #ECEEE4; outline: none; }
.si-form button, .si-form button:hover {
  margin-top: 16px; padding: 13px; min-height: 48px; font-family: inherit; font-size: 15px; font-weight: 600; letter-spacing: 0;
  background: #3A4431; color: #fff; border-radius: 10px; box-shadow: none;
}
.si-form button:hover { background: #2F3828; }
.si-form button:focus-visible, .si-back:focus-visible { outline: 2px solid #3A4431; outline-offset: 2px; }
.si-form .msg { margin: 12px 0 0; text-align: left; font-size: 13px; font-weight: 500; color: #B4441C; min-height: 18px; }
.si-foot { font-size: 12px; color: #6E7065; }

/* ---------- Dashboard shell (sidebar + main) ---------- */
/* One olive accent on neutral surfaces. Orange marks "today" only. */
/* Theme: Olive sidebar. Deep olive sidebar, warm stone page, white cards,
   one terracotta accent for "today". */
body.admin {
  --olive: #3A4431;
  --olive-2: #5E6A4E;
  --olive-3: #7A8466;
  --orange: #C2603A;
  --bar: #C9CFB8;
  --side-bg: #3A4431;
  --side-text: #D9DECF;
  --side-muted: rgba(236, 240, 228, 0.62);
  --side-hover: rgba(255, 255, 255, 0.08);
  --side-on: rgba(255, 255, 255, 0.14);
  --side-line: rgba(255, 255, 255, 0.12);
  --bg: #F6F5F0;
  --surface: #FFFFFF;
  --border: #E6E4DC;
  --border-2: #D6D3C8;
  --text: #23261F;
  --muted: #6E7065;
  --olive-soft: #ECEEE4;
  --up: #2F7D4F; --up-soft: #E5F2EA;
  --down: #B4441C; --down-soft: #FBEAE3;
  --r: 14px;
  background: var(--bg);
  color: var(--text);
}
.shell {
  display: grid; grid-template-columns: 232px 1fr; min-height: 100vh;
  font-family: 'Inter', system-ui, sans-serif;
  font-variant-numeric: tabular-nums;
}
.shell h1, .shell h2, .shell h3 { margin: 0; }
.ic {
  width: 18px; height: 18px; flex-shrink: 0;
  fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}

.side {
  position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column;
  padding: 24px 14px; background: var(--side-bg); color: var(--side-text);
}
/* The wordmark file is dark on white: invert it to light on the olive sidebar */
.side-logo { display: block; width: 132px; max-width: 100%; margin: 4px auto 18px; filter: invert(1) brightness(1.8); mix-blend-mode: screen; }
.side hr { border: 0; border-top: 1px solid var(--side-line); margin: 0 0 12px; width: 100%; }
.side nav { display: flex; flex-direction: column; gap: 2px; }
.side nav a {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; border-radius: 10px;
  font-size: 14px; font-weight: 500; color: var(--side-muted); text-decoration: none;
}
.side nav a:hover { background: var(--side-hover); color: #fff; }
.side nav a.on { background: var(--side-on); color: #fff; font-weight: 600; box-shadow: inset 3px 0 0 var(--orange); }
.side nav a#signOut { margin-top: 12px; }
.side nav a:focus-visible { outline-color: #fff; }

.main { padding: 24px 28px 40px; min-width: 0; }
.topbar { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.shell .crumb { font-size: 12px; color: var(--muted); margin-bottom: 2px; }
.shell .topbar .title { font-family: 'Poppins', sans-serif; font-size: 26px; font-weight: 600; letter-spacing: -0.01em; color: var(--text); }
.top-tools { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.refresh { display: flex; align-items: center; gap: 10px; }
.updated { font-size: 12px; color: var(--muted); }
.duty-chip {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 7px 12px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--border);
  font-size: 13px; font-weight: 500; color: var(--text); white-space: nowrap;
}
.duty-chip .dot { width: 8px; height: 8px; margin: 0; border-radius: 50%; background: var(--up); }
.duty-chip.off .dot { background: var(--border-2); }
.duty-chip small { color: var(--muted); font-size: 12px; font-weight: 400; }

/* Controls inside the dashboard: flat, no glow */
.shell button { font-family: inherit; letter-spacing: 0; box-shadow: none; }
.shell button:hover { box-shadow: none; }
.shell button:focus-visible, .shell input:focus-visible, .shell select:focus-visible, .shell a:focus-visible {
  outline: 2px solid var(--olive); outline-offset: 2px;
}
.shell button.dark { background: var(--olive); color: #fff; border-radius: 10px; font-weight: 600; }
.shell button.dark:hover { background: #3d4331; }
.shell button.ghost.small {
  background: var(--surface); color: var(--text); border: 1px solid var(--border);
  border-radius: 10px; padding: 8px 14px; font-size: 13px; font-weight: 500;
}
.shell button.ghost.small:hover { background: var(--olive-soft); }
.shell .seg { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 3px; gap: 2px; }
.shell .seg button { border-radius: 7px; padding: 6px 12px; font-size: 13px; font-weight: 500; color: var(--muted); }
.shell .seg button:hover { color: var(--text); }
.shell .seg button[aria-pressed="true"] { background: var(--olive); color: #fff; box-shadow: none; }
.shell label { font-size: 13px; font-weight: 500; color: var(--muted); }
.shell input, .shell select {
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
  box-shadow: none; padding: 11px 14px; font-size: 14px; color: var(--text);
}
.shell input:focus, .shell select:focus { border-color: var(--olive); box-shadow: 0 0 0 3px var(--olive-soft); }

/* Two zones: business on the left, live rail on the right */
.dash-grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 20px; align-items: start; }
.dash-main { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.rail { position: sticky; top: 24px; display: flex; flex-direction: column; gap: 20px; }
section[id], header[id], aside[id] { scroll-margin-top: 16px; }

.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); padding: 20px; min-width: 0; }
.ptitle { font-family: 'Poppins', sans-serif; font-size: 18px; font-weight: 600; color: var(--text); margin: 0 0 2px; }
.pdesc { font-size: 12px; color: var(--muted); margin: 0 0 12px; line-height: 1.5; }
.pdesc.foot { margin: 12px 0 0; }
.prow { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: 20px; }
.avg-note { grid-column: 1 / -1; }

/* ---------- Pages ---------- */
.vdesc { font-size: 13px; color: var(--muted); margin: 4px 0 0; max-width: 60ch; line-height: 1.5; }
.dash-grid.solo { grid-template-columns: minmax(0, 1fr); }

/* Needs attention */
.alist { list-style: none; margin: 0; padding: 0; }
.alist li { display: grid; grid-template-columns: 10px 1fr auto; gap: 12px; align-items: start; padding: 12px 0; border-top: 1px solid var(--border); font-size: 14px; }
.alist li:first-child { border-top: 0; padding-top: 4px; }
.alist li.none { grid-template-columns: 1fr; }
.alist b { display: block; font-weight: 600; color: var(--text); }
.alist small { display: block; font-size: 12px; color: var(--muted); margin-top: 2px; line-height: 1.5; }
.alist a { font-size: 13px; font-weight: 500; color: var(--olive); padding: 4px 0; white-space: nowrap; }
.adot { width: 8px; height: 8px; border-radius: 50%; margin-top: 6px; background: var(--olive-3); }
.alist li.warn .adot, .alist li.due .adot { background: var(--down); }
.alist li.info .adot { background: var(--orange); }
.attn .count { background: var(--down-soft); color: var(--down); }

/* Recent activity */
.act { list-style: none; margin: 0; padding: 0; max-height: 34vh; overflow-y: auto; }
.act li { display: grid; grid-template-columns: 34px 1fr auto; gap: 10px; align-items: center; padding: 9px 0; border-top: 1px solid var(--border); font-size: 13px; }
.act li:first-child { border-top: 0; }
.act li.empty { display: block; color: var(--muted); text-align: center; padding: 16px 0; }
.act small { display: block; font-size: 12px; color: var(--muted); }
.act b { font-weight: 600; white-space: nowrap; }
.abadge { font-style: normal; font-size: 11px; font-weight: 600; text-align: center; border-radius: 6px; padding: 3px 0; }
.abadge.in { background: var(--up-soft); color: var(--up); }
.abadge.out { background: var(--olive-soft); color: var(--muted); }

/* Table search and sortable headings */
.tsearch { margin: 0 0 8px; max-width: 280px; }
.shell .tsearch input { margin-top: 0; padding: 9px 12px; font-size: 13px; }
.shell .sortb {
  width: auto; margin: 0; padding: 4px 0; background: none; border: 0; border-radius: 4px;
  font: inherit; font-size: 12px; font-weight: 500; color: var(--muted); cursor: pointer;
}
.shell .sortb:hover, .shell .sortb.on { color: var(--text); background: none; }
.sortb::after { content: '↕'; margin-left: 4px; opacity: 0.35; }
.sortb[data-dir="up"]::after { content: '↑'; opacity: 1; }
.sortb[data-dir="down"]::after { content: '↓'; opacity: 1; }

/* Card maker result and messages */
.fmsg { font-size: 13px; margin: 10px 0 0; }
.fmsg.err { color: var(--down); }
.cardres { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; margin-top: 14px; padding: 14px 16px; border-radius: 10px; background: var(--up-soft); }
.cr-title { font-size: 14px; font-weight: 600; color: var(--up); }
.cr-url { font-size: 13px; color: var(--text); overflow-wrap: anywhere; margin-top: 2px; }
.cr-tok { font-size: 12px; color: var(--muted); margin-top: 2px; }
.shell button.ghost.small { width: auto; margin: 0; }

/* Summary tiles at the top of each page */
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); padding: 16px 18px; min-width: 0; }
.slabel { font-size: 12px; font-weight: 500; color: var(--muted); }
.svalue { font-size: 26px; font-weight: 600; color: var(--text); margin: 6px 0 4px; line-height: 1.2; overflow-wrap: anywhere; }
.svalue small { font-size: 13px; font-weight: 500; color: var(--muted); }
.ssub { font-size: 12px; color: var(--muted); line-height: 1.4; }
.stat.warn { border-color: #EBC9B8; background: #FDF6F2; }
.stat.warn .svalue { color: var(--down); }

.today-row td { background: var(--olive-soft); }
.today-tag { font-size: 11px; font-weight: 600; color: var(--orange); margin-left: 4px; }
.clist .dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--up); margin: 0 8px 1px 0; vertical-align: middle; }

/* NFC card setup steps */
.steps { list-style: none; counter-reset: step; margin: 8px 0 0; padding: 0; display: grid; gap: 12px; }
.steps li { counter-increment: step; display: grid; grid-template-columns: 28px 1fr; gap: 2px 12px; font-size: 14px; }
.steps li::before {
  content: counter(step); grid-row: 1 / span 2;
  width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center;
  background: var(--olive-soft); color: var(--olive); font-weight: 600; font-size: 13px;
}
.steps li b { font-weight: 600; color: var(--text); }
.steps li span { color: var(--muted); font-size: 13px; line-height: 1.5; }
.shell .hint-left { font-size: 12px; color: var(--muted); }

/* KPI cards */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.kcard { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); padding: 18px 20px; min-width: 0; }
.klabel { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 500; color: var(--muted); }
.klabel .ic { width: 16px; height: 16px; color: var(--olive); }
.kvalue { font-size: 28px; font-weight: 600; color: var(--text); margin: 8px 0 6px; line-height: 1.15; }
.kcard.alert .kvalue { color: var(--down); }
.kcard.alert .klabel .ic { color: var(--down); }
.ksub { font-size: 12px; color: var(--muted); }
.chg { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 500; background: var(--olive-soft); color: var(--muted); }
.chg.up { background: var(--up-soft); color: var(--up); }
.chg.down { background: var(--down-soft); color: var(--down); }
.chg-sub { font-size: 12px; color: var(--muted); margin-left: 6px; }

/* Past days: visitors first, sales underneath */
.days { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 10px; margin-top: 4px; }
.day {
  position: relative; background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  padding: 12px 10px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 2px;
}
.day .dw { font-size: 12px; color: var(--muted); }
.day .dd { font-size: 13px; font-weight: 600; color: var(--text); }
.dbar { width: 100%; height: 44px; display: flex; align-items: flex-end; margin: 10px 0 8px; background: var(--olive-soft); border-radius: 6px; overflow: hidden; }
.dbar i { display: block; width: 100%; min-height: 3px; background: var(--olive-3); border-radius: 6px 6px 0 0; }
.day .dv { font-size: 22px; font-weight: 600; color: var(--text); line-height: 1.1; }
.day .dv small { display: block; font-size: 12px; font-weight: 400; color: var(--muted); margin-top: 2px; }
.day .ds { font-size: 12px; color: var(--muted); margin-top: 4px; }
.day.today { border-color: var(--border-2); box-shadow: inset 0 3px 0 var(--orange); }
.day.today .dbar i { background: var(--olive); }
.day .tag { font-size: 11px; font-weight: 600; color: var(--orange); }
.recent-sum { font-size: 13px; color: var(--muted); margin: 14px 0 0; line-height: 1.6; }
.recent-sum b { color: var(--text); font-weight: 600; }

/* Chart */
.legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 12px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend .sw { width: 10px; height: 10px; border-radius: 3px; background: var(--bar); }
.legend .ln { width: 16px; height: 2px; border-radius: 2px; background: var(--olive); }
.legend .td { width: 8px; height: 8px; border-radius: 50%; background: var(--orange); }
.chart-wrap { padding: 4px 0 0; }
.chart-wrap svg { width: 100%; height: auto; display: block; }
.chart-wrap .axis { font-size: 11px; fill: var(--muted); font-family: 'Inter', system-ui, sans-serif; }
.chart-wrap .grid { stroke: var(--border); stroke-width: 1; }
.chart-wrap .grid.base { stroke: var(--border-2); }
.chart-wrap .bar { fill: var(--bar); transition: fill 0.15s; }
.chart-wrap .bar:hover { fill: var(--olive-3); }
.chart-wrap .bar.today { fill: var(--olive-3); }
.chart-wrap .line-s { fill: none; stroke: var(--olive); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart-wrap .dot-s { fill: var(--surface); stroke: var(--olive); stroke-width: 2; }
.chart-wrap .dot-s.today { fill: var(--orange); stroke: var(--surface); }
.chart-wrap .peak-lbl { font-size: 11px; font-weight: 600; fill: var(--text); font-family: 'Inter', system-ui, sans-serif; }
.peak-note { font-size: 12px; color: var(--muted); margin: 8px 0 0; }

/* Tables */
table.dtable { width: 100%; border-collapse: collapse; font-size: 14px; margin-top: 4px; }
.dtable th, .dtable td { padding: 10px 8px; border-bottom: 1px solid var(--border); text-align: left; color: var(--text); }
.dtable th { color: var(--muted); font-weight: 500; font-size: 12px; }
.dtable tbody tr:last-child td { border-bottom: 0; }
.num, .dtable .num { text-align: right; }
.dtable tr.staff-row { cursor: pointer; }
.dtable tr.staff-row:hover td { background: var(--bg); }
.dtable tr.staff-row.sel td { background: var(--olive-soft); }
.dtable tr.staff-row.sel td:first-child { box-shadow: inset 3px 0 0 var(--olive); }
.dtable tr.total-row td { font-weight: 600; border-top: 1px solid var(--border-2); }
.dtable td.empty { color: var(--muted); text-align: center; padding: 18px 8px; }

/* Lists */
.clist { list-style: none; margin: 8px 0 0; padding: 0; max-height: 300px; overflow-y: auto; }
.clist li {
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
  padding: 10px 0; border-bottom: 1px solid var(--border); font-size: 14px;
}
.clist li:last-child { border-bottom: 0; }
.clist li small { display: block; font-size: 12px; color: var(--muted); margin-top: 2px; }
.clist li b { white-space: nowrap; font-weight: 600; }
.clist li span { display: block; }

/* Live rail: who's in right now */
.rail .ptitle { margin: 0; }
.count { font-size: 12px; font-weight: 600; color: var(--olive); background: var(--olive-soft); border-radius: 999px; padding: 2px 9px; }
.count:empty { display: none; }
.live { list-style: none; margin: 0; padding: 0; max-height: 34vh; overflow-y: auto; }
.live li { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; padding: 12px 0; border-bottom: 1px solid var(--border); font-size: 14px; }
.live li:last-child { border-bottom: 0; }
.live .room { font-weight: 600; color: var(--text); }
.live .guest { color: var(--muted); font-weight: 400; }
.live .amt { grid-row: 1 / span 2; grid-column: 2; align-self: center; font-weight: 600; }
.live .when { font-size: 12px; color: var(--muted); }
.live .empty { display: block; color: var(--muted); font-size: 13px; padding: 18px 0; text-align: center; border: 0; }

/* Payment methods */
.pm-wrap { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; margin-top: 4px; }
.donut { width: 120px; flex: 0 0 120px; }
.donut svg { display: block; width: 100%; height: auto; }
.dn-base { fill: none; stroke: var(--bar); stroke-width: 14; }
.dn-base.none { stroke: var(--olive-soft); }
.dn-g { fill: none; stroke: var(--olive); stroke-width: 14; }
.dn-num { font-size: 20px; font-weight: 600; fill: var(--text); font-family: 'Inter', system-ui, sans-serif; }
.dn-lbl { font-size: 10px; fill: var(--muted); font-family: 'Inter', system-ui, sans-serif; }
.pm-side { flex: 1 1 160px; min-width: 0; }
.pmrow { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; font-weight: 500; padding: 8px 0; border-top: 1px solid var(--border); }
.pmrow small { font-size: 12px; font-weight: 400; color: var(--muted); margin-left: 4px; }
.key { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 8px; }
.key.g { background: var(--olive); }
.key.c { background: var(--bar); }
.pm-total { font-size: 26px; font-weight: 600; margin: 0 0 8px; }

.avg-list { margin-top: 6px; }
.avg-row {
  display: flex; align-items: baseline; justify-content: space-between; gap: 16px;
  padding: 10px 0; border-top: 1px solid var(--border);
}
.avg-row:first-child { border-top: 0; padding-top: 2px; }
.avg-row .label { font-size: 13px; color: var(--muted); font-weight: 500; }
.avg-row .value {
  font-size: 16px; font-weight: 600; color: var(--text); text-align: right;
  font-variant-numeric: tabular-nums; overflow-wrap: anywhere;
}

.hideable { margin-top: 12px; }
.hideable summary {
  cursor: pointer; font-size: 13px; font-weight: 500; color: var(--muted);
  padding: 6px 0; list-style: none;
}
.hideable summary:hover { color: var(--text); }
.hideable summary::-webkit-details-marker { display: none; }
.hideable summary::before { content: '▸  '; }
.hideable[open] summary::before { content: '▾  '; }

.shell .status { background: var(--bg); border-radius: 10px; font-weight: 500; }
.shell .status.err { background: var(--down-soft); color: var(--down); margin: 0 0 16px; }
#cardResult { text-align: left; font-size: 14px; }
.cardform { display: grid; grid-template-columns: 1fr 1fr auto; gap: 12px; align-items: end; }
.cardform button { margin-top: 0; width: auto; padding: 12px 22px; }
.cardform label { margin-top: 0; }
.cardform input, .cardform select { margin-top: 6px; }
.shell .skel { border-radius: 12px; background: linear-gradient(90deg, #EFEFE8 25%, #F8F8F3 50%, #EFEFE8 75%); background-size: 200% 100%; }

.kpi-note { display: none; }

@media (max-width: 1280px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 1100px) {
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 1100px) {
  .dash-grid { grid-template-columns: 1fr; }
  .rail { position: static; }
  .live { max-height: none; }
}

/* ---------- Phones and small tablets ---------- */
@media (max-width: 900px) {
  .shell { grid-template-columns: minmax(0, 1fr); }

  /* Compact header: the logo scrolls away, the section menu stays pinned */
  .side {
    position: sticky; top: -58px; z-index: 20; height: auto; min-width: 0;
    padding: 12px 0 0; border-right: 0; border-bottom: 0;
  }
  .side-logo { width: 112px; height: 36px; object-fit: cover; margin: 0 16px 10px; }
  .side hr { display: none; }
  .side nav {
    flex-direction: row; flex-wrap: nowrap; gap: 6px;
    overflow-x: auto; padding: 0 16px 10px;
    scrollbar-width: none; -webkit-overflow-scrolling: touch;
  }
  .side nav::-webkit-scrollbar { display: none; }
  .side nav a {
    flex: 0 0 auto; gap: 8px; min-height: 44px; padding: 10px 14px;
    border: 1px solid var(--side-line); border-radius: 999px; font-size: 13px;
  }
  .side nav a .ic { width: 16px; height: 16px; }
  .side nav a.on { border-color: var(--bg); background: var(--bg); color: var(--olive); box-shadow: none; }
  .side nav a#signOut { margin-top: 0; }

  .main { padding: 16px 16px calc(40px + env(safe-area-inset-bottom)); }
  .shell .crumb { display: none; }
  .topbar { flex-direction: column; align-items: stretch; gap: 12px; margin-bottom: 16px; }
  .shell .topbar .title { font-size: 22px; }
  .updated { display: block; margin-top: 2px; }
  .top-tools { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; width: 100%; }
  .duty-chip { min-width: 0; overflow: hidden; text-overflow: ellipsis; min-height: 44px; }
  .top-tools .seg { grid-column: 1 / -1; grid-row: 2; display: flex; width: 100%; }
  .top-tools .seg button { flex: 1; min-height: 44px; }
  .refresh button.ghost.small, .copyb { min-height: 44px; }

  /* Order on phones: headline numbers, who's in, then the rest */
  .dash-grid { display: flex; flex-direction: column; align-items: stretch; gap: 16px; }
  .dash-main { display: contents; }
  .dash-main > * { order: 3; }
  .kpis, .kpi-note, .stats, .dash-main > .attn { order: 1; }
  .vdesc { font-size: 12px; }
  .rail { order: 2; }

  .panel { padding: 16px; }
  .grid2 { grid-template-columns: 1fr; gap: 16px; }
  .prow .seg button { min-height: 44px; }
  .sortb { min-height: 44px; }
  .tsearch { max-width: none; }
  .shell .tsearch input { min-height: 44px; }
  .rail { gap: 16px; }
  .live, .act { max-height: none; }
  .ptitle { font-size: 17px; }

  /* Past days: one swipeable row, today at the end */
  .days {
    display: flex; gap: 8px; overflow-x: auto; scroll-snap-type: x proximity;
    margin: 4px -16px 0; padding: 0 16px 4px; scrollbar-width: none;
  }
  .days::-webkit-scrollbar { display: none; }
  .day { flex: 0 0 88px; scroll-snap-align: end; }

  .dtable { font-size: 13px; }
  .dtable th, .dtable td { padding: 9px 6px; }
  #staffSec, #passes, #whoSec, #daysTableSec { overflow-x: auto; }
  #whoSec .dtable th, #whoSec .dtable td, #daysTableSec .dtable td { white-space: nowrap; }
}

@media (max-width: 560px) {
  /* 2 x 2 headline cards; the comparison is said once underneath */
  .kpis, .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .stat { padding: 12px 14px; }
  .svalue { font-size: 20px; }
  .kcard { padding: 14px; }
  .klabel { font-size: 12px; gap: 6px; }
  .kvalue { font-size: 22px; margin: 6px 0 6px; }
  .chg-sub { display: none; }
  .ksub { font-size: 11px; }
  .kpi-note { display: block; order: 1; margin: -8px 2px 0; font-size: 12px; color: var(--muted); }

  .legend { gap: 12px; }
  .avg-row { padding: 9px 0; }
  .avg-row .value { font-size: 15px; }
  .cardform { grid-template-columns: 1fr; }
  .cardform button { width: 100%; min-height: 44px; }
  .recent-sum { font-size: 12px; }
}

/* ---------- Motion ---------- */
/* Hover and press feedback */
.side nav a, .shell button, .shell .seg button, .sortb, .alist a, .si-back,
.dtable tr.staff-row td, .shell input, .shell select {
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease, transform 0.1s ease;
}
.kcard, .stat, .day {
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}
.kcard:hover, .stat:hover, .day:hover {
  transform: translateY(-2px); border-color: var(--border-2);
  box-shadow: 0 6px 16px rgba(35, 38, 31, 0.06);
}
.day.today:hover { box-shadow: inset 0 3px 0 var(--orange), 0 6px 16px rgba(35, 38, 31, 0.06); }
.shell button.dark:active, .shell button.ghost.small:active, .si-form button:active { transform: scale(0.98); }
.side nav a .ic { transition: transform 0.15s ease; }
.side nav a:hover .ic { transform: translateX(2px); }
.dbar i { transition: height 0.4s ease; }
.hideable summary::before { display: inline-block; }
.duty-chip:not(.off) .dot { animation: pulse 2.4s ease-out infinite; }

/* Entrance: plays when a page opens or the period changes (.anim is set by app.js) */
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes growY { from { transform: scaleY(0); } to { transform: scaleY(1); } }
@keyframes draw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
@keyframes sweep { from { stroke-dasharray: 0 264; } }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(47, 125, 79, 0.45); } 70%, 100% { box-shadow: 0 0 0 7px rgba(47, 125, 79, 0); } }

.anim .topbar .title, .anim .vdesc { animation: fade 0.3s ease both; }
.anim .dash-main > :not(.kpis):not(.stats), .anim .rail > * { animation: rise 0.36s ease both; }
.anim .dash-main > :nth-child(n+4), .anim .rail > :nth-child(2) { animation-delay: 0.05s; }
.anim .dash-main > :nth-child(n+7) { animation-delay: 0.1s; }
.anim .dash-main > :nth-child(n+10) { animation-delay: 0.15s; }
.anim .kcard, .anim .stat { animation: rise 0.36s ease both; }
.anim .kcard:nth-child(2), .anim .stat:nth-child(2) { animation-delay: 0.05s; }
.anim .kcard:nth-child(3), .anim .stat:nth-child(3) { animation-delay: 0.1s; }
.anim .kcard:nth-child(4), .anim .stat:nth-child(4) { animation-delay: 0.15s; }
.anim .alist li, .anim .act li, .anim .live li { animation: fade 0.4s ease 0.15s both; }

.anim .chart-wrap .bar { transform-box: fill-box; transform-origin: bottom; animation: growY 0.5s cubic-bezier(0.2, 0.7, 0.2, 1) both; animation-delay: calc(var(--i, 0) * 25ms + 0.1s); }
.anim .chart-wrap .line-s { stroke-dasharray: 1; animation: draw 0.8s ease 0.25s both; }
.anim .chart-wrap .dot-s, .anim .chart-wrap .peak-lbl { animation: fade 0.3s ease 0.9s both; }
.anim .dbar i { transform-origin: bottom; animation: growY 0.5s cubic-bezier(0.2, 0.7, 0.2, 1) 0.15s both; }
.anim .dn-g { animation: sweep 0.7s ease 0.2s both; }

.signin:not([hidden]) .si-form { animation: rise 0.4s ease both; }

/* People who ask for less motion get none */
@media (prefers-reduced-motion: reduce) {
  .shell *, .signin * { animation: none !important; transition: none !important; }
  .kcard:hover, .stat:hover, .day:hover { transform: none; }
}

/* ---------- Bill summary (tap screen) ---------- */
.bill { margin-top: 14px; background: var(--band); border-radius: 16px; padding: 14px 16px; text-align: left; }
.bill-title { font-size: 11px; font-weight: 600; letter-spacing: 0.8px; text-transform: uppercase; color: var(--olive-3); margin-bottom: 6px; }
.bill-row { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; padding: 7px 0; border-bottom: 1px dashed var(--line); }
.bill-row span { color: var(--olive-2); }
.bill-total { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 10px; font-size: 13px; font-weight: 600; }
.bill-total b { font-size: 22px; color: var(--olive); }
.bill-note { font-size: 11px; color: var(--olive-2); margin: 8px 0 0; text-align: left; line-height: 1.5; }

/* ---------- Loading states ---------- */
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
.spin {
  display: inline-block; width: 26px; height: 26px; flex-shrink: 0;
  border: 3px solid #DCE4CB; border-top-color: var(--olive);
  border-radius: 50%; animation: spin 0.8s linear infinite;
}
.loader {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 12px; padding: 28px 0; font-size: 13px; color: var(--olive-2); text-align: center;
}
.skel {
  border-radius: 16px;
  background: linear-gradient(90deg, #EEF3E4 25%, #F8FBF2 50%, #EEF3E4 75%);
  background-size: 200% 100%;
  animation: shimmer 1.3s ease-in-out infinite;
}
button.busy { position: relative; color: transparent !important; pointer-events: none; }
button.busy::after {
  content: ''; position: absolute; left: 50%; top: 50%;
  width: 18px; height: 18px; margin: -9px 0 0 -9px;
  border: 2px solid rgba(75, 83, 64, 0.3); border-top-color: var(--olive);
  border-radius: 50%; animation: spin 0.7s linear infinite;
}
button.dark.busy::after { border-color: rgba(255, 255, 255, 0.4); border-top-color: #fff; }

@media (max-width: 800px) {
  .signin { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .si-right { flex-direction: row; justify-content: flex-start; gap: 12px; padding: 14px 20px; }
  .si-right .badge, .si-pill { display: none; }
  .si-right .wordmark { width: 112px; height: 36px; object-fit: cover; }
  .si-left { padding: 16px 20px 24px; }
  .si-form { padding: 24px; }
}
