/* Minutes — staff screens (shop board, rider web).
   Built for a tablet on a counter and a phone in one hand: big targets, high
   contrast, nothing that needs a mouse. Same look as the apps and the
   website: Liquid-glass surfaces over a slowly moving brand colour field. */

:root {
  --citrus: #f0d9a8;
  --amber: #d6a444;
  --lime: #e7cb91;
  --green: #d6a444;
  --forest: #8c651f;
  --danger: #e5473d;

  --bg: #f4f8f2;
  --surface: #ffffff;
  --raised: #f6faf4;
  --ink: #17140f;
  --ink-2: #4f5753;
  --ink-3: #7c8580;
  --on-accent: #17140f;
  --line: rgba(23, 20, 15, 0.09);
  --glass: rgba(255, 255, 255, 0.62);
  --glass-strong: rgba(255, 255, 255, 0.8);
  --glass-edge: rgba(255, 255, 255, 0.9);
  --shadow: 0 1px 2px rgba(60, 44, 14, 0.05), 0 14px 40px rgba(60, 44, 14, 0.10);
  --accent-text: #8c651f;
  --mesh-a: 0.5;
  --mesh-warm: var(--citrus);

  --signature: linear-gradient(135deg, var(--citrus), var(--lime) 50%, var(--green));
  --action: linear-gradient(180deg, var(--lime), var(--green) 55%, var(--forest));

  --r-sm: 12px;
  --r-md: 18px;
  --r-lg: 24px;
  --r-xl: 32px;
  --spring: cubic-bezier(.2, .9, .25, 1.15);
  --ease: cubic-bezier(.22, 1, .36, 1);

  --font: "Inter", -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, sans-serif;
  --display: "Inter Tight", "Inter", -apple-system, "SF Pro Display", system-ui, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #141411; --surface: #1d1c18; --raised: #1c2320; --ink: #f4f7f5; --ink-2: #b3bbb6; --ink-3: #7f8983;
    --line: rgba(255, 255, 255, 0.10); --glass: rgba(24, 32, 28, 0.6); --glass-strong: rgba(28, 36, 32, 0.85);
    --glass-edge: rgba(255, 255, 255, 0.12); --shadow: 0 1px 2px rgba(0,0,0,.3), 0 18px 50px rgba(0,0,0,.45);
    --accent-text: #e4bd76; --mesh-a: 0.38; --mesh-warm: #71552a; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #141411; --surface: #1d1c18; --raised: #1c2320; --ink: #f4f7f5; --ink-2: #b3bbb6; --ink-3: #7f8983;
  --line: rgba(255, 255, 255, 0.10); --glass: rgba(24, 32, 28, 0.6); --glass-strong: rgba(28, 36, 32, 0.85);
  --glass-edge: rgba(255, 255, 255, 0.12); --shadow: 0 1px 2px rgba(0,0,0,.3), 0 18px 50px rgba(0,0,0,.45);
  --accent-text: #e4bd76; --mesh-a: 0.38; --mesh-warm: #71552a; color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body.work {
  margin: 0; min-height: 100vh; background: var(--bg); color: var(--ink);
  font: 16px/1.5 var(--font); -webkit-font-smoothing: antialiased;
  padding-bottom: 32px; -webkit-tap-highlight-color: transparent; overflow-x: hidden;
}
a { color: inherit; }
button { font: inherit; }
:focus-visible { outline: 2.5px solid var(--green); outline-offset: 3px; border-radius: 8px; }
h1, h2, h3 { font-family: var(--display); letter-spacing: -0.025em; margin: 0; }
.muted { color: var(--ink-2); }
.small { font-size: 13px; }
.wrap-narrow { max-width: 680px; margin: 0 auto; padding: 0 16px; }
.wrap-wide { max-width: 1400px; margin: 0 auto; padding: 0 20px; }

