:root, [data-theme="dark"] {
  --bg: #07070d;
  --bg-raised: #0d0d17;
  --bg-card: rgba(18, 16, 29, 0.75);
  --bg-card-hover: rgba(28, 24, 46, 0.85);
  --bg-card-solid: #13111f;
  --accent: #8b5cf6;
  --accent-bright: #a78bfa;
  --accent-soft: #c4b5fd;
  --accent-glow: rgba(139, 92, 246, 0.45);
  --accent-dim: rgba(139, 92, 246, 0.16);
  --accent-line: rgba(139, 92, 246, 0.38);
  --cyan: #38bdf8;
  --cyan-dim: rgba(56, 189, 248, 0.15);
  --cyan-line: rgba(56, 189, 248, 0.35);
  --pink: #f43f5e;
  --pink-dim: rgba(244, 63, 94, 0.15);
  --text: #f8fafc;
  --text-muted: #94a3b8;
  --text-faint: #64748b;
  --line: rgba(255, 255, 255, 0.09);
  --line-strong: rgba(255, 255, 255, 0.18);
  --line-glass: rgba(255, 255, 255, 0.14);
  --green: #34d399;
  --green-bright: #10b981;
  --green-dim: rgba(52, 211, 153, 0.16);
  --red: #f87171;
  --red-dim: rgba(248, 113, 113, 0.16);
  --amber: #fbbf24;
  --amber-dim: rgba(251, 191, 36, 0.16);
  --blue: #60a5fa;
  --blue-dim: rgba(96, 165, 250, 0.16);
  --font-sans: "Plus Jakarta Sans", "Space Grotesk", -apple-system, BlinkMacSystemFont, sans-serif;
  --font-display: "Space Grotesk", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;
  --page-max: 1280px;
  --radius: 14px;
  --radius-lg: 20px;
  --radius-sm: 8px;
  --shadow-sm: 0 4px 14px rgba(0, 0, 0, 0.35);
  --shadow-md: 0 12px 36px rgba(0, 0, 0, 0.45);
  --shadow-glow: 0 0 25px rgba(139, 92, 246, 0.28);
  --shadow-cyan: 0 0 25px rgba(56, 189, 248, 0.25);
  color-scheme: dark;
}

[data-theme="light"] {
  --bg: #f5f7fb;
  --bg-raised: #ffffff;
  --bg-card: rgba(255, 255, 255, 0.9);
  --bg-card-hover: rgba(248, 250, 252, 0.98);
  --bg-card-solid: #ffffff;
  --accent: #7c3aed;
  --accent-bright: #6d28d9;
  --accent-soft: #8b5cf6;
  --accent-glow: rgba(124, 58, 237, 0.3);
  --accent-dim: rgba(124, 58, 237, 0.12);
  --accent-line: rgba(124, 58, 237, 0.28);
  --cyan: #0284c7;
  --cyan-dim: rgba(2, 132, 199, 0.12);
  --cyan-line: rgba(2, 132, 199, 0.28);
  --pink: #e11d48;
  --pink-dim: rgba(225, 29, 72, 0.12);
  --text: #0f172a;
  --text-muted: #475569;
  --text-faint: #94a3b8;
  --line: rgba(0, 0, 0, 0.08);
  --line-strong: rgba(0, 0, 0, 0.15);
  --line-glass: rgba(0, 0, 0, 0.08);
  --green: #059669;
  --green-bright: #047857;
  --green-dim: rgba(5, 150, 105, 0.12);
  --red: #dc2626;
  --red-dim: rgba(220, 38, 38, 0.12);
  --amber: #d97706;
  --amber-dim: rgba(217, 119, 6, 0.12);
  --blue: #2563eb;
  --blue-dim: rgba(37, 99, 235, 0.12);
  --shadow-sm: 0 4px 14px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 12px 36px rgba(0, 0, 0, 0.08);
  --shadow-glow: 0 0 25px rgba(124, 58, 237, 0.15);
  --shadow-cyan: 0 0 25px rgba(2, 132, 199, 0.15);
  color-scheme: light;
}

*, *:before, *:after { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  position: relative;
  transition: background-color .25s ease, color .25s ease;
  overflow-x: hidden;
}


/* Custom Sleek Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.2);
}
::-webkit-scrollbar-thumb {
  background: rgba(139, 92, 246, 0.35);
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: padding-box;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(139, 92, 246, 0.65);
}

button, input, select, textarea { font-family: inherit; font-size: inherit; }
button { cursor: pointer; }
button:disabled { opacity: .55; cursor: wait; }
.shell { width: 100%; min-width: 0; max-width: var(--page-max); margin: 0 auto; padding: 0 24px 40px; position: relative; z-index: 1; }

/* Topbar */
.topbar {
  height: 74px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line-glass);
  background: rgba(7, 7, 13, 0.78);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.35);
  position: sticky;
  top: 0;
  z-index: 50;
  padding: 0 8px;
  transition: all .25s ease;
}
[data-theme="light"] .topbar {
  background: rgba(255, 255, 255, 0.85);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.04);
}
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--text); }
.brand-logo {
  height: 40px; width: 40px; border-radius: 10px; object-fit: contain;
  background: rgba(255, 255, 255, .04); border: 1px solid var(--line);
  box-shadow: 0 0 16px rgba(139, 92, 246, .25);
}
.brandtext strong { display: block; font-size: 15px; font-weight: 700; letter-spacing: .06em; line-height: 1.1; }
.brandtext small { font-family: var(--font-mono); font-size: 10px; letter-spacing: .2em; color: var(--accent-soft); }

.top-controls { display: flex; align-items: center; gap: 14px; }
.theme-switch-box {
  display: inline-flex; border: 1px solid var(--line-strong); border-radius: 999px; padding: 2px;
  background: rgba(255, 255, 255, .04);
}
[data-theme="light"] .theme-switch-box { background: #e2e8f0; border-color: #cbd5e1; }
.theme-opt-btn {
  border: 0; background: transparent; color: var(--text-muted); font-size: 12px; font-weight: 600;
  padding: 4px 10px; border-radius: 999px; transition: all .14s ease; display: inline-flex; align-items: center; gap: 4px;
}
.theme-opt-btn.active {
  background: var(--accent); color: #0b0813; font-weight: 700;
  box-shadow: 0 0 10px rgba(139, 92, 246, .4);
}
[data-theme="light"] .theme-opt-btn.active { color: #ffffff; }

.topnote {
  display: flex; align-items: center; gap: 8px; font-family: var(--font-mono);
  font-size: 11px; letter-spacing: .12em; color: var(--text-muted); text-transform: uppercase;
}
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 10px var(--green); }
.notice {
  margin: 20px 0; background: rgba(248, 113, 113, .12); border: 1px solid rgba(248, 113, 113, .3);
  padding: 12px 16px; border-radius: var(--radius); color: #fca5a5; font-size: 13px;
}
.hidden { display: none !important; }

/* Typography */
h1, h2, h3, h4 {
  margin: 0 0 .4em;
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: -.025em;
}
h1 {
  font-size: clamp(34px, 4.2vw, 52px);
}
h1 em {
  font-style: normal;
}
h2 {
  font-size: 22px;
  letter-spacing: -.015em;
}
p { margin: 0 0 .8em; color: var(--text-muted); }
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--accent-bright);
  margin-bottom: 12px;
  font-weight: 600;
}
.eyebrow:before {
  content: "";
  width: 24px;
  height: 2px;
  background: var(--accent-bright);
  border-radius: 999px;
}
.mono { font-family: var(--font-mono); }
.muted { color: var(--text-muted); }
.small { font-size: 12px; }

/* Buttons & Inputs */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 9px 20px; border-radius: 999px; font-weight: 600; font-size: 13px;
  border: 1px solid transparent; transition: all .2s cubic-bezier(0.16, 1, 0.3, 1); text-decoration: none;
  cursor: pointer;
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }
.btn--primary {
  background: var(--accent);
  color: #0b0813;
  font-weight: 700;
  box-shadow: 0 4px 20px rgba(139, 92, 246, 0.42), inset 0 1px 1px rgba(255, 255, 255, 0.4);
}
.btn--primary:hover {
  box-shadow: 0 6px 26px rgba(139, 92, 246, 0.58), inset 0 1px 1px rgba(255, 255, 255, 0.6);
  filter: brightness(1.1);
}
[data-theme="light"] .btn--primary { color: #ffffff; }
.btn--ghost {
  border-color: var(--line-strong);
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(8px);
}
.btn--ghost:hover {
  border-color: var(--accent-line);
  color: var(--accent-bright);
  background: var(--accent-dim);
  box-shadow: 0 0 16px var(--accent-dim);
}
.btn--danger { background: var(--red-dim); color: #fca5a5; border-color: rgba(248, 113, 113, .35); }
.btn--danger:hover { background: rgba(248, 113, 113, .25); }
.btn--sm { padding: 6px 12px; font-size: 11px; }
.btn--full { width: 100%; margin-top: 16px; }
.textbtn { border: 0; background: transparent; color: var(--accent-soft); padding: 8px 0; font-size: 12px; font-weight: 600; }
.textbtn:hover { color: var(--accent-bright); text-decoration: underline; }

input, select, textarea {
  width: 100%; border: 1px solid var(--line-strong); background: var(--bg-card);
  color: var(--text); border-radius: 9px; padding: 10px 14px; outline: none; transition: border-color .15s;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--accent-bright);
  box-shadow: 0 0 0 3px var(--accent-dim), 0 0 18px rgba(139, 92, 246, 0.25);
}
[data-theme="light"] input, [data-theme="light"] select, [data-theme="light"] textarea {
  background: #ffffff; border-color: #cbd5e1;
}
label { display: block; font-size: 12px; font-weight: 600; color: var(--text); margin: 12px 0 6px; }

/* Auth Layout */
.authlayout {
  min-height: calc(100vh - 120px); display: grid; grid-template-columns: 1.15fr minmax(320px, .85fr);
  gap: clamp(35px, 6vw, 90px); align-items: center; padding: 50px 0;
}
.metrics { display: flex; gap: 32px; flex-wrap: wrap; margin-top: 36px; }
.metric strong { display: block; font-size: 32px; font-family: var(--font-mono); letter-spacing: -.03em; color: var(--text); }
.metric small { font-size: 10px; font-family: var(--font-mono); letter-spacing: .15em; color: var(--accent-soft); }
.stamp {
  margin-top: 36px; border: 1px solid var(--line); display: inline-flex; align-items: center; gap: 16px;
  padding: 12px 18px; border-radius: var(--radius); background: rgba(255, 255, 255, .03);
}

.card {
  background: var(--bg-card);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid var(--line-glass);
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: var(--shadow-md);
  transition: all .25s ease;
}
.card:hover {
  border-color: rgba(139, 92, 246, 0.32);
}
.tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; padding: 4px; border-radius: 10px; background: var(--bg); margin: 20px 0; }
.tab { border: 0; background: transparent; color: var(--text-muted); padding: 9px; border-radius: 7px; font-weight: 600; font-size: 13px; }
.tab.active { background: var(--accent-dim); color: var(--accent-soft); border: 1px solid var(--accent-line); }
.authmessage {
  margin-top: 14px; padding: 10px 14px; background: var(--green-dim); border: 1px solid rgba(74, 222, 128, .3);
  color: #bbf7d0; border-radius: 8px; font-size: 12px;
}
.authmessage.error { background: var(--red-dim); border-color: rgba(248, 113, 113, .3); color: #fecdd3; }

/* Dashboard */
.dashboard { padding: 32px 0 20px; }
.welcome { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; margin-bottom: 28px; flex-wrap: wrap; }
.userchip {
  display: flex;
  gap: 12px;
  align-items: center;
  background: var(--bg-card);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--line-glass);
  padding: 8px 18px;
  border-radius: 999px;
  box-shadow: var(--shadow-sm);
  transition: all .2s cubic-bezier(0.16, 1, 0.3, 1);
}
.userchip:hover {
  border-color: var(--accent-bright);
  box-shadow: 0 0 20px var(--accent-dim);
  transform: translateY(-1px);
}
.avatar {
  height: 36px;
  width: 36px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--accent-dim);
  border: 1px solid var(--accent-bright);
  color: #ffffff;
  font-weight: 800;
  font-size: 14px;
  font-family: var(--font-mono);
  box-shadow: 0 0 16px rgba(139, 92, 246, 0.4);
}
.username { font-weight: 700; font-size: 13px; }
.username small { display: block; font-family: var(--font-mono); font-size: 10px; color: var(--accent-soft); letter-spacing: .08em; }

/* User Controls Under User Chip */
.user-controls-block {
  display: flex; flex-direction: column; align-items: flex-end; gap: 8px;
}
.user-quick-actions {
  display: flex; gap: 10px; align-items: center;
}

/* Stats Grid */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 24px; }
.stat {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--line-glass);
  border-radius: var(--radius);
  padding: 20px 22px;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: all .25s cubic-bezier(0.16, 1, 0.3, 1);
}
.stat:before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--accent-bright);
  opacity: 0;
  transition: opacity .3s ease;
}
.stat:hover {
  transform: translateY(-3px);
  border-color: var(--accent-line);
  box-shadow: var(--shadow-md), 0 0 24px var(--accent-dim);
}
.stat:hover:before {
  opacity: 1;
}
.stat small { font-family: var(--font-mono); font-size: 10px; letter-spacing: .15em; color: var(--accent-soft); font-weight: 700; text-transform: uppercase; }
.stat strong { font-size: 34px; font-family: var(--font-mono); display: block; letter-spacing: -.03em; margin: 6px 0 2px; font-weight: 800; }
.stat p { font-size: 11.5px; margin: 0; color: var(--text-muted); }

/* View Nav Tabs */
.viewtabs { display: flex; gap: 8px; margin-bottom: 20px; border-bottom: 1px solid var(--line); padding-bottom: 12px; overflow-x: auto; }
.viewtab {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--line);
  color: var(--text-muted);
  padding: 9px 18px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  transition: all .2s cubic-bezier(0.16, 1, 0.3, 1);
  white-space: nowrap;
  backdrop-filter: blur(10px);
}
.viewtab:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--line-strong);
  transform: translateY(-1px);
}
.viewtab.active {
  background: var(--accent-dim);
  color: #ffffff;
  border-color: var(--accent-bright);
  font-weight: 700;
  box-shadow: 0 4px 18px rgba(139, 92, 246, 0.32);
}
.badgenum {
  display: inline-block; padding: 2px 7px; border-radius: 999px; font-size: 10px;
  font-family: var(--font-mono); background: var(--line-strong); color: var(--text); margin-left: 5px;
}

/* Panel */
.panel {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--line-glass);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.38);
  margin-bottom: 24px;
  transition: border-color .2s ease;
}
.panel:hover {
  border-color: rgba(139, 92, 246, 0.28);
}
.toolbar { padding: 20px 24px; display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.toolbar-actions { display: flex; gap: 10px; align-items: center; }
.filters {
  display: flex; gap: 12px; align-items: center; justify-content: space-between;
  padding: 0 24px 14px; flex-wrap: wrap;
}
.tabslist { display: flex; gap: 6px; flex-wrap: wrap; }
.catbtn {
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.02);
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
  transition: all .18s cubic-bezier(0.16, 1, 0.3, 1);
}
.catbtn:hover {
  border-color: var(--line-strong);
  color: #ffffff;
  background: rgba(255, 255, 255, 0.06);
  transform: translateY(-1px);
}
.catbtn.active {
  background: var(--accent-dim);
  color: #ffffff;
  border-color: var(--accent-bright);
  font-weight: 700;
  box-shadow: 0 0 16px rgba(139, 92, 246, 0.3);
}
.catbtn span { margin-left: 4px; font-family: var(--font-mono); font-size: 10px; }
.search { max-width: 280px; min-width: 180px; }

