*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #141414;
  --surface: #1c1c1c;
  --surface-2: #1e1e1e;
  --surface-3: #262626;
  --border: #2e2e2e;
  --border-2: #383838;
  --text: #f0f0f0;
  --muted: #909090;
  --dim: #8a8a8a;
  --open: #ff5a52;
  --open-soft: #ff8a83;
  --partial: #f4c542;
  --booked: #37d67a;
  --booked-soft: #8fd9b2;
  --r: 12px;
  --r-lg: 14px;
  --r-sm: 9px;
}

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: 'Public Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  overscroll-behavior-y: none;
}

h1, h2, h3, .display { font-family: 'Archivo', sans-serif; letter-spacing: -0.015em; }

button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }
button { cursor: pointer; background: none; border: none; }
a { color: inherit; text-decoration: none; }

.boot { padding: 80px 20px; text-align: center; color: var(--muted); }

/* ── Layout ─────────────────────────────────────────────────────────────── */

.app { min-height: 100vh; display: flex; flex-direction: column; }
.phone { display: flex; flex-direction: column; min-height: 100vh; max-width: 520px; margin: 0 auto; width: 100%; }
.scroll { flex-grow: 1; overflow-y: auto; padding: 0 16px 24px; -webkit-overflow-scrolling: touch; }
.stack { display: flex; flex-direction: column; gap: 10px; }
.stack-lg { display: flex; flex-direction: column; gap: 16px; }
.row { display: flex; align-items: center; gap: 10px; }
.row-top { display: flex; align-items: flex-start; gap: 10px; }
.grow { flex-grow: 1; min-width: 0; }
.spacer { flex-grow: 1; }

.top {
  padding: 20px 16px 12px;
  display: flex; align-items: center; gap: 12px;
  border-bottom: 1px solid #272727;
  position: sticky; top: 0; background: var(--bg); z-index: 5;
}
.wordmark { font-family: 'Archivo', sans-serif; font-size: 10px; font-weight: 700; letter-spacing: 0.2em; color: var(--dim); }
.title { font-family: 'Archivo', sans-serif; font-size: 22px; font-weight: 700; margin-top: 3px; }
.title-sm { font-family: 'Archivo', sans-serif; font-size: 18px; font-weight: 700; }
.eyebrow { font-size: 10px; font-weight: 700; letter-spacing: 0.2em; color: var(--dim); }
.section-label { font-size: 11px; font-weight: 700; letter-spacing: 0.12em; color: var(--dim); }

.avatar {
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--surface-3); border: 1px solid var(--border-2);
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; flex-shrink: 0;
}
.avatar.sm { width: 32px; height: 32px; font-size: 11px; }

.icon-btn {
  width: 44px; height: 44px; border-radius: var(--r);
  background: var(--surface); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  color: #d8d8d8; flex-shrink: 0;
}

/* ── Tabs ───────────────────────────────────────────────────────────────── */

.tabs { display: flex; gap: 6px; padding: 14px 16px 12px; }
.tab {
  flex-grow: 1; font-size: 13px; font-weight: 700; padding: 11px 8px;
  border-radius: var(--r-sm); background: var(--surface);
  color: #a8a8a8; border: 1px solid var(--border);
}
.tab[aria-selected="true"] { background: var(--text); color: var(--bg); border-color: var(--text); }

/* ── Cards ──────────────────────────────────────────────────────────────── */

.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-lg); padding: 14px; display: block; width: 100%; text-align: left;
}
.card.urgent { border-color: #3a2a29; background: #1c1a19; }
.card.dismissed { border-style: dashed; background: none; }
.card.dismissed .time, .card.dismissed .who, .card.dismissed .when { color: var(--muted); }
/* Small to look at, but the negative margin keeps a thumb-sized target. */
.card-x {
  width: 36px; height: 36px; margin: -9px -9px -9px -4px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--dim); cursor: pointer; flex-shrink: 0;
}
.card-x:hover, .card-x:active { color: var(--text); background: var(--surface-3); }
.card-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 13px; padding-top: 12px; border-top: 1px solid #292929; }