/* Moving colour field (replaces the old .ambient blobs) */
.mesh, .ambient { position: fixed; inset: -10%; z-index: -1; pointer-events: none; overflow: hidden; }
.mesh i, .ambient span { position: absolute; border-radius: 50%; filter: blur(80px); opacity: var(--mesh-a); will-change: transform; }
.mesh .m1, .ambient .a1 { width: 44vmax; height: 44vmax; left: -8%; top: -12%; background: var(--mesh-warm); animation: drift1 28s ease-in-out infinite alternate; }
.mesh .m2, .ambient .a2 { width: 50vmax; height: 50vmax; right: -14%; top: 8%; background: var(--green); opacity: calc(var(--mesh-a) * .75); animation: drift2 34s ease-in-out infinite alternate; }
.mesh .m3 { width: 36vmax; height: 36vmax; left: 30%; bottom: -16%; background: var(--lime); opacity: calc(var(--mesh-a) * .6); animation: drift1 30s ease-in-out infinite alternate-reverse; }
@keyframes drift1 { to { transform: translate(10vw, 10vh) scale(1.15); } }
@keyframes drift2 { to { transform: translate(-12vw, 12vh) scale(.9); } }

.glass {
  background: var(--glass); border: 1px solid var(--glass-edge);
  -webkit-backdrop-filter: saturate(170%) blur(22px); backdrop-filter: saturate(170%) blur(22px);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255,255,255,.3);
  border-radius: var(--r-lg);
}

/* Brand */
.brand { display: inline-flex; align-items: center; gap: 10px; font-family: var(--display); font-weight: 800; font-size: 19px; letter-spacing: -0.03em; text-decoration: none; }
.brand-mark { width: 34px; height: 34px; border-radius: 11px; background: var(--signature); display: grid; place-items: center; flex: none; box-shadow: 0 6px 16px rgba(214, 164, 68,.35); }
.brand-mark svg { width: 20px; height: 20px; }

/* Live signal */
.live { display: inline-flex; align-items: center; gap: 7px; height: 32px; padding: 0 12px; border-radius: 999px; font-size: 13px; font-weight: 700; background: var(--glass); border: 1px solid var(--glass-edge); }
.live i { width: 8px; height: 8px; border-radius: 50%; background: var(--green); position: relative; }
.live i::after { content: ""; position: absolute; inset: 0; border-radius: 50%; background: inherit; animation: ripple 1.6s ease-out infinite; }
.live.connecting i { background: var(--amber); }
.live.offline i { background: var(--ink-3); }
.live.connecting i::after, .live.offline i::after { animation: none; }
@keyframes ripple { from { transform: scale(1); opacity: .8; } to { transform: scale(2.8); opacity: 0; } }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 50px; padding: 0 22px;
  border-radius: 16px; border: 0; cursor: pointer; font: 700 16px/1.1 var(--font); text-decoration: none; color: var(--ink);
  transition: transform .3s var(--spring), box-shadow .2s, opacity .2s; touch-action: manipulation;
}
.btn:active { transform: scale(.95); }
.btn-primary { background: var(--action); color: var(--on-accent); box-shadow: inset 0 1px 0 rgba(255,255,255,.4), 0 8px 22px rgba(214, 164, 68,.35); }
.btn-ghost { background: var(--glass); border: 1px solid var(--line); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); }
.btn-danger { background: color-mix(in srgb, var(--danger) 12%, transparent); color: var(--danger); border: 1px solid color-mix(in srgb, var(--danger) 30%, transparent); }
.btn-sm { min-height: 44px; padding: 0 16px; font-size: 14px; border-radius: 14px; }
.btn-xl { min-height: 64px; font-size: 19px; border-radius: 20px; }
.btn[disabled] { opacity: .5; cursor: progress; }
.wide { width: 100%; }
.link-btn { background: none; border: 0; color: var(--accent-text); font: 600 15px var(--font); cursor: pointer; padding: 6px 0; justify-self: start; min-height: 44px; }
.icon-btn { width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line); background: var(--glass); color: var(--ink); display: grid; place-items: center; cursor: pointer; font-size: 16px; }

/* Fields */
.field { display: grid; gap: 6px; }
.field > span { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.field input, .field select, .field textarea, input.field {
  min-height: 50px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface);
  color: var(--ink); font: 16px var(--font); padding: 10px 14px; width: 100%;
}
.form-note { font-size: 14px; color: var(--ink-3); min-height: 20px; margin: 0; }
.form-note.err { color: var(--danger); font-weight: 600; }
.form-note.ok { color: var(--accent-text); font-weight: 600; }