/* Table */
.tablehead, .itemrow {
  display: grid;
  grid-template-columns: minmax(200px, 2.2fr) minmax(110px, 1.1fr) minmax(130px, 1.2fr) minmax(110px, 1fr) minmax(140px, 1.3fr);
  gap: 12px; align-items: center;
}
.tablehead {
  padding: 14px 24px;
  background: rgba(255, 255, 255, 0.03);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: .15em;
  color: var(--text-faint);
  text-transform: uppercase;
}
.itemrow {
  padding: 16px 24px;
  border-bottom: 1px solid var(--line);
  font-size: 13.5px;
  transition: all .16s ease;
  position: relative;
}
.itemrow:hover {
  background: var(--bg-card-hover);
  border-bottom-color: rgba(139, 92, 246, 0.2);
}
.itemrow:last-child { border-bottom: 0; }
.itemname { font-weight: 700; font-size: 14px; color: var(--text); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.itemnotes { font-size: 11px; color: var(--text-muted); margin-top: 3px; max-width: 360px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.parttag { font-family: var(--font-mono); font-size: 10px; color: var(--accent-soft); background: var(--accent-dim); padding: 2px 6px; border-radius: 4px; }

/* Pills */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 8px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: .05em;
  font-weight: 600;
  border: 1px solid var(--line-glass);
  background: rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(6px);
  transition: all .15s ease;
}
.pill:hover {
  filter: brightness(1.15);
  transform: translateY(-1px);
}
.pill.Mechanical { color: #fed7aa; border-color: rgba(251, 146, 60, .3); background: rgba(251, 146, 60, .1); }
.pill.Electrical { color: #bae6fd; border-color: rgba(56, 189, 248, .3); background: rgba(56, 189, 248, .1); }
.pill.Software { color: #ddd6fe; border-color: rgba(167, 139, 250, .3); background: rgba(167, 139, 250, .1); }
.pill.Miscellaneous { color: #bbf7d0; border-color: rgba(74, 222, 128, .3); background: rgba(74, 222, 128, .1); }
.pill.DesignCAD { color: #fbcfe8; border-color: rgba(244, 114, 182, .3); background: rgba(244, 114, 182, .1); }
.pill.Business { color: #fef08a; border-color: rgba(250, 204, 21, .3); background: rgba(250, 204, 21, .1); }
.pill.General { color: #cbd5e1; border-color: rgba(148, 163, 184, .3); background: rgba(148, 163, 184, .1); }
.pill.tool { border-color: var(--amber); color: var(--amber); background: var(--amber-dim); }

/* Priority & Status pills */
.prio { font-family: var(--font-mono); font-size: 10px; padding: 2px 7px; border-radius: 999px; text-transform: uppercase; font-weight: 700; }
.prio.urgent { background: var(--red-dim); color: var(--red); border: 1px solid rgba(248, 113, 113, .3); }
.prio.high { background: var(--amber-dim); color: var(--amber); border: 1px solid rgba(251, 191, 36, .3); }
.prio.medium { background: var(--blue-dim); color: var(--blue); border: 1px solid rgba(96, 165, 250, .3); }
.prio.low { background: rgba(255, 255, 255, .05); color: var(--text-muted); border: 1px solid var(--line); }

.status-badge {
  font-family: var(--font-mono); font-size: 10px; font-weight: 700; padding: 3px 8px; border-radius: 6px;
  display: inline-flex; align-items: center; gap: 4px;
}
.status-badge.needed { background: var(--red-dim); color: var(--red); border: 1px solid rgba(248, 113, 113, .3); }
.status-badge.ordered { background: var(--amber-dim); color: var(--amber); border: 1px solid rgba(251, 191, 36, .3); }
.status-badge.shipped { background: var(--blue-dim); color: var(--blue); border: 1px solid rgba(96, 165, 250, .3); }
.status-badge.arrived { background: var(--green-dim); color: var(--green); border: 1px solid rgba(74, 222, 128, .3); }

/* Quantity & Actions */
.quantity { display: flex; align-items: center; gap: 8px; font-family: var(--font-mono); }
.qtybtn {
  width: 28px;
  height: 28px;
  border: 1px solid var(--line-glass);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  padding: 0;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 13px;
  transition: all .16s cubic-bezier(0.16, 1, 0.3, 1);
}
.qtybtn:hover {
  border-color: var(--accent-bright);
  color: #ffffff;
  background: var(--accent-dim);
  box-shadow: 0 0 12px var(--accent-dim);
  transform: scale(1.1);
}
.qtybtn:active {
  transform: scale(0.95);
}
.qtynum { min-width: 20px; text-align: center; font-weight: 700; font-size: 14px; }
.qtynum.low { color: var(--red); }
.actions { display: flex; gap: 6px; flex-wrap: wrap; }
.actionbtn {
  border: 1px solid var(--line-strong); background: rgba(255, 255, 255, .04);
  color: var(--text-muted); border-radius: 6px; padding: 5px 9px; font-size: 11px; font-weight: 600;
}
.actionbtn:hover { border-color: var(--accent-line); color: var(--text); background: var(--accent-dim); }
.actionbtn.delete:hover { border-color: var(--red); color: var(--red); background: var(--red-dim); }
.actionbtn.checkout { border-color: rgba(251, 191, 36, .4); color: var(--amber); background: var(--amber-dim); }
.actionbtn.checkout:hover { filter: brightness(1.2); }

/* Checkout Row */
.checkout-banner {
  margin-top: 6px; font-size: 11px; padding: 4px 8px; border-radius: 6px;
  background: var(--amber-dim); border: 1px solid rgba(251, 191, 36, .25); color: var(--amber);
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
}

/* Shifts Grid */
.shift-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; padding: 20px 24px;
}
.shift-card {
  background: var(--bg-card);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--line-glass);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  transition: all .25s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: relative;
  overflow: hidden;
}
.shift-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent-line);
  background: var(--bg-card-hover);
  box-shadow: var(--shadow-md), 0 0 20px rgba(139, 92, 246, 0.2);
}
.shift-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.shift-title { font-weight: 700; font-size: 15px; color: var(--text); }
.shift-time { font-family: var(--font-mono); font-size: 12px; color: var(--accent-bright); display: flex; align-items: center; gap: 6px; }
.shift-loc { font-size: 12px; color: var(--text-muted); display: flex; align-items: center; gap: 6px; }
.shift-roster {
  border-top: 1px solid var(--line); padding-top: 10px; font-size: 12px; display: flex; flex-direction: column; gap: 6px;
}
.attendee-pill {
  display: inline-flex; align-items: center; gap: 5px; padding: 2px 8px; border-radius: 999px; background: var(--accent-dim);
  border: 1px solid var(--accent-line); color: var(--accent-soft); font-size: 11px; font-family: var(--font-mono); margin: 2px;
}
.attendee-pill.is-me {
  background: rgba(139, 92, 246, .25); border-color: var(--accent); color: #ffffff;
}
.attendee-remove-btn {
  background: transparent; border: none; color: var(--text-muted); cursor: pointer; padding: 0; line-height: 1;
  font-size: 13px; font-weight: 700; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
  transition: color .15s ease, transform .15s ease;
}
.attendee-remove-btn:hover { color: var(--red); transform: scale(1.2); }
.slogan-motto {
  font-family: var(--font-mono); font-size: 13px; font-weight: 700;
  letter-spacing: .08em; color: var(--accent-bright); margin: 6px 0 10px; text-transform: uppercase;
}
.pill.pill-weekly {
  color: var(--accent-bright); border-color: var(--accent-line); background: var(--accent-dim); font-weight: 700;
}
.recurrence-box {
  background: rgba(255, 255, 255, .03); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 12px 14px; margin: 14px 0 4px;
}

/* Planner Board */
.planner-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; padding: 20px 24px;
}
.planner-col {
  background: rgba(255, 255, 255, .02); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px; display: flex; flex-direction: column; gap: 12px; min-height: 480px;
}
[data-theme="light"] .planner-col { background: #f8fafc; }

.col-header {
  display: flex; justify-content: space-between; align-items: center; padding-bottom: 10px;
  border-bottom: 1px solid var(--line); font-family: var(--font-mono); font-size: 12px; font-weight: 700;
}
.col-count {
  background: var(--line-strong); padding: 2px 7px; border-radius: 999px; font-size: 10px;
}
.task-card {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--line-glass);
  border-radius: 12px;
  padding: 16px;
  box-shadow: var(--shadow-sm);
  transition: all .22s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.task-card:hover {
  transform: translateY(-3px);
  border-color: var(--accent-line);
  background: var(--bg-card-hover);
  box-shadow: var(--shadow-md), 0 0 16px rgba(139, 92, 246, 0.18);
}
.task-card { cursor: grab; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.task-card--dragging { display: none; }
.task-card--ghost {
  position: fixed; z-index: 9999; pointer-events: none; cursor: grabbing;
  transform: rotate(2.5deg) scale(1.03); opacity: .95;
  box-shadow: var(--shadow-md), 0 18px 40px rgba(0, 0, 0, .35);
  transition: none;
}
.task-card-placeholder {
  border: 2px dashed var(--accent-line); border-radius: 12px;
  background: var(--accent-dim); flex-shrink: 0;
}
.task-dropzone--over { min-height: 80px; }
body.is-dragging-task, body.is-dragging-task * { cursor: grabbing !important; }
.task-title { font-weight: 700; font-size: 14px; line-height: 1.25; color: var(--text); }
.task-desc { font-size: 12px; color: var(--text-muted); line-height: 1.4; }
.task-meta { display: flex; justify-content: space-between; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 11px; }
.task-assignee { font-family: var(--font-mono); font-size: 11px; color: var(--accent-bright); }
.task-date { font-family: var(--font-mono); font-size: 10px; color: var(--text-faint); }
.task-actions { display: flex; justify-content: space-between; align-items: center; border-top: 1px solid var(--line); padding-top: 8px; margin-top: 4px; }
.task-stepbtn {
  background: var(--accent-dim); border: 1px solid var(--accent-line); color: var(--accent-soft);
  padding: 4px 10px; border-radius: 6px; font-size: 11px; font-weight: 600;
}
.task-stepbtn:hover { background: var(--accent); color: #0b0813; }
[data-theme="light"] .task-stepbtn:hover { color: #ffffff; }

/* Modals */
.modalback { position: fixed; inset: 0; z-index: 100; background: rgba(7, 7, 12, .85); backdrop-filter: blur(8px); display: grid; place-items: center; padding: 20px; }
[data-theme="light"] .modalback { background: rgba(15, 23, 42, .6); }
.modal {
  width: min(100%, 640px);
  max-height: 90vh;
  overflow-y: auto;
  background: rgba(18, 16, 29, 0.94);
  backdrop-filter: blur(28px) saturate(190%);
  -webkit-backdrop-filter: blur(28px) saturate(190%);
  border: 1px solid var(--accent-line);
  border-radius: 22px;
  padding: 32px;
  box-shadow: 0 30px 100px rgba(0, 0, 0, 0.85), 0 0 50px rgba(139, 92, 246, 0.25);
  animation: modalPopIn 0.24s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes modalPopIn {
  from { opacity: 0; transform: scale(0.95) translateY(12px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}
.modalhead { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 18px; }
.close {
  background: rgba(255, 255, 255, .05); color: var(--text); border: 1px solid var(--line);
  border-radius: 8px; width: 34px; height: 34px; font-size: 20px; display: grid; place-items: center;
}
.formgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.modalactions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 24px; }

/* Checkbox Groups for Departments */
.dept-check-group {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; margin: 10px 0 16px;
}
.dept-check-label {
  display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 8px;
  background: rgba(255, 255, 255, .03); border: 1px solid var(--line); cursor: pointer; font-size: 13px; font-weight: 600;
}
.dept-check-label input { width: auto; margin: 0; }

/* Admin & Log sections */
.logrow {
  display: grid;
  grid-template-columns: 135px 175px 1fr 140px;
  gap: 12px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
  align-items: flex-start;
  transition: background-color .15s ease;
}
.logrow:hover {
  background: rgba(255, 255, 255, 0.02);
}
.logrow:last-child { border-bottom: 0; }
.logtime {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-faint);
  line-height: 1.4;
  padding-top: 2px;
}
.logaction {
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  width: max-content;
  letter-spacing: .02em;
  white-space: nowrap;
}
.logaction.ITEM_CREATED { background: var(--green-dim); color: var(--green); border: 1px solid rgba(74, 222, 128, .3); }
.logaction.ITEM_UPDATED { background: var(--accent-dim); color: var(--accent-soft); border: 1px solid var(--accent-line); }
.logaction.ITEM_DELETED { background: var(--red-dim); color: var(--red); border: 1px solid rgba(248, 113, 113, .3); }
.logaction.TOOL_CHECKOUT { background: var(--amber-dim); color: var(--amber); border: 1px solid rgba(251, 191, 36, .3); }
.logaction.TOOL_CHECKIN { background: rgba(56, 189, 248, .15); color: #7dd3fc; border: 1px solid rgba(56, 189, 248, .3); }
.logaction.PLANNER_TASK_CREATED { background: var(--blue-dim); color: var(--blue); border: 1px solid rgba(96, 165, 250, .3); }
.logaction.PLANNER_TASK_UPDATED { background: var(--accent-dim); color: var(--accent-soft); border: 1px solid var(--accent-line); }
.logaction.PLANNER_TASK_COMPLETED { background: var(--green-dim); color: var(--green); border: 1px solid rgba(74, 222, 128, .3); }
.logaction.PLANNER_TASK_DELETED { background: var(--red-dim); color: var(--red); border: 1px solid rgba(248, 113, 113, .3); }
.logaction.PART_NEEDED_CREATED { background: rgba(244, 63, 94, .12); color: #fda4af; border: 1px solid rgba(244, 63, 94, .3); }
.logaction.PART_STATUS_UPDATED { background: rgba(168, 85, 247, .15); color: #d8b4fe; border: 1px solid rgba(168, 85, 247, .3); }
.logaction.PART_NEEDED_DELETED { background: var(--red-dim); color: var(--red); border: 1px solid rgba(248, 113, 113, .3); }
.logaction.SPENDING_RECORDED { background: var(--green-dim); color: var(--green); border: 1px solid rgba(74, 222, 128, .3); }
.logaction.SPENDING_DELETED { background: var(--red-dim); color: var(--red); border: 1px solid rgba(248, 113, 113, .3); }
.logaction.SHIFT_CREATED { background: var(--blue-dim); color: var(--blue); border: 1px solid rgba(96, 165, 250, .3); }
.logaction.SHIFT_ATTENDED { background: var(--green-dim); color: var(--green); border: 1px solid rgba(74, 222, 128, .3); }
.logaction.SHIFT_LEFT { background: var(--amber-dim); color: var(--amber); border: 1px solid rgba(251, 191, 36, .3); }
.logaction.SHIFT_ATTENDEE_REMOVED { background: var(--red-dim); color: var(--red); border: 1px solid rgba(248, 113, 113, .3); }
.logaction.SHIFT_DELETED { background: var(--red-dim); color: var(--red); border: 1px solid rgba(248, 113, 113, .3); }
.logaction.PLAYBOOK_SAVED { background: rgba(56, 189, 248, .15); color: #7dd3fc; border: 1px solid rgba(56, 189, 248, .3); }
.logaction.PLAYBOOK_DELETED { background: var(--red-dim); color: var(--red); border: 1px solid rgba(248, 113, 113, .3); }
.logaction.SCOUTING_SUBMITTED { background: rgba(250, 204, 21, .15); color: #fde047; border: 1px solid rgba(250, 204, 21, .3); }
.logaction.SCOUTING_DELETED { background: var(--red-dim); color: var(--red); border: 1px solid rgba(248, 113, 113, .3); }
.logaction.MEMBER_APPROVED { background: var(--green-dim); color: var(--green); border: 1px solid rgba(74, 222, 128, .3); }
.logaction.MEMBER_REVOKED { background: var(--red-dim); color: var(--red); border: 1px solid rgba(248, 113, 113, .3); }
.logaction.USER_LOGIN { background: var(--accent-dim); color: var(--accent-bright); border: 1px solid var(--accent-line); }

/* Verbose Detail Styling */
.log-narrative {
  color: var(--text);
  line-height: 1.45;
  margin-bottom: 6px;
  font-size: 13px;
}
.log-narrative strong {
  color: var(--accent-bright);
}
.log-pill-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 4px;
}
.log-pill {
  font-family: var(--font-mono);
  font-size: 10.5px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
  padding: 2px 7px;
  border-radius: 5px;
  color: var(--text-muted);
}
.log-pill b {
  color: var(--text);
}
.log-diff-pill {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 5px;
  display: inline-block;
}
.log-diff-pill.pos {
  background: var(--green-dim);
  color: var(--green);
  border: 1px solid rgba(74, 222, 128, .3);
}
.log-diff-pill.neg {
  background: var(--red-dim);
  color: var(--red);
  border: 1px solid rgba(248, 113, 113, .3);
}
.log-raw-details {
  margin-top: 8px;
}
.log-raw-details summary {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-faint);
  cursor: pointer;
  user-select: none;
  letter-spacing: .04em;
}
.log-raw-details summary:hover {
  color: var(--accent-soft);
}
.log-raw-details pre {
  margin: 6px 0 0;
  padding: 8px 10px;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--line);
  border-radius: 6px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--accent-bright);
  overflow-x: auto;
  max-height: 160px;
  white-space: pre-wrap;
  word-break: break-all;
}

@media (max-width: 900px) {
  .log-table-header {
    display: none !important;
  }
  .logrow {
    grid-template-columns: 1fr !important;
    gap: 8px !important;
    padding: 12px 14px !important;
  }
}

/* Quick FRC dropdown helper container */
.frc-preset-box {
  background: var(--accent-dim); border: 1px dashed var(--accent-line); border-radius: 9px;
  padding: 10px 14px; margin-bottom: 14px;
}
.frc-preset-box label { margin-top: 0; color: var(--accent-soft); font-size: 11px; }

/* Scouting Form & Analytics Styles */
.scout-card {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 20px;
  margin-bottom: 16px;
}
.scout-phase-title {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .12em;
  color: var(--accent-bright);
  font-weight: 700;
  text-transform: uppercase;
  margin-bottom: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.scout-counter-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255, 255, 255, .03);
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 12px 16px;
  margin-bottom: 10px;
}
.scout-counter-card.fuel {
  border-color: rgba(234, 179, 8, .3);
  background: rgba(234, 179, 8, .04);
}
.scout-counter-num {
  font-family: var(--font-mono);
  font-size: 32px;
  font-weight: 800;
  color: var(--text);
  min-width: 50px;
  text-align: right;
  margin-right: 14px;
}
.scout-counter-num.fuel { color: #facc15; }
.scout-step-btns {
  display: flex;
  gap: 6px;
}
.scout-step-btns button {
  padding: 8px 14px;
  font-weight: 700;
  font-family: var(--font-mono);
  font-size: 14px;
  border-radius: 6px;
  background: rgba(255, 255, 255, .06);
  border: 1px solid var(--line);
  color: var(--text);
  cursor: pointer;
  touch-action: manipulation;
  transition: all .12s;
}
.scout-step-btns button:hover {
  background: var(--accent-dim);
  border-color: var(--accent-line);
  color: var(--accent-soft);
}
.scout-step-btns button.minus {
  background: rgba(239, 68, 68, .1);
  border-color: rgba(239, 68, 68, .3);
  color: #f87171;
}
.scout-toggles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 8px;
  margin-top: 10px;
}
.scout-toggle-pill {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, .03);
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  transition: all .12s;
}
.scout-toggle-pill:has(input:checked) {
  background: var(--accent-dim);
  border-color: var(--accent-line);
  color: var(--accent-soft);
}
.scout-radio-group {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.scout-radio-btn {
  flex: 1 1 auto;
  text-align: center;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, .03);
  cursor: pointer;
  font-weight: 700;
  font-size: 13px;
  transition: all .12s;
}
.scout-radio-btn:has(input:checked) {
  background: var(--accent-dim);
  border-color: var(--accent-line);
  color: var(--accent-soft);
}
.scout-radio-btn input { position: absolute; opacity: 0; pointer-events: none; }

/* Toast */
.toast {
  position: fixed; bottom: 24px; right: 24px; max-width: min(440px, calc(100vw - 32px));
  background: var(--bg-card); border: 1px solid var(--accent-line); color: var(--text);
  padding: 14px 18px; border-radius: var(--radius); z-index: 200; box-shadow: 0 10px 40px rgba(0, 0, 0, .6);
  font-size: 13px; font-weight: 500;
}
.toast.error { border-color: rgba(248, 113, 113, .5); background: #1a0f12; color: #fecdd3; }

/* Responsive */
/* App Layout & Left Sidebar */
.app-layout {
  display: flex;
  min-height: 100vh;
  width: 100%;
}
.app-sidebar {
  width: 250px;
  flex-shrink: 0;
  background: #07070ceb;
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  padding: 20px 14px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  z-index: 70;
  transition: transform .22s cubic-bezier(0.16, 1, 0.3, 1), background-color .2s ease;
}
[data-theme="light"] .app-sidebar {
  background: #f8fafc;
  border-right-color: #cbd5e1;
}
.app-sidebar-backdrop {
  position: fixed; inset: 0; background: rgba(0,0,0,.6); backdrop-filter: blur(4px); z-index: 65; display: none;
}
.app-sidebar-backdrop.active { display: block; }
.app-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.sidebar-header {
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 14px;
}
.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}
.sidebar-logo {
  border-radius: 8px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.05);
}
.sidebar-brand strong {
  display: block;
  font-size: 14px;
  letter-spacing: .06em;
  line-height: 1.1;
}
.sidebar-brand small {
  font-size: 9px;
  letter-spacing: .18em;
  color: var(--accent-soft);
}
.sidebar-slogan {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: .05em;
  color: var(--accent-bright);
  margin-top: 8px;
  line-height: 1.35;
  text-transform: uppercase;
}
.sidebar-section-title {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: .16em;
  color: var(--text-faint);
  margin: 14px 6px 6px;
  text-transform: uppercase;
}
.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.sidebar-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-muted);
  font-size: 13.5px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  transition: all .2s cubic-bezier(0.16, 1, 0.3, 1);
  width: 100%;
}
.sidebar-link:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #ffffff;
  border-color: var(--line-strong);
  transform: translateX(3px);
}
.sidebar-link.active {
  background: var(--accent-dim);
  border-color: var(--accent-bright);
  color: #ffffff;
  font-weight: 700;
  box-shadow: 0 4px 18px rgba(139, 92, 246, 0.35);
}
.sidebar-icon { font-size: 16px; }
.sidebar-stat-chip {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 7px 10px;
  background: rgba(255, 255, 255, .02);
  border: 1px solid var(--line);
  border-radius: 7px;
  font-size: 11px;
  margin-bottom: 5px;
}
.sidebar-footer {
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}
.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  background: rgba(255, 255, 255, .03);
  border: 1px solid var(--line);
  cursor: pointer;
  transition: border-color .14s;
}
.sidebar-user:hover { border-color: var(--accent-line); }
.sidebar-user-text { flex: 1; min-width: 0; }
.sidebar-user-text span {
  display: block;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sidebar-user-text small {
  font-size: 9px;
  color: var(--accent-soft);
}
.sidebar-toggle-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,.05);
  border: 1px solid var(--line);
  color: var(--text);
  font-size: 18px;
  padding: 6px 10px;
  border-radius: 8px;
  cursor: pointer;
  transition: all .15s ease;
  line-height: 1;
}
.sidebar-toggle-btn:hover {
  background: var(--accent-dim);
  border-color: var(--accent-line);
  color: var(--accent-bright);
}
.mobile-menu-btn {
  display: inline-flex;
}

/* PC Collapsible Sidebar State */
@media (min-width: 1025px) {
  body.sidebar-collapsed .app-sidebar {
    display: none !important;
  }
  body.sidebar-collapsed .app-main {
    margin-left: 0 !important;
    width: 100% !important;
  }
}

/* Strategy & Whiteboard Styles */
.playbook-container {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.playbook-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 12px 16px;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.tool-group {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.tool-label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: .12em;
  color: var(--text-muted);
  font-weight: 700;
  margin-right: 2px;
}
.tool-btn {
  background: rgba(255,255,255,.04);
  border: 1px solid var(--line);
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
  padding: 5px 10px;
  border-radius: 6px;
  transition: all .12s;
}
.tool-btn:hover { background: rgba(255,255,255,.08); color: var(--text); }
.tool-btn.active {
  background: var(--accent-dim);
  border-color: var(--accent-line);
  color: var(--accent-soft);
  font-weight: 700;
}
.color-swatches {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.swatch {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform .12s;
}
.swatch.active {
  border-color: #ffffff;
  transform: scale(1.18);
  box-shadow: 0 0 10px rgba(255,255,255,.5);
}
.size-btn {
  background: rgba(255,255,255,.04);
  border: 1px solid var(--line);
  color: var(--text-muted);
  font-size: 11px;
  padding: 4px 8px;
  border-radius: 5px;
}
.size-btn.active {
  background: var(--accent-dim);
  border-color: var(--accent-line);
  color: var(--accent-soft);
  font-weight: 700;
}
.canvas-wrapper {
  position: relative;
  width: 100%;
  background: #090912;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 16px 50px rgba(0,0,0,.6);
  display: flex;
  justify-content: center;
}
#field-canvas {
  width: 100%;
  max-width: 960px;
  height: auto;
  aspect-ratio: 2 / 1;
  display: block;
  cursor: crosshair;
  touch-action: none;
}
.playbook-save-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  padding: 14px 18px;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.saved-plays-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
  margin-top: 6px;
}
.play-card {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color .15s, transform .15s;
}
.play-card:hover {
  border-color: var(--accent-line);
  transform: translateY(-2px);
}
.play-card-thumb {
  width: 100%;
  aspect-ratio: 2 / 1;
  object-fit: cover;
  background: #090912;
  display: block;
  border-bottom: 1px solid var(--line);
}
.play-card-body {
  padding: 12px 14px;
}
.play-card-title {
  font-weight: 700;
  font-size: 13px;
  color: var(--text);
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.play-card-meta {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-faint);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.play-card-actions {
  display: flex;
  gap: 6px;
  margin-top: 10px;
}

/* Match Simulator Styles */
.sim-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin-bottom: 18px;
}
.sim-alliance-box {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
}
.sim-alliance-box.red { border-top: 3px solid #ef4444; }
.sim-alliance-box.blue { border-top: 3px solid #3b82f6; }
.sim-alliance-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}
.sim-slot {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 12px;
}
.sim-slot select {
  font-size: 13px;
  padding: 8px 10px;
  width: 100%;
}
.sim-slot-search {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: 6px;
  transition: border-color .15s ease;
}
.sim-slot-search:focus {
  border-color: var(--accent-line);
  outline: none;
  background: rgba(255, 255, 255, 0.08);
}
.sim-result-card {
  background: var(--bg-card);
  border: 1px solid var(--accent-line);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: 0 10px 40px rgba(0,0,0,.5);
}
.prob-bar-container {
  height: 28px;
  background: rgba(255,255,255,.05);
  border-radius: 999px;
  overflow: hidden;
  display: flex;
  margin: 16px 0;
  border: 1px solid var(--line);
}
.prob-bar-fill {
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  transition: width .4s cubic-bezier(0.16, 1, 0.3, 1);
}
.prob-bar-fill.red { background: #e04848; color: #ffffff; }
.prob-bar-fill.blue { background: #1c6bff; color: #ffffff; }
.sim-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 12px;
  margin: 16px 0;
}
.sim-stat-box {
  background: rgba(255,255,255,.02);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 14px;
  text-align: center;
}
.sim-stat-box small { font-size: 10px; font-family: var(--font-mono); color: var(--text-muted); display: block; }
.sim-stat-box strong { font-size: 18px; font-family: var(--font-mono); }

/* Rankings Table */
.rank-badge {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: rgba(255,255,255,.04);
  border: 1px solid var(--line);
}
.rank-badge.top3 {
  background: rgba(250, 204, 21, .15);
  border-color: rgba(250, 204, 21, .4);
  color: #fde047;
}

/* Responsive adjustments */
@media (max-width: 1024px) {
  .app-sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    transform: translateX(-100%);
    box-shadow: 10px 0 40px rgba(0,0,0,.7);
  }
  .app-sidebar.open {
    transform: translateX(0);
  }
  /* mobile menu button visible */
  .sim-grid { grid-template-columns: 1fr; }
}


/* ==========================================================================
   MOBILE FIRST & RESPONSIVE POLISH (Phones < 768px & Tablets < 900px)
   ========================================================================== */
@media (max-width: 900px) {
  body {
    font-size: 14px;
    -webkit-text-size-adjust: 100%;
    padding-bottom: 78px !important; /* Dedicated clearance for mobile bottom nav */
  }

  .shell {
    padding: 0 12px 30px !important;
  }

  .app-main {
    padding-bottom: 12px;
  }

  .dashboard {
    padding: 8px 4px 20px;
  }

  /* Compact Sleek Topbar */
  .topbar {
    height: 56px !important;
    padding: 0 6px !important;
    gap: 8px;
  }
  .brand-logo {
    height: 32px !important;
    width: 32px !important;
  }
  .brandtext strong {
    font-size: 13.5px !important;
    letter-spacing: .03em;
  }
  .brandtext small {
    display: none !important; /* Hide tiny unreadable slogan on mobile header */
  }
  .theme-toggle {
    scale: 0.9;
  }
  .userchip {
    padding: 4px 10px !important;
    gap: 8px !important;
  }
  .avatar {
    height: 28px !important;
    width: 28px !important;
    font-size: 11px !important;
  }

  /* Welcome Hero Section */
  .welcome {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 12px !important;
    margin-bottom: 16px !important;
    padding: 14px 16px !important;
    border-radius: var(--radius-sm);
  }
  .welcome h1 {
    font-size: 20px !important;
    line-height: 1.2 !important;
    margin-bottom: 2px !important;
  }
  .welcome p.muted {
    font-size: 12px !important;
    line-height: 1.4 !important;
  }

  /* 2x2 Stats Dashboard Grid */
  .stats {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 10px !important;
    margin-bottom: 18px !important;
  }
  .stat {
    padding: 12px 14px !important;
    border-radius: var(--radius-sm) !important;
    min-height: 80px;
  }
  .statlabel {
    font-size: 9.5px !important;
    letter-spacing: .08em;
  }
  .statvalue {
    font-size: 22px !important;
    line-height: 1.1 !important;
    margin-top: 4px;
  }
  .stathelp {
    font-size: 10.5px !important;
    margin-top: 2px;
  }

  /* Strict Mobile Viewport - ZERO Horizontal Scroll */
  html, body {
    overflow-x: hidden !important;
    max-width: 100vw !important;
    width: 100% !important;
  }
  .app-layout, .app-main, .shell, .dashboard, .panel {
    max-width: 100% !important;
    overflow-x: hidden !important;
    box-sizing: border-box !important;
  }

  /* Replace horizontal scrolling tabs with Vertical Popup Pickers on mobile */
  .viewtabs {
    display: none !important; /* Hidden on mobile in favor of popup modal */
  }
  .mobile-view-picker-container {
    display: block !important;
  }
  .mobile-filter-picker-container {
    display: block !important;
  }

  /* Wrap filter pill lists cleanly so they never scroll horizontally */
  .tabslist {
    display: flex !important;
    flex-wrap: wrap !important;
    overflow-x: visible !important;
    white-space: normal !important;
    padding-bottom: 6px !important;
    gap: 6px !important;
    width: 100% !important;
  }
  .catbtn {
    flex: 1 1 auto !important;
    font-size: 11.5px !important;
    padding: 6px 10px !important;
    min-height: 32px !important;
    text-align: center !important;
    justify-content: center !important;
  }
  #strat-sort-tabs {
    display: none !important; /* Controlled by mobile sort popup button */
  }

  /* Single Column Multi-Grid Layouts for Mobile */
  .planner-grid {
    grid-template-columns: 1fr !important;
    gap: 16px !important;
    padding: 12px !important;
  }
  .planner-col {
    min-height: auto !important;
  }
  .sim-grid {
    grid-template-columns: 1fr !important;
    gap: 14px !important;
  }
  .shift-grid {
    grid-template-columns: 1fr !important;
    padding: 12px !important;
  }

  /* Card layouts for Checkouts, Parts Needed, Spending, and Audit Logs */
  #checkouts-list .itemrow,
  #parts-needed-list .itemrow,
  #spending-list .itemrow,
  #admin-members-list .itemrow,
  #logs-list > div {
    display: flex !important;
    flex-direction: column !important;
    gap: 8px !important;
    padding: 14px !important;
    margin-bottom: 10px !important;
    background: var(--bg-card) !important;
    border: 1px solid var(--line) !important;
    border-radius: var(--radius-sm) !important;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2) !important;
  }

  /* Toolbars & Search */
  .toolbar {
    padding: 12px 14px !important;
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 12px !important;
  }
  .toolbar-actions {
    width: 100% !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 10px !important;
  }
  .toolbar-actions .search,
  .search {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 100% !important;
    box-sizing: border-box !important;
    font-size: 14px !important;
    height: 40px !important;
  }

  /* Hide Desktop Table Headers */
  .tablehead {
    display: none !important;
  }

  /* Mobile Inventory Card Transformation */
  .itemrow {
    display: flex !important;
    flex-direction: column !important;
    padding: 14px 16px !important;
    margin-bottom: 10px !important;
    background: var(--bg-card) !important;
    border: 1px solid var(--line) !important;
    border-radius: var(--radius-sm) !important;
    gap: 10px !important;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2) !important;
  }
  .itemrow > div:first-child {
    width: 100%;
  }
  .itemname {
    font-size: 15px !important;
    font-weight: 700 !important;
    color: var(--text) !important;
    display: flex !important;
    align-items: center !important;
    gap: 6px !important;
    flex-wrap: wrap !important;
  }
  .itemnotes {
    font-size: 12px !important;
    white-space: normal !important;
    max-width: 100% !important;
    margin-top: 4px !important;
    color: var(--text-muted) !important;
  }
  .itemrow .subsys {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    flex-wrap: wrap !important;
  }
  .itemrow .location {
    display: inline-block !important;
    font-size: 11.5px !important;
  }

  /* Quantity & Action Controls in Modern Native Row */
  .itemrow .quantity {
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 12px !important;
    background: rgba(255, 255, 255, 0.03) !important;
    padding: 8px 12px !important;
    border-radius: 8px !important;
    border: 1px solid var(--line) !important;
    width: fit-content !important;
  }
  .qtybtn {
    width: 36px !important;
    height: 36px !important;
    font-size: 18px !important;
    font-weight: 700 !important;
    display: grid !important;
    place-items: center !important;
    border-radius: 8px !important;
    -webkit-tap-highlight-color: transparent;
  }
  .qtynum {
    font-size: 17px !important;
    min-width: 26px !important;
    font-weight: 800 !important;
    text-align: center !important;
  }
  .itemrow .actions {
    display: flex !important;
    align-items: center !important;
    justify-content: flex-end !important;
    gap: 8px !important;
    width: 100% !important;
    margin-top: 4px !important;
    border-top: 1px solid rgba(255, 255, 255, 0.05) !important;
    padding-top: 10px !important;
  }
  .actionbtn {
    padding: 8px 14px !important;
    font-size: 13px !important;
    min-height: 36px !important;
    border-radius: 7px !important;
  }

  /* Touch-friendly Buttons */
  .btn {
    padding: 9px 15px !important;
    font-size: 13px !important;
    min-height: 42px !important;
    border-radius: 8px !important;
  }

  /* Secret Intel Cards Mobile */
  #secret-intel-list .card {
    padding: 14px 14px !important;
    border-radius: var(--radius-sm) !important;
  }
  #secret-intel-list .card > div:first-child {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 12px !important;
  }
  #secret-intel-list .card > div:first-child > div:last-child {
    width: 100% !important;
    justify-content: space-between !important;
  }

  /* Mobile Strategy & Whiteboard polish */
  .playbook-toolbar {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 10px !important;
    padding: 10px 12px !important;
  }
  .tool-group {
    justify-content: flex-start !important;
    overflow-x: auto !important;
    padding-bottom: 4px !important;
  }
  .playbook-save-bar {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 10px !important;
  }
  .canvas-wrapper {
    touch-action: none !important;
    -webkit-user-select: none !important;
    user-select: none !important;
    max-width: 100% !important;
    overflow: hidden !important;
    border-radius: var(--radius-sm) !important;
  }
  #field-canvas {
    touch-action: none !important;
    width: 100% !important;
    height: auto !important;
    aspect-ratio: 2 / 1 !important;
  }

  /* Mobile Rankings list card view */
  #strat-rankings-list .itemrow {
    display: flex !important;
    flex-direction: column !important;
    gap: 8px !important;
    padding: 14px !important;
    border-radius: var(--radius-sm) !important;
    margin-bottom: 8px !important;
  }
  #strat-rankings-pagination {
    flex-direction: column !important;
    gap: 10px !important;
    align-items: center !important;
    text-align: center !important;
  }
  #strat-sort-tabs {
    display: none !important;
  }

  /* Fixed Mobile Bottom Navigation Bar */
  .mobile-bottom-nav {
    display: flex !important;
    position: fixed !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    height: 62px !important;
    background: rgba(15, 17, 23, 0.96) !important;
    backdrop-filter: blur(16px) !important;
    -webkit-backdrop-filter: blur(16px) !important;
    border-top: 1px solid var(--line-strong) !important;
    z-index: 9999 !important;
    justify-content: space-around !important;
    align-items: center !important;
    padding: 4px 8px env(safe-area-inset-bottom, 8px) !important;
    box-shadow: 0 -4px 24px rgba(0,0,0,0.5) !important;
  }
  [data-theme="light"] .mobile-bottom-nav {
    background: rgba(255, 255, 255, 0.96) !important;
    box-shadow: 0 -4px 20px rgba(0,0,0,0.08) !important;
  }
  .mobile-nav-item {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 3px !important;
    background: transparent !important;
    border: none !important;
    color: var(--text-muted) !important;
    font-size: 11px !important;
    font-weight: 600 !important;
    padding: 6px 12px !important;
    border-radius: 8px !important;
    cursor: pointer !important;
    flex: 1 !important;
    max-width: 110px !important;
    transition: color 0.15s, transform 0.1s !important;
    -webkit-tap-highlight-color: transparent !important;
  }
  .mobile-nav-item .nav-icon {
    font-size: 20px !important;
    line-height: 1 !important;
  }
  .mobile-nav-item.active {
    color: var(--accent-bright) !important;
  }
  .mobile-nav-item:active {
    transform: scale(0.95) !important;
  }
  .mobile-nav-item.secrets-item.active {
    color: #f43f5e !important;
  }
}

