/* Shared design system: "printed paper". The whole product (site, customer page, games, staff screen,
   dashboard) is one theme: warm cream paper with grain, ink outlines and hard (unblurred) shadows,
   die-cut stickers, strips of tape, and one hot "signal" orange that means "someone is calling you".
   Dark mode is dark kraft paper with cream ink. */
:root {
  --font-display: "Baloo Bhaijaan 2", "Readex Pro", "Segoe UI", Tahoma, system-ui, sans-serif;
  --font-ui: "Readex Pro", "Segoe UI", Tahoma, system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, Consolas, monospace;

  --plane: #f3ebdc;
  --surface: #fbf5e9;
  --surface-2: #f2e7d2;
  --surface-3: #e8dac2;
  --ink: #201c17;
  --ink-2: #4a4136;
  --muted: #746856;
  --line: #e2d5bf;
  --line-strong: #a39478;
  /* outlines of cards, buttons and fields, and the color of hard shadows */
  --outline: #201c17;
  --ink-shadow: #201c17;

  --signal: #ff5a1f;
  --signal-2: #ff2e6e;
  --signal-ink: #b23e0e;
  --signal-soft: #ffe4d3;
  --on-signal: #ffffff;

  --good: #0f9d58;
  --good-ink: #0b6b3c;
  --good-soft: #dcefdc;
  --warn: #f2a516;
  --warn-ink: #7a4f00;
  --warn-soft: #fbe6b4;
  --bad: #d63b3b;
  --bad-ink: #9f2222;
  --bad-soft: #f8dcd4;
  --info: #2a78d6;
  --info-ink: #1c5cab;
  --info-soft: #dde8f4;

  /* Charts, validated on the paper surface (dataviz validate_palette: light #fbf5e9). */
  --viz-1: #2a78d6;
  --viz-hi: #e0521b;
  --viz-1-soft: rgba(42, 120, 214, 0.14);
  --viz-grid: #e6dac6;
  --viz-axis: #bfae93;

  --shadow-1: 2px 2px 0 var(--ink-shadow);
  --shadow-2: 4px 4px 0 var(--ink-shadow);
  --shadow-3: 6px 7px 0 var(--ink-shadow);
  --r-sm: 9px;
  --r-md: 12px;
  --r-lg: 16px;
  --r-xl: 20px;
  --focus: 0 0 0 3px var(--surface), 0 0 0 5px var(--signal);
  --scrim: rgba(32, 28, 23, 0.55);

  /* paper details */
  --tape: rgba(244, 190, 72, 0.78);
  --mustard: #f2b33d;
  --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .32 0 0 0 0 .25 0 0 0 0 .16 0 0 0 .11 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  --sticker: drop-shadow(1.6px 0 0 #fff) drop-shadow(-1.6px 0 0 #fff) drop-shadow(0 1.6px 0 #fff) drop-shadow(0 -1.6px 0 #fff) drop-shadow(1.5px 2.5px 0 rgba(32, 28, 23, 0.32));
  /* the names the games and the dhikr corner use */
  --paper: var(--surface);
  --paper-2: var(--surface-2);
  --paper-ink: var(--outline);
  --paper-shadow: var(--ink-shadow);
  --paper-muted: var(--muted);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --plane: #1b1814;
    --surface: #25211b;
    --surface-2: #2e2921;
    --surface-3: #3a332a;
    --ink: #efe4cf;
    --ink-2: #cfc2aa;
    --muted: #a3967f;
    --line: #3a332a;
    --line-strong: #6b604f;
    --outline: #d8ccb4;
    --ink-shadow: #000;
    --signal: #ff6a33;
    --signal-2: #ff4d82;
    --signal-ink: #ff9a6b;
    --signal-soft: #3a2216;
    --good: #22c272;
    --good-ink: #6ee7a8;
    --good-soft: #173325;
    --warn: #f5b83d;
    --warn-ink: #ffd27a;
    --warn-soft: #3a2e12;
    --bad: #ef5b5b;
    --bad-ink: #ff9b9b;
    --bad-soft: #3d1d1a;
    --info: #3987e5;
    --info-ink: #8cbcf5;
    --info-soft: #172a40;
    --viz-1: #3987e5;
    --viz-hi: #d95926;
    --viz-1-soft: rgba(57, 135, 229, 0.18);
    --viz-grid: #352f27;
    --viz-axis: #5a5041;
    --scrim: rgba(0, 0, 0, 0.66);
    --tape: rgba(244, 190, 72, 0.5);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --plane: #1b1814;
  --surface: #25211b;
  --surface-2: #2e2921;
  --surface-3: #3a332a;
  --ink: #efe4cf;
  --ink-2: #cfc2aa;
  --muted: #a3967f;
  --line: #3a332a;
  --line-strong: #6b604f;
  --outline: #d8ccb4;
  --ink-shadow: #000;
  --signal: #ff6a33;
  --signal-2: #ff4d82;
  --signal-ink: #ff9a6b;
  --signal-soft: #3a2216;
  --good: #22c272;
  --good-ink: #6ee7a8;
  --good-soft: #173325;
  --warn: #f5b83d;
  --warn-ink: #ffd27a;
  --warn-soft: #3a2e12;
  --bad: #ef5b5b;
  --bad-ink: #ff9b9b;
  --bad-soft: #3d1d1a;
  --info: #3987e5;
  --info-ink: #8cbcf5;
  --info-soft: #172a40;
  --viz-1: #3987e5;
  --viz-hi: #d95926;
  --viz-1-soft: rgba(57, 135, 229, 0.18);
  --viz-grid: #352f27;
  --viz-axis: #5a5041;
  --scrim: rgba(0, 0, 0, 0.66);
  --tape: rgba(244, 190, 72, 0.5);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-ui);
  font-size: 15px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--plane) var(--grain);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
