/* FlairStaff client portal. Colours follow the main Flair app's Staff Zone tokens. */
:root {
  --ink: #21145F;
  --body: #4A4F6A;
  --muted: #8892AD;
  --canvas: #F5F6FA;
  --surface: #FFFFFF;
  --surface-2: #F8F9FC;
  --line: #E6E8F0;
  --sidebar: #21145F;
  --sidebar-ink: #CFCBEA;
  --hero: #16123A;
  --teal: #0d7677;
  --teal-bright: #36A9A2;
  --teal-soft: #E0F4F3;
  --orange: #EE7623;
  --amber: #B54708;
  --amber-soft: #FFF1E5;
  --red: #B42318;
  --red-soft: #FDECEC;
  --green: #0D6B5E;
  --green-soft: #E7F6F3;
  --blue: #3B4CB8;
  --blue-soft: #ECEEFB;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.05), 0 12px 32px -16px rgba(33, 20, 95, 0.2);
  --radius: 14px;
  color-scheme: light;
  --font: "Poppins", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* Dark theme: chosen in the app, or following the device when no choice is saved */
:root[data-theme="dark"] {
    --ink: #ECEAF6;
    --body: #B9B6D0;
    --muted: #8783A6;
    --canvas: #0E0B21;
    --surface: #17132F;
    --surface-2: #1E1A3B;
    --line: #2A2550;
    --sidebar: #120F2A;
    --sidebar-ink: #ADA8CF;
    --hero: #120E30;
    --teal: #4FD1C5;
    --teal-bright: #2E9C95;
    --teal-soft: rgba(79, 209, 197, 0.12);
    --amber: #F7B27A;
    --amber-soft: rgba(238, 118, 35, 0.14);
    --red: #F59A92;
    --red-soft: rgba(240, 68, 56, 0.14);
    --green: #7FD6C6;
    --green-soft: rgba(54, 169, 162, 0.14);
    --blue: #AEB7F5;
    --blue-soft: rgba(110, 124, 230, 0.16);
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.35), 0 16px 40px -18px rgba(0, 0, 0, 0.7);
    color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
      --ink: #ECEAF6;
      --body: #B9B6D0;
      --muted: #8783A6;
      --canvas: #0E0B21;
      --surface: #17132F;
      --surface-2: #1E1A3B;
      --line: #2A2550;
      --sidebar: #120F2A;
      --sidebar-ink: #ADA8CF;
      --hero: #120E30;
      --teal: #4FD1C5;
      --teal-bright: #2E9C95;
      --teal-soft: rgba(79, 209, 197, 0.12);
      --amber: #F7B27A;
      --amber-soft: rgba(238, 118, 35, 0.14);
      --red: #F59A92;
      --red-soft: rgba(240, 68, 56, 0.14);
      --green: #7FD6C6;
      --green-soft: rgba(54, 169, 162, 0.14);
      --blue: #AEB7F5;
      --blue-soft: rgba(110, 124, 230, 0.16);
      --shadow: 0 1px 2px rgba(0, 0, 0, 0.35), 0 16px 40px -18px rgba(0, 0, 0, 0.7);
      color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
[hidden] { display: none !important; }

body {
  margin: 0;
  background: var(--canvas);
  color: var(--body);
  font: 15px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, strong { color: var(--ink); }
h1, h2 { line-height: 1.2; }
button { font: inherit; color: inherit; }
.muted { color: var(--muted); }
.text-amber { color: var(--amber); font-weight: 600; }
.text-red { color: var(--red); font-weight: 600; }
.icon { flex: none; display: block; }

/* Shown while the server runs on made-up data, so nobody mistakes it for real */
.demo-strip {
  position: fixed; left: 50%; top: 0; z-index: 30; transform: translateX(-50%);
  padding: 3px 12px; border-radius: 0 0 8px 8px; background: var(--orange); color: #fff;
  font-size: 11px; font-weight: 600; letter-spacing: 0.4px; pointer-events: none;
}

/* ---------- Brand ---------- */
.brand-word { font-weight: 700; font-size: 28px; letter-spacing: -0.5px; color: #fff; line-height: 1; }
.brand-word em { font-style: normal; color: var(--teal-bright); }
.brand-word-lg { font-size: clamp(44px, 6vw, 72px); }
.brand-tag { display: block; margin-top: 6px; font-size: 10px; letter-spacing: 2.4px; text-transform: uppercase; color: var(--sidebar-ink); }

/* ---------- Buttons ---------- */
.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 20px; border: 0; border-radius: 10px;
  font-weight: 600; text-decoration: none; cursor: pointer;
  transition: background 0.15s, transform 0.15s;
}
.button-primary { background: var(--teal-bright); color: #fff; }
.button-primary:hover { background: var(--teal); }
.button-primary:active { transform: translateY(1px); }
.button-primary:disabled { opacity: 0.7; cursor: progress; }
.button-block { width: 100%; }
.button-hero { background: var(--teal-bright); color: #fff; padding: 14px 22px; }
.button small, .nav-item small {
  font-size: 10px; font-weight: 600; letter-spacing: 0.5px; text-transform: uppercase;
  padding: 2px 6px; border-radius: 999px; background: rgba(255, 255, 255, 0.18);
}
.is-soon { cursor: default; opacity: 0.6; }

.icon-button {
  display: inline-grid; place-items: center; width: 34px; height: 34px;
  border: 0; border-radius: 8px; background: transparent; color: var(--muted); cursor: pointer;
}
.icon-button:hover { background: var(--surface-2); color: var(--ink); }

.theme-toggle { width: 38px; height: 38px; border-radius: 10px; }
.theme-toggle .icon-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
:root[data-theme="dark"] .theme-toggle .icon-moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .icon-sun { display: block; }
  :root:not([data-theme="light"]) .theme-toggle .icon-moon { display: none; }
}
.theme-switching, .theme-switching * { transition: background-color 0.25s ease, border-color 0.25s ease, color 0.25s ease !important; }

:focus-visible { outline: 2px solid var(--teal-bright); outline-offset: 2px; }

/* ---------- Sign in ---------- */
.public { background: #0F0C24; }
.public .theme-toggle { position: fixed; top: 16px; right: 16px; z-index: 2; color: #D8D5F0; background: rgba(255, 255, 255, 0.08); }
.public .theme-toggle:hover { background: rgba(255, 255, 255, 0.16); color: #fff; }
.login-page {
  min-height: 100vh;
  display: grid; grid-template-columns: 1.1fr 1fr; align-items: center; gap: 48px;
  padding: 48px clamp(16px, 6vw, 96px);
  background:
    radial-gradient(ellipse 60% 50% at 15% 85%, rgba(54, 169, 162, 0.28), transparent 70%),
    radial-gradient(ellipse 50% 40% at 85% 10%, rgba(238, 118, 35, 0.14), transparent 70%),
    linear-gradient(160deg, #21145F 0%, #16123A 55%, #0F0C24 100%);
}
.login-intro { color: #D8D5F0; }
.login-intro .brand-tag { margin: 14px 0 56px; }
.login-intro h1 { margin: 0 0 16px; font-size: clamp(36px, 4.4vw, 56px); color: #fff; letter-spacing: -1px; }
.login-intro h1 em { font-style: normal; color: var(--teal-bright); }
.login-intro-text { max-width: 440px; font-size: 17px; margin: 0; }

.login-card {
  width: 100%; max-width: 460px; justify-self: end;
  padding: 40px 36px; border-radius: 18px;
  background: var(--surface); color: var(--body);
  border: 1px solid var(--line);
  box-shadow: 0 30px 80px -30px rgba(0, 0, 0, 0.6);
  animation: rise 0.5s ease-out both;
}
.login-card h2 { margin: 0; font-size: 30px; color: var(--ink); }
.login-card .muted { margin: 6px 0 24px; color: var(--muted); }
.login-form label { display: block; margin: 18px 0 6px; font-size: 14px; font-weight: 600; color: var(--ink); }
.input-icon { position: relative; display: flex; align-items: center; }
.input-icon > .icon { position: absolute; left: 14px; color: var(--muted); pointer-events: none; }
.input-icon input {
  width: 100%; padding: 12px 44px; border: 1px solid var(--line); border-radius: 10px;
  font: inherit; color: var(--ink); background: var(--surface-2);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.input-icon input:focus { outline: none; border-color: var(--teal-bright); background: var(--surface); box-shadow: 0 0 0 4px var(--teal-soft); }
.input-icon input::placeholder { color: var(--muted); }
.reveal { position: absolute; right: 6px; display: grid; place-items: center; width: 34px; height: 34px; border: 0; background: none; color: var(--muted); cursor: pointer; border-radius: 8px; }
.reveal[aria-pressed="true"] { color: var(--teal); }
.login-form .button { margin-top: 28px; padding: 14px; font-size: 16px; }
.login-help { margin: 24px 0 0; padding-top: 20px; border-top: 1px solid var(--line); font-size: 14px; color: var(--muted); }
.login-card .flash { margin: 0 0 8px; }

@keyframes rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

/* ---------- App shell ---------- */
.app { display: flex; min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh; width: 248px; flex: none;
  display: flex; flex-direction: column;
  padding: 26px 14px 20px; background: var(--sidebar); color: var(--sidebar-ink);
}
.sidebar .brand { display: block; padding: 0 10px 28px; text-decoration: none; }
.nav { display: flex; flex-direction: column; gap: 4px; }
.nav-item {
  display: flex; align-items: center; gap: 14px;
  padding: 11px 12px; border-radius: 10px;
  color: var(--sidebar-ink); text-decoration: none; font-weight: 500;
  transition: background 0.15s, color 0.15s;
}
a.nav-item:hover { background: rgba(255, 255, 255, 0.07); color: #fff; }
.nav-item.is-active { background: var(--teal-bright); color: #fff; box-shadow: 0 8px 20px -10px rgba(54, 169, 162, 0.9); }
.nav-item small { margin-left: auto; }
.sidebar-foot { margin: auto 10px 0; font-size: 12px; opacity: 0.7; }
.sidebar-scrim { display: none; }

.shell { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; gap: 12px;
  /* Lines up with the centred content on very wide screens */
  padding: 12px max(var(--gutter), calc((100% - var(--content-max)) / 2 + var(--gutter)));
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: blur(8px); border-bottom: 1px solid var(--line);
}
.menu-toggle { display: none; }
.topbar-company { font-weight: 600; color: var(--ink); }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.user-menu { position: relative; }
.user-menu summary { display: flex; align-items: center; gap: 10px; cursor: pointer; list-style: none; padding: 4px 6px; border-radius: 10px; }
.user-menu summary::-webkit-details-marker { display: none; }
.user-menu summary:hover { background: var(--surface-2); }
.avatar { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; background: var(--teal-soft); color: var(--teal); font-weight: 600; font-size: 14px; }
.user-text { display: flex; flex-direction: column; line-height: 1.25; }
.user-text strong { font-size: 14px; }
.user-text small { font-size: 12px; color: var(--muted); }
.user-menu-panel {
  position: absolute; right: 0; top: calc(100% + 8px); min-width: 180px; padding: 6px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow);
}
.menu-action { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 12px; border: 0; border-radius: 8px; background: none; cursor: pointer; text-align: left; }
.menu-action:hover { background: var(--surface-2); color: var(--ink); }

/* Fluid up to a comfortable reading width, then centred with even space both sides */
:root { --content-max: 1600px; --gutter: 28px; }
.content { padding: 24px var(--gutter) 48px; max-width: var(--content-max); width: 100%; margin: 0 auto; }
.flash { padding: 10px 14px; border-radius: 10px; font-size: 14px; margin: 0 0 16px; }
.flash-alert { background: var(--red-soft); color: var(--red); }
.flash-notice { background: var(--green-soft); color: var(--green); }

/* ---------- Home: hero ---------- */
.hero {
  position: relative; overflow: hidden;
  display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap;
  padding: 32px 36px; border-radius: 18px; color: #D8D5F0;
  background:
    radial-gradient(ellipse 45% 120% at 100% 0%, rgba(54, 169, 162, 0.45), transparent 70%),
    radial-gradient(ellipse 30% 90% at 75% 120%, rgba(238, 118, 35, 0.22), transparent 70%),
    linear-gradient(120deg, #21145F, #16123A);
  animation: rise 0.4s ease-out both;
}
.hero::after {
  content: ""; position: absolute; right: -60px; top: -80px; width: 280px; height: 280px;
  border: 26px solid rgba(255, 255, 255, 0.05); border-radius: 50%;
}
.hero-date { margin: 0 0 6px; font-size: 13px; letter-spacing: 1.5px; text-transform: uppercase; color: var(--teal-bright); font-weight: 600; }
.hero h1 { margin: 0 0 8px; font-size: clamp(26px, 3vw, 38px); color: #fff; letter-spacing: -0.5px; }
.hero h1 em { font-style: normal; color: var(--teal-bright); }
.hero p { margin: 0; max-width: 520px; }
.hero .button { position: relative; z-index: 1; }

/* ---------- Home: stats ---------- */
.stats { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 16px; margin: 20px 0; }
.stat {
  display: flex; align-items: center; gap: 14px; text-align: left;
  padding: 18px; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--surface); box-shadow: var(--shadow); cursor: pointer;
  transition: transform 0.15s, border-color 0.15s, box-shadow 0.15s;
  animation: rise 0.45s ease-out both;
}
.stat:nth-child(2) { animation-delay: 0.04s; }
.stat:nth-child(3) { animation-delay: 0.08s; }
.stat:nth-child(4) { animation-delay: 0.12s; }
.stat:nth-child(5) { animation-delay: 0.16s; }
.stat:hover { transform: translateY(-2px); border-color: var(--teal-bright); }
.stat[aria-pressed="true"] { border-color: var(--teal-bright); box-shadow: 0 0 0 3px var(--teal-soft), var(--shadow); }
.stat-icon { display: grid; place-items: center; width: 50px; height: 50px; border-radius: 12px; flex: none; }
.stat-body { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.stat-body strong { font-size: 30px; line-height: 1.1; font-variant-numeric: tabular-nums; }
.stat-body span { font-weight: 600; color: var(--ink); font-size: 14px; }
.stat-body small { color: var(--muted); font-size: 12px; }

.tone-blue { background: var(--blue-soft); color: var(--blue); }
.tone-teal { background: var(--teal-soft); color: var(--teal); }
.tone-green { background: var(--green-soft); color: var(--green); }
.tone-amber { background: var(--amber-soft); color: var(--amber); }
.tone-red { background: var(--red-soft); color: var(--red); }

/* ---------- Cards ---------- */
.home-grid { display: grid; grid-template-columns: minmax(0, 2.2fr) minmax(300px, 1fr); gap: 20px; align-items: start; }
.upcoming-card { grid-column: 1 / -1; }
.card {
  padding: 22px; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--surface); box-shadow: var(--shadow);
  animation: rise 0.5s ease-out both; animation-delay: 0.1s;
}
.card-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.card-head h2 { margin: 0; font-size: 19px; }
.card-meta { margin-left: auto; display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }

.live-badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 10px; border-radius: 999px; background: var(--red-soft); color: var(--red);
  font-size: 12px; font-weight: 700; letter-spacing: 0.6px; text-transform: uppercase;
}
.pulse { width: 8px; height: 8px; border-radius: 50%; background: currentColor; animation: pulse 1.6s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(240, 68, 56, 0.6); } 70% { box-shadow: 0 0 0 8px rgba(240, 68, 56, 0); } 100% { box-shadow: 0 0 0 0 rgba(240, 68, 56, 0); } }
.is-refreshing [data-refresh] .icon { animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.is-stale .card-meta { color: var(--amber); }
.is-stale .card-meta::after { content: "· couldn't refresh"; }

.chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.chip {
  padding: 6px 14px; border: 1px solid var(--line); border-radius: 999px;
  background: var(--surface); color: var(--body); font-size: 13px; font-weight: 500; cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.chip:hover { border-color: var(--teal-bright); }
.chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--surface); }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; margin: 0 -22px; padding: 0 22px; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th {
  padding: 10px 12px; text-align: left; white-space: nowrap;
  font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.4px;
  background: var(--surface-2); border-bottom: 1px solid var(--line);
}
.table th:first-child { border-radius: 10px 0 0 10px; }
.table th:last-child { border-radius: 0 10px 10px 0; }
.table th button { all: unset; cursor: pointer; }
.table th button:hover { color: var(--ink); }
.table th button:focus-visible { outline: 2px solid var(--teal-bright); outline-offset: 2px; }
.table th[aria-sort="ascending"] button::after { content: " ↑"; }
.table th[aria-sort="descending"] button::after { content: " ↓"; }
.table td { padding: 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.table tbody tr:last-child td { border-bottom: 0; }

.event-row:hover td { background: var(--surface-2); }
.event-name { display: flex; align-items: center; gap: 8px; }
.event-name > span { display: flex; flex-direction: column; }
.event-name small, .event-cell small { color: var(--muted); font-size: 12px; }
.event-name small { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 2px; }

/* Where each event and shift is in its day */
.shift-pill { display: inline-flex; align-items: center; gap: 5px; padding: 1px 8px; border-radius: 999px; font-size: 11px; font-weight: 600; white-space: nowrap; }
.shift-on { background: var(--green-soft); color: var(--green); }
.shift-on .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; animation: pulse-green 1.8s infinite; }
@keyframes pulse-green { 0% { box-shadow: 0 0 0 0 rgba(54, 169, 162, 0.6); } 70% { box-shadow: 0 0 0 6px rgba(54, 169, 162, 0); } 100% { box-shadow: 0 0 0 0 rgba(54, 169, 162, 0); } }
.shift-next { background: var(--amber-soft); color: var(--amber); }
.shift-done { background: var(--surface-2); color: var(--muted); }
.mode-pill {
  display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 999px;
  background: color-mix(in srgb, var(--orange) 16%, var(--surface)); color: var(--amber);
  border: 1px solid color-mix(in srgb, var(--orange) 40%, transparent);
  font-size: 12px; font-weight: 700; white-space: nowrap;
}
.table-key { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 14px 0 0; font-size: 13px; color: var(--muted); }
.row-caret { color: var(--muted); transition: transform 0.2s; }
.event-row.is-open .row-caret { transform: rotate(90deg); color: var(--teal); }
.event-row.is-not_arrived td:first-child { box-shadow: inset 3px 0 0 var(--red); }
.event-row.is-awaiting td:first-child { box-shadow: inset 3px 0 0 var(--orange); }
.event-row.is-complete td:first-child { box-shadow: inset 3px 0 0 var(--teal-bright); }
.empty-row td, .empty { padding: 24px 12px; text-align: center; color: var(--muted); }

.jobs-row > td { padding: 0 12px 12px 40px; background: var(--surface-2); }
.jobs-table { width: 100%; border-collapse: collapse; font-size: 13px; animation: rise 0.25s ease-out both; }
.jobs-table th { padding: 10px 8px 6px; text-align: left; font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.4px; }
.jobs-table td { padding: 6px 8px; border-top: 1px dashed var(--line); }
.jobs-table .num { text-align: right; }

/* Progress bars, styled per browser */
progress { -webkit-appearance: none; appearance: none; width: 100%; height: 8px; border: 0; border-radius: 999px; background: var(--line); overflow: hidden; }
progress::-webkit-progress-bar { background: var(--line); border-radius: 999px; }
progress::-webkit-progress-value { background: var(--teal-bright); border-radius: 999px; transition: width 0.6s ease; }
progress::-moz-progress-bar { background: var(--teal-bright); border-radius: 999px; }

/* Arrivals bar: teal arrived, red missing after the shift started, light orange not due yet */
.stack { display: block; width: 100%; height: 8px; overflow: visible; }
.stack .seg-track { fill: var(--line); }
.stack .seg-arrived { fill: var(--teal-bright); }
.stack .seg-missing { fill: var(--red); }
.stack .seg-awaiting { fill: color-mix(in srgb, var(--orange) 45%, var(--line)); }
.stack rect { transition: width 0.4s ease, x 0.4s ease; }
.job-bar { width: 140px; }
.onsite { display: flex; align-items: center; gap: 10px; min-width: 150px; }
.onsite span { width: 42px; text-align: right; font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; }

/* ---------- Attention ---------- */
.attention-list { list-style: none; margin: 0; padding: 0; }
.attention-item { display: flex; align-items: center; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.attention-item:last-child { border-bottom: 0; }
.attention-item > span:last-child { display: flex; flex-direction: column; }
.attention-item small { color: var(--muted); font-size: 13px; }
.attention-icon { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; flex: none; }
.all-clear { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 24px 0; color: var(--teal); }
.all-clear p { margin: 0; color: var(--muted); }

/* ---------- Upcoming ---------- */
.search { margin-left: auto; position: relative; display: flex; align-items: center; }
.search .icon { position: absolute; left: 12px; color: var(--muted); }
.search input {
  width: 240px; padding: 8px 12px 8px 34px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--surface-2); color: var(--ink); font: inherit; font-size: 14px;
}
.search input:focus { outline: none; border-color: var(--teal-bright); box-shadow: 0 0 0 3px var(--teal-soft); }
.event-cell { display: flex; align-items: center; gap: 12px; }
.event-cell > span:last-child { display: flex; flex-direction: column; }
.date-tile {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  width: 48px; height: 52px; border-radius: 10px; background: var(--amber-soft); flex: none; line-height: 1.1;
}
.date-tile small { font-size: 11px; font-weight: 700; text-transform: uppercase; color: var(--orange); }
.date-tile strong { font-size: 20px; }
.event-thumb { width: 64px; height: 44px; flex: none; border-radius: 8px; object-fit: cover; background: var(--surface-2); }
.staff-fill { display: flex; flex-direction: column; gap: 4px; min-width: 120px; }
.staff-fill span { font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; }
.status { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.status-ok { background: var(--green-soft); color: var(--green); }
.status-warn { background: var(--amber-soft); color: var(--amber); }

/* ---------- Company profile ---------- */
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; flex-wrap: wrap; margin-bottom: 20px; }
.page-head h1 { margin: 2px 0 4px; font-size: clamp(26px, 3vw, 34px); letter-spacing: -0.5px; }
.page-head .muted { margin: 0; }
.crumbs { display: flex; align-items: center; gap: 6px; margin: 0; font-size: 13px; color: var(--muted); }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--teal); }
.notice {
  display: flex; gap: 12px; align-items: flex-start; max-width: 440px;
  padding: 14px 16px; border-radius: 12px; border: 1px solid color-mix(in srgb, var(--orange) 30%, transparent);
  background: var(--amber-soft); color: var(--amber); font-size: 14px;
}
.notice p { margin: 0; color: var(--body); }

.section-tabs {
  position: sticky; top: 63px; z-index: 4;
  display: flex; gap: 4px; overflow-x: auto; margin: 0 0 20px; padding: 6px;
  border: 1px solid var(--line); border-radius: 12px; background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: blur(8px); box-shadow: var(--shadow);
}
.section-tabs a {
  display: inline-flex; align-items: center; gap: 8px; white-space: nowrap;
  padding: 8px 14px; border-radius: 8px; color: var(--body); text-decoration: none; font-size: 14px; font-weight: 500;
  transition: background 0.15s, color 0.15s;
}
.section-tabs a:hover { background: var(--surface-2); color: var(--ink); }
.section-tabs a[aria-current="true"] { background: var(--teal-soft); color: var(--teal); }
.count { padding: 0 7px; border-radius: 999px; background: var(--surface-2); font-size: 12px; color: var(--muted); }

.profile-section { margin-bottom: 20px; scroll-margin-top: 130px; }
.section-head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding-bottom: 16px; margin-bottom: 18px; border-bottom: 1px solid var(--line); }
.section-head h2 { margin: 0; font-size: 19px; }
.section-head .muted { margin: 2px 0 0; font-size: 14px; }
.section-num {
  display: grid; place-items: center; width: 36px; height: 36px; flex: none;
  border-radius: 50%; background: var(--teal-bright); color: #fff; font-weight: 700;
}
.managed {
  margin-left: auto; display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 12px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line);
  font-size: 12px; font-weight: 600; color: var(--muted);
}

.fields { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 24px; margin: 0; }
.fields-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.field { padding: 12px 0; border-bottom: 1px dashed var(--line); min-width: 0; }
.field-wide { grid-column: span 2; }
.field dt { font-size: 12px; font-weight: 600; letter-spacing: 0.3px; text-transform: uppercase; color: var(--muted); margin-bottom: 4px; }
.field dd { margin: 0; color: var(--ink); font-weight: 500; overflow-wrap: anywhere; }
.address { line-height: 1.6; }
.not-set { color: var(--muted); font-weight: 400; font-style: italic; }

.copyable { display: inline-flex; align-items: center; gap: 4px; max-width: 100%; }
.copyable a { color: inherit; text-decoration: none; border-bottom: 1px dotted var(--muted); overflow-wrap: anywhere; }
.copyable a:hover { color: var(--teal); border-color: var(--teal); }
.copy-button {
  display: inline-grid; place-items: center; width: 26px; height: 26px; flex: none;
  border: 0; border-radius: 6px; background: none; color: var(--muted); cursor: pointer; opacity: 0;
  transition: opacity 0.15s, background 0.15s, color 0.15s;
}
.copyable:hover .copy-button, .copy-button:focus-visible { opacity: 1; }
.copy-button:hover { background: var(--surface-2); color: var(--ink); }
.copy-button.is-copied { opacity: 1; color: var(--green); }
@media (hover: none) { .copy-button { opacity: 1; } }

.person { display: flex; align-items: center; gap: 12px; }
.person > span:last-child { display: flex; flex-direction: column; }
.person small { color: var(--teal); font-size: 12px; font-weight: 500; }
.avatar-sm { width: 34px; height: 34px; font-size: 13px; }
.tag { display: inline-block; padding: 3px 10px; border-radius: 6px; background: var(--surface-2); border: 1px solid var(--line); font-size: 13px; color: var(--body); white-space: nowrap; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.status-info { background: var(--blue-soft); color: var(--blue); }
.status-muted { background: var(--surface-2); color: var(--muted); }
.section-foot { margin: 14px 0 0; font-size: 14px; }

.toast {
  position: fixed; left: 50%; bottom: 24px; z-index: 50; transform: translate(-50%, 12px);
  padding: 10px 16px; border-radius: 10px; background: var(--ink); color: var(--surface);
  font-size: 14px; font-weight: 500; box-shadow: var(--shadow); opacity: 0; pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
}
.toast.is-shown { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Links inside rows ---------- */
.row-link { color: var(--ink); font-weight: 600; text-decoration: none; }
.row-link:hover { color: var(--teal); text-decoration: underline; text-underline-offset: 3px; }
tr[data-href] { cursor: pointer; }
.row-toggle { display: grid; place-items: center; width: 26px; height: 26px; flex: none; padding: 0; border: 0; border-radius: 6px; background: none; color: var(--muted); cursor: pointer; }
.row-toggle:hover { background: var(--line); color: var(--ink); }
.row-toggle-space { width: 26px; flex: none; }
.live-badge-sm { padding: 2px 8px; font-size: 11px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.flip { transform: rotate(180deg); }
.status-bad { background: var(--red-soft); color: var(--red); }

/* ---------- Staff list ---------- */
.event-card {
  display: flex; gap: 16px; align-items: center; padding: 12px; min-width: 300px;
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow);
}
.event-card img { width: 132px; height: 88px; border-radius: 10px; object-fit: cover; }
.event-card > div { display: flex; flex-direction: column; gap: 4px; padding-right: 8px; }
.event-card span { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.event-card .icon { color: var(--teal); }

.mode-banner {
  display: flex; gap: 18px; align-items: flex-start; margin-bottom: 16px; padding: 20px 24px;
  border-radius: 14px; border: 1px solid var(--line); background: var(--surface); box-shadow: var(--shadow);
}
.mode-icon { display: grid; place-items: center; width: 52px; height: 52px; flex: none; border-radius: 14px; }
.mode-control { border-left: 6px solid var(--orange); }
.mode-control .mode-icon { background: var(--amber-soft); color: var(--orange); }
.mode-visual { border-left: 6px solid var(--teal-bright); }
.mode-visual .mode-icon { background: var(--teal-soft); color: var(--teal); }
.mode-kicker { margin: 0; font-size: 12px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; }
.mode-control .mode-kicker { color: var(--amber); }
.mode-visual .mode-kicker { color: var(--teal); }
.mode-text h2 { margin: 2px 0 6px; font-size: clamp(19px, 2vw, 23px); }
.mode-text > p { margin: 0; max-width: 760px; }
.mode-steps { display: flex; flex-wrap: wrap; gap: 10px 24px; margin: 12px 0 0; padding: 0; list-style: none; counter-reset: step; }
.mode-steps li { counter-increment: step; display: flex; align-items: center; gap: 8px; font-size: 14px; }
.mode-steps li::before {
  content: counter(step); display: grid; place-items: center; width: 24px; height: 24px; flex: none;
  border-radius: 50%; background: var(--orange); color: #fff; font-size: 12px; font-weight: 700;
}

.toolbar { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px 14px; margin-bottom: 16px; padding: 16px 18px; animation: none; }
.day-switch { display: flex; align-items: center; gap: 4px; }
.day-switch .is-disabled { opacity: 0.35; cursor: default; }
.day-select select, .filter select {
  height: 38px; padding: 0 34px 0 12px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--surface-2); color: var(--ink); font: inherit; font-size: 14px; cursor: pointer;
}
.day-select select { font-weight: 600; }
.filter { display: flex; flex-direction: column; gap: 4px; }
.filter > span { font-size: 12px; font-weight: 600; color: var(--muted); }
.toolbar .search { margin-left: 0; }
.toolbar .search input { width: 200px; height: 38px; }
.toolbar-actions { margin-left: auto; display: flex; gap: 8px; }
.button-ghost { background: var(--surface); color: var(--ink); border: 1px solid var(--line); padding: 9px 14px; font-size: 14px; }
.button-ghost:hover { border-color: var(--teal-bright); color: var(--teal); }

.totals { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 16px; }
.total {
  display: flex; align-items: center; gap: 12px; padding: 12px 16px;
  border: 1px solid var(--line); border-radius: 12px; background: var(--surface);
}
.total strong { font-size: 24px; font-variant-numeric: tabular-nums; }
.total span { font-size: 14px; color: var(--body); }
.total-ok { background: var(--green-soft); border-color: transparent; }
.total-ok strong, .total-ok span { color: var(--green); }
.total-bad strong { color: var(--red); }
.total-live { flex-direction: column; align-items: flex-start; gap: 4px; }
.total-live > span:last-child { font-size: 12px; color: var(--muted); }

.staff-group { margin-bottom: 16px; padding: 0; overflow: hidden; animation: none; }
.group-head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 16px 20px; border-bottom: 1px solid var(--line); background: var(--surface-2); }
.group-icon { color: var(--ink); }
.group-title h2 { margin: 0; font-size: 17px; }
.group-title p { margin: 2px 0 0; font-size: 14px; }
.sep { margin: 0 6px; opacity: 0.5; }
.group-counts { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.pill { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 10px; background: var(--surface); border: 1px solid var(--line); font-size: 13px; }
.pill strong { font-size: 16px; font-variant-numeric: tabular-nums; }
.pill-ok { background: var(--green-soft); border-color: transparent; color: var(--green); }
.pill-ok strong { color: var(--green); }
.pill-bad strong { color: var(--red); }

.staff-group .table-wrap { margin: 0; padding: 0; }
.staff-table th { border-radius: 0 !important; line-height: 1.2; vertical-align: bottom; }
.staff-table th small { font-weight: 500; text-transform: none; letter-spacing: 0; }
.staff-table td { padding: 8px 10px; }
.staff-table .col-check { width: 44px; text-align: center; }
.staff-table .col-num { width: 36px; }
.staff-table .col-note { min-width: 240px; position: relative; }
.staff-table .col-role { min-width: 130px; white-space: nowrap; }
textarea.note-input {
  display: block; width: 100%; min-height: 36px; padding: 8px 10px; resize: none; overflow: hidden;
  line-height: 1.35; height: auto;
}
.note-count { position: absolute; right: 14px; bottom: 2px; font-size: 10px; color: var(--muted); pointer-events: none; }
.note-count.is-near { color: var(--amber); font-weight: 600; }
.call-button {
  display: inline-flex; align-items: center; gap: 4px; margin-left: 6px; padding: 3px 9px; border-radius: 999px;
  background: var(--teal-bright); color: #fff; font-size: 12px; font-weight: 600; text-decoration: none; white-space: nowrap;
}
.call-button:hover { background: var(--teal); }
.staff-table input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--teal-bright); cursor: pointer; }
.staff-row { transition: background 0.3s; }
.staff-row:hover td { background: var(--surface-2); }
.staff-row.is-selected td { background: var(--teal-soft); }
.staff-row.is-saving { opacity: 0.85; }
.staff-row.just-changed td { background: var(--green-soft); }
.staff-row .person strong { font-weight: 500; white-space: nowrap; }

.time-fixed, .time-input, .note-input {
  height: 36px; padding: 0 10px; border: 1px solid var(--line); border-radius: 8px;
  background: var(--surface); color: var(--ink); font: inherit; font-size: 14px; font-variant-numeric: tabular-nums;
}
.time-fixed { display: inline-flex; align-items: center; background: var(--surface-2); color: var(--body); }
.time-input { width: 112px; }
.time-input.is-filled { background: var(--green-soft); border-color: transparent; }
.note-input { width: 100%; }
.time-input:focus, .note-input:focus { outline: none; border-color: var(--teal-bright); box-shadow: 0 0 0 3px var(--teal-soft); }
.time-input:disabled { background: var(--surface-2); color: var(--muted); cursor: not-allowed; }
.time-wrap { display: inline-flex; align-items: center; gap: 4px; }
.now-button {
  height: 28px; padding: 0 8px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface);
  color: var(--teal); font-size: 12px; font-weight: 600; cursor: pointer;
}
.now-button:hover { border-color: var(--teal-bright); background: var(--teal-soft); }
.hint { display: block; margin-top: 2px; font-size: 11px; color: var(--muted); }

.switch { position: relative; display: inline-block; width: 42px; height: 24px; cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.switch-track { position: absolute; inset: 0; border-radius: 999px; background: var(--line); transition: background 0.2s; }
.switch-track::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25); transition: transform 0.2s;
}
.switch input:checked + .switch-track { background: var(--teal-bright); }
.switch input:checked + .switch-track::after { transform: translateX(18px); }
.switch input:focus-visible + .switch-track { outline: 2px solid var(--teal-bright); outline-offset: 2px; }
.switch input:disabled + .switch-track { opacity: 0.5; cursor: not-allowed; }

.hours { display: inline-block; min-width: 56px; padding: 6px 8px; border-radius: 8px; text-align: center; font-weight: 600; color: var(--muted); }
.hours.has-hours { background: var(--green-soft); color: var(--green); }
.staff-row.is-approved td { background: color-mix(in srgb, var(--green-soft) 45%, transparent); }

.stars { display: inline-flex; gap: 2px; white-space: nowrap; }
.star {
  padding: 0 1px; border: 0; background: none; cursor: pointer;
  font-size: 20px; line-height: 1; color: var(--line); transition: color 0.12s, transform 0.12s;
}
.star.is-on { color: #F5A524; }
.stars-readonly .star { cursor: default; font-size: 16px; }
.stars-readonly .star:hover { transform: none; }
.recording-line { margin: 0 0 6px !important; color: var(--ink); }
.star.is-hover { color: #F8C266; }
.star:hover { transform: scale(1.15); }

.save-state { position: absolute; right: 16px; top: 50%; transform: translateY(-50%); font-size: 11px; font-weight: 600; opacity: 0; transition: opacity 0.2s; pointer-events: none; }
.save-state.is-ok { opacity: 1; color: var(--green); }
.save-state.is-error { opacity: 1; color: var(--red); }

.action-bar {
  position: sticky; bottom: 16px; z-index: 6; display: flex; align-items: center; gap: 12px; width: fit-content; margin: 8px auto 0;
  padding: 10px 12px 10px 18px; border-radius: 14px; background: var(--ink); color: var(--surface); box-shadow: 0 16px 40px -12px rgba(15, 12, 36, 0.5);
  animation: rise 0.2s ease-out both;
}
.action-bar strong { color: var(--surface); }
.action-bar .button-ghost { background: transparent; color: var(--surface); border-color: color-mix(in srgb, var(--surface) 35%, transparent); }

/* Breaks: one length for the day, and a cup per person with a count badge.
   Orange outline at 0, filled green once breaks are added. */
.break-choices { display: inline-flex; padding: 3px; gap: 2px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); }
.break-choice {
  min-width: 40px; height: 30px; padding: 0 8px; border: 0; border-radius: 7px; background: transparent;
  font-size: 13px; font-weight: 600; color: var(--body); cursor: pointer; font-variant-numeric: tabular-nums;
}
.break-choice:hover { color: var(--ink); }
.break-choice[aria-checked="true"] { background: var(--surface); color: var(--amber); box-shadow: 0 1px 2px rgba(16, 24, 40, 0.12), inset 0 0 0 1px color-mix(in srgb, var(--orange) 45%, transparent); }

.cup {
  position: relative; display: grid; place-items: center; width: 44px; height: 40px; padding: 0;
  border: 0; border-radius: 10px; background: var(--amber-soft); color: var(--orange);
  cursor: pointer; transition: background 0.15s, color 0.15s;
}
.cup .cup-body { fill: none; transition: fill 0.15s; }
.cup.has-breaks { background: var(--green-soft); color: var(--green); }
.cup.has-breaks .cup-body { fill: currentColor; }
.cup:hover:not(:disabled) { filter: brightness(0.97); }
.cup:disabled { opacity: 0.55; cursor: not-allowed; }
.cup-badge {
  position: absolute; top: -7px; right: -7px; display: grid; place-items: center;
  min-width: 20px; height: 20px; padding: 0 5px; border-radius: 999px;
  background: var(--orange); color: #fff; border: 2px solid var(--surface);
  font-size: 11px; font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums;
}
.cup.has-breaks .cup-badge { background: var(--teal-bright); }
.cup.bump { animation: bump 0.22s ease-out; }
@keyframes bump { 50% { transform: scale(1.12); } }
.time-input.break-mins { width: 74px; text-align: center; }
.break-mins.is-custom { background: var(--amber-soft); border-color: transparent; }

/* ---------- Staff Lists filters ---------- */
.segmented { display: inline-flex; padding: 3px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); }
.segment { position: relative; }
.segment input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.segment span { display: block; padding: 6px 14px; border-radius: 8px; font-size: 14px; font-weight: 500; color: var(--body); }
.segment input:checked + span { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(16, 24, 40, 0.12); }
.segment input:focus-visible + span { outline: 2px solid var(--teal-bright); outline-offset: 1px; }
.date-input { height: 38px; padding: 0 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); color: var(--ink); font: inherit; font-size: 14px; }
.day-card { margin-bottom: 16px; }
.day-card .card-head h2 { font-size: 17px; }

/* ---------- Slim sidebar (desktop): icons only ---------- */
.sidebar { transition: width 0.2s ease; }
.brand-mark { display: none; font-weight: 700; font-size: 22px; color: #fff; letter-spacing: -0.5px; }
.brand-mark em { font-style: normal; color: var(--teal-bright); }
.sidebar-collapse {
  display: flex; align-items: center; gap: 14px; margin: 12px 0 0; padding: 10px 12px;
  border: 0; border-radius: 10px; background: transparent; color: var(--sidebar-ink);
  font-size: 13px; font-weight: 500; cursor: pointer; text-align: left;
}
.sidebar-collapse:hover { background: rgba(255, 255, 255, 0.07); color: #fff; }
.sidebar-slim .sidebar-collapse .icon { transform: scaleX(-1); }

@media (min-width: 901px) {
  .sidebar-slim .sidebar { width: 76px; padding-left: 12px; padding-right: 12px; }
  .sidebar-slim .sidebar .brand { padding: 0 0 28px; text-align: center; }
  .sidebar-slim .brand-word, .sidebar-slim .brand-tag, .sidebar-slim .sidebar-foot,
  .sidebar-slim .nav-item > span, .sidebar-slim .nav-item small, .sidebar-slim .sidebar-collapse span { display: none; }
  .sidebar-slim .brand-mark { display: block; }
  .sidebar-slim .nav-item, .sidebar-slim .sidebar-collapse { justify-content: center; padding: 12px 0; }
  .sidebar-slim .sidebar-collapse { margin-top: auto; }
}

/* ---------- Smaller screens ---------- */
/* Phones and small tablets: each person on a staff list becomes a card */
@media (max-width: 900px) {
  .staff-table, .staff-table tbody { display: block; }
  .staff-table thead { display: none; }
  .staff-table tr.staff-row {
    position: relative; display: grid; grid-template-columns: 1fr 1fr; gap: 10px 14px;
    padding: 14px 16px 14px 52px; border-bottom: 1px solid var(--line);
  }
  .staff-table tr.staff-row[hidden] { display: none; }
  .staff-table td { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; padding: 0; border: 0; background: none !important; }
  .staff-table td[data-label]::before { content: attr(data-label); font-size: 11px; font-weight: 600; letter-spacing: 0.3px; text-transform: uppercase; color: var(--muted); }
  .staff-table td.col-check { position: absolute; left: 16px; top: 18px; width: auto; }
  .staff-table td.col-num { display: none; }
  .staff-table td.col-name { grid-column: 1 / -1; }
  .staff-table td.col-name::before { display: none; }
  .staff-table td.col-role { grid-column: 1 / -1; margin-top: -6px; }
  .staff-table td.col-role::before { display: none; }
  .staff-table td.col-note { grid-column: 1 / -1; min-width: 0; width: 100%; }
  .staff-table .num { text-align: left; }
  .staff-table .time-input { width: 100%; min-width: 0; }
  .staff-table .time-wrap { width: 100%; }
  .staff-table .stars .star { font-size: 26px; padding: 0 3px; }
  .staff-table .save-state { top: auto; bottom: -16px; right: 0; transform: none; }
  .staff-row.is-approved { box-shadow: inset 4px 0 0 var(--teal-bright); }
  .group-head { padding: 14px 16px; }
  .action-bar { left: 16px; right: 16px; width: auto; justify-content: space-between; }
}

@media (max-width: 1200px) {
  .stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .home-grid { grid-template-columns: 1fr; }
  .fields-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .toolbar-actions { margin-left: 0; }
}

@media (max-width: 900px) {
  .login-page { grid-template-columns: 1fr; gap: 32px; padding-top: 40px; }
  .login-intro .brand-tag { margin-bottom: 24px; }
  .login-intro h1, .login-intro-text { display: none; }
  .login-card { justify-self: stretch; max-width: none; padding: 28px 22px; }

  .sidebar {
    position: fixed; z-index: 20; left: 0; top: 0;
    transform: translateX(-100%); transition: transform 0.25s ease;
  }
  .sidebar-open .sidebar { transform: none; }
  .sidebar-collapse { display: none; }
  .sidebar-open .sidebar-scrim { display: block; position: fixed; inset: 0; z-index: 15; background: rgba(15, 12, 36, 0.5); }
  .menu-toggle { display: inline-grid; }
  .topbar { padding: 10px 16px; }
  :root { --gutter: 16px; }
  .user-text { display: none; }
  .content { padding: 16px 16px 40px; }
  .hero { padding: 24px 20px; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .stat { padding: 14px; }
  .stat-icon { width: 40px; height: 40px; }
  .stat-body strong { font-size: 24px; }
  .card { padding: 16px; }
  .table-wrap { margin: 0 -16px; padding: 0 16px; }
  .search { margin-left: 0; width: 100%; }
  .search input { width: 100%; }
  .fields, .fields-4 { grid-template-columns: 1fr; }
  .field-wide { grid-column: auto; }
  .section-tabs { top: 59px; }
  .event-card { min-width: 0; width: 100%; }
  .totals { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .toolbar .search, .toolbar .search input, .filter, .filter select { width: 100%; }
  .group-counts { margin-left: 0; }

  .managed { margin-left: 0; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