/* Landscape / Mobile Fullscreen mode for Strategy Planner */
.playbook-container.fullscreen-active {
  position: fixed !important;
  inset: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  max-width: 100vw !important;
  max-height: 100vh !important;
  z-index: 99999 !important;
  background: #090912 !important;
  padding: 8px !important;
  display: flex !important;
  flex-direction: column !important;
  overflow: hidden !important;
}
.playbook-container.fullscreen-active .canvas-wrapper {
  flex: 1 1 auto !important;
  height: 100% !important;
  max-height: calc(100vh - 100px) !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  border-radius: 6px !important;
}
.playbook-container.fullscreen-active #field-canvas {
  width: auto !important;
  height: 100% !important;
  max-height: 100% !important;
  max-width: 100% !important;
  aspect-ratio: 2 / 1 !important;
  object-fit: contain !important;
}
.playbook-container.fullscreen-active .playbook-toolbar {
  position: relative !important;
  flex-direction: row !important;
  flex-wrap: wrap !important;
  gap: 6px !important;
  padding: 6px 10px !important;
  background: rgba(18, 20, 28, 0.95) !important;
  border-radius: 8px !important;
  z-index: 10 !important;
}
.playbook-container.fullscreen-active .playbook-save-bar,
.playbook-container.fullscreen-active .eyebrow,
.playbook-container.fullscreen-active .saved-plays-grid {
  display: none !important;
}