[hidden] { display: none !important; }
img, svg, canvas, video { max-width: 100%; }
h1, h2, h3, h4 { margin: 0; line-height: 1.25; text-wrap: balance; font-weight: 700; }
p { margin: 0; }
a { color: var(--signal-ink); text-underline-offset: 3px; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: none; box-shadow: var(--focus); }
::selection { background: color-mix(in srgb, var(--signal) 30%, transparent); }
.tnum { font-variant-numeric: tabular-nums; }
.mono { font-family: var(--font-mono); letter-spacing: 0.04em; }
.muted { color: var(--muted); }
.small { font-size: 0.85rem; }
.eyebrow { font-size: 0.78rem; font-weight: 600; color: var(--muted); }
:lang(en) .eyebrow { text-transform: uppercase; letter-spacing: 0.08em; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
/* A highlighter stroke under a word, in the place's (or Pickup's) color. */
.mark { padding-inline: 3px; background: linear-gradient(transparent 56%, color-mix(in srgb, var(--brand, var(--signal)) 40%, transparent) 56% 90%, transparent 90%); }
/* An emoji as a die-cut sticker. */
.stk { display: inline-block; filter: var(--sticker); }
/* A strip of tape on top of a card (the card needs position: relative). */
.taped::before { content: ""; position: absolute; top: -11px; left: 50%; width: 64px; height: 21px; margin-left: -32px; background: var(--tape); transform: rotate(-3deg); pointer-events: none; }

/* ---- buttons: outlined, with a hard shadow that presses in ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 9px 18px;
  border: 2px solid var(--outline);
  border-radius: var(--r-md);
  background: var(--surface);
  color: var(--ink);
  font-weight: 700;
  font-size: 0.95rem;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
  box-shadow: var(--shadow-1);
  transition: transform 0.1s ease, box-shadow 0.1s ease, background-color 0.15s ease, opacity 0.15s;
  user-select: none;
}
.btn:hover { background: var(--surface-2); }
.btn:active { transform: translate(2px, 2px); box-shadow: 0 0 0 var(--ink-shadow); }
.btn[disabled], .btn.is-busy { opacity: 0.5; pointer-events: none; box-shadow: none; }
.btn-primary { background: var(--signal); color: var(--on-signal); box-shadow: 3px 3px 0 var(--ink-shadow); }
.btn-primary:hover { background: var(--signal); filter: brightness(1.05); }
.btn-ghost { background: transparent; box-shadow: none; }
.btn-ghost:hover { background: var(--surface-2); }
.btn-good { background: var(--good); color: #fff; }
.btn-good:hover { background: var(--good); filter: brightness(1.06); }
.btn-bad { background: var(--bad-soft); color: var(--bad-ink); }
.btn-bad:hover { background: var(--bad-soft); filter: brightness(0.97); }
.btn-lg { min-height: 54px; padding: 13px 22px; font-size: 1.05rem; border-radius: var(--r-lg); box-shadow: var(--shadow-2); }
.btn-lg.btn-ghost { box-shadow: none; }
.btn-lg:active { transform: translate(3px, 3px); }
.btn-sm { min-height: 34px; padding: 5px 12px; font-size: 0.85rem; border-radius: var(--r-sm); border-width: 1.5px; }
.btn-block { width: 100%; }
.btn-icon { width: 40px; min-height: 40px; padding: 0; border-radius: 11px; }
.link-btn { background: none; border: 0; padding: 4px; color: var(--signal-ink); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }

/* ---- form controls ---- */
.field { display: grid; gap: 6px; }
.field > label, .label { font-weight: 600; font-size: 0.9rem; }
.field .hint { font-size: 0.8rem; color: var(--muted); }
.input, .select, .textarea {
  width: 100%;
  min-height: 44px;
  padding: 9px 13px;
  border: 2px solid var(--outline);
  border-radius: var(--r-md);
  background: var(--surface);
  color: var(--ink);
  transition: box-shadow 0.15s;
}
.textarea { min-height: 90px; resize: vertical; }
/* focus: the field casts a hard orange shadow */
.input:focus, .select:focus, .textarea:focus { outline: none; box-shadow: 3px 3px 0 var(--signal); }
.input[dir="ltr"] { text-align: left; }
.input::placeholder, .textarea::placeholder { color: var(--muted); }

.switch { position: relative; display: inline-flex; flex: none; width: 48px; height: 28px; }
.switch input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; z-index: 1; }
.switch span { position: absolute; inset: 0; border-radius: 99px; border: 2px solid var(--outline); background: var(--surface-3); transition: background 0.2s; }
.switch span::after {
  content: "";
  position: absolute;
  top: 2px;
  inset-inline-start: 2px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid var(--outline);
  background: #fff;
  transition: transform 0.2s;
}
.switch input:checked + span { background: var(--good); }
.switch input:checked + span::after { transform: translateX(20px); }
[dir="rtl"] .switch input:checked + span::after { transform: translateX(-20px); }
.switch input:focus-visible + span { box-shadow: var(--focus); }
.switch input:disabled + span { opacity: 0.5; }