/* Sign in */
.auth-view { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.auth-card { width: 100%; max-width: 420px; padding: 32px; display: grid; gap: 16px; }
.auth-card h1 { font-size: 30px; margin-top: 8px; }
.auth-card p { margin: 0; }

/* Top bar */
.topbar {
  position: sticky; top: 10px; z-index: 30; display: flex; align-items: center; gap: 12px;
  margin: 10px 12px 0; padding: 8px 10px 8px 14px; border-radius: 22px;
  background: var(--glass-strong); border: 1px solid var(--glass-edge); box-shadow: var(--shadow);
  -webkit-backdrop-filter: saturate(180%) blur(22px); backdrop-filter: saturate(180%) blur(22px);
}
.topbar .brand { font-size: 17px; }
.topbar .spacer { margin-left: auto; }
.topbar .who { font-size: 13px; color: var(--ink-2); max-width: 26vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 640px) { .topbar .who { display: none; } }

/* Segmented tabs with a sliding pill */
.seg { display: flex; gap: 4px; padding: 5px; margin: 14px auto 4px; max-width: 680px; border-radius: 18px; background: var(--glass); border: 1px solid var(--glass-edge); position: relative; }
.seg button {
  flex: 1; min-height: 46px; border-radius: 14px; border: 0; background: transparent; color: var(--ink-2);
  font: 700 15px var(--font); cursor: pointer; position: relative; z-index: 1; transition: color .25s;
}
.seg button[aria-selected="true"] { color: var(--on-accent); background: var(--action); box-shadow: 0 6px 16px rgba(214, 164, 68,.3); }
.seg .count { font-size: 12px; opacity: .8; }

h1.page { font-size: 26px; margin: 22px 0 6px; }

/* Cards */
.cards { display: grid; gap: 14px; padding: 12px 0 24px; }
.card {
  border-radius: var(--r-lg); border: 1px solid var(--glass-edge); background: var(--glass-strong);
  -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px);
  box-shadow: var(--shadow); overflow: hidden; animation: cardin .45s var(--spring) both;
}
@keyframes cardin { from { opacity: 0; transform: translateY(10px) scale(.97); } }
.card-head { display: flex; align-items: center; gap: 10px; padding: 16px 18px 0; flex-wrap: wrap; }
.card-head .num { font-family: var(--display); font-weight: 800; font-size: 20px; letter-spacing: -0.02em; }
.card-body { padding: 10px 18px 16px; display: grid; gap: 10px; }
.card-foot { display: flex; gap: 10px; padding: 12px 14px 14px; flex-wrap: wrap; }
.card-foot .btn { flex: 1 1 auto; min-height: 52px; }

.leg { display: grid; grid-template-columns: 26px 1fr; gap: 10px; align-items: start; }
.leg .dot { width: 12px; height: 12px; border-radius: 50%; margin: 6px 7px; }
.leg .dot.shop { background: var(--amber); }
.leg .dot.drop { background: var(--green); }
.leg b { display: block; font-size: 13px; color: var(--ink-2); font-weight: 600; }
.leg a { color: var(--accent-text); font-size: 14px; font-weight: 700; text-decoration: none; display: inline-flex; min-height: 36px; align-items: center; }

.facts { display: flex; flex-wrap: wrap; gap: 8px; }
.fact { font-size: 13px; font-weight: 600; padding: 6px 11px; border-radius: 999px; background: var(--raised); border: 1px solid var(--line); }
.fact.warn { background: color-mix(in srgb, var(--amber) 24%, transparent); border-color: transparent; }
.fact.pay { background: color-mix(in srgb, var(--green) 16%, transparent); color: var(--accent-text); border-color: transparent; }

.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 800; padding: 5px 11px; border-radius: 999px; }
.pill.ok { background: color-mix(in srgb, var(--green) 18%, transparent); color: var(--accent-text); }
.pill.warn { background: color-mix(in srgb, var(--amber) 26%, transparent); color: var(--ink); }
.pill.off { background: var(--raised); color: var(--ink-3); }
.pill.new { background: var(--signature); color: var(--on-accent); }

.items { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }
.items li { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 14px; background: var(--raised); font-size: 17px; }
.items .q { font-weight: 800; min-width: 34px; font-family: var(--display); }
.items .tick { margin-left: auto; width: 28px; height: 28px; accent-color: var(--green); }
.items li.done { opacity: .45; text-decoration: line-through; }

.empty-state { text-align: center; padding: 44px 16px; color: var(--ink-2); }
.empty-state b { display: block; color: var(--ink); font-size: 18px; margin-bottom: 6px; font-family: var(--display); }