@media (max-width: 950px) and (orientation: landscape) {
  body.auto-landscape-playbook .playbook-container {
    padding: 6px !important;
  }
}

/* ==========================================================================
   VERTICAL POPUP PICKER & BOTTOM SHEET SYSTEM (NO HORIZONTAL SCROLL)
   ========================================================================== */
.mobile-view-picker-container {
  display: none;
  width: 100%;
  margin-bottom: 14px;
}
.mobile-picker-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--bg-card);
  border: 1px solid var(--accent-line);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  color: var(--text);
  cursor: pointer;
  transition: all 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}
.mobile-picker-btn:active {
  transform: scale(0.98);
  border-color: var(--accent-bright);
}
.mobile-picker-btn .picker-icon {
  font-size: 22px;
  line-height: 1;
}
.mobile-picker-btn .picker-text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  flex: 1;
  text-align: left;
}
.mobile-picker-btn .picker-text small {
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.12em;
  color: var(--accent-bright);
  font-weight: 700;
}
.mobile-picker-btn .picker-text strong {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  margin-top: 1px;
}
.mobile-picker-btn .picker-arrow {
  font-size: 16px;
  color: var(--text-muted);
}

.mobile-filter-picker-container {
  display: none;
  width: 100%;
  margin-bottom: 10px;
}
.mobile-filter-picker-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  padding: 9px 14px;
  font-size: 13px;
  color: var(--text);
  font-weight: 600;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.mobile-filter-picker-btn:active {
  background: rgba(255, 255, 255, 0.08);
}


/* By default on PC/Desktop screens (>900px), hide mobile bottom navigation bar */
.mobile-bottom-nav {
  display: none !important;
}

/* Modal Bottom Sheets */
.bottom-sheet-backdrop {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(5, 5, 10, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 0;
  animation: fadeInBackdrop 0.2s ease-out;
}
.bottom-sheet-backdrop.hidden {
  display: none !important;
}
@keyframes fadeInBackdrop {
  from { opacity: 0; }
  to { opacity: 1; }
}

.bottom-sheet {
  background: var(--bg-card);
  border-top: 1px solid var(--accent-line);
  border-top-left-radius: 20px;
  border-top-right-radius: 20px;
  padding: 12px 18px 28px;
  box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.7);
  max-height: 82vh;
  display: flex;
  flex-direction: column;
  animation: slideUpSheet 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
@keyframes slideUpSheet {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

.bottom-sheet-handle {
  width: 44px;
  height: 4px;
  background: rgba(255, 255, 255, 0.25);
  border-radius: 999px;
  margin: 0 auto 12px;
}
.bottom-sheet-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 10px;
}
.sheet-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 18px;
  padding: 6px 10px;
  cursor: pointer;
  border-radius: 6px;
}
.sheet-close:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
}

.bottom-sheet-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.sheet-option {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  transition: all 0.12s ease;
  -webkit-tap-highlight-color: transparent;
}
.sheet-option:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--line-strong);
}
.sheet-option.active {
  background: var(--accent-dim);
  border-color: var(--accent-bright);
  color: var(--accent-bright);
}
.sheet-option-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
}
.sheet-option .opt-icon {
  font-size: 18px;
  line-height: 1;
}
.sheet-badge {
  font-family: var(--font-mono);
  font-size: 11px;
  background: rgba(255, 255, 255, 0.08);
  padding: 3px 8px;
  border-radius: 999px;
  color: var(--text-muted);
}
.sheet-option.active .sheet-badge {
  background: var(--accent-bright);
  color: #000;
  font-weight: 700;
}

/* Quick Jump & Command Palette (Ctrl+K) */
.global-search-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line-glass);
  border-radius: 999px;
  padding: 6px 14px;
  color: var(--text-muted);
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  transition: all .2s cubic-bezier(0.16, 1, 0.3, 1);
  backdrop-filter: blur(8px);
}
.global-search-btn:hover {
  background: var(--accent-dim);
  border-color: var(--accent-line);
  color: #ffffff;
  box-shadow: 0 0 16px var(--accent-dim);
}
.shortcut-kbd {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--line-strong);
  color: var(--accent-soft);
}
.cmd-palette-results {
  max-height: 380px;
  overflow-y: auto;
  margin-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.cmd-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-radius: 10px;
  cursor: pointer;
  transition: all .15s ease;
  color: var(--text);
  font-size: 13.5px;
}
.cmd-item:hover, .cmd-item.selected {
  background: var(--accent-dim);
  color: var(--accent-bright);
}
.cmd-item-left {
  display: flex;
  align-items: center;
  gap: 12px;
}
.cmd-item-icon {
  font-size: 16px;
}
.cmd-item-badge {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-faint);
  background: rgba(255, 255, 255, 0.05);
  padding: 2px 6px;
  border-radius: 4px;
}

@media (max-width: 900px) {
  .global-search-btn .search-label,
  .global-search-btn .shortcut-kbd {
    display: none !important;
  }
  .global-search-btn {
    padding: 6px 10px !important;
  }
}

/* ==========================================================================
   Mobile polish: header, quick actions, spending ledger cards, modals
   ========================================================================== */
@media (max-width: 900px) {
  .topnote { display: none !important; }

  .user-quick-actions {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px !important;
    width: 100%;
  }
  .user-quick-actions > * {
    width: 100%;
    min-height: 40px !important;
    padding: 6px 8px !important;
    font-size: 12px !important;
    line-height: 1.2;
    text-align: center;
    justify-content: center;
    white-space: normal;
  }
  .user-quick-actions > .hidden { display: none !important; }

  /* Season filter: one scrollable row of pills */
  #spending-season-filter-tabs {
    flex-wrap: nowrap !important;
    overflow-x: auto;
    width: 100%;
    padding-bottom: 4px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  #spending-season-filter-tabs .catbtn { flex-shrink: 0; white-space: nowrap; }

  /* Spending rows as compact cards:  date ........ amount
                                      title + notes
                                      vendor · period · receipt
                                      ............... actions */
  #spending-list .spend-row {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) auto !important;
    grid-template-areas:
      "date   amount"
      "main   main"
      "meta   meta"
      "receipt actions";
    align-items: center;
    gap: 8px 10px !important;
    text-align: left !important;
  }
  #spending-list .spend-row > * { width: auto !important; text-align: left !important; justify-self: stretch; }
  #spending-list .spend-date { grid-area: date; }
  #spending-list .spend-amount { grid-area: amount; justify-self: end !important; }
  #spending-list .spend-amount strong { font-size: 17px !important; }
  #spending-list .spend-main { grid-area: main; }
  #spending-list .spend-vendor { grid-area: meta; }
  #spending-list .spend-period { grid-area: meta; justify-self: end !important; }
  #spending-list .spend-receipt { grid-area: receipt; }
  #spending-list .spend-actions {
    grid-area: actions;
    justify-self: end !important;
    border-top: 0 !important;
    padding-top: 0 !important;
    margin-top: 0 !important;
  }
  #spending-list .spend-receipt .actionbtn { padding: 6px 12px !important; font-size: 12px !important; }

  /* Modals: full-width sheets that scroll, with reachable action buttons */
  .modalback { place-items: end center !important; padding: 0 !important; }
  .modal {
    width: 100% !important;
    max-width: 100% !important;
    max-height: 92vh !important;
    max-height: 92dvh !important;
    overflow-y: auto !important;
    border-radius: 16px 16px 0 0 !important;
    padding: 18px 16px calc(18px + env(safe-area-inset-bottom)) !important;
  }
  .modal .formgrid { grid-template-columns: 1fr !important; }
  .modalactions {
    position: sticky;
    bottom: calc(-18px - env(safe-area-inset-bottom));
    background: rgb(18, 16, 29);
    border-top: 1px solid var(--line);
    padding: 12px 0 calc(12px + env(safe-area-inset-bottom));
    margin-bottom: calc(-18px - env(safe-area-inset-bottom));
    z-index: 2;
  }
  .modalactions .btn { flex: 1; }
  .modal input, .modal select, .modal textarea { font-size: 16px !important; } /* stops iOS zoom-on-focus */

  #claude-connect-url { min-width: 0; }
  .toolbar-actions > .btn { width: 100%; justify-content: center; }

  .spend-stats {
    grid-template-columns: 1fr 1fr !important;
    gap: 10px !important;
    padding: 0 0 14px !important;
  }
  .spend-stats > .stat:first-child { grid-column: 1 / -1; }
  .spend-stats strong { font-size: 22px !important; white-space: normal !important; overflow: visible !important; text-overflow: clip !important; overflow-wrap: anywhere; }
  .spend-stats #spending-top-vendor { font-size: 15px !important; line-height: 1.3; }
}

/* Planner cards: keep long-press from triggering text selection / callouts on touch */
@media (hover: none) {
  .task-card:hover { transform: none; }
}

/* Shift member picker (admin) */
.assign-box {
  margin: 16px 0 6px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.025);
}
.assign-quick { display: flex; gap: 12px; }
.assign-quick .textbtn { font-size: 12px; }
.assign-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
  max-height: 200px;
  overflow-y: auto;
  padding: 2px;
}
.assign-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  user-select: none;
  transition: background .15s, border-color .15s, color .15s;
}
.assign-chip input { position: absolute; opacity: 0; pointer-events: none; width: 0; height: 0; }
.assign-chip small { font-family: var(--font-mono); font-size: 9.5px; opacity: .7; text-transform: uppercase; }
.assign-chip.is-on {
  background: var(--accent-dim);
  border-color: var(--accent-line);
  color: var(--text);
}
.assign-chip.is-on::before { content: "✓"; color: var(--accent-bright); font-weight: 800; }
.assign-chip:has(input:focus-visible) { outline: 2px solid var(--accent-bright); outline-offset: 2px; }
@media (max-width: 900px) {
  .assign-chip { padding: 8px 12px; font-size: 13px; }
  .assign-list { max-height: 240px; }
}

/* ==========================================================================
   CLEAN THEME — flat, quiet, high-clarity. Overrides the earlier glass/glow
   styling: no blur, gradients, glows or grid background; neutral surfaces,
   one accent colour, simple tables. Light is the default.
   ========================================================================== */
:root, [data-theme="light"] {
  --bg: #f6f6f8;
  --bg-raised: #ffffff;
  --bg-card: #ffffff;
  --bg-card-hover: #fafafb;
  --bg-card-solid: #ffffff;
  --bg-subtle: #f4f4f6;
  --accent: #5b3ce6;
  --accent-bright: #5b3ce6;
  --accent-soft: #6d51ee;
  --accent-glow: transparent;
  --accent-dim: #efebfd;
  --accent-line: #d8cffb;
  --text: #16161a;
  --text-muted: #5f6370;
  --text-faint: #9a9da8;
  --line: #e8e8ec;
  --line-strong: #d9d9df;
  --line-glass: #e8e8ec;
  --green: #138a4b;
  --green-bright: #138a4b;
  --green-dim: #e7f6ed;
  --red: #d33a3a;
  --red-dim: #fdeceb;
  --amber: #b26b00;
  --amber-dim: #fff4e0;
  --blue: #2563eb;
  --blue-dim: #e9f0fe;
  --cyan: #0e7490;
  --cyan-dim: #e6f6f9;
  --cyan-line: #bfe6ee;
  --pink: #d33a3a;
  --pink-dim: #fdeceb;
  --font-sans: "Inter", "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-display: var(--font-sans);
  --radius: 12px;
  --radius-lg: 14px;
  --radius-sm: 8px;
  --shadow-sm: 0 1px 2px rgba(16, 16, 24, 0.04);
  --shadow-md: 0 8px 24px rgba(16, 16, 24, 0.08);
  --shadow-glow: none;
  --shadow-cyan: none;
  color-scheme: light;
}
[data-theme="dark"] {
  --bg: #0f0f12;
  --bg-raised: #17171b;
  --bg-card: #17171b;
  --bg-card-hover: #1c1c21;
  --bg-card-solid: #17171b;
  --bg-subtle: #1c1c21;
  --accent: #8b74ff;
  --accent-bright: #9b87ff;
  --accent-soft: #a897ff;
  --accent-glow: transparent;
  --accent-dim: #24203a;
  --accent-line: #3a3360;
  --text: #ededf0;
  --text-muted: #a1a3ad;
  --text-faint: #6c6f7a;
  --line: #26262c;
  --line-strong: #32323a;
  --line-glass: #26262c;
  --green: #4ade80;
  --green-bright: #4ade80;
  --green-dim: #15291d;
  --red: #f87171;
  --red-dim: #2f1717;
  --amber: #fbbf24;
  --amber-dim: #2e2412;
  --blue: #7aa2ff;
  --blue-dim: #18203a;
  --pink: #f87171;
  --pink-dim: #2f1717;
  --shadow-sm: none;
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.4);
  --shadow-glow: none;
  color-scheme: dark;
}

/* Kill decorative effects everywhere */
body:before, [data-theme="light"] body:before { display: none !important; }
*, *::before, *::after {
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  text-shadow: none !important;
}
body { font-size: 14px; line-height: 1.5; letter-spacing: 0; transition: none; }
h1, h2, h3, h4 { font-family: var(--font-sans); letter-spacing: -0.01em; color: var(--text); }
h1 em, h2 em { font-style: normal; color: inherit; background: none !important; -webkit-text-fill-color: currentColor !important; }
.eyebrow { font-family: var(--font-sans) !important; letter-spacing: 0 !important; text-transform: none !important; font-size: 12px !important; color: var(--text-muted) !important; font-weight: 600; }
.eyebrow::before, .eyebrow::after { display: none !important; }
.slogan-motto { display: none !important; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--line-strong); }
::-webkit-scrollbar-thumb:hover { background: var(--text-faint); }