/* segmented choice: the picked one is printed in ink */
.seg { display: inline-flex; padding: 3px; gap: 3px; border-radius: var(--r-md); background: var(--surface-2); border: 2px solid var(--outline); }
.seg button { border: 0; background: transparent; padding: 6px 12px; border-radius: 8px; font-weight: 600; font-size: 0.88rem; color: var(--ink-2); min-height: 34px; }
.seg button[aria-pressed="true"] { background: var(--ink); color: var(--surface); }
.seg button:disabled { opacity: 0.5; cursor: not-allowed; }

/* ---- surfaces ---- */
.card { position: relative; background: var(--surface); border: 2px solid var(--outline); border-radius: var(--r-lg); padding: 18px; box-shadow: var(--shadow-2); }
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 10px;
  border: 1.5px solid color-mix(in srgb, currentColor 45%, transparent);
  border-radius: 99px;
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1.5;
  background: var(--surface-2);
  color: var(--ink-2);
  white-space: nowrap;
}
.pill-good { background: var(--good-soft); color: var(--good-ink); }
.pill-warn { background: var(--warn-soft); color: var(--warn-ink); }
.pill-bad { background: var(--bad-soft); color: var(--bad-ink); }
.pill-info { background: var(--info-soft); color: var(--info-ink); }
.pill-signal { background: var(--signal-soft); color: var(--signal-ink); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; flex: none; }