.earn { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin: 16px 0; }
.earn div { padding: 18px; border-radius: var(--r-md); border: 1px solid var(--glass-edge); background: var(--glass-strong); box-shadow: var(--shadow); }
.earn span { display: block; font-size: 13px; color: var(--ink-2); font-weight: 600; }
.earn b { font-family: var(--display); font-size: 30px; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }

/* Stock rows */
.shelf { display: grid; gap: 8px; }
.shelf-item {
  display: grid; grid-template-columns: 1fr 110px 96px auto; gap: 10px; align-items: center;
  padding: 12px 14px; border-radius: 16px; border: 1px solid var(--glass-edge); background: var(--glass-strong);
}
.shelf-item input { min-height: 46px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font: 16px var(--font); padding: 8px 10px; width: 100%; }
.shelf-item .name { font-weight: 700; }
.shelf-item .sub { font-size: 12px; color: var(--ink-3); }
.shelf-item.off { opacity: .55; }
@media (max-width: 560px) { .shelf-item { grid-template-columns: 1fr 1fr; } .shelf-item .name-cell { grid-column: span 2; } }

/* Sheets */
dialog.sheet {
  width: min(600px, calc(100vw - 20px)); max-height: calc(100vh - 24px); padding: 0;
  border: 1px solid var(--glass-edge); border-radius: var(--r-xl); background: var(--glass-strong); color: var(--ink);
  -webkit-backdrop-filter: blur(30px); backdrop-filter: blur(30px); box-shadow: 0 40px 80px rgba(0,0,0,.3);
}
dialog.sheet[open] { display: flex; flex-direction: column; animation: sheetin .4s var(--spring); }
@keyframes sheetin { from { opacity: 0; transform: translateY(20px) scale(.97); } }
dialog::backdrop { background: rgba(5, 12, 8, .45); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
.sheet-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 18px 20px; border-bottom: 1px solid var(--line); flex: none; }
.sheet-head h2 { font-size: 22px; }
.sheet-body { padding: 18px 20px; overflow-y: auto; display: grid; gap: 14px; flex: 1 1 auto; min-height: 0; }
.sheet-foot { padding: 14px 18px 18px; border-top: 1px solid var(--line); display: flex; gap: 10px; flex: none; }
.sheet-foot .btn { flex: 1; min-height: 56px; }

.choice { display: grid; gap: 8px; }
.choice label { display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; font-weight: 600; min-height: 52px; }
.choice input { width: 22px; height: 22px; accent-color: var(--green); }
.choice label:has(input:checked) { border-color: var(--green); background: color-mix(in srgb, var(--green) 10%, var(--surface)); }

.photo-btn { position: relative; overflow: hidden; display: inline-flex; }
.photo-btn input { position: absolute; inset: 0; opacity: 0; }
.photo-preview { width: 100%; max-height: 190px; object-fit: cover; border-radius: 14px; }

.toast {
  position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); z-index: 100;
  background: var(--ink); color: var(--bg); padding: 14px 22px; border-radius: 999px; font-weight: 700;
  box-shadow: 0 14px 34px rgba(0,0,0,.28); max-width: calc(100vw - 32px); animation: toastin .45s var(--spring);
}
@keyframes toastin { from { opacity: 0; transform: translate(-50%, 16px) scale(.95); } }
.toast.err { background: var(--danger); color: #fff; }
.card.offer { outline: 2px solid var(--green); }

/* A switch that looks like one */
.switch { position: relative; display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-weight: 700; min-height: 44px; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch .track { width: 58px; height: 34px; border-radius: 999px; background: var(--line); position: relative; transition: background .3s; flex: none; }
.switch .track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 28px; height: 28px; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgba(0,0,0,.25); transition: transform .4s var(--spring); }
.switch input:checked + .track { background: var(--action); }
.switch input:checked + .track::after { transform: translateX(24px); }
.switch input:focus-visible + .track { outline: 2.5px solid var(--green); outline-offset: 3px; }

/* Skeletons */
.skeleton { border-radius: var(--r-lg); background: linear-gradient(90deg, var(--line), color-mix(in srgb, var(--line) 30%, transparent), var(--line)); background-size: 200% 100%; animation: shimmer 1.3s linear infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
.topbar .btn { white-space: nowrap; }