/* Surfaces */
.card, .panel, .stat, .modal, .task-card, .shift-card, .planner-col, .scout-card,
.userchip, .global-search-btn, .theme-switch-box, .mobile-picker-btn, .itemrow,
.assign-box, .recurrence-box, .play-card {
  background: var(--bg-card) !important;
  border: 1px solid var(--line) !important;
  box-shadow: none !important;
  animation: none !important;
}
.panel, .stat, .card { border-radius: var(--radius) !important; }
.modal { box-shadow: var(--shadow-md) !important; border-radius: 14px; }
.modalback { background: rgba(16, 16, 24, 0.45) !important; }
[data-theme="dark"] .modalback { background: rgba(0, 0, 0, 0.6) !important; }
.task-card:hover, .shift-card:hover, .stat:hover, .panel:hover, .itemrow:hover, .play-card:hover {
  transform: none !important;
  box-shadow: none !important;
  border-color: var(--line-strong) !important;
}

/* Sidebar */
.app-sidebar {
  background: var(--bg-card) !important;
  border-right: 1px solid var(--line) !important;
  box-shadow: none !important;
  padding: 18px 14px !important;
}
.sidebar-header { border-bottom: 0 !important; padding-bottom: 8px !important; margin-bottom: 8px !important; }
.sidebar-brand strong { font-family: var(--font-sans) !important; font-size: 15px !important; letter-spacing: 0 !important; color: var(--text) !important; }
.sidebar-brand small { font-family: var(--font-sans) !important; letter-spacing: 0 !important; text-transform: none !important; color: var(--text-muted) !important; font-size: 12px !important; }
.sidebar-logo { border-radius: 8px; }
.sidebar-section-title {
  font-family: var(--font-sans) !important; font-size: 11px !important; font-weight: 600 !important;
  letter-spacing: 0.04em !important; text-transform: uppercase; color: var(--text-faint) !important;
  margin: 14px 8px 6px !important;
}
.sidebar-link {
  background: transparent !important; border: 0 !important; box-shadow: none !important;
  color: var(--text-muted) !important; font-weight: 500 !important; font-size: 14px !important;
  padding: 8px 10px !important; border-radius: 8px !important; transform: none !important;
}
.sidebar-link:hover { background: var(--bg-subtle) !important; color: var(--text) !important; }
.sidebar-link.active { background: var(--bg-subtle) !important; color: var(--text) !important; font-weight: 600 !important; }
.sidebar-link.active::before, .sidebar-link::after { display: none !important; }
.sidebar-icon { filter: grayscale(1); opacity: .75; }
.sidebar-subnav { display: flex; flex-direction: column; gap: 1px; margin: 2px 0 6px 21px; padding-left: 10px; border-left: 1px solid var(--line); }
.sidebar-sublink {
  display: flex; justify-content: space-between; align-items: center;
  background: transparent; border: 0; border-radius: 6px; text-align: left;
  padding: 6px 10px; font-size: 13px; color: var(--text-muted); font-weight: 500;
}
.sidebar-sublink:hover { background: var(--bg-subtle); color: var(--text); }
.sidebar-sublink.active { background: var(--bg-subtle); color: var(--text); font-weight: 600; }
.sidebar-sublink span:not(:empty) { font-size: 11px; color: var(--text-faint); font-weight: 600; }
.sidebar-sublink.hidden { display: none; }
.sidebar-footer { border-top: 1px solid var(--line) !important; }
.sidebar-user { background: transparent !important; border: 0 !important; }
.sidebar-user-text small { font-family: var(--font-sans) !important; letter-spacing: 0 !important; font-size: 11px !important; }

/* Topbar */
.topbar { border-bottom: 1px solid var(--line) !important; background: var(--bg) !important; box-shadow: none !important; height: 60px; }
.brand-logo { border-radius: 8px; box-shadow: none !important; }
.brandtext strong { font-family: var(--font-sans) !important; letter-spacing: 0 !important; font-size: 15px !important; }
.brandtext small { display: none !important; }
.topnote { display: none !important; }
.global-search-btn { border-radius: 8px !important; color: var(--text-muted) !important; }
.theme-switch-box { border-radius: 8px !important; padding: 2px !important; }
.theme-opt-btn { border-radius: 6px !important; box-shadow: none !important; font-size: 12px !important; font-weight: 500 !important; color: var(--text-muted) !important; background: transparent !important; }
.theme-opt-btn.active { background: var(--bg-subtle) !important; color: var(--text) !important; }
.sidebar-toggle-btn { background: transparent !important; border: 1px solid var(--line) !important; box-shadow: none !important; border-radius: 8px !important; color: var(--text-muted) !important; }

/* Page header */
.welcome {
  background: transparent !important; border: 0 !important; box-shadow: none !important;
  padding: 22px 0 6px !important; margin-bottom: 14px !important; align-items: center !important;
}
.welcome h1 { font-size: 24px !important; font-weight: 700 !important; margin: 0 0 2px !important; line-height: 1.2 !important; }
.welcome p.muted { font-size: 13px !important; margin: 0 !important; }
.userchip { border-radius: 10px !important; padding: 6px 12px !important; }
.avatar { background: var(--accent-dim) !important; color: var(--accent) !important; box-shadow: none !important; border: 0 !important; font-weight: 700; }
.username small { font-family: var(--font-sans) !important; letter-spacing: 0 !important; font-size: 11px !important; color: var(--text-muted) !important; }

/* Stats */
.stats { gap: 12px !important; margin-bottom: 18px !important; }
.stat { padding: 16px 18px !important; }
.stat::before, .stat::after { display: none !important; }
.stat small {
  font-family: var(--font-sans) !important; letter-spacing: 0 !important; text-transform: none !important;
  font-size: 13px !important; color: var(--text-muted) !important; font-weight: 500 !important;
}
.stat strong { font-family: var(--font-sans) !important; font-size: 26px !important; font-weight: 700 !important; color: var(--text) !important; margin: 4px 0 2px; }
.stat p { font-size: 12px !important; color: var(--text-faint) !important; }

/* View tabs: simple underline tabs */
.viewtabs { gap: 2px !important; border-bottom: 1px solid var(--line) !important; padding-bottom: 0 !important; margin-bottom: 16px !important; }
.viewtab {
  background: transparent !important; border: 0 !important; border-bottom: 2px solid transparent !important;
  border-radius: 0 !important; box-shadow: none !important; transform: none !important;
  padding: 10px 12px !important; font-size: 13.5px !important; font-weight: 500 !important; color: var(--text-muted) !important;
  margin-bottom: -1px;
}
.viewtab:hover { color: var(--text) !important; }
.viewtab.active { color: var(--text) !important; border-bottom-color: var(--accent) !important; font-weight: 600 !important; }
.badgenum { background: var(--bg-subtle) !important; color: var(--text-muted) !important; box-shadow: none !important; border: 0 !important; font-family: var(--font-sans) !important; font-weight: 600; }
.viewtab.active .badgenum { background: var(--accent-dim) !important; color: var(--accent) !important; }
@media (min-width: 1025px) {
  body:not(.sidebar-collapsed) #inventory-screen > .viewtabs { display: none !important; }
}

/* Panels & toolbars */
.panel { padding: 0 !important; overflow: hidden; }
.panel::before, .panel::after { display: none !important; }
.toolbar { padding: 18px 20px 12px !important; border-bottom: 0 !important; align-items: center !important; }
.toolbar h2 { font-size: 18px !important; font-weight: 700 !important; margin: 0 0 2px !important; }
.toolbar p.muted { font-size: 13px !important; margin: 0 !important; }
.filters { padding: 0 20px 14px !important; gap: 10px !important; border-bottom: 1px solid var(--line) !important; background: transparent !important; }

