/* Mobile dashboard (owner and crew views). Spec: docs/superpowers/specs/2026-10-22-mobile-dashboard-roles-design.md
   Colours are tokens on body.dash. Dark is the website near-black; light is warm beige with pastel
   cards on top. Phone first: one column, 44px tap targets, bottom tab bar, bottom sheets. */

[hidden] { display: none !important; }

body.dash {
  --bg: #080808; --card: #141414; --ink: #ffffff; --muted: #a8a8a8; --line: #2a2a2a;
  --kpi-a: #c6c7f8; --kpi-b: #b1e3ff; --on-kpi: #1c1c1c; --on-kpi-soft: #404040;
  --pending: #ffb800; --confirmed: #7db4ff; --completed: #35d07f; --cancelled: #ff6b6b; --wa: #4ade80;
  --btn-bg: #ffffff; --btn-ink: #1c1c1c; --ghost-bg: #232323; --ghost-ink: #ffffff;
  --chip-bg: #1d1d1d; --chip-ink: #c9c9c9; --field: #141414; --link: #bcf20a;
  --this: #ffffff; --prev: #7fb8d8; --paid: #95a4fc; --unpaid: #ffe999; --grid: #2a2a2a;
  --s0: #95a4fc; --s1: #a1e3cb; --s2: #ffffff; --s3: #b1e3ff; --s4: #c6c7f8;
  background: var(--bg); color: var(--ink);
  font: 14px/20px 'Inter', system-ui, -apple-system, sans-serif; letter-spacing: 0;
  min-height: 100vh; overflow-x: hidden; -webkit-text-size-adjust: 100%;
}
:root[data-theme=light] body.dash {
  --bg: #efe8da; --card: #f8f3e9; --ink: #1e1a13; --muted: #6a634f; --line: #dbd1bd;
  --kpi-a: #e3f5ff; --kpi-b: #e5ecf6; --on-kpi: #1c1c1c; --on-kpi-soft: #4a4a4a;
  --pending: #8f5400; --confirmed: #0a4fd1; --completed: #1d7a4b; --cancelled: #b4342e; --wa: #15803d;
  --btn-bg: #1c1c1c; --btn-ink: #f8f3e9; --ghost-bg: #ece4d3; --ghost-ink: #1e1a13;
  --chip-bg: #e6dcc7; --chip-ink: #4f4938; --field: #fffdf8; --link: #4f7000;
  --this: #1e1a13; --prev: #3d8fb8; --paid: #8591e6; --unpaid: #e0a800; --grid: #dbd1bd;
  --s0: #6b7bd8; --s1: #3fa383; --s2: #1e1a13; --s3: #3d8fb8; --s4: #9a9be0;
}
body.dash * { box-sizing: border-box; }
body.dash button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; text-align: left; touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
body.dash :focus-visible { outline: 2px solid var(--link); outline-offset: 2px; }
body.dash a { color: inherit; text-decoration: none; }
body.dash svg.ic { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* ---- shell ---- */
body.dash .app { max-width: 480px; margin: 0 auto; min-height: 100vh; padding-top: env(safe-area-inset-top); }
body.dash .screen { padding: 0 16px calc(96px + env(safe-area-inset-bottom)); }
body.dash .hd { display: flex; align-items: center; gap: 12px; padding: 14px 16px; }
body.dash .hd .ti { font-size: 20px; line-height: 28px; font-weight: 600; }
body.dash .hd .su { color: var(--muted); font-size: 12px; }
body.dash .hd .r { margin-left: auto; display: flex; gap: 8px; align-items: center; }
body.dash .ib { min-height: 40px; min-width: 40px; padding: 0 12px; border-radius: 12px; background: var(--card); display: inline-flex; align-items: center; justify-content: center; gap: 6px; font-size: 13px; font-weight: 500; }
body.dash .err-banner { border: 1px solid var(--cancelled); color: var(--cancelled); border-radius: 12px; padding: 10px 14px; margin-bottom: 12px; }
body.dash .cap { color: var(--muted); font-size: 12px; margin: 4px 0 8px; }
body.dash .note { font-size: 12px; color: var(--muted); padding: 10px 12px; background: var(--card); border-radius: 10px; margin-bottom: 12px; }

/* ---- login ---- */
body.dash .login { max-width: 400px; margin: 10vh auto; display: grid; gap: 14px; padding: 0 20px; }
body.dash .login h2 { font-size: 22px; font-weight: 600; }
body.dash .field { display: grid; gap: 6px; }
body.dash .field span { color: var(--muted); font-size: 13px; }
body.dash .field input { background: var(--field); border: 1px solid var(--line); color: var(--ink); padding: 12px; font: inherit; font-size: 16px; border-radius: 12px; min-height: 44px; }
body.dash .err { color: var(--cancelled); min-height: 1.2em; }

/* ---- buttons ---- */
body.dash .btn { box-shadow: none; border: 0; display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 12px; border-radius: 12px;
  background: var(--btn-bg); color: var(--btn-ink); font-weight: 500; flex: 1 1 0; min-width: 0; text-align: center; }
body.dash .btn.ghost { background: var(--ghost-bg); color: var(--ghost-ink); }
body.dash .btn.sm { min-height: 40px; flex: none; font-size: 13px; padding: 0 14px; }
body.dash .btn:disabled { opacity: .55; cursor: progress; }

/* ---- kpi cards, cards, headings ---- */
body.dash .kpis { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
body.dash .kpi { border-radius: 16px; padding: 16px; display: block; width: 100%; background: var(--kpi-a); color: var(--on-kpi); min-height: 96px; }
body.dash .kpi.kb { background: var(--kpi-b); }
body.dash .kpi:active { transform: scale(.97); }
body.dash .kpi .t { font-size: 12px; color: var(--on-kpi-soft); }
body.dash .kpi .n { font-size: 22px; line-height: 32px; font-weight: 600; margin-top: 4px; color: var(--on-kpi); }
body.dash .kpi .d { font-size: 12px; color: var(--on-kpi-soft); margin-top: 2px; }
body.dash .kpi .up { color: #14683d; font-weight: 600; }
body.dash .kpi .down { color: #a12622; font-weight: 600; }
body.dash .card { background: var(--card); border-radius: 16px; padding: 16px; margin-top: 12px; }
body.dash .ch { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
body.dash .ch h3 { font-size: 14px; font-weight: 600; }
body.dash .ch .sub { color: var(--muted); font-size: 12px; }
body.dash .ch .r { margin-left: auto; }
body.dash .seg { display: flex; background: var(--bg); border-radius: 10px; padding: 2px; }
body.dash .seg button { padding: 0 12px; min-height: 40px; border-radius: 8px; color: var(--muted); font-size: 12px; display: inline-flex; align-items: center; }
body.dash .seg .on { background: var(--btn-bg); color: var(--btn-ink); }
body.dash .legend { display: flex; gap: 14px; font-size: 11px; color: var(--muted); margin: 4px 0 2px; flex-wrap: wrap; }
body.dash .legend i, body.dash .dl i { display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 6px; background: var(--sc); }

/* ---- chart colours (classes come from dash-charts.js) ---- */
body.dash svg text { font: 11px 'Inter', sans-serif; fill: var(--muted); }
body.dash svg .grid { stroke: var(--grid); }
body.dash svg .c-this { stroke: var(--this); stroke-width: 2.5; }
body.dash svg .c-prev { stroke: var(--prev); stroke-width: 2; }
body.dash svg circle.pt.c-this { fill: var(--card); stroke: var(--this); stroke-width: 2; }
body.dash svg rect.c-paid { fill: var(--paid); }
body.dash svg rect.c-unpaid { fill: var(--unpaid); }
body.dash i.c-paid { --sc: var(--paid); } body.dash i.c-unpaid { --sc: var(--unpaid); }
body.dash i.c-this { --sc: var(--this); } body.dash i.c-prev { --sc: var(--prev); }
body.dash .pt { cursor: pointer; }
body.dash .s0 { --sc: var(--s0); } body.dash .s1 { --sc: var(--s1); } body.dash .s2 { --sc: var(--s2); } body.dash .s3 { --sc: var(--s3); } body.dash .s4 { --sc: var(--s4); }
body.dash svg path.s0, body.dash svg path.s1, body.dash svg path.s2, body.dash svg path.s3, body.dash svg path.s4, body.dash svg circle.s0, body.dash svg circle.s1, body.dash svg circle.s2, body.dash svg circle.s3, body.dash svg circle.s4 { stroke: var(--sc); }
body.dash svg .ring-empty { stroke: var(--grid); }
body.dash svg text.donut-n { font-size: 17px; font-weight: 600; fill: var(--ink); }
body.dash .donut-wrap { display: flex; align-items: center; gap: 16px; margin-top: 4px; }
body.dash .dl { flex: 1; display: grid; gap: 4px; font-size: 12px; }
body.dash .dl button, body.dash .dl div { display: flex; align-items: center; min-height: 40px; width: 100%; }
body.dash .dl b { margin-left: auto; font-weight: 500; }

/* ---- rows and booking cards ---- */
body.dash .row { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); width: 100%; min-height: 44px; }
body.dash .row:first-child { border-top: 0; }
body.dash .tm { width: 64px; font-weight: 600; font-size: 13px; flex: none; white-space: nowrap; }
body.dash .tm.done { color: var(--muted); }
body.dash .rm { flex: 1; min-width: 0; }
body.dash .rm .n1 { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
body.dash .rm small { display: block; color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
body.dash .amt { font-weight: 500; }
body.dash .ico { width: 36px; height: 36px; border-radius: 10px; background: var(--bg); display: grid; place-items: center; flex: none; }
body.dash .chev { color: var(--muted); }
body.dash .st { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--ink); }
body.dash .st::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--c); }
body.dash .s-completed { --c: var(--completed); } body.dash .s-confirmed { --c: var(--confirmed); } body.dash .s-cancelled { --c: var(--cancelled); }
body.dash .s-pending { --c: var(--pending); } body.dash .s-unpaid { --c: var(--pending); }
body.dash .chips { display: flex; gap: 8px; overflow-x: auto; margin: 0 -16px 8px; padding: 0 16px; scrollbar-width: none; }
body.dash .chips::-webkit-scrollbar, body.dash .strip::-webkit-scrollbar, body.dash .hs::-webkit-scrollbar { display: none; }
body.dash .chip { flex: none; background: var(--chip-bg); color: var(--chip-ink); border-radius: 20px; padding: 0 16px; min-height: 40px; display: inline-flex; align-items: center; }
body.dash .chip.on { background: var(--btn-bg); color: var(--btn-ink); }
body.dash .search { display: flex; align-items: center; gap: 8px; background: var(--card); border-radius: 12px; padding: 0 12px; min-height: 44px; margin-bottom: 12px; color: var(--muted); }
body.dash .search input { flex: 1; background: none; border: 0; outline: 0; font: inherit; color: var(--ink); font-size: 16px; min-height: 44px; min-width: 0; }
body.dash .dh { padding: 12px 0 4px; color: var(--muted); font-size: 12px; font-weight: 500; }
body.dash .bk { background: var(--card); border-radius: 14px; padding: 12px 14px; display: flex; align-items: center; gap: 12px; margin-bottom: 8px; width: 100%; min-height: 56px; }
body.dash .bk .end { text-align: right; flex: none; }

/* ---- slots tab ---- */
body.dash .strip { display: flex; gap: 8px; overflow-x: auto; margin: 0 -16px 12px; padding: 0 16px 4px; scrollbar-width: none; }
body.dash .dy { flex: none; width: 56px; min-height: 64px; border-radius: 14px; background: var(--card); padding: 10px 0; text-align: center; }
body.dash .dy.on { background: var(--btn-bg); color: var(--btn-ink); }
body.dash .dy small { display: block; font-size: 11px; color: var(--muted); }
body.dash .dy.on small { color: var(--btn-ink); }
body.dash .dy b { font-size: 16px; font-weight: 600; }
body.dash .dots { display: flex; gap: 3px; justify-content: center; margin-top: 6px; }
body.dash .dots i { width: 5px; height: 5px; border-radius: 50%; background: var(--line); }
body.dash .dots i.booked { background: var(--paid); }
body.dash .dots i.pending { background: var(--pending); }
body.dash .dots i.blocked { background: transparent; border: 1px solid var(--muted); }
body.dash .slotrow { background: var(--card); border-radius: 14px; padding: 12px 14px; display: flex; align-items: center; gap: 12px; margin-bottom: 8px; width: 100%; min-height: 56px; }
body.dash .hs { display: flex; gap: 12px; overflow-x: auto; margin: 0 -16px; padding: 0 16px; scrollbar-width: none; }
body.dash .hs .kpi { flex: none; width: 150px; }

/* ---- bottom tab bar ---- */
body.dash .bn { position: fixed; left: 0; right: 0; bottom: 0; max-width: 480px; margin: 0 auto; background: var(--bg); border-top: 1px solid var(--line);
  display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; padding: 6px 8px calc(8px + env(safe-area-inset-bottom)); z-index: 10; }
body.dash .bn button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; color: var(--muted); font-size: 11px; position: relative; border-radius: 12px; min-height: 48px; }
body.dash .bn button.on { color: var(--ink); }
body.dash .bn button.on::before { content: ""; position: absolute; top: -7px; width: 20px; height: 3px; border-radius: 2px; background: var(--ink); }
body.dash .badge { position: absolute; top: 2px; left: calc(50% + 6px); background: var(--paid); color: #1c1c1c; border-radius: 9px; font-size: 10px; padding: 0 5px; line-height: 15px; }

/* ---- bottom sheet ---- */
body.dash .scrim { position: fixed; inset: 0; background: rgba(0,0,0,.4); opacity: 0; pointer-events: none; transition: opacity .2s; z-index: 20; }
body.dash .scrim.on { opacity: 1; pointer-events: auto; }
body.dash .sheet { position: fixed; left: 0; right: 0; bottom: 0; max-width: 480px; margin: 0 auto; max-height: 85vh; background: var(--bg); color: var(--ink);
  border-radius: 24px 24px 0 0; transform: translateY(105%); transition: transform .28s cubic-bezier(.2,.8,.2,1); z-index: 30; display: flex; flex-direction: column; outline: 0; visibility: hidden; }
body.dash .sheet.on { transform: none; visibility: visible; }
body.dash .grab { width: 40px; height: 4px; border-radius: 2px; background: var(--line); margin: 8px auto 0; }
body.dash .sh { padding: 12px 20px 4px; display: flex; gap: 12px; align-items: flex-start; }
body.dash .sh h2 { font-size: 18px; line-height: 26px; font-weight: 600; }
body.dash .sh .sub { color: var(--muted); font-size: 12px; }
body.dash .sh .ib { margin-left: auto; }
body.dash .sb { padding: 4px 20px calc(24px + env(safe-area-inset-bottom)); overflow: auto; }
body.dash .big { font-size: 30px; line-height: 40px; font-weight: 600; }
body.dash .dsub { color: var(--muted); margin-bottom: 8px; font-size: 13px; }
body.dash .bar { height: 6px; border-radius: 3px; background: var(--card); overflow: hidden; margin-top: 6px; }
body.dash .bar i { display: block; height: 100%; background: var(--paid); }
body.dash .kv { display: flex; padding: 10px 0; border-top: 1px solid var(--line); gap: 8px; }
body.dash .kv > span:first-child { color: var(--muted); width: 84px; flex: none; }
body.dash .kv > span + span { overflow-wrap: anywhere; }
body.dash .acts { display: flex; gap: 8px; margin-top: 12px; }
body.dash .picker { display: grid; gap: 6px; margin-top: 12px; }
body.dash .picker .btn { justify-content: flex-start; }

/* ---- crew view ---- */
body.dash .days { display: flex; gap: 8px; margin-bottom: 12px; }
body.dash .days button { flex: 1; text-align: center; background: var(--chip-bg); border-radius: 12px; padding: 8px 0; color: var(--chip-ink); font-weight: 500; min-height: 48px; }
body.dash .days .on { background: var(--btn-bg); color: var(--btn-ink); }
body.dash .days small { display: block; font-size: 11px; font-weight: 400; }
body.dash .sum { display: flex; gap: 12px; margin-bottom: 12px; }
body.dash .sum > div { flex: 1; border-radius: 16px; padding: 12px 16px; background: var(--kpi-a); color: var(--on-kpi); }
body.dash .sum > div + div { background: var(--kpi-b); }
body.dash .sum b { display: block; font-size: 22px; line-height: 30px; }
body.dash .sum span { font-size: 12px; color: var(--on-kpi-soft); }
body.dash .job { background: var(--card); border-radius: 18px; padding: 16px; margin-bottom: 12px; }
body.dash .job .top { display: flex; align-items: center; gap: 8px; }
body.dash .job .tm { width: auto; font-size: 18px; }
body.dash .job .tag { margin-left: auto; font-size: 12px; border-radius: 10px; padding: 2px 10px; background: var(--bg); color: var(--ink); }
body.dash .job .next { font-size: 11px; background: var(--s1); color: #1c1c1c; border-radius: 8px; padding: 1px 8px; font-weight: 600; }
body.dash .job .nm { font-size: 16px; font-weight: 600; margin-top: 8px; }
body.dash .job .sv { color: var(--muted); }
body.dash .job .ad { display: flex; gap: 8px; margin-top: 10px; align-items: flex-start; }
body.dash .job .ad svg { margin-top: 1px; color: var(--muted); }
body.dash .job.done .nm { color: var(--muted); }
body.dash .cacts { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; margin-top: 14px; }
body.dash .a { min-height: 48px; border-radius: 14px; display: flex; flex-direction: column; align-items: center; justify-content: center; font-size: 11px; font-weight: 500; background: var(--bg); border: 1px solid var(--line); color: var(--ink); text-align: center; }
body.dash .a.go { background: var(--btn-bg); color: var(--btn-ink); border-color: var(--btn-bg); }
body.dash .a.wa { color: var(--wa); }
body.dash .fin { margin-top: 10px; width: 100%; min-height: 48px; border-radius: 12px; background: var(--paid); color: #1c1c1c; font-weight: 600; text-align: center; }
body.dash .wait { margin-top: 10px; color: var(--pending); font-size: 13px; }
body.dash .tip { font-size: 12px; color: var(--muted); text-align: center; padding: 8px; }

/* ---- toast ---- */
body.dash .toast { position: fixed; left: 16px; right: 16px; bottom: calc(80px + env(safe-area-inset-bottom)); max-width: 440px; margin: 0 auto; z-index: 40; text-align: center;
  background: var(--btn-bg); color: var(--btn-ink); border-radius: 12px; font-size: 13px; }
body.dash .toast:not(:empty) { padding: 12px 16px; }

@media (min-width: 700px) { body.dash .app { box-shadow: 0 0 0 1px var(--line); } }

body.dash .foot { display: flex; gap: 8px; margin-top: 24px; }
body.dash .foot .btn { flex: 1; }
