/* Apex Crew Scheduler — Apple-minimal, Connecteam-style. Built to match the mockups. */
:root {
  --blue: #0071e3; --blue-h: #0058b0; --blue-bg: #eef5fd; --blue-chip-fg: #0b4f9c; --blue-chip-bg: #e6f0fc;
  --ink: #1d1d1f; --ink2: #424245; --muted: #6e6e73;
  --line: #d2d2d7; --soft: #ececf0; --surface: #f5f5f7; --card: #ffffff;
  --orange: #c2410c; --orange-text: #9a3412; --orange-bg: #fff4ed; --orange-border: #f3c7a8;
  --amber: #f59e0b; --red: #d70015; --red-bg: #ffecec;
  --green: #0b5f58; --green-bg: #dff2ef; --draft-border: #b0b0b8;
  --dash-grey: #e3e3e8; --row-alt: #fafafc;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bot: env(safe-area-inset-bottom, 0px);
  --safe-l: env(safe-area-inset-left, 0px);
  --safe-r: env(safe-area-inset-right, 0px);
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body { font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Helvetica Neue", Arial, sans-serif;
  background: var(--surface); color: var(--ink); font-size: 16px; line-height: 1.45;
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; }
a { color: var(--blue); text-decoration: none; }
a:hover { color: var(--blue-h); }
button { font: inherit; cursor: pointer; }

/* ---------- Layout shells ---------- */
.app-shell { display: flex; flex-direction: column; min-height: 100vh; }
.topbar {
  background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20;
  padding: calc(var(--safe-top) + 10px) calc(var(--safe-r) + 16px) 10px calc(var(--safe-l) + 16px);
  display: flex; align-items: center; gap: 10px;
}
.topbar .logo { width: 32px; height: 32px; border-radius: 7px; object-fit: contain; background: #fff; }
.topbar .title { font-size: 18px; font-weight: 700; letter-spacing: -0.3px; flex-grow: 1; }
.topbar .avatar {
  border: 0; cursor: pointer; font-family: inherit;
  width: 36px; height: 36px; border-radius: 50%; background: var(--ink); color: #fff;
  display: inline-flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 600;
}
.topbar nav.desktop-nav { display: none; gap: 4px; }
.topbar nav.desktop-nav a, .topbar nav.desktop-nav button {
  padding: 8px 12px; border-radius: 8px; color: var(--ink2); font-size: 15px;
  border: 0; background: transparent; font-family: inherit; white-space: nowrap; cursor: pointer; min-height: 36px;
}
.topbar nav.desktop-nav button:hover { background: var(--surface); }
.topbar nav.desktop-nav a.on, .topbar nav.desktop-nav button.on { background: var(--blue-bg); color: var(--blue-h); font-weight: 600; }
.topbar nav.desktop-nav a .badge, .topbar nav.desktop-nav button .badge {
  background: var(--orange); color: #fff; border-radius: 9px; padding: 1px 7px; font-size: 12px; font-weight: 700; margin-left: 6px;
}
@media (min-width: 900px) { .topbar nav.desktop-nav { display: flex; } .topbar.phone-only { display: none; } }

main.app-main {
  flex-grow: 1;
  padding: 14px calc(var(--safe-r) + 16px) calc(var(--safe-bot) + 86px) calc(var(--safe-l) + 16px);
  max-width: 1440px; width: 100%; margin: 0 auto;
}
main.app-main.desktop { padding-bottom: 20px; }
.page-h1 { font-size: 28px; font-weight: 700; letter-spacing: -0.5px; margin: 2px 0 10px; }

/* ---------- Tab bar (mobile) ---------- */
.tabbar {
  position: fixed; bottom: 0; left: 0; right: 0; background: #fff; border-top: 1px solid var(--line);
  display: grid; grid-template-columns: repeat(5, minmax(0, 1fr));
  padding: 8px calc(var(--safe-r) + 4px) calc(var(--safe-bot) + 10px) calc(var(--safe-l) + 4px);
  z-index: 30;
}
.tabbar button {
  background: none; border: 0; min-height: 44px; display: flex; flex-direction: column; align-items: center;
  gap: 3px; font-size: 11px; font-weight: 600; color: var(--muted); position: relative;
}
.tabbar button.on { color: var(--blue); }
.tabbar svg { width: 26px; height: 26px; }
.tabbar .badge {
  position: absolute; top: 2px; left: 50%; transform: translateX(2px);
  background: var(--orange); color: #fff; border-radius: 9px; padding: 1px 6px; font-size: 10px; font-weight: 700;
}
@media (min-width: 900px) { .tabbar { display: none; } }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 44px; border: 0; border-radius: 22px; padding: 10px 18px;
  background: var(--blue); color: #fff; font-size: 15px; font-weight: 600;
}
.btn:hover { background: var(--blue-h); }
.btn.ghost { background: transparent; color: var(--blue); border: 1px solid var(--line); }
.btn.ghost:hover { background: var(--surface); }
.btn.dark { background: var(--ink); color: #fff; }
.btn.danger { background: var(--red); }
.btn.lg { height: 54px; border-radius: 27px; font-size: 17px; }
.btn.sm { min-height: 36px; padding: 7px 12px; font-size: 13px; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .5; cursor: default; }
.icon-btn {
  width: 44px; height: 44px; border: 0; background: var(--surface); border-radius: 22px;
  display: inline-flex; align-items: center; justify-content: center; color: var(--ink);
}
.icon-btn.small { width: 36px; height: 36px; border-radius: 8px; background: #fff; border: 1px solid var(--line); font-size: 16px; }
.icon-btn.small { width: auto; min-width: 36px; padding: 0 10px; white-space: nowrap; font-family: inherit; font-size: 14px; cursor: pointer; }
.admin-toolbar .icon-btn.small[aria-label] { font-size: 18px; }
.linklike { background: none; border: 0; color: var(--blue); font-weight: 600; padding: 10px 4px; font-size: 15px; }

/* ---------- Shared ---------- */
.card { background: var(--card); border-radius: 14px; padding: 16px; border: 1px solid var(--dash-grey); }
.card + .card { margin-top: 10px; }
label.field { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.4px; }
label.field input, label.field textarea, label.field select, label.field .pseudo {
  border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; font-size: 15px;
  color: var(--ink); font-weight: 400; font-family: inherit; background: #fff; text-transform: none; letter-spacing: 0; min-height: 44px;
}
textarea { min-height: 70px; resize: vertical; width: 100%; }
input, select { width: 100%; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.row3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; }
@media (max-width: 480px) { .row2, .row3 { grid-template-columns: 1fr; } }
.muted { color: var(--muted); font-size: 13px; }
.err { background: var(--red-bg); color: var(--red); padding: 10px 14px; border-radius: 10px; margin: 8px 0; font-size: 14px; }
.sectionlabel { font-size: 13px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.4px; margin: 10px 0 6px; }
.hr { height: 1px; background: var(--line); margin: 14px 0; border: 0; }

/* ---------- Status chips ---------- */
.chip { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 600; padding: 4px 9px; border-radius: 10px; background: var(--surface); color: var(--ink2); }
.chip.confirmed { background: var(--green-bg); color: var(--green); }
.chip.pending { background: #fff4e5; color: var(--orange); }
.chip.declined { background: var(--red-bg); color: var(--red); }
.chip.shortnotice { background: var(--orange); color: #fff; font-weight: 700; }
.chip.open { background: #ecf7ee; color: #0b5f58; }
.chip.draft { background: #eceaff; color: #4a2bb6; }
.chip.sup { background: var(--blue-chip-bg); color: var(--blue-chip-fg); }
.chip.available { background: #dff2ef; color: var(--green); }
.chip.unavailable { background: var(--red-bg); color: var(--red); }
.chip.urgent { background: var(--orange); color: #fff; }
.chip.badge-grey { background: var(--soft); color: var(--ink2); }

/* ---------- Login (name list + PIN pad) ---------- */
.login-wrap { max-width: 480px; margin: 0 auto; }
.login-wrap h1 { font-size: 30px; font-weight: 700; letter-spacing: -0.5px; margin: 10px 0 6px; }
.login-wrap .intro { color: var(--muted); margin-bottom: 16px; font-size: 15px; }
.name-list { background: var(--card); border-radius: 14px; border: 1px solid var(--dash-grey); overflow: hidden; }
.name-list .row {
  display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-top: 1px solid var(--soft);
  min-height: 56px; background: #fff; border: 0; width: 100%; text-align: left;
}
.name-list .row:first-child { border-top: 0; }
.name-list .row:active { background: var(--surface); }
.name-list .avatar { width: 40px; height: 40px; border-radius: 50%; background: var(--blue-bg); color: var(--blue-chip-fg);
  display: inline-flex; align-items: center; justify-content: center; font-size: 15px; font-weight: 700; }
.name-list .avatar.admin { background: var(--ink); color: #fff; }
.name-list .name { font-size: 16px; font-weight: 600; flex-grow: 1; color: var(--ink); }
.name-list .role { font-size: 12px; color: var(--muted); }
.name-list .chevron { color: var(--muted); }

.pin-wrap { max-width: 320px; margin: 24px auto; text-align: center; }
.pin-dots { display: flex; justify-content: center; gap: 14px; margin: 16px 0 10px; }
.pin-dot { width: 14px; height: 14px; border-radius: 50%; background: #fff; border: 1.5px solid var(--line); }
.pin-dot.filled { background: var(--ink); border-color: var(--ink); }
.pin-dot.err { background: #fff; border-color: var(--red); }
.pin-wrap.shake { animation: shake 0.4s; }
@keyframes shake { 10%,90%{transform:translateX(-2px)} 20%,80%{transform:translateX(4px)}
  30%,50%,70%{transform:translateX(-6px)} 40%,60%{transform:translateX(6px)} }
.pin-pad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 14px; }
.pin-pad button {
  height: 60px; border-radius: 30px; border: 0; background: #fff; color: var(--ink);
  font-size: 24px; font-weight: 600; box-shadow: inset 0 0 0 1px var(--line);
}
.pin-pad button:active { background: var(--surface); }
.pin-pad .wide { grid-column: span 1; }
.pin-pad .blank { visibility: hidden; }
.pin-pad .del { font-size: 15px; font-weight: 600; }

/* ---------- Week strip ---------- */
.weekstrip {
  display: grid; grid-template-columns: 32px repeat(7, 1fr) 32px; gap: 4px; align-items: center; margin-top: 10px;
}
.weekstrip .arrow { width: 32px; height: 44px; border: 0; background: transparent; color: var(--muted); font-size: 18px; }
.weekstrip .day {
  display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 0; min-height: 50px;
  background: #fff; border: 0; border-radius: 12px; position: relative;
}
.weekstrip .day .wk { font-size: 11px; color: var(--muted); }
.weekstrip .day .num { font-size: 17px; color: var(--ink); }
.weekstrip .day.today { background: var(--blue); color: #fff; }
.weekstrip .day.today .wk,.weekstrip .day.today .num { color: #fff; }
.weekstrip .day.has { font-weight: 600; }
.weekstrip .day.has::after { content: ""; width: 4px; height: 4px; border-radius: 50%; background: var(--blue); position: absolute; bottom: 4px; }
.weekstrip .day.today.has::after { background: #fff; }

/* ---------- Segmented control ---------- */
.seg {
  display: grid; grid-template-columns: repeat(var(--n, 2), 1fr); background: #eeeef0; border-radius: 10px; padding: 3px; margin-top: 10px;
}
.seg button { background: transparent; border: 0; padding: 8px 0; font-size: 14px; color: var(--ink2); border-radius: 8px; min-height: 36px; }
.seg button.on { background: #fff; color: var(--ink); font-weight: 600; box-shadow: 0 1px 2px rgba(0,0,0,0.06); }

/* ---------- Shift cards ---------- */
.day-head { font-size: 13px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.4px; margin-top: 14px; }
.shift-card {
  background: #fff; border: 1px solid var(--dash-grey); border-radius: 14px; padding: 14px 16px;
  display: flex; flex-direction: column; gap: 8px; width: 100%; color: var(--ink); text-align: left; margin-top: 8px;
}
.shift-card.short { border: 2px solid var(--orange); }
.shift-card .top { display: flex; align-items: center; gap: 8px; }
.shift-card .dot { width: 10px; height: 10px; border-radius: 5px; background: var(--blue); flex-shrink: 0; }
.shift-card .time { font-size: 17px; font-weight: 600; flex-grow: 1; }
.shift-card .loc { font-size: 15px; }
.shift-card .meta { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }
.shift-card .meta .r { flex-grow: 1; }
.shift-card .inline-cta {
  background: var(--blue); color: #fff; font-size: 14px; font-weight: 600; padding: 9px 16px; border-radius: 18px; border: 0;
}
.shift-card.open-shift .top .dot { background: var(--amber); }
.shift-card.draft { border-style: dashed; }

/* ---------- Full-screen page (details, onboarding, quick-add) ---------- */
.page-fs {
  position: fixed; inset: 0; background: var(--surface); z-index: 60;
  display: flex; flex-direction: column; overflow: hidden;
}
.page-fs > header {
  background: #fff; border-bottom: 1px solid var(--line);
  padding: calc(var(--safe-top) + 10px) calc(var(--safe-r) + 12px) 10px calc(var(--safe-l) + 12px);
  display: flex; align-items: center; gap: 4px;
}
.page-fs > header .back { display: inline-flex; align-items: center; gap: 2px; min-height: 44px; padding: 0 8px; background: none; border: 0; color: var(--blue); font-size: 17px; }
.page-fs > header .title { flex-grow: 1; text-align: center; font-size: 17px; font-weight: 600; margin-right: 70px; }
.page-fs > header .headerRight { background: none; border: 0; color: var(--blue); font-size: 15px; font-weight: 600; min-height: 44px; padding: 0 8px; }
.page-fs > main.body { flex-grow: 1; overflow-y: auto; padding: 14px calc(var(--safe-r) + 16px); display: flex; flex-direction: column; gap: 12px; }
.page-fs > footer.sticky {
  background: #fff; border-top: 1px solid var(--line);
  padding: 12px calc(var(--safe-r) + 16px) calc(var(--safe-bot) + 14px) calc(var(--safe-l) + 16px);
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
}
.banner-warn { background: var(--orange-bg); border: 1px solid var(--orange-border); color: var(--orange-text); border-radius: 12px; padding: 10px 14px; font-size: 14px; font-weight: 600; }

/* ---------- Document rows ---------- */
.doc-row { display: flex; align-items: center; gap: 10px; background: var(--surface); border-radius: 10px; padding: 10px 12px; }
.doc-row .name { font-size: 14px; font-weight: 600; }
.doc-row .sub { font-size: 12px; color: var(--muted); }
.doc-row .flex { flex-grow: 1; display: flex; flex-direction: column; }
.doc-row .btn { padding: 9px 12px; min-height: 0; }
.sup-only { background: #fff; border: 1px solid #c7dcf7; border-radius: 14px; padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.sup-only h3 { margin: 0; font-size: 13px; text-transform: uppercase; letter-spacing: 0.4px; color: var(--blue-chip-fg); display: flex; align-items: center; gap: 6px; }

/* ---------- Timer ring ---------- */
.clock-wrap { display: flex; flex-direction: column; align-items: center; gap: 14px; margin-top: 10px; }
.clock-ring {
  width: 210px; height: 210px; border-radius: 50%; border: 8px solid var(--blue); background: #fff;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
}
.clock-ring.off { border-color: var(--line); }
.clock-ring .label { font-size: 13px; color: var(--muted); }
.clock-ring .big { font-size: 40px; font-weight: 700; letter-spacing: -1px; font-variant-numeric: tabular-nums; }
.clock-ring button { position: absolute; }
.clock-cta {
  margin-top: 6px; height: 54px; border-radius: 27px; border: 0; background: var(--ink); color: #fff; font-size: 17px; font-weight: 600; width: 100%;
}
.clock-cta.in { background: var(--blue); }
.period-strip { display: grid; grid-template-columns: repeat(3, 1fr); background: #fff; border-radius: 14px; padding: 14px 16px; text-align: center; border: 1px solid var(--dash-grey); }
.period-strip .big { font-size: 20px; font-weight: 700; }
.period-strip .lbl { font-size: 12px; color: var(--muted); }

/* ---------- Sheets ---------- */
.sheet-backdrop {
  position: fixed; inset: 0; background: rgba(0,0,0,0.35); z-index: 70;
  display: flex; align-items: flex-end; justify-content: center;
}
.sheet {
  background: #fff; border-radius: 20px 20px 0 0;
  width: 100%; max-width: 640px;
  padding: 10px 20px calc(var(--safe-bot) + 20px) 20px;
  display: flex; flex-direction: column; gap: 12px; max-height: 92vh; overflow: auto;
}
@media (min-width: 720px) { .sheet-backdrop { align-items: center; } .sheet { border-radius: 20px; max-height: 90vh; } }
.sheet .grabber { width: 40px; height: 5px; border-radius: 3px; background: var(--line); align-self: center; }
.sheet h2 { margin: 0; font-size: 22px; font-weight: 700; }
.sheet .live { font-size: 13px; color: var(--muted); }

/* ---------- Onboarding ---------- */
.onboard { background: #fff; }
.onboard main.body { padding-top: 54px; padding-bottom: 20px; align-items: center; }
.onboard .dots { display: flex; gap: 8px; justify-content: center; margin-bottom: 6px; }
.onboard .dot { width: 8px; height: 8px; border-radius: 4px; background: var(--line); }
.onboard .dot.on { background: var(--blue); }
.onboard .dot.cur { background: var(--blue); width: 24px; }
.onboard .step-label { font-size: 13px; color: var(--muted); text-align: center; margin-bottom: 10px; }
.onboard .illus { width: 100%; background: var(--surface); border-radius: 24px; padding: 24px 16px; display: flex; flex-direction: column; gap: 10px; }
.onboard h1 { font-size: 28px; font-weight: 700; letter-spacing: -0.5px; text-align: center; margin: 10px 0 0; }
.onboard p.lead { font-size: 17px; line-height: 1.45; color: var(--ink2); text-align: center; margin: 0; }
.onboard .notif { background: #fff; border-radius: 18px; padding: 12px 14px; display: flex; gap: 12px; box-shadow: 0 6px 18px rgba(0,0,0,0.10); }
.onboard .notif .ico { width: 38px; height: 38px; border-radius: 9px; background: #fff; display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--line); }
.onboard .notif .flex { flex-grow: 1; display: flex; flex-direction: column; gap: 2px; }
.onboard .notif .title-row { display: flex; font-size: 13px; }
.onboard .notif .title-row b { flex-grow: 1; }
.onboard .notif .title-row .time { color: var(--muted); }
.onboard .notif-body { font-size: 14px; }
.onboard .notif.dim { background: rgba(255,255,255,0.7); box-shadow: none; }

/* ---------- Admin phone agenda ---------- */
.admin-day-head { font-size: 15px; font-weight: 700; margin-top: 16px; display: flex; align-items: center; gap: 8px; }
.admin-day-head .muted { font-weight: 400; }
.admin-job-card {
  background: #fff; border-radius: 14px; border: 1px solid var(--dash-grey); padding: 12px 14px;
  display: flex; flex-direction: column; gap: 8px; width: 100%; text-align: left; color: var(--ink); margin-top: 8px;
}
.admin-job-card.draft { border-style: dashed; }
.admin-job-card .toprow { display: flex; align-items: center; gap: 8px; }
.admin-job-card .toprow .dot { width: 10px; height: 10px; border-radius: 5px; }
.admin-job-card .toprow .time { font-size: 16px; font-weight: 700; flex-grow: 1; }
.admin-job-card .loc { font-size: 14px; }
.admin-job-card .initials { display: flex; flex-wrap: wrap; gap: 4px; }
.initial-dot { position: relative; width: 28px; height: 28px; border-radius: 50%; background: var(--blue-bg); color: var(--blue-chip-fg); font-size: 11px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }
.initial-dot .mark { position: absolute; right: -2px; bottom: -2px; width: 14px; height: 14px; border-radius: 50%; background: #fff; font-size: 10px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--line); }
.initial-dot .mark.ok { background: var(--green); color: #fff; border-color: var(--green); }
.initial-dot .mark.no { background: var(--red); color: #fff; border-color: var(--red); }
.initial-dot .mark.wait { background: var(--amber); color: #fff; border-color: var(--amber); }
.fab {
  position: fixed; right: calc(var(--safe-r) + 16px); bottom: calc(var(--safe-bot) + 86px);
  width: 56px; height: 56px; border-radius: 50%; background: var(--blue); color: #fff; border: 0;
  box-shadow: 0 8px 24px rgba(0,113,227,0.4); font-size: 28px; display: inline-flex; align-items: center; justify-content: center; z-index: 25;
}
@media (min-width: 900px) { .fab { display: none; } }
.publish-bar {
  position: fixed; bottom: calc(var(--safe-bot) + 72px); left: calc(var(--safe-l) + 10px); right: calc(var(--safe-r) + 10px);
  background: var(--ink); color: #fff; border-radius: 16px; padding: 12px 16px; display: flex; align-items: center; gap: 10px;
  z-index: 28; box-shadow: 0 8px 20px rgba(0,0,0,0.2);
}
.publish-bar .flex { flex-grow: 1; }
.publish-bar button { background: #fff; color: var(--ink); border: 0; border-radius: 10px; padding: 8px 14px; font-weight: 600; }
@media (min-width: 900px) { .publish-bar { display: none; } }

/* ---------- Desktop admin grid ---------- */
.admin-desktop { display: none; }
@media (min-width: 900px) {
  .admin-desktop { display: flex; min-height: calc(100vh - 60px); }
  .admin-main { flex-grow: 1; padding: 16px 20px; display: flex; flex-direction: column; gap: 12px; min-width: 0; overflow: hidden; }
  .admin-side { width: 360px; flex-shrink: 0; box-sizing: border-box; background: #fff; border-left: 1px solid var(--line); padding: 18px 20px; display: flex; flex-direction: column; gap: 12px; overflow: auto;
    position: sticky; top: 60px; align-self: flex-start; max-height: calc(100vh - 60px); }
}
.admin-toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.admin-toolbar .range { font-size: 18px; font-weight: 700; }
.admin-toolbar .pill-nav { display: flex; background: #e8e8ed; border-radius: 8px; padding: 2px; font-size: 13px; }
.admin-toolbar .pill-nav button { background: transparent; border: 0; padding: 7px 12px; border-radius: 6px; color: var(--ink2); min-height: 32px; }
.admin-toolbar .pill-nav button.on { background: #fff; font-weight: 600; color: var(--ink); }
.admin-toolbar .spacer { flex-grow: 1; }
.admin-toolbar .chip-warn { font-size: 13px; font-weight: 600; color: var(--orange-text); background: var(--orange-bg); border-radius: 14px; padding: 6px 12px; }

.admin-grid {
  background: #fff; border-radius: 12px; border: 1px solid var(--dash-grey); overflow: auto; flex-grow: 1;
}
.admin-grid .ghead, .admin-grid .grow {
  display: grid; grid-template-columns: 170px repeat(7, minmax(130px, 1fr));
}
.admin-grid .ghead { border-bottom: 1px solid var(--dash-grey); font-size: 13px; color: var(--muted); position: sticky; top: 0; background: #fff; z-index: 1; }
.admin-grid .ghead > div { padding: 10px 12px; border-left: 1px solid var(--soft); }
.admin-grid .ghead > div:first-child { border-left: 0; }
.admin-grid .ghead > div.today { color: var(--blue); font-weight: 700; }
.admin-grid .grow { border-bottom: 1px solid var(--soft); min-height: 60px; background: #fff; }
.admin-grid .grow.alt { background: var(--row-alt); }
.admin-grid .grow .label { padding: 8px 12px; display: flex; flex-direction: column; justify-content: center; gap: 2px; border-left: 0; }
.admin-grid .grow .label .nm { font-size: 14px; font-weight: 600; }
.admin-grid .grow .label .sub { font-size: 12px; color: var(--muted); }
.admin-grid .grow .cell { border-left: 1px solid var(--soft); padding: 4px; display: flex; flex-direction: column; gap: 4px; cursor: pointer; }
.admin-grid .grow .cell:empty::before { content: ""; }
.gcard { border-radius: 7px; padding: 5px 7px; font-size: 11px; line-height: 1.3; cursor: pointer; }
.gcard .t { font-weight: 700; }
.gcard.pending { outline: 2px solid var(--amber); outline-offset: -2px; }
.gcard.declined { border: 1px solid var(--orange); }
.gcard.draft { background: #fff !important; border: 1px dashed currentColor; }
.gblock { background: var(--soft); color: var(--ink2); border-radius: 7px; padding: 6px 8px; font-size: 11px; }

/* ---------- Admin side panel ---------- */
.aside-row { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.4px; }
.aside-row > .pseudo, .aside-row input, .aside-row textarea, .aside-row select { border: 1px solid var(--line); border-radius: 8px; padding: 9px 10px; font-size: 14px; color: var(--ink); font-weight: 400; text-transform: none; letter-spacing: 0; font-family: inherit; }
.aside-footer { margin-top: auto; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.aside-footer .btn { min-height: 40px; border-radius: 8px; font-size: 14px; }

/* ---------- Form helpers ---------- */
.autofill-list { border: 1px solid var(--line); border-radius: 10px; background: #fff; box-shadow: 0 6px 16px rgba(0,0,0,0.08); display: flex; flex-direction: column; font-size: 14px; overflow: hidden; margin-top: 4px; }
.autofill-list .opt { padding: 10px 12px; cursor: pointer; }
.autofill-list .opt.active, .autofill-list .opt:hover { background: var(--blue-bg); }
.crew-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.crew-chip { font-size: 14px; background: #f0f0f3; color: var(--ink); padding: 7px 11px; border-radius: 16px; font-weight: 500; border: 0; }
.crew-chip.on { background: var(--blue-chip-bg); color: var(--blue-chip-fg); font-weight: 600; }
.crew-chip.sup { background: var(--blue-chip-bg); color: var(--blue-chip-fg); font-weight: 700; }
.crew-chip.warn { background: var(--orange-bg); color: var(--orange-text); }
.stepper { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 10px; }
.stepper button { background: none; border: 0; width: 40px; text-align: center; font-size: 20px; color: var(--blue); min-height: 44px; }
.stepper span { width: 28px; text-align: center; font-size: 16px; font-weight: 600; }

/* ---------- Me / alerts cards ---------- */
.status-card { display: flex; align-items: center; gap: 12px; background: #fff; border-radius: 14px; padding: 14px 16px; border: 1px solid var(--dash-grey); }
.status-card .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--green); }
.status-card.off .dot { background: var(--red); }
.status-card.checking .dot { background: var(--muted); }
.status-card .flex { flex-grow: 1; }
.status-card .ttl { font-weight: 600; }

/* ---------- Toast ---------- */
.toast { position: fixed; bottom: calc(var(--safe-bot) + 100px); left: 50%; transform: translateX(-50%);
  background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 980px; font-size: 14px; z-index: 90; }

/* ---------- Scrollable lists ---------- */
.list { display: flex; flex-direction: column; }
.list > .list-row { padding: 12px 0; border-bottom: 1px solid var(--soft); display: flex; gap: 10px; align-items: flex-start; }
.list > .list-row:last-child { border-bottom: 0; }
.list .unread b { font-weight: 700; }
.list .unread { background: #fffbe9; margin: 0 -12px; padding: 12px; border-radius: 10px; }

/* ---------- Approvals cards ---------- */
.approval-card { background: #fff; border: 1px solid var(--dash-grey); border-radius: 14px; padding: 14px 16px; display: flex; flex-direction: column; gap: 8px; }
.approval-card .big { font-size: 16px; font-weight: 600; }
.approval-card .warn { color: var(--orange-text); background: var(--orange-bg); border-radius: 10px; padding: 8px 10px; font-size: 13px; }
.approval-card .btn-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }

/* ---------- Person row ---------- */
.person-row { background: #fff; border: 1px solid var(--dash-grey); border-radius: 14px; padding: 14px 16px; display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.person-row .top { display: flex; align-items: center; gap: 10px; }
.person-row .nm { font-size: 16px; font-weight: 600; flex-grow: 1; }
.person-row .setup { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.setup-chip { font-size: 12px; padding: 3px 8px; border-radius: 980px; background: var(--soft); color: var(--ink2); display: inline-flex; align-items: center; gap: 4px; }
.setup-chip.ok { background: #dff2ef; color: var(--green); }
.setup-chip.no { background: var(--red-bg); color: var(--red); }
.person-row .actions { display: flex; flex-wrap: wrap; gap: 6px; }

.table-tight { width: 100%; border-collapse: collapse; background: #fff; border: 1px solid var(--dash-grey); border-radius: 12px; overflow: hidden; }
.table-tight th, .table-tight td { padding: 8px 10px; border-bottom: 1px solid var(--soft); font-size: 14px; text-align: left; }
.table-tight th { background: var(--surface); font-weight: 600; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: 0.4px; }
.table-tight tr:last-child td { border-bottom: 0; }

/* ---------- Suppress mobile when desktop admin shown ---------- */
.hide-when-admin-desktop { display: block; }
@media (min-width: 900px) { body.admin-desktop-mode .tabbar { display: none; } body.admin-desktop-mode .fab { display: none; } }

/* ---------- No horizontal overflow safety ---------- */
img, svg, canvas, video { max-width: 100%; }
input, textarea, select, button { max-width: 100%; }