.when { font-size: 11px; font-weight: 700; letter-spacing: 0.09em; color: #e4e4e4; }
.time { font-family: 'Archivo', sans-serif; font-size: 20px; font-weight: 600; margin-top: 8px; }
.time-lg { font-family: 'Archivo', sans-serif; font-size: 25px; font-weight: 700; }
.who { font-size: 13.5px; color: #c9c9c9; margin-top: 4px; }
.meta { font-size: 12px; color: var(--muted); margin-top: 6px; }

.chip { font-size: 11px; font-weight: 600; color: #b4b4b4; background: var(--surface-3); border-radius: 6px; padding: 4px 8px; }
.pill {
  font-size: 10px; font-weight: 700; letter-spacing: 0.08em;
  padding: 4px 9px; border-radius: 999px; white-space: nowrap;
}
.pill.open { background: rgba(255,90,82,.16); color: var(--open-soft); border: 1px solid rgba(255,90,82,.42); }
.pill.hands, .pill.partial { background: rgba(244,197,66,.14); color: var(--partial); border: 1px solid rgba(244,197,66,.4); }
.pill.covered { background: rgba(55,214,122,.14); color: var(--booked); border: 1px solid rgba(55,214,122,.38); }
.pill.none { background: var(--surface-3); color: var(--muted); border: 1px solid var(--border); }

.banner { padding: 11px 12px; border-radius: var(--r); display: flex; gap: 9px; align-items: flex-start; font-size: 12.5px; line-height: 1.45; }
.banner.alert { background: rgba(255,90,82,.12); border: 1px solid rgba(255,90,82,.38); color: #ffada7; }
.banner.warn { background: rgba(244,197,66,.1); border: 1px solid rgba(244,197,66,.34); color: #e0c87a; }
.banner.good { background: rgba(55,214,122,.09); border: 1px solid rgba(55,214,122,.3); color: var(--booked-soft); }
.banner.flat { background: var(--surface); border: 1px solid var(--border); color: var(--muted); }

.field-row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.field-row .k { font-size: 11.5px; font-weight: 600; color: var(--dim); }
.field-row .v { font-size: 13.5px; font-weight: 600; text-align: right; }

.locked { background: #1a1a1a; border: 1px dashed var(--border-2); border-radius: var(--r-lg); padding: 14px; }

/* ── Buttons ────────────────────────────────────────────────────────────── */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  font-weight: 700; border-radius: var(--r-sm); padding: 13px 18px; line-height: 18px;
  border: 1px solid transparent; font-size: 14px; white-space: nowrap;
}
.btn:disabled { opacity: .5; cursor: default; }
.btn-primary { background: var(--text); color: var(--bg); }
.btn-secondary { background: var(--surface-3); border-color: var(--border-2); color: var(--text); }
.btn-ghost { background: none; border-color: #333; color: #a8a8a8; }
.btn-warn { background: var(--partial); color: #1a1400; }
.btn-block { width: 100%; }
.btn-sm { padding: 9px 13px; font-size: 12.5px; line-height: 16px; }
.btn-link { color: var(--muted); font-size: 12.5px; font-weight: 600; padding: 6px; text-align: center; }

.foot {
  padding: 14px 16px calc(20px + env(safe-area-inset-bottom));
  border-top: 1px solid #272727; background: #171717;
  display: flex; flex-direction: column; gap: 9px;
  position: sticky; bottom: 0;
}

/* ── Bottom nav ─────────────────────────────────────────────────────────── */

.nav {
  display: flex; border-top: 1px solid #272727; background: #171717;
  padding: 8px 8px calc(14px + env(safe-area-inset-bottom));
  position: sticky; bottom: 0; z-index: 5;
}
.nav a { flex-grow: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px 0; color: var(--dim); }
.nav a[aria-current="page"] { color: var(--text); }
.nav span { font-size: 10.5px; font-weight: 600; }

/* ── Forms ──────────────────────────────────────────────────────────────── */

label.opt {
  display: flex; gap: 11px; align-items: center;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r); padding: 12px 13px;
}
label.opt .name { font-size: 13.5px; font-weight: 600; }
label.opt .hint { font-size: 11.5px; color: var(--muted); margin-top: 1px; }
input[type="checkbox"] { width: 20px; height: 20px; accent-color: var(--booked); flex-shrink: 0; }

.input, textarea.input, select.input {
  width: 100%; background: var(--surface); border: 1px solid #333;
  border-radius: var(--r-sm); padding: 12px; outline: none; font-size: 14px;
}
.input:focus { border-color: #5a5a5a; }
textarea.input { resize: vertical; line-height: 1.5; }
.label { display: block; font-size: 11px; font-weight: 700; letter-spacing: 0.08em; color: var(--dim); margin-bottom: 6px; }

.seg { display: flex; gap: 5px; }
.seg button { background: var(--surface); border: 1px solid var(--border); color: #a8a8a8; font-weight: 700; padding: 9px 0; border-radius: 8px; min-width: 42px; }
.seg button[aria-pressed="true"] { background: var(--text); color: var(--bg); border-color: var(--text); }

.reasons { display: flex; gap: 6px; flex-wrap: wrap; }
.reasons button { background: var(--surface); border: 1px solid var(--border); color: #a8a8a8; font-size: 12.5px; font-weight: 600; padding: 9px 14px; border-radius: 999px; }
.reasons button[aria-pressed="true"] { background: var(--surface-3); border-color: var(--border-2); color: var(--text); }

/* ── Auth ───────────────────────────────────────────────────────────────── */

.auth { display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 20px; }
.auth-card { background: #161616; border: 1px solid #2a2a2a; border-radius: var(--r-lg); padding: 32px; width: 100%; max-width: 360px; }

/* ── Manager ────────────────────────────────────────────────────────────── */

.desk { display: flex; min-height: 100vh; }
.side {
  width: 216px; flex-shrink: 0; background: #171717; border-right: 1px solid #272727;
  padding: 22px 14px 18px; display: flex; flex-direction: column; gap: 3px;
}
.side a { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: var(--r-sm); font-size: 13.5px; font-weight: 500; color: #9c9c9c; }
.side a[aria-current="page"] { background: var(--surface-3); color: #f4f4f4; font-weight: 600; }
.side .badge { margin-left: auto; font-size: 11px; font-weight: 700; background: var(--partial); color: #1a1400; border-radius: 999px; padding: 2px 7px; }
.main { flex-grow: 1; padding: 24px 28px 40px; display: flex; flex-direction: column; gap: 16px; min-width: 0; }

.table { background: #1a1a1a; border: 1px solid #2a2a2a; border-radius: 13px; overflow: hidden; }
.tr { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid #242424; }
.tr:last-child { border-bottom: none; }
.tr.head { background: #1d1d1d; font-size: 10.5px; font-weight: 700; letter-spacing: 0.11em; color: var(--dim); padding: 11px 16px; }
.tr.open-row { background: rgba(255,90,82,.05); }
.tr.hands-row { background: rgba(244,197,66,.055); }
.c-when { width: 158px; flex-shrink: 0; }
.c-hrs { width: 52px; flex-shrink: 0; text-align: right; font-weight: 600; color: #d0d0d0; }
.c-cov { width: 190px; flex-shrink: 0; }
.c-act { width: 104px; flex-shrink: 0; text-align: right; }

.filters { display: flex; gap: 7px; flex-wrap: wrap; }
.filters button { font-size: 12.5px; font-weight: 700; padding: 8px 13px; border-radius: 999px; background: var(--surface); color: #a0a0a0; border: 1px solid var(--border); }
.filters button[aria-pressed="true"] { color: var(--text); border-color: var(--border-2); background: var(--surface-3); }

.drawer-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.6); z-index: 20; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(452px, 100vw);
  background: #181818; border-left: 1px solid #303030; z-index: 21;
  display: flex; flex-direction: column;
}
.drawer .body { flex-grow: 1; overflow-y: auto; padding: 18px 22px; display: flex; flex-direction: column; gap: 14px; }
.drawer .head { padding: 22px 22px 16px; border-bottom: 1px solid #2a2a2a; display: flex; align-items: flex-start; gap: 14px; }
.drawer .foot { position: static; background: #1a1a1a; border-top: 1px solid #2a2a2a; padding: 16px 22px 20px; }

.hand-card { background: var(--surface-2); border: 1px solid #2c2c2c; border-radius: 11px; padding: 12px 13px; }
.hand-card.picked { border: 1.5px solid var(--text); }

.empty { text-align: center; color: var(--muted); font-size: 13px; padding: 40px 20px; line-height: 1.5; }

/* ── Toast ──────────────────────────────────────────────────────────────── */

.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 16px);
  background: #262626; border: 1px solid var(--border-2); color: var(--text);
  padding: 12px 18px; border-radius: var(--r); font-size: 13px; font-weight: 600;
  max-width: calc(100vw - 32px); opacity: 0; pointer-events: none;
  transition: opacity .18s ease, transform .18s ease; z-index: 50;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.bad { border-color: rgba(255,90,82,.5); color: var(--open-soft); }

@media (max-width: 860px) {
  .desk { flex-direction: column; }
  .side { width: auto; flex-direction: row; overflow-x: auto; border-right: none; border-bottom: 1px solid #272727; padding: 10px; }
  .side a { white-space: nowrap; }
  .main { padding: 20px 16px 40px; }
  .c-when { width: 120px; }
  .c-cov { width: 130px; }
  .c-hrs { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

/* Money. The amount a shift is worth should be readable before anything else
   on the card, without shouting over the status colours. */
.chip.pay { color: var(--text); background: var(--surface-3); border: 1px solid var(--border-2); font-weight: 700; }

.payout {
  margin-top: 13px; padding-top: 13px; border-top: 1px solid #292929;
  display: flex; align-items: baseline; gap: 12px;
}
.payout-amount { font-family: 'Archivo', sans-serif; font-size: 30px; font-weight: 700; letter-spacing: -0.02em; }
.payout-note { font-size: 11.5px; color: var(--muted); line-height: 1.45; }

/* .card sets display:block, which beats .row's flex because it is declared
   later. Any card that is also a row needs it back. */
.card.row { display: flex; align-items: center; gap: 10px; }
.card.row .pill { flex-shrink: 0; }

/* One-time push prompt. Sits over the board rather than beside it, because a
   host who scrolls past the banner gets no shift alerts at all. */
.dialog-wrap {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, .66);
  display: flex;
  align-items: flex-end;
  z-index: 40;
}
.dialog {
  width: 100%;
  background: var(--surface);
  border-top: 1px solid var(--border);
  border-radius: var(--r-lg) var(--r-lg) 0 0;
  padding: 22px 18px calc(18px + env(safe-area-inset-bottom));
  display: grid;
  gap: 10px;
}
.dialog-title { font-size: 17px; font-weight: 700; }
.dialog-body { font-size: 13.5px; line-height: 1.45; color: var(--muted); margin-bottom: 6px; }