/* Buttons */
.btn {
  border-radius: 8px !important; box-shadow: none !important; transform: none !important;
  font-weight: 600 !important; letter-spacing: 0 !important; font-size: 13px;
}
.btn--primary { background: var(--accent) !important; color: #fff !important; border: 1px solid var(--accent) !important; }
.btn--primary:hover { background: var(--accent-soft) !important; }
.btn--ghost { background: var(--bg-card) !important; color: var(--text) !important; border: 1px solid var(--line-strong) !important; }
.btn--ghost:hover { background: var(--bg-subtle) !important; }
.btn--danger { background: var(--bg-card) !important; color: var(--red) !important; border: 1px solid var(--line-strong) !important; }
.btn::before, .btn::after { display: none !important; }
.textbtn { color: var(--accent) !important; text-shadow: none !important; }
.actionbtn {
  background: var(--bg-card) !important; border: 1px solid var(--line) !important; box-shadow: none !important;
  color: var(--text-muted) !important; border-radius: 6px !important; transform: none !important;
}
.actionbtn:hover { background: var(--bg-subtle) !important; color: var(--text) !important; }
.actionbtn.delete:hover { color: var(--red) !important; }

/* Filter pills (category / subsystem tabs) */
.catbtn {
  background: var(--bg-card) !important; border: 1px solid var(--line) !important; box-shadow: none !important;
  color: var(--text-muted) !important; border-radius: 8px !important; font-weight: 500 !important; transform: none !important;
  font-size: 13px !important; padding: 6px 12px !important;
}
.catbtn:hover { color: var(--text) !important; border-color: var(--line-strong) !important; }
.catbtn.active { background: var(--bg-subtle) !important; color: var(--text) !important; border-color: var(--line-strong) !important; font-weight: 600 !important; }
.catbtn span { color: var(--text-faint) !important; }

/* Inputs */
input, select, textarea, .search {
  background: var(--bg-card) !important; border: 1px solid var(--line-strong) !important; box-shadow: none !important;
  border-radius: 8px !important; color: var(--text) !important;
}
input:focus, select:focus, textarea:focus, .search:focus {
  outline: none !important; border-color: var(--accent) !important; box-shadow: 0 0 0 3px var(--accent-dim) !important;
}
label { color: var(--text) !important; font-weight: 500; font-size: 13px; }

/* Tables */
.tablehead {
  background: var(--bg-subtle) !important; border-top: 0 !important; border-bottom: 1px solid var(--line) !important;
  font-family: var(--font-sans) !important; letter-spacing: 0 !important; text-transform: none !important;
  font-size: 12px !important; font-weight: 600 !important; color: var(--text-muted) !important; padding: 10px 20px !important;
}
.itemrow {
  border: 0 !important; border-bottom: 1px solid var(--line) !important; border-radius: 0 !important;
  padding: 12px 20px !important; background: var(--bg-card) !important;
}
.itemrow:hover { background: var(--bg-card-hover) !important; }
.itemname { font-weight: 600 !important; color: var(--text) !important; }
.itemnotes { color: var(--text-faint) !important; }
.parttag, .mono.small, .task-assignee, .task-date, .shift-time, .logtime {
  font-family: var(--font-sans) !important; letter-spacing: 0 !important;
}

/* Status pills: soft background, coloured dot */
.pill, .prio, .status-badge, .attendee-pill, .log-pill {
  box-shadow: none !important; border: 0 !important; border-radius: 999px !important;
  font-family: var(--font-sans) !important; letter-spacing: 0 !important; text-transform: none !important;
  font-weight: 500 !important; font-size: 12px !important;
  background: var(--bg-subtle) !important; color: var(--text-muted) !important;
}
.prio.urgent, .prio.high { background: var(--red-dim) !important; color: var(--red) !important; }
.prio.medium { background: var(--amber-dim) !important; color: var(--amber) !important; }
.prio.low { background: var(--green-dim) !important; color: var(--green) !important; }
.attendee-pill.is-me { background: var(--accent-dim) !important; color: var(--accent) !important; }

/* Quantity stepper */
.qtybtn { background: var(--bg-card) !important; border: 1px solid var(--line-strong) !important; box-shadow: none !important; color: var(--text) !important; border-radius: 6px !important; }
.qtynum { font-family: var(--font-sans) !important; }

/* Planner & shifts */
.planner-col { background: var(--bg-subtle) !important; border-color: transparent !important; }
.col-header { font-family: var(--font-sans) !important; letter-spacing: 0 !important; font-size: 13px !important; color: var(--text) !important; border-bottom: 0 !important; }
.col-count { background: var(--bg-card) !important; color: var(--text-muted) !important; border: 1px solid var(--line) !important; }
.task-card { border-radius: 10px !important; }
.task-card--ghost { box-shadow: var(--shadow-md) !important; transform: rotate(1.5deg) !important; }
.task-stepbtn { background: var(--bg-card) !important; border: 1px solid var(--line-strong) !important; color: var(--text) !important; box-shadow: none !important; }
.shift-card { border-radius: var(--radius) !important; }
.shift-title { font-family: var(--font-sans) !important; }
.shift-roster { border-top-color: var(--line) !important; }

/* Toast */
.toast { background: var(--text) !important; color: var(--bg-card) !important; border: 0 !important; box-shadow: var(--shadow-md) !important; border-radius: 10px !important; }
.toast.error { background: var(--red) !important; color: #fff !important; }

/* Mobile bottom nav & picker */
.mobile-bottom-nav { background: var(--bg-card) !important; border-top: 1px solid var(--line) !important; box-shadow: none !important; }
.mobile-nav-item.active { color: var(--accent) !important; background: transparent !important; }
.mobile-picker-btn { border-radius: 10px !important; }
.mobile-picker-btn small { font-family: var(--font-sans) !important; letter-spacing: 0 !important; text-transform: none !important; }

/* Part picker */
.part-picker { position: relative; display: flex; gap: 6px; }
.part-picker > input { flex: 1; min-width: 0; }
.part-picker-browse {
  flex-shrink: 0; border: 1px solid var(--line-strong); background: var(--bg-card); color: var(--text-muted);
  border-radius: 8px; padding: 0 12px; font-size: 13px; font-weight: 500;
}
.part-picker-browse:hover { background: var(--bg-subtle); color: var(--text); }
.part-picker-panel {
  position: absolute; z-index: 50; top: calc(100% + 4px); left: 0; right: 0;
  max-height: 340px; overflow-y: auto; background: var(--bg-card); border: 1px solid var(--line-strong);
  border-radius: 10px; box-shadow: var(--shadow-md); padding: 4px 0;
}
.part-picker-panel.hidden { display: none; }
.pp-section {
  position: sticky; top: -4px; z-index: 1; background: var(--bg-card);
  padding: 8px 12px 4px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--text-faint);
  border-top: 1px solid var(--line);
}
.pp-section:first-child { border-top: 0; }
.pp-section span { font-weight: 600; margin-left: 4px; }
.pp-subhead { padding: 6px 12px 2px; font-size: 11.5px; font-weight: 600; color: var(--text-muted); }
.pp-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 7px 12px; cursor: pointer; font-size: 13px; }
.pp-row:hover, .pp-row.is-active { background: var(--bg-subtle); }
.pp-name { color: var(--text); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pp-meta { flex-shrink: 0; display: flex; gap: 4px; align-items: center; color: var(--text-muted); font-size: 12px; }
.pp-vendor { background: var(--bg-subtle); border: 1px solid var(--line); border-radius: 5px; padding: 0 5px; font-size: 11px; font-weight: 600; color: var(--text-muted); }
.pp-vendor--none { font-weight: 500; color: var(--text-faint); }
.pp-ok { color: var(--green); font-weight: 600; }
.pp-low { color: var(--red); font-weight: 600; }
.pp-more, .pp-empty { padding: 8px 12px; font-size: 12px; color: var(--text-faint); }
@media (max-width: 900px) {
  .part-picker-panel { max-height: 50vh; }
  .pp-row { padding: 10px 12px; }
}

/* Stock status */
.stockcell { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.stock-pill { display: inline-flex; align-items: center; gap: 6px; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 500; }
.stock-pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.stock-pill--in { background: var(--green-dim); color: var(--green); }
.stock-pill--low { background: var(--amber-dim); color: var(--amber); }
.stock-pill--out { background: var(--red-dim); color: var(--red); }
.qtynum.low { color: var(--text) !important; }
#stock-breakdown { margin-top: 6px; }
.stockbar { display: flex; gap: 3px; height: 6px; border-radius: 999px; overflow: hidden; background: var(--bg-subtle); }
.stockbar i { display: block; min-width: 6px; border-radius: 999px; }
.stockbar-in { background: #22a35a; }
.stockbar-low { background: #f2b630; }
.stockbar-out { background: #e04848; }
.stocklegend { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; margin-top: 8px; font-size: 12px; color: var(--text-muted); }
.stocklegend b { color: var(--text); margin-right: 6px; }
.stocklegend span { width: 3px; height: 10px; border-radius: 2px; display: inline-block; }
.dot-in { background: #22a35a; } .dot-low { background: #f2b630; } .dot-out { background: #e04848; }

/* With the sidebar open on desktop, the sidebar already shows the brand */
@media (min-width: 1025px) {
  body:not(.sidebar-collapsed) .topbar .brand { display: none !important; }
}
@media (max-width: 900px) {
  #items-list .itemrow, #parts-needed-list .itemrow, #checkouts-list .itemrow { align-items: flex-start !important; text-align: left !important; }
  #items-list .itemrow > *, #parts-needed-list .itemrow > *, #checkouts-list .itemrow > * { text-align: left !important; justify-content: flex-start; }
  #items-list .itemrow .actions, #parts-needed-list .itemrow .actions { align-self: stretch; justify-content: flex-end !important; }
  .stockcell { flex-direction: row; align-items: center; gap: 10px; }
}

/* ==========================================================================
   Scouting hub (event · match claims · pit · teams · pick lists)
   ========================================================================== */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.scout-hubbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; padding: 0 20px 12px; border-bottom: 1px solid var(--line); }
.scout-subnav { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; }
.scout-subnav button { background: transparent; border: 1px solid transparent; border-radius: 8px; padding: 7px 14px; font-size: 13.5px; font-weight: 500; color: var(--text-muted); white-space: nowrap; }
.scout-subnav button:hover { color: var(--text); background: var(--bg-subtle); }
.scout-subnav button.active { background: var(--bg-subtle); border-color: var(--line); color: var(--text); font-weight: 600; }
.scout-event-chip { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.scout-event-chip select { width: auto; max-width: 260px; padding: 6px 10px; font-size: 13px; }
.scout-warn { color: var(--amber); font-weight: 600; }
.scout-warn-box { margin: 16px 20px; border-color: var(--amber) !important; background: var(--amber-dim) !important; }
.scout-pane[hidden] { display: none !important; }
.scout-pane-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; padding: 16px 20px 12px; }
.scout-pane-head h3 { margin: 0; font-size: 16px; }
.scout-picker-empty { font-size: 13px; color: var(--text-muted); line-height: 1.5; }

/* Robot picker */
.scout-picker-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 12px; }
.scout-stepper { display: flex; align-items: center; border: 1px solid var(--line-strong); border-radius: 10px; overflow: hidden; }
.scout-stepper button { width: 44px; height: 44px; border: 0; background: var(--bg-card); font-size: 20px; color: var(--text); }
.scout-stepper button:active { background: var(--bg-subtle); }
.scout-stepper span { min-width: 64px; text-align: center; font-weight: 700; font-size: 16px; }
.robot-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.robot-slot {
  min-width: 0;
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px; text-align: left;
  padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line-strong); background: var(--bg-card); min-height: 86px;
}
.robot-slot strong { font-size: 18px; }
.robot-slot.red { border-left: 4px solid #e04848; }
.robot-slot.blue { border-left: 4px solid #3b6fe0; }
.robot-station { font-size: 11px; font-weight: 700; color: var(--text-faint); }
.robot-name { font-size: 12px; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.robot-status { font-size: 11.5px; color: var(--green); font-weight: 600; margin-top: auto; line-height: 1.25; }
.robot-slot.is-mine { background: var(--accent-dim); border-color: var(--accent); }
.robot-slot.is-mine .robot-status { color: var(--accent); }
.robot-slot.is-taken { opacity: .6; cursor: not-allowed; }
.robot-slot.is-taken .robot-status { color: var(--text-faint); }
.robot-slot.is-done .robot-status { color: var(--text-muted); }

/* 1–10 scales & tags */
.scout-scale { display: grid; grid-template-columns: repeat(auto-fit, minmax(34px, 1fr)); gap: 4px; margin-top: 6px; }
.scout-scale label, .scout-tags label { margin: 0; cursor: pointer; }
.scout-scale input, .scout-tags input { position: absolute; opacity: 0; pointer-events: none; width: 0; height: 0; }
.scout-scale span { display: grid; place-items: center; height: 38px; border: 1px solid var(--line-strong); border-radius: 8px; font-weight: 600; font-size: 14px; color: var(--text-muted); background: var(--bg-card); }
.scout-scale input:checked + span { background: var(--accent); border-color: var(--accent); color: #fff; }
.scout-tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 12px; }
.scout-tags span { display: inline-block; padding: 8px 12px; border: 1px solid var(--line-strong); border-radius: 999px; font-size: 13px; font-weight: 500; color: var(--text-muted); background: var(--bg-card); }
.scout-tags input:checked + span { background: var(--accent-dim); border-color: var(--accent); color: var(--accent); }
.scout-scale input:focus-visible + span, .scout-tags input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Pit grid */
.scout-progress { width: 200px; height: 6px; background: var(--bg-subtle); border-radius: 999px; overflow: hidden; }
.scout-progress i { display: block; height: 100%; background: #22a35a; }
.pit-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; padding: 0 20px 20px; }
.pit-tile { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; text-align: left; padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg-card); min-height: 84px; }
.pit-tile:hover { border-color: var(--line-strong); }
.pit-tile strong { font-size: 17px; }
.pit-name { font-size: 12px; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.pit-status { margin-top: auto; font-size: 11.5px; font-weight: 600; color: var(--red); }
.pit-tile.is-done { background: var(--green-dim); border-color: transparent; }
.pit-tile.is-done .pit-status { color: var(--green); }

/* Teams */
.scout-team-row { display: grid !important; grid-template-columns: minmax(180px, 2fr) 120px 80px 80px 80px 120px; align-items: center; gap: 10px; width: 100%; text-align: left; font: inherit; color: inherit; cursor: pointer; }
.tier-pill { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--bg-subtle); color: var(--text-muted); }
.tier-tier1 { background: var(--green-dim); color: var(--green); }
.tier-tier2 { background: var(--blue-dim); color: var(--blue); }
.tier-tier3 { background: var(--amber-dim); color: var(--amber); }
.tier-dnp { background: var(--red-dim); color: var(--red); }
.team-detail-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 12px; }
.team-detail-stats div { background: var(--bg-subtle); border-radius: 8px; padding: 8px 10px; }
.team-detail-stats small { display: block; font-size: 11.5px; color: var(--text-muted); }
.team-detail-stats strong { font-size: 18px; }
.detail-reports { display: flex; flex-direction: column; gap: 6px; max-height: 260px; overflow-y: auto; }
.detail-report { display: flex; flex-direction: column; gap: 2px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; }
#scout-hub-modal h4 { margin: 14px 0 6px; font-size: 14px; }

/* Pick lists */
.picks-layout { display: grid; grid-template-columns: 230px 1fr; min-height: 420px; }
.picks-side { border-right: 1px solid var(--line); padding: 14px; display: flex; flex-direction: column; gap: 16px; }
.picks-side-title { display: flex; justify-content: space-between; align-items: center; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--text-faint); margin-bottom: 6px; }
.picks-side-title .textbtn { font-size: 12px; text-transform: none; letter-spacing: 0; }
.picklist-item { display: flex; flex-direction: column; align-items: flex-start; width: 100%; text-align: left; border: 0; background: transparent; padding: 7px 10px; border-radius: 8px; font-size: 13.5px; color: var(--text); }
.picklist-item small { color: var(--text-faint); font-size: 11.5px; }
.picklist-item:hover { background: var(--bg-subtle); }
.picklist-item.active { background: var(--accent-dim); }
.picks-main { min-width: 0; }
.picks-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; padding: 14px 16px; }
.picks-toolbar h3 { margin: 0; font-size: 16px; }
.picks-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.pick-board { display: grid; grid-template-columns: repeat(5, minmax(150px, 1fr)); gap: 10px; padding: 0 16px 16px; overflow-x: auto; }
.pick-col { background: var(--bg-subtle); border-radius: 10px; display: flex; flex-direction: column; min-width: 150px; }
.pick-col-head { display: flex; justify-content: space-between; padding: 10px 12px 6px; font-size: 13px; font-weight: 600; }
.pick-col-head span { color: var(--text-faint); font-weight: 500; }
.pick-col-tier1 .pick-col-head { color: var(--green); }
.pick-col-tier2 .pick-col-head { color: var(--blue); }
.pick-col-tier3 .pick-col-head { color: var(--amber); }
.pick-col-dnp .pick-col-head { color: var(--red); }
.pick-col-body { display: flex; flex-direction: column; gap: 6px; padding: 4px 8px 10px; min-height: 80px; flex: 1; }
.pick-card { background: var(--bg-card); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.pick-card.is-draggable { cursor: grab; }
.pick-card-top { display: flex; align-items: baseline; gap: 6px; }
.pick-card-top strong { font-size: 15px; }
.pick-name { font-size: 12px; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; min-width: 0; }
.pick-consensus { font-size: 11px; font-weight: 700; color: var(--accent); background: var(--accent-dim); border-radius: 6px; padding: 0 6px; }
.pick-card-meta { display: flex; flex-wrap: wrap; gap: 4px 8px; margin-top: 4px; font-size: 11px; color: var(--text-faint); }
.pick-move { display: none; margin-top: 6px; padding: 4px 8px !important; font-size: 12px !important; }
.pick-ghost { position: fixed; z-index: 9999; pointer-events: none; box-shadow: var(--shadow-md); transform: rotate(1.5deg); cursor: grabbing; }
.pick-placeholder { border: 2px dashed var(--accent-line); border-radius: 8px; background: var(--accent-dim); }
.scout-event-row { display: grid !important; grid-template-columns: minmax(200px, 2fr) 1fr auto auto; align-items: center; gap: 10px; }
@media (hover: none) { .pick-move { display: block; } }

@media (max-width: 900px) {
  .scout-hubbar { padding: 0 12px 10px; }
  .robot-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
  .robot-slot { padding: 8px; min-height: 92px; }
  .robot-slot strong { font-size: 16px; }
  .scout-scale { grid-template-columns: repeat(6, 1fr); }
  .scout-scale span { height: 44px; }
  .pit-grid { grid-template-columns: repeat(2, 1fr); padding: 0 12px 16px; }
  .scout-team-row { grid-template-columns: 1fr auto auto !important; }
  .scout-team-row > :nth-child(3), .scout-team-row > :nth-child(4), .scout-team-row > :nth-child(5) { display: none; }
  .team-detail-stats { grid-template-columns: repeat(2, 1fr); }
  .picks-layout { grid-template-columns: 1fr; }
  .picks-side { border-right: 0; border-bottom: 1px solid var(--line); flex-direction: row; overflow-x: auto; gap: 14px; }
  .picks-side-group { min-width: 170px; }
  .pick-board { grid-template-columns: 1fr; overflow: visible; }
  .scout-event-row { grid-template-columns: 1fr !important; }
  .scout-progress { width: 100%; }
}

@media (max-width: 900px) {
  #scout-pane-match { padding: 12px 8px !important; }
  #scout-pane-match .scout-card { padding: 12px !important; }
  .scout-picker-head .scout-phase-title span { white-space: nowrap; }
}

/* Scout assignments (admin) */
.assign-banner { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 12px; margin-bottom: 12px; border-radius: 10px; background: var(--accent-dim); font-size: 13px; }
.assign-tools { display: grid; grid-template-columns: 1fr 1.4fr; gap: 12px; padding: 0 20px; }
.assign-tools .scout-card { margin: 0; }
.assign-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.assign-row select { width: auto; min-width: 120px; }
.assign-range { display: inline-flex; align-items: center; gap: 4px; margin: 0; font-size: 13px; white-space: nowrap; }
.assign-range input { width: 64px; padding: 6px 8px; }
.assign-load { display: flex; flex-wrap: wrap; gap: 6px; padding: 12px 20px; }
.assign-grid-wrap { overflow-x: auto; padding: 0 20px 20px; }
.assign-grid { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px; }
.assign-grid th, .assign-grid td { padding: 6px; border-bottom: 1px solid var(--line); text-align: left; }
.assign-grid thead th { position: sticky; top: 0; background: var(--bg-subtle); font-size: 12px; font-weight: 600; color: var(--text-muted); z-index: 1; }
.assign-grid thead th.red { box-shadow: inset 0 3px 0 #e04848; }
.assign-grid thead th.blue { box-shadow: inset 0 3px 0 #3b6fe0; }
.assign-grid tbody th { font-weight: 700; white-space: nowrap; width: 56px; }
.assign-grid td { min-width: 130px; }
.assign-grid td.is-set select { border-color: var(--accent) !important; background: var(--accent-dim) !important; }
.assign-team { display: block; font-size: 11px; font-weight: 600; color: var(--text-faint); margin-bottom: 2px; }
.assign-grid select { width: 100%; padding: 5px 8px !important; font-size: 12.5px !important; }
@media (max-width: 900px) {
  .assign-tools { grid-template-columns: 1fr; padding: 0 12px; }
  .assign-grid-wrap, .assign-load { padding-left: 12px; padding-right: 12px; }
}

/* Competition sign-ups */
.duty-mine-head { display: grid; grid-template-columns: minmax(260px, 1fr) auto; gap: 14px; align-items: start; margin-bottom: 14px; }
.duty-assigned { margin: 0 !important; }
.duty-assign-row { display: flex; justify-content: space-between; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--line); font-size: 13.5px; }
.duty-assign-row:last-child { border-bottom: 0; }
.duty-legend { display: flex; flex-direction: column; gap: 6px; font-size: 12.5px; color: var(--text-muted); }
.duty-dot { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.duty-dot.want { background: var(--accent); }
.duty-dot.can { background: var(--green); }
.duty-grid-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; }
.duty-grid { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px; }
.duty-grid th, .duty-grid td { padding: 6px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
.duty-grid thead th { background: var(--bg-subtle); font-size: 12px; font-weight: 600; color: var(--text-muted); white-space: nowrap; }
.duty-grid tbody th { position: sticky; left: 0; background: var(--bg-card); z-index: 1; min-width: 150px; max-width: 220px; }
.duty-grid tbody tr:last-child th, .duty-grid tbody tr:last-child td { border-bottom: 0; }
.duty-role { display: block; font-weight: 600; }
.duty-desc { display: block; font-size: 11.5px; font-weight: 400; color: var(--text-faint); }
.duty-cell {
  width: 100%; min-width: 92px; min-height: 44px; border: 1px dashed var(--line-strong); border-radius: 8px;
  background: transparent; color: var(--text-faint); font-size: 12.5px; font-weight: 600;
}
.duty-cell:hover { border-style: solid; color: var(--text); }
.duty-cell.want { background: var(--accent-dim); border: 1px solid var(--accent); color: var(--accent); }
.duty-cell.can { background: var(--green-dim); border: 1px solid var(--green); color: var(--green); }
.duty-cell.is-assigned { background: var(--accent); border: 1px solid var(--accent); color: #fff; }
.duty-cell.admin { display: flex; flex-direction: column; align-items: flex-start; gap: 1px; padding: 6px 8px; min-width: 120px; text-align: left; border-style: solid; color: var(--text); }
.duty-cell.admin.is-full { background: var(--green-dim); border-color: transparent; }
.duty-cell.admin.is-partial { background: var(--amber-dim); border-color: transparent; }
.duty-cap { font-weight: 700; font-size: 13px; }
.duty-names { font-size: 11.5px; font-weight: 500; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 140px; }
.duty-interest { font-size: 11px; font-weight: 500; color: var(--text-faint); }
.duty-toggle { display: inline-flex; border: 1px solid var(--line-strong); border-radius: 8px; overflow: hidden; }
.duty-toggle button { border: 0; background: var(--bg-card); padding: 6px 12px; font-size: 13px; color: var(--text-muted); }
.duty-toggle button.active { background: var(--bg-subtle); color: var(--text); font-weight: 600; }
.duty-person-cell { min-width: 110px; font-size: 12px; }
.duty-person-cell.is-assigned { font-weight: 600; color: var(--accent); }
.duty-cands { display: flex; flex-direction: column; gap: 6px; max-height: 50vh; overflow-y: auto; }
.duty-cand { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; font-size: 13px; }
.duty-tag { font-size: 11px; font-weight: 700; border-radius: 6px; padding: 1px 6px; }
.duty-tag.want { background: var(--accent-dim); color: var(--accent); }
.duty-tag.can { background: var(--green-dim); color: var(--green); }
#duty-modal h4 { margin: 12px 0 6px; font-size: 14px; }
.duty-setup { display: grid; grid-template-columns: 1.4fr 1fr; gap: 14px; }
.duty-setup .scout-card { margin: 0; }
.duty-setup-row { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; }
.duty-setup-row input:not([type="number"]) { flex: 1; min-width: 0; }
.duty-setup-row input[type="number"] { width: 64px; }
@media (max-width: 900px) {
  .duty-mine-head, .duty-setup { grid-template-columns: 1fr; }
  #duties-body { padding: 12px !important; }
  .duty-grid tbody th { min-width: 110px; }
  .duty-cell { min-width: 76px; }
}

/* Member role toggles (admin) */
.role-toggles { display: flex; flex-wrap: wrap; gap: 6px; }
.role-toggle { margin: 0; cursor: pointer; }
.role-toggle input { position: absolute; opacity: 0; width: 0; height: 0; }
.role-toggle span { display: inline-block; padding: 4px 10px; border: 1px solid var(--line-strong); border-radius: 999px; font-size: 12px; font-weight: 600; color: var(--text-muted); background: var(--bg-card); }
.role-toggle.is-on span { background: var(--accent-dim); border-color: var(--accent); color: var(--accent); }
.role-toggle input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.role-toggle input:disabled + span { cursor: not-allowed; opacity: .7; }

/* ==========================================================================
   Shift calendar (Google Calendar style)
   ========================================================================== */
#shift-calendar { padding: 0 12px 16px; }
.gcal { position: relative; display: grid; grid-template-columns: 236px 1fr; gap: 12px; }
.gcal-rail { display: flex; flex-direction: column; gap: 6px; padding-top: 4px; }
.gcal-create {
  display: inline-flex; align-items: center; gap: 10px; align-self: flex-start;
  padding: 12px 20px 12px 16px; border-radius: 16px; border: 1px solid var(--line);
  background: var(--bg-card); color: var(--text); font-weight: 600; font-size: 14px;
  box-shadow: 0 1px 3px rgba(0,0,0,.12), 0 1px 2px rgba(0,0,0,.08) !important; margin-bottom: 10px;
}
.gcal-create span { font-size: 22px; line-height: 1; color: var(--accent); }
.gcal-create:hover { background: var(--bg-subtle); }
.gcal-create--compact { display: none; padding: 6px 12px; margin: 0; border-radius: 12px; }
.gcal-mini { padding: 4px 2px 10px; }
.gcal-mini-head { display: flex; justify-content: space-between; align-items: center; padding: 0 4px 6px; font-size: 13px; }
.gcal-mini-grid { display: grid; grid-template-columns: repeat(7, 1fr); text-align: center; }
.gcal-mini-grid .dow { font-size: 10.5px; color: var(--text-faint); padding: 4px 0; font-weight: 600; }
.gcal-mini-grid button { position: relative; aspect-ratio: 1; border: 0; background: transparent; border-radius: 50%; font-size: 11.5px; color: var(--text); margin: 1px; }
.gcal-mini-grid button:hover { background: var(--bg-subtle); }
.gcal-mini-grid button.out { color: var(--text-faint); }
.gcal-mini-grid button.sel { background: var(--accent-dim); color: var(--accent); font-weight: 700; }
.gcal-mini-grid button.today { background: var(--accent); color: #fff; font-weight: 700; }
.gcal-mini-grid button.busy::after { content: ""; position: absolute; bottom: 2px; left: 50%; width: 4px; height: 4px; margin-left: -2px; border-radius: 50%; background: var(--accent); }
.gcal-mini-grid button.today.busy::after { background: #fff; }
.gcal-rail-title { font-size: 12px; font-weight: 700; color: var(--text-muted); padding: 8px 4px 2px; }
.gcal-dept { display: flex; align-items: center; gap: 10px; padding: 5px 4px; margin: 0; font-size: 13px; font-weight: 500; cursor: pointer; border-radius: 6px; }
.gcal-dept:hover { background: var(--bg-subtle); }
.gcal-dept input { position: absolute; opacity: 0; width: 0; height: 0; }
.gcal-dept i { width: 16px; height: 16px; border-radius: 4px; border: 2px solid var(--c); display: grid; place-items: center; }
.gcal-dept input:checked + i { background: var(--c); }
.gcal-dept input:checked + i::after { content: "✓"; color: #fff; font-size: 11px; font-weight: 800; font-style: normal; }
.gcal-dept input:focus-visible + i { outline: 2px solid var(--accent); outline-offset: 2px; }

.gcal-main { min-width: 0; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--bg-card); }
.gcal-toolbar { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.gcal-btn { padding: 7px 16px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--bg-card); font-weight: 600; font-size: 13.5px; color: var(--text); }
.gcal-btn:hover, .gcal-icon:hover { background: var(--bg-subtle); }
.gcal-icon { width: 34px; height: 34px; border: 0; border-radius: 50%; background: transparent; font-size: 22px; line-height: 1; color: var(--text-muted); }
.gcal-icon.sm { width: 26px; height: 26px; font-size: 17px; }
.gcal-title { margin: 0 0 0 4px; font-size: 19px; font-weight: 500; flex: 1; min-width: 140px; }
.gcal-views { display: inline-flex; border: 1px solid var(--line-strong); border-radius: 8px; overflow: hidden; }
.gcal-views button { border: 0; background: var(--bg-card); padding: 7px 12px; font-size: 13px; font-weight: 500; color: var(--text-muted); border-right: 1px solid var(--line); }
.gcal-views button:last-child { border-right: 0; }
.gcal-views button.active { background: var(--accent-dim); color: var(--accent); font-weight: 700; }

/* Time grid (day / 3 days / week) */
.gcal-time { --gutter: 56px; }
.gcal-head { display: grid; grid-template-columns: var(--gutter) repeat(var(--days), 1fr); border-bottom: 1px solid var(--line); }
.gcal-dayhead { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 0 6px; border: 0; background: transparent; color: var(--text-muted); }
.gcal-dayhead span { font-size: 11px; font-weight: 600; letter-spacing: .04em; }
.gcal-dayhead b { font-size: 22px; font-weight: 500; color: var(--text); width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; }
.gcal-dayhead:hover b { background: var(--bg-subtle); }
.gcal-dayhead.today span { color: var(--accent); }
.gcal-dayhead.today b { background: var(--accent); color: #fff; }
.gcal-scroll { height: min(640px, calc(100vh - 260px)); min-height: 380px; overflow-y: auto; position: relative; }
.gcal-grid { position: relative; display: grid; grid-template-columns: var(--gutter) repeat(var(--days), 1fr); }
.gcal-times { position: relative; }
.gcal-times span { position: absolute; right: 8px; transform: translateY(-50%); font-size: 10.5px; color: var(--text-faint); white-space: nowrap; }
.gcal-col {
  position: relative; border-left: 1px solid var(--line);
  background-image: repeating-linear-gradient(to bottom, var(--line) 0 1px, transparent 1px var(--hour));
}
.gcal-col.today { background-color: rgba(91, 60, 230, .03); }
.gcal-ev {
  position: absolute; z-index: 2; overflow: hidden; display: flex; flex-direction: column; gap: 0;
  padding: 3px 6px; border-radius: 6px; background: var(--c); color: #fff; font-size: 12px; line-height: 1.3;
  border: 1px solid var(--bg-card); cursor: pointer; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;
}
.gcal-ev b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gcal-ev span { opacity: .92; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gcal-ev.short { flex-direction: row; align-items: center; }
.gcal-ev.is-mine { box-shadow: inset 3px 0 0 rgba(255,255,255,.85) !important; }
.gcal-ev.can-drag { cursor: grab; }
.gcal-ev.is-dragging { z-index: 5; opacity: .85; box-shadow: 0 6px 16px rgba(0,0,0,.25) !important; cursor: grabbing; }
.gcal-ev--new { background: var(--accent); opacity: .85; box-shadow: 0 6px 16px rgba(0,0,0,.2) !important; pointer-events: none; }
.gcal-resize { position: absolute; left: 0; right: 0; bottom: 0; height: 8px; cursor: ns-resize; }
.gcal-ev:hover .gcal-resize::after { content: ""; position: absolute; left: 50%; bottom: 2px; width: 16px; height: 3px; margin-left: -8px; border-radius: 2px; background: rgba(255,255,255,.75); }
.gcal-now { position: absolute; left: -1px; right: 0; height: 2px; background: #ea4335; z-index: 4; pointer-events: none; }
.gcal-now::before { content: ""; position: absolute; left: -6px; top: -5px; width: 12px; height: 12px; border-radius: 50%; background: #ea4335; }
body.gcal-dragging, body.gcal-dragging * { cursor: grabbing !important; user-select: none; }

/* Month */
.gcal-month { display: grid; grid-template-columns: repeat(7, 1fr); grid-template-rows: auto repeat(var(--rows), minmax(104px, 1fr)); }
.gcal-mdow { text-align: center; font-size: 11px; font-weight: 600; color: var(--text-muted); padding: 8px 0 4px; border-left: 1px solid var(--line); }
.gcal-mdow:first-child, .gcal-mcell:nth-child(7n + 8) { border-left: 0; }
.gcal-mcell { border-left: 1px solid var(--line); border-top: 1px solid var(--line); padding: 4px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.gcal-mcell.out { background: var(--bg-subtle); }
.gcal-mcell.out .gcal-mnum { color: var(--text-faint); }
.gcal-mcell.drop { background: var(--accent-dim); }
.gcal-mnum { align-self: center; width: 26px; height: 26px; border: 0; border-radius: 50%; background: transparent; font-size: 12px; font-weight: 500; color: var(--text); }
.gcal-mnum:hover { background: var(--bg-subtle); }
.gcal-mnum.today { background: var(--accent); color: #fff; font-weight: 700; }
.gcal-chip { display: flex; align-items: center; gap: 5px; padding: 1px 6px; border-radius: 4px; font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; user-select: none; -webkit-user-select: none; }
.gcal-chip i { flex-shrink: 0; width: 8px; height: 8px; border-radius: 50%; background: var(--c); }
.gcal-chip:hover { background: var(--bg-subtle); }
.gcal-chip.can-drag { cursor: grab; }
.gcal-chip--ghost { position: fixed; z-index: 9999; pointer-events: none; background: var(--bg-card); box-shadow: var(--shadow-md) !important; }
.gcal-more { align-self: flex-start; border: 0; background: transparent; font-size: 11.5px; font-weight: 600; color: var(--text-muted); padding: 1px 6px; border-radius: 4px; }
.gcal-more:hover { background: var(--bg-subtle); }

/* Details popover (reuses the shift card) */
.gcal-popover { position: absolute; z-index: 50; background: var(--bg-card); border-radius: 12px; box-shadow: 0 12px 40px rgba(0,0,0,.25) !important; max-height: 70vh; overflow-y: auto; }
.gcal-popover .shift-card { border: 0 !important; margin: 0; }
.gcal-pop-close { position: absolute; top: 8px; right: 8px; z-index: 1; width: 30px; height: 30px; border: 0; border-radius: 50%; background: var(--bg-subtle); font-size: 18px; color: var(--text-muted); }

@media (max-width: 1100px) {
  .gcal { grid-template-columns: 1fr; }
  .gcal-rail { display: none; }
  .gcal-create--compact { display: inline-flex; }
}
@media (max-width: 700px) {
  #shift-calendar { padding: 0 0 12px; }
  .gcal-main { border-radius: 0; border-left: 0; border-right: 0; }
  .gcal-title { font-size: 16px; min-width: 100px; }
  .gcal-views { width: 100%; }
  .gcal-views button { flex: 1; padding: 7px 4px; font-size: 12px; }
  .gcal-time { --gutter: 42px; }
  .gcal-dayhead b { font-size: 18px; width: 32px; height: 32px; }
  .gcal-ev { font-size: 11px; padding: 2px 4px; }
  .gcal-month { grid-template-rows: auto repeat(var(--rows), minmax(76px, 1fr)); }
  .gcal-chip { font-size: 10.5px; padding: 1px 3px; }
  .gcal-chip i { display: none; }
}
#shifts-list[hidden] { display: none !important; }

/* ==========================================================================
   FABWORKS × APPLE — final layer.
   Fabworks: white canvas, zinc greys, one electric blue (#1C6BFF), Inter set bold
   and tight, 6px buttons, 8px cards, tinted pills, hairline zinc borders.
   Apple: size-specific tracking, press feedback on pointer-down, critically damped
   motion, a translucent top bar, sheets that rise from below, and full fallbacks for
   reduced motion / transparency / higher contrast.
   ========================================================================== */
:root, [data-theme="light"] {
  --bg: #ffffff;
  --bg-raised: #ffffff;
  --bg-card: #ffffff;
  --bg-card-hover: #fafafa;
  --bg-card-solid: #ffffff;
  --bg-subtle: #f4f4f5;            /* zinc-100 */
  --text: #18181b;                 /* zinc-900 */
  --text-body: #3f3f46;            /* zinc-700 */
  --text-muted: #71717a;           /* zinc-500 */
  --text-faint: #a1a1aa;           /* zinc-400 */
  --line: #e4e4e7;                 /* zinc-200 */
  --line-strong: #d4d4d8;          /* zinc-300 */
  --line-glass: #e4e4e7;
  --accent: #1c6bff;
  --accent-bright: #1c6bff;
  --accent-soft: #1557d9;
  --accent-dim: rgba(28, 107, 255, 0.09);
  --accent-line: rgba(28, 107, 255, 0.32);
  --blue: #1c6bff;
  --blue-dim: rgba(28, 107, 255, 0.09);
  --green: #16a34a;  --green-dim: #ecfdf3;
  --amber: #c2410c;  --amber-dim: #fff7ed;
  --red: #dc2626;    --red-dim: #fef2f2;
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", system-ui, sans-serif;
  --radius: 8px;
  --radius-lg: 10px;
  --radius-sm: 6px;
  --shadow-md: 0 12px 32px -8px rgba(24, 24, 27, 0.18), 0 2px 6px rgba(24, 24, 27, 0.06);
  /* Apple-style motion: critically damped feel, no overshoot */
  --ease-out: cubic-bezier(0.2, 0.8, 0.2, 1);
  --ease-sheet: cubic-bezier(0.32, 0.72, 0, 1);
  --dur-fast: 120ms;
  --dur: 220ms;
}
[data-theme="dark"] {
  --bg: #09090b;                   /* zinc-950 */
  --bg-raised: #18181b;
  --bg-card: #111113;
  --bg-card-hover: #18181b;
  --bg-card-solid: #111113;
  --bg-subtle: #18181b;
  --text: #fafafa;
  --text-body: #d4d4d8;
  --text-muted: #a1a1aa;
  --text-faint: #71717a;
  --line: #27272a;
  --line-strong: #3f3f46;
  --line-glass: #27272a;
  --accent: #3b82ff;
  --accent-bright: #5a95ff;
  --accent-soft: #2f74f5;
  --accent-dim: rgba(59, 130, 255, 0.14);
  --accent-line: rgba(59, 130, 255, 0.4);
  --blue: #5a95ff;  --blue-dim: rgba(59, 130, 255, 0.14);
  --green: #4ade80; --green-dim: rgba(74, 222, 128, 0.12);
  --amber: #fb923c; --amber-dim: rgba(251, 146, 60, 0.12);
  --red: #f87171;   --red-dim: rgba(248, 113, 113, 0.12);
  --shadow-md: 0 16px 40px -8px rgba(0, 0, 0, 0.6);
}

/* Font Awesome icons written as <i class=fa-NAME> (quote-free so they work in any JS string) */
i[class^="fa-"], i[class*=" fa-"] {
  font-family: "Font Awesome 6 Free";
  font-weight: 900;
  font-style: normal;
  font-variant: normal;
  display: inline-block;
  line-height: 1;
  width: 1.15em;
  text-align: center;
  text-rendering: auto;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  flex-shrink: 0;
}
.sidebar-icon { filter: none !important; opacity: 1 !important; color: var(--text-muted); width: 20px; display: inline-flex; justify-content: center; }
.sidebar-link.active .sidebar-icon, .sidebar-link:hover .sidebar-icon { color: var(--accent); }
.nav-icon i, .picker-icon i, .search-icon i { color: var(--text-muted); }
.mobile-nav-item.active .nav-icon i { color: var(--accent); }

/* Type — Inter, bold and tight for display; tracking set per size (Apple) */
body { font-family: var(--font-sans); color: var(--text-body); font-feature-settings: "cv11", "ss01"; font-optical-sizing: auto; }
h1, h2, h3, h4, .welcome h1 { color: var(--text) !important; font-weight: 700 !important; }
h1, .welcome h1 { letter-spacing: -0.03em !important; line-height: 1.08 !important; }
h2, .toolbar h2 { letter-spacing: -0.02em !important; line-height: 1.2 !important; }
h3 { letter-spacing: -0.012em !important; }
small, .small, .muted.small { letter-spacing: 0.003em; }
.muted, p.muted { color: var(--text-muted) !important; }
.welcome h1 { font-size: clamp(26px, 2.4vw, 34px) !important; }
.mono, code, kbd { font-family: "JetBrains Mono", ui-monospace, monospace; }

/* Surfaces — white cards, hairline zinc borders, 8px corners */
.panel, .stat, .card, .gcal-main, .scout-card, .assign-box, .shift-card, .task-card, .play-card {
  border: 1px solid var(--line) !important;
  border-radius: var(--radius) !important;
  background: var(--bg-card) !important;
}
.planner-col, .pick-col { background: var(--bg-subtle) !important; border-radius: var(--radius) !important; }
.stat strong { letter-spacing: -0.025em; }

/* Top bar — Apple translucent material, content scrolls underneath */
.topbar {
  position: sticky; top: 0; z-index: 40;
  background: rgba(255, 255, 255, 0.72) !important;
  -webkit-backdrop-filter: saturate(180%) blur(20px) !important;
  backdrop-filter: saturate(180%) blur(20px) !important;
  border-bottom: 1px solid var(--line) !important;
}
[data-theme="dark"] .topbar { background: rgba(9, 9, 11, 0.72) !important; }
.app-sidebar { background: var(--bg) !important; border-right: 1px solid var(--line) !important; }

/* Buttons — Fabworks: flat blue primary, white outlined secondary, 6px radius.
   Apple: feedback on press, instant; motion only on transform/opacity/colour. */
.btn {
  border-radius: var(--radius-sm) !important;
  font-weight: 500 !important;
  letter-spacing: -0.006em !important;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  transition: background-color var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out),
              color var(--dur-fast) var(--ease-out), transform var(--dur-fast) var(--ease-out) !important;
}
.btn--primary { background: var(--accent) !important; border: 1px solid var(--accent) !important; color: #fff !important; }
.btn--primary:hover { background: var(--accent-soft) !important; border-color: var(--accent-soft) !important; }
.btn--ghost { background: var(--bg-card) !important; border: 1px solid var(--line-strong) !important; color: var(--text) !important; }
.btn--ghost:hover { background: var(--bg-subtle) !important; }
.btn:active, .actionbtn:active, .catbtn:active, .viewtab:active, .sidebar-link:active, .sidebar-sublink:active,
.gcal-btn:active, .gcal-create:active, .robot-slot:active, .pit-tile:active, .duty-cell:active,
.scout-subnav button:active, .qtybtn:active, .task-stepbtn:active, .mobile-nav-item:active, .assign-chip:active {
  transform: scale(0.97) !important;
  transition-duration: 60ms !important;
}
.actionbtn, .task-stepbtn, .qtybtn, .catbtn, .sidebar-link, .sidebar-sublink, .robot-slot, .pit-tile, .duty-cell {
  transition: background-color var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out),
              color var(--dur-fast) var(--ease-out), transform var(--dur-fast) var(--ease-out) !important;
}
.actionbtn { display: inline-flex; align-items: center; gap: 6px; border-radius: var(--radius-sm) !important; }
.textbtn { display: inline-flex; align-items: center; gap: 6px; font-weight: 500; }

/* Tags and active filters — Fabworks' tinted blue pills */
.catbtn.active, .scout-subnav button.active, .gcal-views button.active, .duty-toggle button.active,
.theme-opt-btn.active, .viewtab.active .badgenum {
  background: var(--accent-dim) !important;
  color: var(--accent) !important;
  border-color: transparent !important;
}
.catbtn { border-radius: 999px !important; }
.pill, .tier-pill, .stock-pill, .prio, .attendee-pill, .duty-tag { border-radius: 999px !important; }
.sidebar-link.active, .sidebar-sublink.active { background: var(--accent-dim) !important; color: var(--accent) !important; }
.sidebar-sublink span:not(:empty) { color: inherit; opacity: .7; }
.viewtab.active { border-bottom-color: var(--accent) !important; }

/* Inputs — zinc hairline, blue focus ring */
input, select, textarea, .search {
  border: 1px solid var(--line-strong) !important; border-radius: var(--radius-sm) !important;
  transition: border-color var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out);
}
input:focus, select:focus, textarea:focus, .search:focus { border-color: var(--accent) !important; box-shadow: 0 0 0 3px var(--accent-dim) !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Drop zones (receipt upload) — Fabworks' dashed file area */
#spend-receipt-file { border: 2px dashed var(--line-strong) !important; background: var(--bg-subtle) !important; padding: 18px !important; border-radius: var(--radius) !important; width: 100%; cursor: pointer; }
#spend-receipt-file:hover { border-color: var(--accent) !important; }

/* Sheets — Apple: dim to focus, rise from below, settle without overshoot */
.modalback { background: rgba(9, 9, 11, 0.32) !important; }
.modalback:not(.hidden) .modal { animation: sheet-in var(--dur) var(--ease-sheet) both !important; }
@keyframes sheet-in { from { opacity: 0; transform: translateY(12px) scale(0.985); } to { opacity: 1; transform: none; } }
.modal { border-radius: 12px !important; border: 1px solid var(--line) !important; }
.gcal-popover { animation: pop-in 160ms var(--ease-out) both; transform-origin: top left; }
@keyframes pop-in { from { opacity: 0; transform: scale(0.96); } to { opacity: 1; transform: none; } }
.toast { border-radius: 10px !important; animation: toast-in var(--dur) var(--ease-sheet) both; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* Status colours for the brand blue world */
.stock-pill--in { background: var(--green-dim); color: var(--green); }
.stock-pill--low { background: var(--amber-dim); color: var(--amber); }
.stock-pill--out { background: var(--red-dim); color: var(--red); }
.gcal-dayhead.today b, .gcal-mini-grid button.today, .gcal-mnum.today, .scout-scale input:checked + span { background: var(--accent) !important; color: #fff !important; }
.gcal-now, .gcal-now::before { background: #ea4335; }

/* Accessibility: Apple's three signals */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; animation-iteration-count: 1 !important; transition-duration: 1ms !important; scroll-behavior: auto !important; }
  .btn:active, .actionbtn:active, .catbtn:active { transform: none !important; }
}
@media (prefers-reduced-transparency: reduce) {
  .topbar { background: var(--bg) !important; -webkit-backdrop-filter: none !important; backdrop-filter: none !important; }
}
@media (prefers-contrast: more) {
  :root, [data-theme="light"] { --line: #a1a1aa; --line-strong: #71717a; --text-muted: #3f3f46; }
  [data-theme="dark"] { --line: #52525b; --line-strong: #71717a; --text-muted: #d4d4d8; }
}

/* Sign-in: one plain card, nothing else */
body.is-auth .topbar, body.is-auth .shell > footer, body.is-auth #setup-notice:not(.hidden) ~ footer { display: none !important; }
body.is-auth .app-sidebar, body.is-auth .mobile-bottom-nav { display: none !important; }
body.is-auth { padding-bottom: 0 !important; }
.auth-only {
  min-height: 100vh; min-height: 100dvh;
  display: grid; place-items: center;
  padding: 24px 16px;
}
.auth-only.hidden { display: none !important; }
.auth-card {
  width: 100%; max-width: 380px;
  background: var(--bg-card); border: 1px solid var(--line); border-radius: 12px;
  padding: 28px 28px 24px;
}
.auth-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 22px; }
.auth-brand img { width: 40px; height: 40px; border-radius: 9px; object-fit: contain; }
.auth-brand span { font-size: 17px; font-weight: 700; letter-spacing: -0.02em; color: var(--text); }
.auth-title { font-size: 22px !important; margin: 0 0 4px !important; letter-spacing: -0.02em !important; }
.auth-subtitle { margin: 0 0 4px; }
.auth-switch {
  display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 3px; margin: 16px 0 6px;
  background: var(--bg-subtle); border-radius: 8px;
}
.auth-switch .tab {
  border: 0; border-radius: 6px; padding: 7px 10px; background: transparent;
  font-size: 13px; font-weight: 500; color: var(--text-muted);
  transition: background-color var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out);
}
.auth-switch .tab.active { background: var(--bg-card); color: var(--text); box-shadow: 0 1px 2px rgba(24, 24, 27, 0.08) !important; }
[data-theme="dark"] .auth-switch .tab.active { background: var(--bg-raised); box-shadow: none !important; }
.auth-card form label { margin-top: 14px; }
.auth-card .btn--full { width: 100%; margin-top: 20px; height: 40px; }
.auth-forgot { display: block; margin: 14px auto 0; font-size: 13px; }
.auth-card .authmessage { margin-top: 14px; }
@media (max-width: 480px) {
  .auth-only { place-items: start center; padding-top: 12vh; }
  .auth-card { border: 0; padding: 8px 4px; background: transparent !important; }
}
.auth-switch .tab { background: transparent !important; color: var(--text-muted) !important; border: 0 !important; }
.auth-switch .tab.active { background: var(--bg-card) !important; color: var(--text) !important; font-weight: 600 !important; }
[data-theme="dark"] .auth-switch .tab.active { background: var(--line-strong) !important; }

/* Shop check-in (top bar) */
.shop-checkin {
  display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 12px;
  border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: var(--bg-card);
  color: var(--text); font-size: 13px; font-weight: 500; white-space: nowrap;
  transition: background-color var(--dur-fast) var(--ease-out), transform var(--dur-fast) var(--ease-out);
}
.shop-checkin[hidden] { display: none; }
.shop-checkin:hover { background: var(--bg-subtle); }
.shop-checkin:active { transform: scale(0.97); }
.shop-checkin i { color: var(--text-muted); }
.shop-checkin.is-in { border-color: transparent; background: var(--green-dim); color: var(--green); }
.shop-checkin.is-in i { color: var(--green); }
.shop-checkin .shop-action { padding-left: 8px; border-left: 1px solid currentColor; opacity: .8; }
@media (max-width: 900px) {
  .shop-checkin { padding: 0 10px; }
  .shop-checkin .shop-action { display: none; }
  .shop-checkin:not(.is-in) .shop-label { display: none; }
}

/* Analytics */
.an-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.an-tiles { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; margin-bottom: 14px; }
.an-tile strong { font-size: 26px !important; font-variant-numeric: tabular-nums; }
.an-tile strong small { font-size: 15px; color: var(--text-muted); font-weight: 600; }
.an-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 14px; }
.an-card { background: var(--bg-card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; min-width: 0; }
.an-card h3 { margin: 0 0 2px; font-size: 15px; }
.an-card > p.muted { margin: 0 0 14px; }
.an-wide { grid-column: 1 / -1; }

/* Activity per day: single series, bars anchored to the baseline, rounded data-end, 2px gaps */
.an-days { display: grid; grid-template-columns: 34px 1fr; gap: 6px; height: 220px; }
.an-yaxis { display: flex; flex-direction: column; justify-content: space-between; text-align: right; font-size: 11px; color: var(--text-faint); padding-bottom: 20px; font-variant-numeric: tabular-nums; }
.an-yaxis span { transform: translateY(-50%); }
.an-yaxis span:last-child { transform: translateY(50%); }
.an-plot { position: relative; display: grid; grid-template-rows: 1fr 20px; min-width: 0; }
.an-gridline { position: absolute; left: 0; right: 0; height: 1px; background: var(--line); pointer-events: none; }
.an-bars { position: relative; display: grid; grid-template-columns: repeat(var(--n), minmax(0, 1fr)); gap: 2px; align-items: end; height: 100%; }
.an-day { position: relative; z-index: 1; height: 100%; display: flex; align-items: flex-end; border: 0; padding: 0; background: transparent; cursor: default; }
.an-day i { display: block; width: 100%; min-height: 0; background: var(--accent); border-radius: 4px 4px 0 0; }
.an-day:hover i, .an-day:focus-visible i { background: var(--accent-soft); }
.an-xaxis { display: grid; grid-template-columns: repeat(var(--n), minmax(0, 1fr)); gap: 2px; font-size: 10.5px; color: var(--text-faint); white-space: nowrap; padding-top: 6px; }
.an-xaxis span { overflow: visible; }

/* Horizontal bar lists */
.an-barlist { display: flex; flex-direction: column; gap: 6px; }
.an-barrow { display: grid; grid-template-columns: minmax(90px, 140px) 1fr auto; align-items: center; gap: 10px; padding: 3px 0; border-radius: 6px; font-size: 13px; }
.an-barrow:hover, .an-barrow:focus-visible { background: var(--bg-subtle); outline: none; }
.an-barlabel { color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.an-bartrack { height: 10px; }
.an-bartrack i { display: block; height: 100%; background: var(--accent); border-radius: 0 4px 4px 0; }
.an-barval { font-variant-numeric: tabular-nums; color: var(--text-muted); font-weight: 600; min-width: 44px; text-align: right; }

.an-inshop { display: flex; flex-direction: column; gap: 6px; }
.an-inshop-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--radius-sm); font-size: 13px; }

.an-table-card { padding-bottom: 6px; }
.an-table-wrap { overflow-x: auto; margin: 0 -18px; }
.an-table { width: 100%; border-collapse: collapse; font-size: 13px; font-variant-numeric: tabular-nums; }
.an-table th, .an-table td { padding: 9px 12px; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
.an-table th:first-child, .an-table td:first-child { padding-left: 18px; }
.an-table thead th { background: var(--bg-subtle); font-size: 12px; font-weight: 600; color: var(--text-muted); }
.an-table thead th button { border: 0; background: transparent; font: inherit; color: inherit; padding: 0; cursor: pointer; display: inline-flex; align-items: center; gap: 4px; }
.an-table thead th button[aria-sort="ascending"], .an-table thead th button[aria-sort="descending"] { color: var(--text); }
.an-table tbody th { font-weight: 600; color: var(--text); }
.an-table .num { text-align: right; }
.an-table th.num button { justify-content: flex-end; }
.an-table tbody tr:last-child th, .an-table tbody tr:last-child td { border-bottom: 0; }
.an-table tbody tr:hover { background: var(--bg-card-hover); }

.an-tooltip { position: fixed; z-index: 9999; pointer-events: none; padding: 6px 10px; border-radius: 8px; background: var(--text); color: var(--bg); font-size: 12px; font-weight: 500; max-width: 280px; box-shadow: var(--shadow-md) !important; }
.an-tooltip[hidden] { display: none; }

@media (max-width: 1200px) { .an-tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); } .an-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 700px) {
  .an-tiles { grid-template-columns: 1fr 1fr; gap: 8px; }
  .an-grid { grid-template-columns: 1fr; }
  .an-days { height: 180px; }
  .an-card { padding: 14px; }
  .an-table-wrap { margin: 0 -14px; }
}

/* ==========================================================================
   Sign in with PIN
   ========================================================================== */
.auth-or { display: flex; align-items: center; gap: 12px; margin: 18px 0 12px; color: var(--text-faint); font-size: 12px; }
.auth-or::before, .auth-or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.auth-or.hidden, #show-pin-login.hidden, .pin-pane.hidden, .auth-switch.hidden { display: none !important; }
#show-pin-login { width: 100%; height: 44px; }
.pin-pane { margin-top: 6px; text-align: center; }
.pin-label { display: block; margin: 0 0 10px !important; font-size: 14px !important; color: var(--text-muted) !important; font-weight: 500; }
.pin-input { position: absolute; opacity: 0; pointer-events: none; width: 1px; height: 1px; }
.pin-dots { display: flex; justify-content: center; gap: 14px; margin: 4px 0 20px; }
.pin-dots i { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--line-strong); transition: background-color 120ms var(--ease-out), border-color 120ms var(--ease-out), transform 120ms var(--ease-out); }
.pin-dots i.on { background: var(--accent); border-color: var(--accent); transform: scale(1.08); }
.pin-pane.is-error .pin-dots { animation: pin-shake 320ms var(--ease-out); }
.pin-pane.is-error .pin-dots i { border-color: var(--red); }
.pin-pane.is-busy .pin-dots i.on { animation: pin-pulse 900ms ease-in-out infinite; }
@keyframes pin-shake { 0%, 100% { transform: none; } 20% { transform: translateX(-8px); } 40% { transform: translateX(7px); } 60% { transform: translateX(-5px); } 80% { transform: translateX(3px); } }
@keyframes pin-pulse { 50% { opacity: .4; } }
.pin-pad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; max-width: 300px; margin: 0 auto; }
.pin-pad button {
  height: 64px; border-radius: 14px; border: 1px solid var(--line); background: var(--bg-subtle);
  font-size: 24px; font-weight: 600; color: var(--text); font-variant-numeric: tabular-nums;
  -webkit-tap-highlight-color: transparent; touch-action: manipulation;
  transition: background-color 80ms var(--ease-out), transform 80ms var(--ease-out);
}
.pin-pad button:active { transform: scale(0.95); background: var(--line); }
.pin-pad button[data-pin="clear"], .pin-pad button[data-pin="back"] { background: transparent; border-color: transparent; font-size: 15px; color: var(--text-muted); }
.pin-pad button[data-pin="back"] { font-size: 20px; }
.pin-help { margin: 16px 0 0; }
.pin-reveal { font-size: 40px; font-weight: 700; letter-spacing: 0.12em; font-variant-numeric: tabular-nums; color: var(--text); margin: 14px 0 10px; }
.pin-profile-actions { display: flex; gap: 8px; }
.pin-profile-actions .hidden { display: none; }
@media (prefers-reduced-motion: reduce) { .pin-pane.is-error .pin-dots, .pin-pane.is-busy .pin-dots i.on { animation: none; } }

/* ==========================================================================
   Touchscreens: 44px targets (Apple HIG), 16px inputs, no hover-only behaviour
   ========================================================================== */
@media (pointer: coarse) {
  html { -webkit-tap-highlight-color: transparent; }
  button, a, input, select, textarea, label { touch-action: manipulation; }   /* no double-tap zoom delay */

  .btn, .btn--sm, .shop-checkin, .gcal-btn, .gcal-create, .global-search-btn, .sidebar-toggle-btn { min-height: 44px !important; }
  .btn--sm { padding-left: 14px !important; padding-right: 14px !important; }
  .actionbtn, .task-stepbtn { min-height: 40px !important; min-width: 40px; padding: 8px 12px !important; }
  .catbtn, .viewtab, .scout-subnav button, .gcal-views button, .duty-toggle button, .theme-opt-btn, .auth-switch .tab { min-height: 42px !important; }
  .sidebar-link { min-height: 46px !important; }
  .sidebar-sublink { min-height: 42px; padding: 10px 12px; font-size: 14px; }
  .textbtn { min-height: 40px; padding: 8px 4px; }
  .close, .gcal-pop-close { min-width: 44px; min-height: 44px; }
  .gcal-icon { width: 44px; height: 44px; }
  .gcal-icon.sm { width: 36px; height: 36px; }
  .gcal-mini-grid button { min-height: 34px; }
  .gcal-resize { height: 16px; }
  .gcal-ev { min-height: 28px; }

  input:not([type="checkbox"]):not([type="radio"]):not([type="range"]), select, .search { min-height: 46px; font-size: 16px !important; }
  textarea { font-size: 16px !important; }
  input[type="checkbox"], input[type="radio"] { width: 22px; height: 22px; }
  label { padding-top: 2px; padding-bottom: 2px; }

  .qtybtn { width: 44px !important; height: 44px !important; }
  .scout-step-btns button { min-height: 48px; min-width: 52px; }
  .scout-tags span, .assign-chip, .role-toggle span { padding: 10px 14px !important; }
  .scout-toggle-pill { min-height: 48px; }
  .robot-slot, .pit-tile { min-height: 96px; }
  .duty-cell { min-height: 52px; }
  .pp-row { padding: 12px; }
  .pick-move { display: block; min-height: 40px; }
  .an-barrow { padding: 8px 0; }
  .an-table th, .an-table td { padding-top: 12px; padding-bottom: 12px; }
  .mobile-nav-item { min-height: 56px; }
  .mobile-filter-picker-btn, .mobile-picker-btn { min-height: 46px !important; }
  .tool-btn, .size-btn { min-height: 44px !important; padding: 8px 14px !important; font-size: 14px !important; }
  .swatch { width: 40px !important; height: 40px !important; }
  .tool-group { gap: 8px !important; flex-wrap: wrap; }

  /* Spacing so neighbouring targets aren't mis-tapped */
  .actions, .toolbar-actions, .picks-actions, .modalactions, .user-quick-actions { gap: 10px !important; }
}
@media (hover: none) {
  .task-card:hover, .shift-card:hover, .stat:hover, .itemrow:hover, .play-card:hover, .pit-tile:hover { transform: none !important; background: var(--bg-card) !important; }
  .gcal-ev .gcal-resize::after { content: ""; position: absolute; left: 50%; bottom: 3px; width: 18px; height: 3px; margin-left: -9px; border-radius: 2px; background: rgba(255,255,255,.8); }
}