.empty { display: grid; justify-items: center; gap: 6px; padding: 28px 12px; text-align: center; color: var(--muted); }
.empty b { color: var(--ink-2); }

.spinner { width: 28px; height: 28px; border-radius: 50%; border: 3px solid var(--line-strong); border-top-color: var(--signal); animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---- toast: an ink label with an orange shadow ---- */
.toasts {
  position: fixed;
  z-index: 90;
  inset-inline: 0;
  bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  display: grid;
  justify-items: center;
  gap: 8px;
  padding-inline: 16px;
  pointer-events: none;
}
.toast {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: min(520px, 100%);
  padding: 11px 16px;
  border: 2px solid var(--ink-shadow);
  border-radius: var(--r-md);
  background: var(--ink);
  color: var(--surface);
  box-shadow: 4px 4px 0 var(--signal);
  font-weight: 600;
  animation: toast-in 0.25s ease;
}
.toast.good { background: var(--good-ink); color: #fff; box-shadow: 4px 4px 0 var(--ink-shadow); }
.toast.bad { background: var(--bad); color: #fff; box-shadow: 4px 4px 0 var(--ink-shadow); }
.toast button { background: none; border: 0; color: inherit; font-weight: 700; text-decoration: underline; padding: 4px; }
@keyframes toast-in { from { transform: translateY(12px); opacity: 0; } }

/* ---- modal: a taped card ---- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 16px;
  background: var(--scrim);
  animation: fade 0.18s ease;
}
.modal {
  position: relative;
  width: min(480px, 100%);
  max-height: calc(100dvh - 32px);
  overflow: auto;
  background: var(--surface) var(--grain);
  border: 2px solid var(--outline);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-3);
  padding: 22px;
  display: grid;
  gap: 14px;
  animation: pop 0.22s cubic-bezier(0.2, 0.9, 0.3, 1.2);
}
.modal h3 { font-family: var(--font-display); font-size: 1.3rem; font-weight: 800; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }

/* ---- employee codes and the team (login page, staff screen, dashboard) ---- */
.code-input { font-family: var(--font-mono); font-size: 1.9rem; font-weight: 600; letter-spacing: 0.16em; text-align: center !important; height: 64px; text-transform: uppercase; }
.code-input::placeholder { color: var(--line-strong); }
.code-reveal { font-family: var(--font-mono); font-size: 2.4rem; font-weight: 600; letter-spacing: 0.16em; text-align: center; padding: 14px 12px; border-radius: var(--r-md); background: var(--surface-2); border: 2px dashed var(--outline); direction: ltr; user-select: all; }
.code-steps { display: grid; gap: 6px; padding-inline-start: 20px; margin: 6px 0 0; font-size: 0.9rem; }
.code-steps code { font-size: 0.85rem; word-break: break-all; }
.role-opts { display: grid; gap: 8px; }
.role-opt { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: var(--r-md); border: 2px solid var(--outline); background: var(--surface); cursor: pointer; }
.role-opt:has(input:checked) { background: var(--signal-soft); box-shadow: 3px 3px 0 var(--signal); }
.role-opt input { accent-color: var(--signal); width: 18px; height: 18px; flex: none; margin: 0; }
.role-opt .ic { font-size: 1.3rem; flex: none; filter: var(--sticker); }
.role-opt b { display: block; font-size: 0.92rem; }
.role-opt small { display: block; color: var(--muted); font-size: 0.8rem; line-height: 1.35; }
.team-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.team-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 12px; border-radius: var(--r-md); background: var(--surface-2); border: 1.5px solid var(--outline); }
.team-row .ic { font-size: 1.3rem; flex: none; filter: var(--sticker); }
.team-row .who-is { flex: 1; min-width: 120px; display: grid; }
.team-row .who-is small { color: var(--muted); font-size: 0.8rem; }
.team-row .acts { display: flex; gap: 6px; margin-inline-start: auto; }
.team-row .ask { flex-basis: 100%; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 0.86rem; font-weight: 600; }
.team-row .ask span { flex: 1; min-width: 160px; }
.team-add { display: grid; gap: 12px; padding-top: 12px; border-top: 2px dashed var(--line-strong); }
.team-row .perms-edit { flex-basis: 100%; display: grid; gap: 8px; padding-top: 4px; }
.team-row .perms-edit .row-end { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
.perm-switches { display: grid; }
.perm-switch { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 0; border-top: 1.5px dashed var(--line-strong); font-size: 0.92rem; font-weight: 600; cursor: pointer; }
.perm-switch:first-child { border-top: 0; }
.perm-switch small { display: block; color: var(--muted); font-weight: 500; font-size: 0.78rem; }
.perm-switch.locked { opacity: 0.55; cursor: not-allowed; }

/* ---- phone mockup (landing demo, dashboard preview) ----
   The page inside is laid out at a real phone size (390×844, like an iPhone) and scaled by --k,
   so it looks exactly like it will on a customer's phone. The status bar keeps the camera island off the page. */
.phone-mock { --k: 0.72; width: fit-content; padding: 10px; border-radius: calc(55px * var(--k) + 10px); background: #1d1915; border: 2px solid #000; }
.phone-box { position: relative; width: calc(390px * var(--k)); height: calc(844px * var(--k)); border-radius: calc(55px * var(--k)); overflow: hidden; background: #fff; isolation: isolate; }
.phone-screen { position: absolute; top: 0; left: 0; width: 390px; height: 844px; display: flex; flex-direction: column; transform: scale(var(--k)); transform-origin: 0 0; background: #fff; }
.phone-status { flex: none; position: relative; height: 54px; display: flex; align-items: center; justify-content: space-between; padding: 4px 26px 0 40px; direction: ltr; background: var(--status-bg, #ff5a1f); color: var(--status-ink, #fff); font: 600 17px/1 -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif; letter-spacing: -0.01em; }
.phone-status .island { position: absolute; top: 11px; left: 50%; width: 124px; height: 36px; border-radius: 20px; background: #000; transform: translateX(-50%); }
.phone-status .icons { display: flex; align-items: center; gap: 6px; }
.phone-status svg { display: block; }
.phone-screen iframe { flex: 1; min-height: 0; width: 100%; border: 0; display: block; background: #fff; }
.phone-home { position: absolute; bottom: 8px; left: 50%; width: 140px; height: 5px; border-radius: 3px; background: rgba(0, 0, 0, 0.32); transform: translateX(-50%); pointer-events: none; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { transform: scale(0.94); opacity: 0; } }

.center-page { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: 24px max(16px, env(safe-area-inset-right, 0px)) 24px max(16px, env(safe-area-inset-left, 0px)); }
.notfound { display: grid; gap: 12px; justify-items: center; text-align: center; max-width: 420px; }
.notfound h1 { font-family: var(--font-display); font-size: 2rem; }

kbd { font-family: var(--font-mono); font-size: 0.8em; padding: 1px 6px; border: 1.5px solid var(--outline); border-bottom-width: 3px; border-radius: 6px; background: var(--surface-2); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; scroll-behavior: auto !important; }
}
