/* ═══════════════════════════════════════════════════════════════
   SILVASHIFT — v2
   The Silva Digital window frame over liquid metal. Numbers are the
   content: set in Space Grotesk with tabular figures. One chrome moment
   (this period's pay catching the light); everything else is quiet.
   ═══════════════════════════════════════════════════════════════ */

/* ── Fonts (self-hosted variable woff2) ───────────────────────── */
@font-face {
  font-family: 'Space Grotesk';
  src: url('../assets/fonts/space-grotesk-latin.woff2') format('woff2');
  font-weight: 300 700;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Space Grotesk';
  src: url('../assets/fonts/space-grotesk-latin-ext.woff2') format('woff2');
  font-weight: 300 700;
  font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Inter';
  src: url('../assets/fonts/inter-latin.woff2') format('woff2');
  font-weight: 100 900;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Inter';
  src: url('../assets/fonts/inter-latin-ext.woff2') format('woff2');
  font-weight: 100 900;
  font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* ── Tokens ───────────────────────────────────────────────────── */
:root {
  color-scheme: dark;

  --void: #07070d;
  --graphite: #0e0f16;
  --steel-100: #e8e9ed;
  --steel-200: #c8c9d1;
  --steel-300: #a0a1ae;
  --steel-400: #7a7b8c;
  --steel-500: #55566a;
  --signal: #a8b8e0;
  --signal-deep: #8b9cc6;
  --danger: #e8b4b4;
  --done: #a9cbb9;

  --rate-base: #7e9bb5;
  --rate-mid: #9b9bc4;
  --rate-high: #b89bc4;
  --rate-premium: #a8b8e0;

  --hair: rgba(232, 233, 237, 0.08);
  --hair-strong: rgba(232, 233, 237, 0.15);
  --panel: rgba(12, 13, 20, 0.66);
  --panel-solid: rgba(12, 13, 20, 0.94);
  --wash: rgba(255, 255, 255, 0.025);
  --wash-strong: rgba(255, 255, 255, 0.05);

  --font-display: 'Space Grotesk', ui-sans-serif, system-ui, -apple-system, sans-serif;
  --font-body: 'Inter', ui-sans-serif, system-ui, -apple-system, sans-serif;

  --inset: clamp(6px, 0.9vw, 10px);
  --radius-frame: clamp(14px, 1.7vw, 22px);
  --radius-card: 18px;
  --radius-ctl: 12px;

  --rail-w: 252px;
  --topbar-h: 56px;
  --tabbar-h: 64px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);

  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-io: cubic-bezier(0.65, 0, 0.35, 1);

  --lx: 38%; /* light position for chrome surfaces, moved by app.js */
}

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

html {
  background: var(--void);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.55;
  color: var(--steel-200);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100dvh;
  overflow-x: clip;
}

html.has-sheet body { overflow: hidden; }

[hidden] { display: none !important; }
img, svg, picture { display: block; max-width: 100%; }
img { height: auto; }
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; color: inherit; }
button { background: none; border: 0; cursor: pointer; text-align: inherit; }
button:disabled { cursor: not-allowed; }
ul, ol { list-style: none; }
::selection { background: rgba(168, 184, 224, 0.28); color: var(--steel-100); }

h1, h2, h3 {
  font-family: var(--font-display);
  color: var(--steel-100);
  font-weight: 500;
  letter-spacing: -0.015em;
  line-height: 1.15;
  text-wrap: balance;
}

:focus-visible {
  outline: 2px solid var(--signal);
  outline-offset: 2px;
  border-radius: 6px;
}

.icon { width: 18px; height: 18px; flex-shrink: 0; }

.num { font-family: var(--font-display); font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.muted { color: var(--steel-400); }
.grow { flex: 1; }

.chrome-text {
  background-image: linear-gradient(100deg,
    #6e7184 0%,
    #c4c7d2 calc(var(--lx) - 24%),
    #f6f7fb calc(var(--lx) - 5%),
    #b9c7ea var(--lx),
    #e9ebf1 calc(var(--lx) + 7%),
    #9093a4 calc(var(--lx) + 28%),
    #5a5d70 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
}

.skip-link {
  position: fixed;
  top: calc(var(--inset) + 10px);
  left: calc(var(--inset) + 10px);
  z-index: 90;
  padding: 10px 16px;
  border-radius: 10px;
  background: var(--steel-100);
  color: var(--void);
  font-weight: 600;
  transform: translateY(-200%);
  transition: transform 0.3s var(--ease);
}
.skip-link:focus { transform: none; }

/* ── Backdrop + the Silva Digital frame ───────────────────────── */
.backdrop {
  position: fixed;
  inset: 0;
  z-index: -1;
  background-color: var(--void);
  background-image: url('../assets/background-1800.jpg');
  background-image: image-set(url('../assets/background-1800.webp') type('image/webp'), url('../assets/background-1800.jpg') type('image/jpeg'));
  background-size: cover;
  background-position: 50% 30%;
}
.backdrop::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(120% 80% at 50% 0%, transparent 35%, rgba(7, 7, 13, 0.6) 100%),
    linear-gradient(180deg, rgba(7, 7, 13, 0.15), rgba(7, 7, 13, 0.45));
}
@media (max-width: 900px) {
  .backdrop {
    background-image: url('../assets/background-1000.jpg');
    background-image: image-set(url('../assets/background-1000.webp') type('image/webp'), url('../assets/background-1000.jpg') type('image/jpeg'));
  }
}

.frame {
  position: fixed;
  inset: var(--inset);
  border: 1px solid var(--hair);
  border-radius: var(--radius-frame);
  box-shadow: 0 0 0 100vmax var(--void), inset 0 0 60px rgba(139, 156, 198, 0.03);
  pointer-events: none;
  z-index: 60;
}

/* ── Buttons ──────────────────────────────────────────────────── */
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 18px;
  border-radius: var(--radius-ctl);
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0.005em;
  white-space: nowrap;
  transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease), border-color 0.25s, background-color 0.25s, color 0.25s, opacity 0.25s;
}
.btn .icon { width: 17px; height: 17px; }
.btn-sm { min-height: 36px; padding: 0 13px; font-size: 14px; border-radius: 10px; }
.btn-sm .icon { width: 15px; height: 15px; }
.btn-block { width: 100%; }
.btn:disabled { opacity: 0.45; }

/* brushed steel — the primary action is a piece of the chrome */
.btn-primary {
  color: #0b0c12;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.55), rgba(255, 255, 255, 0) 48%),
    linear-gradient(100deg, #b9bdca 0%, #eef0f5 calc(var(--lx) - 6%), #ffffff var(--lx), #d6d9e2 calc(var(--lx) + 14%), #9fa3b3 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.85), inset 0 -1px 0 rgba(0, 0, 0, 0.25), 0 8px 24px rgba(0, 0, 0, 0.35);
}
.btn-primary:not(:disabled):hover {
  transform: translateY(-1px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9), inset 0 -1px 0 rgba(0, 0, 0, 0.25), 0 12px 32px rgba(0, 0, 0, 0.45), 0 0 0 4px rgba(168, 184, 224, 0.12);
}
.btn-primary:not(:disabled):active { transform: translateY(0); }

.btn-ghost {
  color: var(--steel-100);
  border: 1px solid var(--hair-strong);
  background: rgba(255, 255, 255, 0.02);
}
.btn-ghost:not(:disabled):hover { border-color: rgba(168, 184, 224, 0.45); background: rgba(168, 184, 224, 0.06); }

.btn-danger {
  color: #1a0d0f;
  background: linear-gradient(180deg, #f3cfcf, #e2a9a9);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6), 0 8px 24px rgba(0, 0, 0, 0.35);
}
.btn-danger:not(:disabled):hover { transform: translateY(-1px); }
.btn-danger-text { color: var(--danger); }
.btn-danger-text:not(:disabled):hover { border-color: rgba(232, 180, 180, 0.45); background: rgba(232, 180, 180, 0.06); }

.btn-icon-only { padding: 0; width: 36px; }

.btn.is-busy { pointer-events: none; }
.spin {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 1.5px solid currentColor;
  border-right-color: transparent;
  animation: spin 0.7s linear infinite;
  flex-shrink: 0;
}
@keyframes spin { to { transform: rotate(360deg); } }

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  color: var(--steel-300);
  transition: background-color 0.2s, color 0.2s;
  flex-shrink: 0;
}
.icon-btn:hover { background: var(--wash-strong); color: var(--steel-100); }
.icon-btn--sm { width: 32px; height: 32px; }
.icon-btn--sm .icon { width: 15px; height: 15px; }

.link-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  padding: 0 2px;
  font-size: 14px;
  color: var(--signal);
  border-radius: 6px;
  transition: color 0.2s;
}
.link-btn .icon { width: 15px; height: 15px; }
.link-btn:hover { color: var(--steel-100); }
.link-btn--center { align-self: center; }

/* ── Form controls ────────────────────────────────────────────── */
.form { display: grid; gap: 16px; }
.form-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px 16px; align-items: end; }
.span-2 { grid-column: span 2; }
.span-4 { grid-column: 1 / -1; }
.form-actions { display: flex; gap: 10px; justify-content: flex-start; }

.field { display: grid; gap: 6px; min-width: 0; border: 0; }
.field--inline { display: flex; align-items: center; gap: 10px; }
.field--inline .field-label { white-space: nowrap; }
.card > .muted + .form { margin-top: 16px; }
.field-label { font-size: 13px; color: var(--steel-400); }
.field-hint { font-size: 13px; color: var(--steel-400); }

.input {
  width: 100%;
  min-height: 44px;
  padding: 0 14px;
  border-radius: var(--radius-ctl);
  border: 1px solid var(--hair-strong);
  background: rgba(7, 7, 13, 0.55);
  color: var(--steel-100);
  font-size: 15px;
  transition: border-color 0.2s, box-shadow 0.2s, background-color 0.2s;
}
.input::placeholder { color: var(--steel-500); }
.input:hover { border-color: rgba(232, 233, 237, 0.24); }
.input:focus { outline: none; border-color: rgba(168, 184, 224, 0.7); box-shadow: 0 0 0 3px rgba(168, 184, 224, 0.15); }
.input:disabled { opacity: 0.55; }
select.input {
  appearance: none;
  padding-right: 36px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23a0a1ae' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 13px center;
}
input[type='date'].input { padding-right: 10px; }
input[type='date']::-webkit-calendar-picker-indicator { filter: invert(0.75); cursor: pointer; }
.textarea { padding: 12px 14px; min-height: 76px; resize: vertical; line-height: 1.5; }

.form-error { font-size: 14px; color: var(--danger); line-height: 1.45; }
.form-success { color: var(--done); }

.notice {
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid rgba(168, 184, 224, 0.28);
  background: rgba(168, 184, 224, 0.07);
  color: var(--steel-200);
  font-size: 14px;
}
.notice--warn { border-color: rgba(232, 214, 168, 0.32); background: rgba(232, 214, 168, 0.07); }
.notice--error { border-color: rgba(232, 180, 180, 0.35); background: rgba(232, 180, 180, 0.07); color: var(--danger); }

/* radio chips */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips--center { justify-content: center; }
.chip { position: relative; display: inline-flex; }
.chip input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.chip span,
.chip-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--hair-strong);
  background: rgba(7, 7, 13, 0.45);
  font-size: 14px;
  color: var(--steel-300);
  transition: color 0.2s, border-color 0.2s, background-color 0.2s;
}
.chip--sm span { min-height: 32px; padding: 0 12px; font-size: 13px; }
.chip--lg span { min-height: 44px; padding: 0 20px; font-size: 15px; }
.chip:hover span,
.chip-btn:hover { color: var(--steel-100); border-color: rgba(232, 233, 237, 0.26); }
.chip input:checked + span,
.chip-btn.is-active {
  color: var(--steel-100);
  border-color: rgba(168, 184, 224, 0.55);
  background: rgba(168, 184, 224, 0.12);
}
.chip input:focus-visible + span { outline: 2px solid var(--signal); outline-offset: 2px; }
.chip-count { color: var(--steel-400); font-size: 12px; }
.chip-btn.is-active .chip-count { color: var(--signal); }

/* switch */
.switch { display: flex; align-items: flex-start; gap: 12px; cursor: pointer; position: relative; }
.switch input { position: absolute; opacity: 0; width: 44px; height: 26px; cursor: pointer; }
.switch-track {
  flex-shrink: 0;
  width: 44px;
  height: 26px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--hair-strong);
  position: relative;
  transition: background-color 0.25s, border-color 0.25s;
}
.switch-thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: linear-gradient(180deg, #f4f5f8, #b9bdca);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
  transition: transform 0.3s var(--ease);
}
.switch input:checked + .switch-track { background: rgba(168, 184, 224, 0.35); border-color: rgba(168, 184, 224, 0.6); }
.switch input:checked + .switch-track .switch-thumb { transform: translateX(18px); }
.switch input:focus-visible + .switch-track { outline: 2px solid var(--signal); outline-offset: 2px; }
.switch-text { display: grid; gap: 2px; font-size: 15px; color: var(--steel-100); }

/* segmented */
.segmented {
  display: inline-flex;
  padding: 3px;
  border-radius: 12px;
  border: 1px solid var(--hair-strong);
  background: rgba(7, 7, 13, 0.5);
}
.seg {
  min-height: 34px;
  padding: 0 14px;
  border-radius: 9px;
  font-size: 14px;
  color: var(--steel-400);
  transition: color 0.2s, background-color 0.2s;
}
.seg:hover { color: var(--steel-100); }
.seg.is-active { color: var(--steel-100); background: rgba(168, 184, 224, 0.14); box-shadow: inset 0 0 0 1px rgba(168, 184, 224, 0.35); }

.search { position: relative; display: block; min-width: 220px; }
.search .icon { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--steel-400); pointer-events: none; }
.search .input { padding-left: 38px; min-height: 40px; }

/* date range filter */
.date-range { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; }
.date-range-field { display: inline-flex; align-items: center; gap: 8px; }
.date-range-field .field-label { white-space: nowrap; }
.date-range .input { width: auto; min-height: 36px; padding: 0 10px; font-size: 14px; }
.date-range-clear { font-size: 13px; }

/* tabs */
.tabs {
  display: flex;
  gap: 4px;
  padding: 4px;
  border-radius: 14px;
  border: 1px solid var(--hair-strong);
  background: rgba(7, 7, 13, 0.55);
  width: fit-content;
  max-width: 100%;
  overflow-x: auto;
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  min-height: 40px;
  padding: 0 16px;
  border-radius: 10px;
  font-family: var(--font-display);
  font-size: 15px;
  color: var(--steel-400);
  transition: color 0.2s, background-color 0.2s;
}
.tab .icon { width: 16px; height: 16px; }
.tab:hover { color: var(--steel-100); }
.tab[aria-selected='true'] { color: var(--steel-100); background: rgba(168, 184, 224, 0.13); box-shadow: inset 0 0 0 1px rgba(168, 184, 224, 0.35); }

/* ── Shell ────────────────────────────────────────────────────── */
.rail {
  position: fixed;
  top: calc(var(--inset) + 1px);
  bottom: calc(var(--inset) + 1px);
  left: calc(var(--inset) + 1px);
  width: var(--rail-w);
  z-index: 40;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 22px 16px 16px;
  border-right: 1px solid var(--hair);
  background: rgba(7, 7, 13, 0.62);
  backdrop-filter: blur(18px) saturate(120%);
  -webkit-backdrop-filter: blur(18px) saturate(120%);
  overflow-y: auto;
  scrollbar-width: none;
}
.rail::-webkit-scrollbar { display: none; }
.rail-brand { display: flex; justify-content: center; padding: 2px 8px 18px; }
.wordmark--rail { width: 148px; }
.rail-log { margin-bottom: 14px; }
.rail-nav { display: grid; gap: 2px; }
.rail-link {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 42px;
  padding: 0 12px;
  border-radius: 10px;
  font-family: var(--font-display);
  font-size: 15px;
  color: var(--steel-400);
  transition: color 0.2s, background-color 0.2s;
}
.rail-link:hover { color: var(--steel-100); background: var(--wash); }
.rail-link[aria-current='page'] { color: var(--steel-100); background: rgba(168, 184, 224, 0.1); box-shadow: inset 2px 0 0 var(--signal); }
.rail-fill { flex: 1; min-height: 16px; }

.rail-period {
  display: grid;
  gap: 2px;
  padding: 14px;
  border-radius: 14px;
  border: 1px solid var(--hair);
  background: rgba(255, 255, 255, 0.02);
  transition: border-color 0.2s;
}
.rail-period:hover { border-color: var(--hair-strong); }
.rail-period-label { font-size: 12px; color: var(--steel-400); }
.rail-period-pay { font-size: 22px; color: var(--steel-100); font-weight: 500; }
.rail-period-sub { font-size: 12px; color: var(--steel-400); }
.rail-period-track { height: 3px; margin-top: 8px; border-radius: 3px; background: rgba(255, 255, 255, 0.07); overflow: hidden; }
.rail-period-track span { display: block; height: 100%; background: linear-gradient(90deg, var(--steel-400), var(--steel-100)); border-radius: inherit; }

.rail-account {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
  padding: 10px;
  border-radius: 12px;
  color: var(--steel-400);
  transition: background-color 0.2s, color 0.2s;
}
.rail-account:hover,
.rail-account[aria-current='page'] { background: var(--wash); color: var(--steel-100); }
.rail-account-text { display: grid; min-width: 0; flex: 1; line-height: 1.3; }
.rail-account-name { color: var(--steel-100); font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rail-account-sub { font-size: 12px; }
.rail-powered { padding-top: 10px; }

.avatar {
  display: inline-grid;
  place-items: center;
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 600;
  color: #10111a;
  background: linear-gradient(140deg, #f2f3f7, #a7abba 60%, #d9dce4);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8), 0 2px 8px rgba(0, 0, 0, 0.4);
}
.avatar--sm { width: 24px; height: 24px; font-size: 10px; }
.avatar--lg { width: 46px; height: 46px; font-size: 16px; }
.avatar--btn { width: 36px; height: 36px; }

.powered {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--hair);
  font-size: 12px;
  color: var(--steel-400);
  transition: border-color 0.2s, color 0.2s;
}
.powered:hover { border-color: var(--hair-strong); color: var(--steel-200); }
.powered-mark { width: 30px; height: auto; }

.topbar {
  display: none;
  position: fixed;
  top: calc(var(--inset) + 1px);
  left: calc(var(--inset) + 1px);
  right: calc(var(--inset) + 1px);
  z-index: 40;
  height: calc(var(--topbar-h) + var(--safe-t));
  padding: var(--safe-t) 14px 0 18px;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--hair);
  background: rgba(7, 7, 13, 0.86);
  backdrop-filter: blur(18px) saturate(120%);
  -webkit-backdrop-filter: blur(18px) saturate(120%);
}
.wordmark--topbar { width: 104px; }

.main {
  min-height: 100dvh;
  padding: calc(var(--inset) + 28px) clamp(24px, 3vw, 44px) calc(var(--inset) + 48px) calc(var(--inset) + var(--rail-w) + clamp(24px, 3vw, 44px));
}
.view { outline: none; max-width: 1200px; }

.demo-strip {
  max-width: 1200px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 6px 16px;
  margin-bottom: 22px;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px dashed rgba(168, 184, 224, 0.4);
  background: rgba(168, 184, 224, 0.06);
  font-size: 14px;
}
.demo-strip-text { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; color: var(--steel-300); }
.demo-strip-text strong { color: var(--steel-100); font-weight: 500; }
.demo-strip-text .icon { color: var(--signal); width: 16px; height: 16px; }
.demo-strip-actions { display: inline-flex; gap: 14px; }

.tabbar {
  display: none;
  position: fixed;
  left: calc(var(--inset) + 1px);
  right: calc(var(--inset) + 1px);
  bottom: calc(var(--inset) + 1px);
  z-index: 40;
  height: calc(var(--tabbar-h) + var(--safe-b));
  padding: 0 6px var(--safe-b);
  grid-template-columns: repeat(5, 1fr);
  align-items: center;
  border-top: 1px solid var(--hair);
  background: rgba(7, 7, 13, 0.78);
  backdrop-filter: blur(18px) saturate(120%);
  -webkit-backdrop-filter: blur(18px) saturate(120%);
}
.tab-link {
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 3px;
  height: 100%;
  font-size: 11px;
  color: var(--steel-400);
  transition: color 0.2s;
}
.tab-link .icon { width: 21px; height: 21px; }
.tab-link[aria-current='page'] { color: var(--steel-100); }
.tab-link[aria-current='page'] .icon { color: var(--signal); }
.tab-log {
  justify-self: center;
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  margin-top: -14px;
  border-radius: 50%;
  color: #0b0c12;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.6), rgba(255, 255, 255, 0) 50%),
    linear-gradient(110deg, #b9bdca 0%, #eef0f5 35%, #ffffff 45%, #d6d9e2 60%, #9fa3b3 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.85), inset 0 -1px 0 rgba(0, 0, 0, 0.3), 0 10px 24px rgba(0, 0, 0, 0.55), 0 0 0 6px rgba(7, 7, 13, 0.85);
}
.tab-log .icon { width: 24px; height: 24px; stroke-width: 2; }

/* ── Pages ────────────────────────────────────────────────────── */
.view-inner { animation: view-in 0.45s var(--ease); }
@keyframes view-in { from { opacity: 0; transform: translateY(6px); } }

.page { display: grid; gap: 22px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.page-title { font-size: clamp(1.6rem, 2.4vw, 2.15rem); font-weight: 500; letter-spacing: -0.025em; }
.page-sub { margin-top: 4px; color: var(--steel-400); font-size: 15px; }

.card {
  position: relative;
  min-width: 0;
  padding: clamp(16px, 1.8vw, 22px);
  border-radius: var(--radius-card);
  border: 1px solid var(--hair);
  background: var(--panel);
  backdrop-filter: blur(14px) saturate(115%);
  -webkit-backdrop-filter: blur(14px) saturate(115%);
}
.card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.card-title { font-size: 16px; font-weight: 500; letter-spacing: -0.005em; }
.card-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.empty { color: var(--steel-400); font-size: 14px; }
.empty-block {
  display: grid;
  justify-items: center;
  gap: 10px;
  padding: 48px 20px;
  text-align: center;
  color: var(--steel-400);
  border: 1px dashed var(--hair-strong);
  border-radius: var(--radius-card);
}
.empty-block .icon { width: 26px; height: 26px; color: var(--steel-500); }

.count-badge {
  display: inline-grid;
  place-items: center;
  min-width: 22px;
  height: 22px;
  padding: 0 7px;
  border-radius: 999px;
  font-family: var(--font-display);
  font-size: 12px;
  color: var(--steel-200);
  background: rgba(255, 255, 255, 0.07);
}

.group-head { display: grid; gap: 4px; margin-bottom: 12px; }
.group-head--row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.group-title { font-size: 17px; font-weight: 500; display: flex; align-items: center; gap: 10px; }

.skeleton {
  height: 104px;
  border-radius: var(--radius-card);
  background: linear-gradient(100deg, rgba(255, 255, 255, 0.03) 30%, rgba(255, 255, 255, 0.07) 50%, rgba(255, 255, 255, 0.03) 70%);
  background-size: 200% 100%;
  animation: shimmer 1.4s linear infinite;
  margin-bottom: 10px;
}
@keyframes shimmer { to { background-position: -200% 0; } }

/* rate colours, dots, bands */
.rate-base { --rate: var(--rate-base); }
.rate-mid { --rate: var(--rate-mid); }
.rate-high { --rate: var(--rate-high); }
.rate-premium { --rate: var(--rate-premium); }
.dot {
  display: inline-block;
  flex-shrink: 0;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--rate, var(--steel-400));
  box-shadow: 0 0 8px color-mix(in srgb, var(--rate, transparent) 60%, transparent);
}
.dot--hollow { background: transparent; border: 1px solid var(--steel-400); box-shadow: none; }

.band { display: flex; gap: 2px; width: 100%; height: 4px; border-radius: 4px; overflow: hidden; }
.band--lg { height: 6px; margin: 14px 0 4px; }
.band--row { width: 72px; height: 4px; }
.band--cell { margin-top: auto; height: 3px; }
.band-seg { min-width: 3px; background: var(--rate, var(--steel-500)); }
.band-seg.rate-none { background: rgba(255, 255, 255, 0.14); }

/* status pills */
.status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
  height: 24px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid var(--hair-strong);
  font-size: 12px;
  color: var(--steel-300);
  white-space: nowrap;
}
.status .icon { width: 13px; height: 13px; }
.status--assigned { color: #c9d3ef; border-color: rgba(168, 184, 224, 0.4); }
.status--in_progress { color: #0b0c12; background: var(--signal); border-color: var(--signal); }
.status--completed { color: var(--done); border-color: rgba(169, 203, 185, 0.38); }
.status--cancelled { color: var(--danger); border-color: rgba(232, 180, 180, 0.35); }

.role { display: inline-flex; align-items: center; height: 22px; padding: 0 9px; border-radius: 999px; font-size: 12px; border: 1px solid var(--hair-strong); color: var(--steel-300); width: fit-content; }
.role--admin { color: var(--signal); border-color: rgba(168, 184, 224, 0.4); }

.tag { display: inline-flex; align-items: center; height: 26px; padding: 0 10px; border-radius: 8px; background: rgba(255, 255, 255, 0.05); font-size: 13px; color: var(--steel-200); }

/* ── Home ─────────────────────────────────────────────────────── */
.home-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 16px;
  grid-auto-flow: dense;
}
.home-grid > .card { grid-column: span 12; }

.card-today .today-figure { font-size: clamp(30px, 3.2vw, 38px); color: var(--steel-100); font-weight: 500; line-height: 1.1; }
.today-empty { font-family: var(--font-display); font-size: 22px; color: var(--steel-100); line-height: 1.25; }
.today-sub { margin-top: 6px; color: var(--steel-400); font-size: 14px; }
.card-today { display: flex; flex-direction: column; }
.card-today .card-actions { margin-top: auto; padding-top: 18px; }
.today-last {
  display: grid;
  gap: 6px;
  width: 100%;
  margin-top: 18px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--hair);
  background: rgba(255, 255, 255, 0.02);
  transition: border-color 0.2s, background-color 0.2s;
}
.today-last:hover { border-color: var(--hair-strong); background: rgba(255, 255, 255, 0.04); }
.today-last-label { font-size: 12px; color: var(--steel-400); }
.today-last-row { display: flex; align-items: baseline; gap: 10px; font-size: 14px; color: var(--steel-100); }
.today-last-row strong { margin-left: auto; font-weight: 500; }
.today-lines { display: grid; margin-top: 14px; }
.today-line { display: grid; grid-template-columns: 10px minmax(0, 1fr) auto auto; align-items: center; gap: 10px; padding: 7px 0; font-size: 14px; }
.today-line + .today-line { border-top: 1px solid var(--hair); }
.today-line-name { color: var(--steel-200); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.today-line-dur { font-family: var(--font-display); font-variant-numeric: tabular-nums; color: var(--steel-400); font-size: 13px; }
.today-line-pay { font-family: var(--font-display); font-variant-numeric: tabular-nums; color: var(--steel-100); min-width: 64px; text-align: right; }

/* the signature: this period's pay, machined edge, light-catching figure */
.card-period {
  border: 1px solid transparent;
  background:
    linear-gradient(rgba(12, 13, 20, 0.74), rgba(12, 13, 20, 0.74)) padding-box,
    linear-gradient(135deg, rgba(255, 255, 255, 0.32), rgba(255, 255, 255, 0.05) 28%, rgba(168, 184, 224, 0.26) 58%, rgba(255, 255, 255, 0.05) 80%, rgba(255, 255, 255, 0.18)) border-box;
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}
.period-pay { font-family: var(--font-display); font-size: clamp(42px, 5.4vw, 64px); font-weight: 500; line-height: 1; letter-spacing: -0.035em; padding-bottom: 0.08em; }
.period-stats { display: flex; gap: clamp(18px, 3vw, 36px); margin: 14px 0 22px; }
.period-stats dt, .team-stats dt, .cal-stats dt, .kpi dt { font-size: 12px; color: var(--steel-400); }
.period-stats dd { font-size: 18px; color: var(--steel-100); }

.track { margin-bottom: 18px; }
.track-rail { position: relative; height: 6px; border-radius: 6px; background: rgba(255, 255, 255, 0.06); box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.6); }
.track-fill { position: absolute; inset: 0 auto 0 0; border-radius: inherit; background: linear-gradient(90deg, #6e7184, #c8c9d1 80%, #f1f2f6); }
.track-tick { position: absolute; top: -3px; width: 1px; height: 12px; background: rgba(255, 255, 255, 0.14); }
.track-cutoff { position: absolute; top: -6px; width: 2px; height: 18px; margin-left: -1px; border-radius: 2px; background: var(--signal); box-shadow: 0 0 10px rgba(168, 184, 224, 0.6); }
.track-today { position: absolute; top: 50%; width: 13px; height: 13px; border-radius: 50%; transform: translate(-50%, -50%); background: #fff; box-shadow: 0 0 0 3px rgba(168, 184, 224, 0.28), 0 0 14px rgba(168, 184, 224, 0.7); }
.track-pay { position: absolute; top: 50%; width: 9px; height: 9px; transform: translate(-50%, -50%) rotate(45deg); background: var(--signal); border-radius: 2px; }
.track-labels { display: flex; justify-content: space-between; gap: 8px; margin-top: 10px; font-size: 12px; color: var(--steel-400); }
.track-labels span:nth-child(2) { color: var(--signal); }

.card-period { display: flex; flex-direction: column; }
.period-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: auto; padding-top: 16px; border-top: 1px solid var(--hair); }
.period-next { display: grid; gap: 0; font-size: 13px; }
.period-next strong { font-size: 17px; color: var(--steel-100); font-weight: 500; }

.week-total { font-size: 15px; color: var(--steel-100); }
.week-total .muted { margin-left: 6px; }
.card-week { display: flex; flex-direction: column; }
.wk { flex: 1; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; }
.wk-day {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 10px 4px 8px;
  border-radius: 12px;
  transition: background-color 0.2s;
}
.wk-day:hover { background: var(--wash); }
.wk-bar { position: relative; flex: 1; width: 100%; max-width: 34px; min-height: 72px; max-height: 190px; border-radius: 8px; background: rgba(255, 255, 255, 0.035); overflow: hidden; box-shadow: inset 0 0 0 1px var(--hair); }
.wk-fill { position: absolute; left: 0; right: 0; bottom: 0; background: linear-gradient(180deg, #e8e9ed, #8e92a6); border-radius: 0 0 8px 8px; }
.wk-hours { font-size: 12px; color: var(--steel-200); min-height: 16px; white-space: nowrap; }
.wk-name { font-size: 12px; color: var(--steel-400); }
.wk-day.is-today .wk-bar { box-shadow: inset 0 0 0 1px rgba(168, 184, 224, 0.7), 0 0 14px rgba(168, 184, 224, 0.2); }
.wk-day.is-today .wk-name { color: var(--signal); }
.wk-day.is-future { opacity: 0.55; }

.mix { display: grid; gap: 10px; }
.mix-row { display: grid; grid-template-columns: minmax(118px, 1.25fr) minmax(48px, 1fr) auto auto; align-items: center; gap: 12px; font-size: 14px; }
.mix-name { color: var(--steel-200); line-height: 1.25; overflow-wrap: anywhere; }
.mix-bar { height: 6px; border-radius: 6px; background: rgba(255, 255, 255, 0.05); overflow: hidden; }
.mix-fill { display: block; height: 100%; border-radius: inherit; background: var(--rate, var(--steel-400)); }
.mix-fill.rate-none { background: repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.28) 0 4px, transparent 4px 7px); }
.mix-val { color: var(--steel-100); text-align: right; }
.mix-pay { color: var(--steel-400); text-align: right; min-width: 72px; }
.mix-more { margin-top: 12px; font-size: 13px; }

.rows { display: grid; }
.rows li + li { border-top: 1px solid var(--hair); }
.row {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 11px 6px;
  border-radius: 10px;
  transition: background-color 0.2s;
}
.row:hover { background: var(--wash); }
.row-main { display: grid; flex: 1; min-width: 0; }
.row-title { color: var(--steel-100); font-size: 15px; }
.row-sub { font-size: 13px; color: var(--steel-400); }
.row-figs { display: grid; justify-items: end; font-size: 13px; color: var(--steel-400); line-height: 1.35; }
.row-figs strong { color: var(--steel-100); font-weight: 500; font-size: 15px; }

.team-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.crew { display: grid; }
.crew-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto auto; align-items: center; gap: 12px; padding: 10px 0; font-size: 14px; }
.crew-row + .crew-row { border-top: 1px solid var(--hair); }
.crew-name { color: var(--steel-100); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.crew-hours { color: var(--steel-300); }
.crew-pay { color: var(--steel-100); font-weight: 500; min-width: 70px; text-align: right; }
.crew-missing { grid-column: 3 / -1; justify-self: end; color: var(--steel-500); font-size: 13px; }
.crew-row.is-missing .avatar { opacity: 0.5; }
.today-job { display: flex; align-items: center; gap: 12px; padding: 10px 0; }
.rows .today-job + .today-job, .rows li + li.today-job { border-top: 1px solid var(--hair); }
.today-job-main { display: grid; flex: 1; min-width: 0; }
.team-stats dd { font-size: 20px; color: var(--steel-100); }

.jobcards { display: grid; gap: 10px; }

/* ── Job cards (worker) ───────────────────────────────────────── */
.jobcard {
  display: grid;
  gap: 8px;
  padding: 16px;
  border-radius: 14px;
  border: 1px solid var(--hair);
  background: rgba(255, 255, 255, 0.02);
}
.page-jobs .jobcard { background: var(--panel); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
.jobcard[data-status='in_progress'] { border-color: rgba(168, 184, 224, 0.45); box-shadow: inset 3px 0 0 var(--signal); }
.jobcard[data-status='completed'] { opacity: 0.7; }
.jobcard-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.jobcard-title { font-size: 16px; font-weight: 500; }
.jobcard-address { display: inline-flex; align-items: flex-start; gap: 6px; width: fit-content; color: var(--steel-200); font-size: 14px; }
.jobcard-address .icon { width: 15px; height: 15px; margin-top: 3px; color: var(--signal); }
.jobcard-address:hover span { text-decoration: underline; text-underline-offset: 3px; text-decoration-color: rgba(168, 184, 224, 0.5); }
.jobcard-meta { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 13px; color: var(--steel-400); }
.jobcard-notes { font-size: 14px; color: var(--steel-300); padding-left: 10px; border-left: 2px solid var(--hair-strong); }
.jobcard-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }

.jobs-group + .jobs-group { margin-top: 18px; }

/* ── Calendar ─────────────────────────────────────────────────── */
.cal-head {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 16px 28px;
}
.cal-nav { display: flex; align-items: center; gap: 8px; }
.cal-title { min-width: 0; }
.cal-stats { display: flex; gap: clamp(16px, 2.6vw, 34px); justify-self: center; }
.cal-stats dd { font-size: 19px; color: var(--steel-100); }
.cal-actions { display: flex; gap: 8px; justify-self: end; }

.cal {
  display: grid;
  gap: 6px;
  padding: clamp(10px, 1.4vw, 16px);
  border-radius: var(--radius-card);
  border: 1px solid var(--hair);
  background: var(--panel);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}
.cal-row { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)) minmax(84px, 0.9fr); gap: 6px; }
.cal-dow { padding: 2px 8px 6px; font-size: 12px; color: var(--steel-400); }
.cal-dow--week { text-align: right; }
.dow-short { display: none; }

.cal-cell {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  min-width: 0;
  min-height: clamp(70px, 8vw, 104px);
  padding: 8px 9px 8px;
  border-radius: 12px;
  border: 1px solid var(--hair);
  background: rgba(255, 255, 255, 0.022);
  text-align: left;
  transition: background-color 0.2s, border-color 0.2s, transform 0.25s var(--ease);
}
button.cal-cell:hover { background: rgba(255, 255, 255, 0.05); border-color: var(--hair-strong); }
.cal-cell--pad { border-color: transparent; background: transparent; }
.cal-cell.has-shift { background: rgba(255, 255, 255, 0.045); border-color: rgba(232, 233, 237, 0.12); }
.cal-cell.is-future:not(.has-shift):not(.is-payday) { background: rgba(255, 255, 255, 0.01); }
.cal-cell.is-today { border-color: rgba(168, 184, 224, 0.75); box-shadow: 0 0 0 1px rgba(168, 184, 224, 0.35), 0 0 22px rgba(168, 184, 224, 0.12); }
.cal-cell.is-cutoff { box-shadow: inset -2px 0 0 var(--signal); }
.cal-cell.is-today.is-cutoff { box-shadow: inset -2px 0 0 var(--signal), 0 0 0 1px rgba(168, 184, 224, 0.35); }
.cal-cell.is-payday { border-style: dashed; border-color: rgba(168, 184, 224, 0.5); background: rgba(168, 184, 224, 0.05); }

.cal-num { font-family: var(--font-display); font-size: 14px; color: var(--steel-300); line-height: 1.2; }
.is-today .cal-num { color: var(--steel-100); font-weight: 600; }
.cal-hours { font-size: 13px; color: var(--steel-100); margin-top: auto; line-height: 1.2; white-space: nowrap; }
.cal-pay { font-size: 12px; color: var(--steel-300); white-space: nowrap; line-height: 1.3; }
.cal-add { margin: auto; font-size: 20px; color: var(--steel-500); opacity: 0; transition: opacity 0.2s; }
button.cal-cell:hover .cal-add, button.cal-cell:focus-visible .cal-add { opacity: 1; }
.cal-cutoff, .cal-flag { position: absolute; top: 8px; right: 8px; font-size: 10px; color: var(--signal); line-height: 1.2; }
.cal-flag { position: static; margin-top: auto; font-size: 11px; }
.cal-cell.has-shift .band { margin-top: 6px; }

.cal-week {
  display: grid;
  align-content: center;
  justify-items: end;
  gap: 1px;
  padding: 6px 8px;
  border-radius: 12px;
  font-size: 13px;
  color: var(--steel-100);
  background: rgba(255, 255, 255, 0.015);
}
.cal-week .muted { font-size: 12px; }

.cal-legend { display: flex; flex-wrap: wrap; gap: 8px 20px; font-size: 13px; color: var(--steel-400); }
.cal-legend li { display: inline-flex; align-items: center; gap: 8px; }
.legend-swatch { width: 14px; height: 14px; border-radius: 4px; border: 1px solid var(--hair-strong); }
.legend-swatch--today { border-color: rgba(168, 184, 224, 0.75); box-shadow: 0 0 8px rgba(168, 184, 224, 0.3); }
.legend-swatch--cutoff { box-shadow: inset -2px 0 0 var(--signal); }
.legend-swatch--payday { border-style: dashed; border-color: rgba(168, 184, 224, 0.6); }

/* Calendar view: fill the available screen (width + height), responsive */
.main:has(.page-calendar) {
  display: flex;
  flex-direction: column;
  height: 100dvh;
  overflow: hidden;
}
.main:has(.page-calendar) .demo-strip { flex-shrink: 0; }
.main:has(.page-calendar) .view {
  max-width: none;
  width: 100%;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.main:has(.page-calendar) .view-inner.view-calendar {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.page-calendar {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-rows: auto 1fr auto;
}
.page-calendar .cal {
  min-height: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
}
.page-calendar .cal-row--head { flex: 0 0 auto; }
.page-calendar .cal-row:not(.cal-row--head) {
  flex: 1 1 0;
  min-height: 0;
}
.page-calendar .cal-cell,
.page-calendar .cal-week {
  height: 100%;
  min-height: 0;
}

/* ── Export ───────────────────────────────────────────────────── */
.export-grid { display: grid; grid-template-columns: minmax(300px, 0.8fr) minmax(0, 1.2fr); gap: 16px; align-items: start; }
.export-controls { display: grid; gap: 20px; }
.range-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.export-summary { min-height: 22px; color: var(--steel-200); font-size: 15px; }
.export-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.report {
  max-height: min(64vh, 720px);
  overflow: auto;
  padding: 16px 18px;
  border-radius: 12px;
  border: 1px solid var(--hair);
  background: rgba(4, 4, 8, 0.6);
  font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  font-size: 13px;
  line-height: 1.6;
  color: var(--steel-200);
  white-space: pre;
  tab-size: 2;
}

/* ── Settings ─────────────────────────────────────────────────── */
.settings-layout { display: grid; gap: 16px; max-width: 760px; }
.settings-card .card-title { margin-bottom: 6px; font-size: 18px; }
.settings-card .form { margin-top: 16px; max-width: 460px; }
.settings-card .chips { margin-top: 16px; }
.rate-bands { display: grid; margin-top: 16px; }
.rate-band { display: grid; grid-template-columns: 120px 1fr; gap: 14px; padding: 14px 0; border-top: 1px solid var(--hair); align-items: start; }
.rate-band-price { display: inline-flex; align-items: center; gap: 10px; color: var(--steel-100); font-size: 17px; }
.rate-band-jobs { display: flex; flex-wrap: wrap; gap: 6px; }
.settings-meta { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.sync-line { display: inline-flex; align-items: center; gap: 10px; color: var(--steel-300); font-size: 14px; }
.sync-line .icon { color: var(--signal); }
.settings-meta-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ── Admin ────────────────────────────────────────────────────── */
.admin-body { display: grid; gap: 18px; min-width: 0; }
.admin-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px 18px; flex-wrap: wrap; }
.jobs-filters { display: flex; align-items: center; justify-content: space-between; gap: 12px 18px; flex-wrap: wrap; }
.toolbar-hint { flex: 1; min-width: 220px; font-size: 14px; }
.range-nav { display: flex; align-items: center; gap: 6px; }
.range-copy { text-align: center; min-width: 160px; }
.range-label { color: var(--steel-100); font-size: 16px; }
.range-sub { font-size: 12px; color: var(--steel-400); }

.kpis {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  border-radius: var(--radius-card);
  border: 1px solid var(--hair);
  background: var(--panel);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}
.kpi { padding: 16px 18px; }
.kpi + .kpi { border-left: 1px solid var(--hair); }
.kpi dd { font-size: clamp(20px, 2vw, 26px); color: var(--steel-100); margin-top: 2px; }

.members {
  border-radius: var(--radius-card);
  border: 1px solid var(--hair);
  background: var(--panel);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  overflow: hidden;
}
.member + .member { border-top: 1px solid var(--hair); }
.member-row {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(0, 2.4fr) 24px;
  align-items: center;
  gap: 16px;
  width: 100%;
  padding: 13px 18px;
  transition: background-color 0.2s;
}
.member-row:hover { background: var(--wash); }
.member-who { display: flex; align-items: center; gap: 10px; min-width: 0; }
.member-name { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; color: var(--steel-100); font-size: 15px; }
.member-figs { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; font-size: 14px; color: var(--steel-100); }
.member-figs span { display: grid; }
.member-figs em { font-style: normal; font-family: var(--font-body); font-size: 11px; color: var(--steel-400); }
.member-chev { color: var(--steel-400); transition: transform 0.3s var(--ease); }
.member.is-open .member-chev { transform: rotate(180deg); }
.member-detail { display: grid; gap: 12px; padding: 4px 18px 18px; }
.member-shift { padding: 14px; border-radius: 12px; background: rgba(255, 255, 255, 0.025); border: 1px solid var(--hair); }
.member-shift-head { display: flex; gap: 12px; align-items: baseline; margin-bottom: 6px; }
.member-shift-head strong { color: var(--steel-100); font-weight: 500; }
.member-note { display: flex; gap: 8px; margin-top: 10px; font-size: 13px; color: var(--steel-300); }
.member-note .icon { width: 15px; height: 15px; margin-top: 2px; }

.wos {
  border-radius: var(--radius-card);
  border: 1px solid var(--hair);
  background: var(--panel);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  overflow: hidden;
  margin-top: 12px;
}
.wo { display: flex; align-items: center; gap: 16px; padding: 14px 18px; }
.wo + .wo { border-top: 1px solid var(--hair); }
.wo-main { flex: 1; min-width: 0; display: grid; gap: 4px; }
.wo-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.wo-title { font-size: 15px; font-weight: 500; }
.wo-address { display: inline-flex; gap: 6px; align-items: flex-start; width: fit-content; font-size: 14px; color: var(--steel-200); }
.wo-address .icon { width: 14px; height: 14px; margin-top: 3px; color: var(--signal); }
.wo-meta { display: flex; flex-wrap: wrap; gap: 2px 14px; font-size: 13px; color: var(--steel-400); }
.wo-notes { font-size: 13px; color: var(--steel-300); }
.wo-actions { display: flex; gap: 8px; flex-shrink: 0; }

.board {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(260px, 300px);
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 8px;
  scroll-snap-type: x proximity;
}
.team {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 14px;
  border-radius: var(--radius-card);
  border: 1px solid var(--hair);
  background: var(--panel);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  scroll-snap-align: start;
  min-height: 320px;
}
.team--pool { border-style: dashed; border-color: var(--hair-strong); background: rgba(12, 13, 20, 0.5); }
.team-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.team-name { font-size: 16px; font-weight: 500; }
.team-label { margin-top: 6px; font-size: 12px; color: var(--steel-400); }
.team-drop {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-height: 48px;
  padding: 6px;
  border-radius: 12px;
  border: 1px dashed transparent;
  transition: border-color 0.2s, background-color 0.2s;
}
.team-drop--jobs { flex-direction: column; flex-wrap: nowrap; flex: 1; }
.is-drop { border-color: rgba(168, 184, 224, 0.6) !important; background: rgba(168, 184, 224, 0.07); }
.drop-hint { margin: auto; font-size: 13px; color: var(--steel-500); text-align: center; }

.chip-worker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 0 12px 0 6px;
  border-radius: 999px;
  border: 1px solid var(--hair-strong);
  background: rgba(255, 255, 255, 0.04);
  font-size: 14px;
  color: var(--steel-100);
  cursor: grab;
  transition: border-color 0.2s, background-color 0.2s, opacity 0.2s;
}
.chip-job {
  display: grid;
  gap: 2px;
  width: 100%;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--hair-strong);
  background: rgba(255, 255, 255, 0.035);
  text-align: left;
  cursor: grab;
  transition: border-color 0.2s, background-color 0.2s, opacity 0.2s;
}
.chip-worker:hover, .chip-job:hover { border-color: rgba(232, 233, 237, 0.3); }
.chip-worker.is-selected, .chip-job.is-selected { border-color: var(--signal); background: rgba(168, 184, 224, 0.14); box-shadow: 0 0 0 3px rgba(168, 184, 224, 0.15); }
.is-dragging { opacity: 0.4; }
.chip-job-title { font-family: var(--font-display); font-size: 14px; color: var(--steel-100); }
.chip-job-addr { font-size: 12px; color: var(--steel-300); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chip-job-meta { font-size: 12px; color: var(--steel-400); }
.team-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.route-result { margin-top: 6px; padding: 10px 12px; border-radius: 12px; background: rgba(255, 255, 255, 0.025); font-size: 13px; }
.route-result ol { list-style: decimal; padding-left: 18px; display: grid; gap: 6px; margin-top: 6px; }
.route-result li span { display: block; color: var(--steel-400); }

.rate-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.rate-col { padding: 16px; border-radius: var(--radius-card); border: 1px solid var(--hair); background: var(--panel); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
.rate-col-head { display: flex; align-items: center; gap: 10px; font-size: 20px; color: var(--steel-100); margin-bottom: 10px; }
.rate-jobs li { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 36px; border-top: 1px solid var(--hair); font-size: 14px; }

/* ── Sheet ────────────────────────────────────────────────────── */
.sheet-layer { position: fixed; inset: 0; z-index: 55; }
.sheet-scrim {
  position: absolute;
  inset: 0;
  background: rgba(4, 4, 8, 0.62);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  opacity: 0;
  transition: opacity 0.35s var(--ease);
}
.sheet {
  position: absolute;
  top: calc(var(--inset) + 1px);
  right: calc(var(--inset) + 1px);
  bottom: calc(var(--inset) + 1px);
  width: min(500px, calc(100vw - 2 * var(--inset) - 2px));
  display: flex;
  flex-direction: column;
  border-left: 1px solid var(--hair-strong);
  background: var(--panel-solid);
  box-shadow: -30px 0 80px rgba(0, 0, 0, 0.5);
  transform: translateX(105%);
  transition: transform 0.5s var(--ease);
  outline: none;
}
.sheet--wide { width: min(640px, calc(100vw - 2 * var(--inset) - 2px)); }
.sheet-layer.is-open .sheet-scrim { opacity: 1; }
.sheet-layer.is-open .sheet { transform: none; }
.sheet-head { display: flex; align-items: flex-start; gap: 12px; padding: 20px 18px 14px 24px; border-bottom: 1px solid var(--hair); }
.sheet-grabber { display: none; }
.sheet-titles { flex: 1; min-width: 0; }
.sheet-title { font-size: 20px; font-weight: 500; }
.sheet-sub { margin-top: 2px; color: var(--steel-400); font-size: 14px; }
.sheet-body { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 18px 24px 24px; }
.sheet-foot { display: flex; align-items: center; gap: 8px; padding: 14px 24px calc(14px + var(--safe-b)); border-top: 1px solid var(--hair); flex-wrap: wrap; }

/* day view + ledger */
.dayview .band--lg { margin-top: 0; margin-bottom: 18px; }
.dayview .sf-title { margin-bottom: 6px; }
.ledger { display: grid; }
.ledger-row, .ledger-total {
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr) auto 84px;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  font-size: 14px;
}
.ledger-row + .ledger-row { border-top: 1px solid var(--hair); }
.ledger-name { color: var(--steel-100); min-width: 0; }
.ledger-x { color: var(--steel-300); font-family: var(--font-display); }
.ledger-meta { color: var(--steel-400); font-family: var(--font-display); font-variant-numeric: tabular-nums; }
.ledger-site { display: inline-block; margin-left: 4px; padding: 0 7px; border-radius: 6px; background: rgba(255, 255, 255, 0.06); font-size: 12px; color: var(--steel-300); }
.ledger-dur { font-family: var(--font-display); font-variant-numeric: tabular-nums; color: var(--steel-300); }
.ledger-pay { font-family: var(--font-display); font-variant-numeric: tabular-nums; color: var(--steel-100); text-align: right; }
.ledger-row--additional .ledger-name { color: var(--steel-300); }
.ledger-total { grid-template-columns: minmax(0, 1fr) auto 84px; border-top: 1px solid var(--hair-strong); margin-top: 2px; padding-top: 12px; }
.ledger-total > span:first-child { font-family: var(--font-display); color: var(--steel-100); font-size: 15px; }
.ledger-total .ledger-pay { font-size: 18px; }
.dayview-note { display: flex; gap: 10px; margin-top: 18px; padding: 12px 14px; border-radius: 12px; background: rgba(255, 255, 255, 0.03); border: 1px solid var(--hair); color: var(--steel-200); font-size: 14px; }
.dayview-note .icon { width: 16px; height: 16px; margin-top: 2px; color: var(--steel-400); }

/* ── Shift form ───────────────────────────────────────────────── */
.sheet-body:has(> .shiftform) { display: flex; flex-direction: column; }
.shiftform { display: flex; flex-direction: column; gap: 22px; flex: 1; }
.sf-block { display: grid; gap: 12px; }
.sf-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.sf-title { font-size: 14px; font-weight: 500; color: var(--steel-200); font-family: var(--font-display); display: flex; align-items: center; gap: 8px; }
.sf-when-row { display: grid; grid-template-columns: minmax(150px, 1.1fr) minmax(0, 1fr) minmax(0, 1fr); gap: 12px; align-items: end; }
.sf-copy-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.sf-copied { font-size: 13px; }

.timefield { display: grid; gap: 6px; min-width: 0; }
.timefield-label { font-size: 13px; color: var(--steel-400); }
.timefield-dials {
  display: flex;
  align-items: center;
  min-height: 44px;
  border-radius: var(--radius-ctl);
  border: 1px solid var(--hair-strong);
  background: rgba(7, 7, 13, 0.55);
  padding: 0 4px;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.timefield-dials:focus-within { border-color: rgba(168, 184, 224, 0.7); box-shadow: 0 0 0 3px rgba(168, 184, 224, 0.15); }
.timefield select {
  flex: 1;
  min-width: 0;
  min-height: 40px;
  appearance: none;
  border: 0;
  background: transparent;
  text-align: center;
  text-align-last: center;
  font-family: var(--font-display);
  font-size: 18px;
  font-variant-numeric: tabular-nums;
  color: var(--steel-100);
  border-radius: 8px;
  cursor: pointer;
}
.timefield select:focus { outline: none; background: rgba(168, 184, 224, 0.1); }
.timefield select option { background: #12131b; color: var(--steel-100); }
.timefield-colon { color: var(--steel-500); font-family: var(--font-display); font-size: 18px; }

.alloc { display: grid; gap: 8px; }
.alloc-track { height: 6px; border-radius: 6px; background: repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.12) 0 4px, rgba(255, 255, 255, 0.04) 4px 7px); overflow: hidden; }
.alloc-jobs { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #8e92a6, #e8e9ed); transition: width 0.4s var(--ease); }
.alloc.is-over .alloc-jobs { background: linear-gradient(90deg, #c98d8d, var(--danger)); }
.alloc-text { display: flex; flex-wrap: wrap; gap: 4px 18px; font-size: 13px; color: var(--steel-400); }
.alloc-text strong { font-family: var(--font-display); font-variant-numeric: tabular-nums; font-weight: 500; color: var(--steel-100); margin-left: 4px; }

.pills { display: flex; flex-wrap: wrap; gap: 8px; }
.pills-empty { font-size: 14px; color: var(--steel-500); padding: 10px 0; }
.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 0 4px 0 12px;
  border-radius: 999px;
  border: 1px solid var(--hair-strong);
  background: rgba(255, 255, 255, 0.04);
  font-size: 14px;
  color: var(--steel-100);
  animation: pill-in 0.35s var(--ease);
}
@keyframes pill-in { from { transform: scale(0.94); opacity: 0; } }
.pill-time { font-family: var(--font-display); font-variant-numeric: tabular-nums; color: var(--steel-300); }
.pill-site { padding: 1px 7px; border-radius: 6px; background: rgba(255, 255, 255, 0.07); font-size: 12px; color: var(--steel-300); }
.pill-x { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; color: var(--steel-400); }
.pill-x:hover { background: rgba(255, 255, 255, 0.08); color: var(--steel-100); }
.pill-x .icon { width: 15px; height: 15px; }
.stepper { display: inline-flex; align-items: center; gap: 2px; padding: 2px; border-radius: 999px; background: rgba(7, 7, 13, 0.6); }
.stepper-btn { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; font-size: 17px; line-height: 1; color: var(--steel-200); }
.stepper-btn:hover { background: rgba(255, 255, 255, 0.1); color: var(--steel-100); }
.stepper-n { min-width: 18px; text-align: center; font-family: var(--font-display); font-variant-numeric: tabular-nums; }

.jobkeys { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 8px; }
.jobkey {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  grid-template-rows: auto auto;
  column-gap: 10px;
  align-items: center;
  min-height: 54px;
  padding: 8px 12px;
  border-radius: 12px;
  border: 1px solid var(--hair);
  background: rgba(255, 255, 255, 0.03);
  transition: border-color 0.2s, background-color 0.2s, transform 0.2s var(--ease);
}
.jobkey:hover { border-color: var(--hair-strong); background: rgba(255, 255, 255, 0.06); }
.jobkey:active { transform: scale(0.98); }
.jobkey .dot { grid-row: span 2; }
.jobkey-label { min-width: 0; font-size: 14px; line-height: 1.3; color: var(--steel-100); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.jobkey-rate { display: inline-flex; align-items: center; gap: 4px; font-family: var(--font-display); font-size: 12px; line-height: 1.3; color: var(--steel-400); font-variant-numeric: tabular-nums; }
.jobkey-clock .icon { width: 13px; height: 13px; }
.jobkey.is-flash { animation: flash 0.5s var(--ease); }
@keyframes flash { 0% { background: rgba(168, 184, 224, 0.28); border-color: var(--signal); } }

.sf-site { display: grid; gap: 6px; }
.composer { display: grid; gap: 12px; padding: 14px; border-radius: 14px; border: 1px solid rgba(168, 184, 224, 0.35); background: rgba(168, 184, 224, 0.05); }
.composer-head { display: flex; align-items: center; gap: 6px; }
.composer-label { font-size: 14px; color: var(--steel-300); }
.composer-label strong { color: var(--steel-100); font-weight: 500; }
.composer-row { display: grid; grid-template-columns: 1fr 1fr auto; gap: 12px; align-items: end; }

.sf-notes { justify-items: start; }
.sf-notes .field { width: 100%; }

.sf-foot {
  position: sticky;
  margin-top: auto;
  bottom: -24px;
  margin: auto -24px -24px;
  padding: 14px 24px calc(14px + var(--safe-b));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-top: 1px solid var(--hair);
  background: rgba(10, 11, 17, 0.97);
}
.sf-total { display: grid; line-height: 1.15; min-height: 40px; }
.sf-total-pay { font-family: var(--font-display); font-variant-numeric: tabular-nums; font-size: 26px; color: var(--steel-100); font-weight: 500; letter-spacing: -0.02em; }
.sf-total-sub { font-size: 13px; color: var(--steel-400); }
.sf-actions { display: flex; gap: 8px; }

/* more sheet */
.more-account { display: flex; align-items: center; gap: 14px; padding: 4px 0 16px; border-bottom: 1px solid var(--hair); }
.more-account > span:last-child { display: grid; line-height: 1.35; min-width: 0; }
.more-account strong { color: var(--steel-100); font-weight: 500; }
.more-list { display: grid; padding: 8px 0; }
.more-link { display: flex; align-items: center; gap: 14px; min-height: 52px; padding: 0 4px; font-size: 16px; color: var(--steel-100); border-radius: 10px; }
.more-link > .icon:last-child { margin-left: auto; color: var(--steel-500); }
.more-link + .more-link { border-top: 1px solid var(--hair); }
.more-foot { padding-top: 12px; }

/* ── Toasts, loading, confirm ─────────────────────────────────── */
.toasts {
  position: fixed;
  top: calc(var(--inset) + 16px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 70;
  display: grid;
  gap: 8px;
  justify-items: center;
  width: max-content;
  max-width: calc(100vw - 2 * var(--inset) - 32px);
  pointer-events: none;
}
.toast {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  max-width: min(420px, calc(100vw - 48px));
  padding: 12px 16px;
  border-radius: 12px;
  border: 1px solid var(--hair-strong);
  background: rgba(16, 17, 25, 0.96);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5);
  font-size: 14px;
  color: var(--steel-100);
  pointer-events: auto;
  cursor: pointer;
  animation: toast-in 0.4s var(--ease);
}
.toast .icon { width: 16px; height: 16px; }
.toast--success .toast-icon { color: var(--done); }
.toast--error { border-color: rgba(232, 180, 180, 0.4); }
.toast--error .toast-icon { color: var(--danger); }
.toast.is-leaving { opacity: 0; transform: translateY(-6px); transition: opacity 0.2s, transform 0.2s; }
@keyframes toast-in { from { opacity: 0; transform: translateY(-10px); } }

.loadbar {
  position: fixed;
  top: calc(var(--inset) + 1px);
  left: calc(var(--inset) + var(--radius-frame));
  right: calc(var(--inset) + var(--radius-frame));
  height: 2px;
  z-index: 75;
  overflow: hidden;
  opacity: 0;
  transition: opacity 0.2s;
  pointer-events: none;
}
.loadbar::after {
  content: '';
  position: absolute;
  inset: 0;
  width: 40%;
  background: linear-gradient(90deg, transparent, var(--signal), transparent);
  animation: loadbar 1.1s var(--ease-io) infinite;
}
.loadbar.is-active { opacity: 1; }
@keyframes loadbar { from { transform: translateX(-100%); } to { transform: translateX(250%); } }

.loader {
  position: fixed;
  inset: calc(var(--inset) + 1px);
  z-index: 74;
  display: grid;
  place-items: center;
  background: rgba(4, 4, 8, 0.45);
  border-radius: var(--radius-frame);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s, visibility 0.25s;
}
.loader.is-visible { opacity: 1; visibility: visible; }
.loader-card { display: flex; align-items: center; gap: 12px; padding: 14px 20px; border-radius: 14px; border: 1px solid var(--hair-strong); background: rgba(16, 17, 25, 0.96); }
.loader-ring { width: 18px; height: 18px; border-radius: 50%; border: 2px solid rgba(168, 184, 224, 0.25); border-top-color: var(--signal); animation: spin 0.8s linear infinite; }
.loader-label { font-size: 14px; color: var(--steel-100); }

.confirm {
  margin: auto;
  width: min(420px, calc(100vw - 40px));
  padding: 0;
  border: 1px solid var(--hair-strong);
  border-radius: 18px;
  background: rgba(14, 15, 22, 0.98);
  color: var(--steel-200);
  box-shadow: 0 40px 100px rgba(0, 0, 0, 0.6);
}
.confirm::backdrop { background: rgba(4, 4, 8, 0.7); backdrop-filter: blur(4px); }
.confirm[open] { animation: confirm-in 0.3s var(--ease); }
@keyframes confirm-in { from { opacity: 0; transform: translateY(8px) scale(0.98); } }
.confirm-body { display: grid; gap: 10px; padding: 22px; }
.confirm-title { font-size: 19px; }
.confirm-text { color: var(--steel-300); font-size: 15px; }
.confirm-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 10px; }

/* ── Auth ─────────────────────────────────────────────────────── */
.auth {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 18px;
  padding: calc(var(--inset) + 32px) 20px calc(var(--inset) + 28px);
  outline: none;
}
.auth-card {
  width: min(440px, 100%);
  display: grid;
  gap: 16px;
  padding: clamp(24px, 4vw, 36px);
  border-radius: 22px;
  border: 1px solid transparent;
  background:
    linear-gradient(rgba(12, 13, 20, 0.78), rgba(12, 13, 20, 0.78)) padding-box,
    linear-gradient(135deg, rgba(255, 255, 255, 0.28), rgba(255, 255, 255, 0.04) 30%, rgba(168, 184, 224, 0.22) 60%, rgba(255, 255, 255, 0.06)) border-box;
  backdrop-filter: blur(18px) saturate(115%);
  -webkit-backdrop-filter: blur(18px) saturate(115%);
  box-shadow: 0 40px 100px rgba(0, 0, 0, 0.45);
}
.auth-card--boot { min-height: 180px; place-items: center; }
.auth-brand { display: grid; place-items: center; padding: 4px 0 6px; }
.wordmark--auth { width: min(220px, 60vw); filter: drop-shadow(0 6px 18px rgba(0, 0, 0, 0.45)); }
.auth-title { font-size: 24px; text-align: center; }
.auth-lead { text-align: center; color: var(--steel-400); font-size: 15px; margin-top: -6px; }
.auth-card .form { gap: 14px; }
.auth-foot { display: grid; justify-items: center; gap: 12px; padding-top: 14px; border-top: 1px solid var(--hair); }
.auth-powered { width: min(440px, 100%); display: flex; justify-content: center; }

.demo-tag { justify-self: center; display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px; border-radius: 999px; border: 1px dashed rgba(168, 184, 224, 0.45); font-size: 13px; color: var(--signal); }
.demo-tag .icon { width: 14px; height: 14px; }
.demo-choices { display: grid; gap: 10px; }
.demo-choice {
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: auto auto;
  column-gap: 14px;
  align-items: center;
  padding: 16px;
  border-radius: 16px;
  border: 1px solid var(--hair-strong);
  background: rgba(255, 255, 255, 0.03);
  transition: border-color 0.25s, background-color 0.25s, transform 0.3s var(--ease);
}
.demo-choice:hover { border-color: rgba(168, 184, 224, 0.55); background: rgba(168, 184, 224, 0.07); transform: translateY(-1px); }
.demo-choice-icon { grid-row: span 2; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; background: rgba(168, 184, 224, 0.12); color: var(--signal); }
.demo-choice-text { display: grid; line-height: 1.35; }
.demo-choice-text strong { font-family: var(--font-display); font-weight: 500; color: var(--steel-100); font-size: 16px; }
.demo-choice-text span { font-size: 13px; color: var(--steel-400); }
.demo-choice-who { grid-column: 2; font-size: 12px; color: var(--steel-500); margin-top: 4px; }
.demo-choice.is-busy { justify-content: center; }

/* ── Responsive ───────────────────────────────────────────────── */
@media (min-width: 1100px) {
  .home-grid > .card-crew { grid-column: span 7; }
  .home-grid > .card-jobs-today { grid-column: span 5; }
  .home-grid > .card-today { grid-column: span 5; }
  .home-grid > .card-period { grid-column: span 7; }
  .home-grid > .card-week { grid-column: span 7; }
  .home-grid > .card-mix { grid-column: span 5; }
  .home-grid > .card-jobs { grid-column: span 7; }
  .home-grid > .card-recent { grid-column: span 5; }
}
@media (min-width: 760px) and (max-width: 1099px) {
  .home-grid > .card-today, .home-grid > .card-period { grid-column: span 6; }
}

@media (max-width: 1180px) {
  .cal-head { grid-template-columns: 1fr auto; }
  .cal-stats { grid-column: 1 / -1; grid-row: 2; justify-self: start; }
}

@media (max-width: 1023px) {
  .rail { display: none; }
  .topbar { display: flex; }
  .tabbar { display: grid; }
  .main {
    padding: calc(var(--inset) + var(--topbar-h) + var(--safe-t) + 20px) clamp(16px, 4vw, 28px) calc(var(--inset) + var(--tabbar-h) + var(--safe-b) + 28px);
  }
  .view, .demo-strip { margin: 0 auto; }
  .demo-strip { margin-bottom: 18px; }
  .toasts { top: calc(var(--inset) + var(--topbar-h) + var(--safe-t) + 10px); }
  .export-grid { grid-template-columns: 1fr; }
  .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .kpi:nth-child(4) { border-left: 0; }
  .kpi:nth-child(n + 4) { border-top: 1px solid var(--hair); }
  .member-row { grid-template-columns: minmax(0, 1fr) 24px; }
  .member-figs { grid-column: 1 / -1; grid-row: 2; }
  .member-chev { grid-row: 1; grid-column: 2; }
}

@media (max-width: 759px) {
  .page { gap: 18px; }
  .demo-strip { padding: 8px 12px; flex-wrap: nowrap; }
  .demo-strip-note { display: none; }
  .demo-strip-actions { gap: 12px; flex-shrink: 0; }
  .form-grid { grid-template-columns: 1fr 1fr; }
  .form-grid .span-2 { grid-column: 1 / -1; }
  .team-stats { grid-template-columns: 1fr 1fr; }
  .crew-row { grid-template-columns: auto minmax(0, 1fr) auto auto; }
  .crew-time { display: none; }
  .cal-head { grid-template-columns: 1fr; }
  .cal-nav { justify-content: space-between; }
  .cal-title { text-align: center; }
  .cal-stats { grid-row: auto; justify-self: stretch; justify-content: space-between; padding: 12px 16px; border-radius: 14px; border: 1px solid var(--hair); background: var(--panel); }
  .cal-actions { justify-self: stretch; }
  .cal-actions .btn { flex: 1; }
  .cal { padding: 8px; gap: 4px; }
  .cal-row { grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
  .cal-dow--week, .cal-week { display: none; }
  .dow-full { display: none; }
  .dow-short { display: inline; }
  .cal-dow { padding: 2px 0 4px; text-align: center; }
  .cal-cell { min-height: 62px; padding: 6px 5px; border-radius: 10px; align-items: center; }
  .page-calendar .cal-cell { min-height: 0; }
  .cal-num { font-size: 13px; }
  .cal-hours { display: none; }
  .cal-pay { margin-top: auto; font-size: 10.5px; letter-spacing: -0.02em; color: var(--steel-100); }
  .cal-flag { font-size: 9.5px; }
  .cal-cutoff { display: none; }
  .cal-add { font-size: 16px; }
  .cal-cell.has-shift .band { margin-top: 4px; }
  .wo { flex-direction: column; align-items: stretch; }
  .wo-actions .btn { flex: 1; }
  .kpis { grid-template-columns: 1fr 1fr; }
  .kpi:nth-child(odd) { border-left: 0; }
  .kpi:nth-child(n + 3) { border-top: 1px solid var(--hair); }
  .kpi:nth-child(4) { border-left: 1px solid var(--hair); }
  .member-figs { grid-template-columns: repeat(3, minmax(0, 1fr)); row-gap: 8px; }
  .admin-toolbar { align-items: stretch; }
  .range-nav { justify-content: space-between; width: 100%; }
  .search { min-width: 0; width: 100%; }
  .date-range { width: 100%; }
  .date-range-field { flex: 1 1 140px; }
  .date-range .input { flex: 1; min-width: 0; }
  .rate-band { grid-template-columns: 1fr; gap: 8px; }

  /* bottom sheet */
  .sheet,
  .sheet--wide {
    top: auto;
    left: calc(var(--inset) + 1px);
    right: calc(var(--inset) + 1px);
    bottom: calc(var(--inset) + 1px);
    width: auto;
    max-height: calc(100dvh - 2 * var(--inset) - 28px - var(--safe-t));
    border-left: 0;
    border-top: 1px solid var(--hair-strong);
    border-radius: 22px 22px calc(var(--radius-frame) - 1px) calc(var(--radius-frame) - 1px);
    transform: translateY(105%);
    box-shadow: 0 -30px 80px rgba(0, 0, 0, 0.5);
  }
  .sheet-head { position: relative; padding: 22px 12px 12px 18px; }
  .sheet-grabber { display: block; position: absolute; top: 8px; left: 50%; width: 40px; height: 4px; margin-left: -20px; border-radius: 4px; background: rgba(255, 255, 255, 0.18); }
  .sheet-body { padding: 16px 18px 18px; }
  .sheet-foot { padding: 12px 18px calc(12px + var(--safe-b)); }
  .sheet-foot .btn { flex: 1; }
  .sheet-foot .grow { display: none; }
  .sf-foot { bottom: -18px; margin: auto -18px -18px; padding: 12px 18px calc(12px + var(--safe-b)); }
  .sf-when-row { grid-template-columns: 1fr 1fr; }
  .sf-date { grid-column: 1 / -1; }
  .composer-row { grid-template-columns: 1fr 1fr; }
  .composer-row .btn { grid-column: 1 / -1; }
  .jobkeys { grid-template-columns: 1fr 1fr; }
  .ledger-row, .ledger-total { grid-template-columns: 10px minmax(0, 1fr) auto 72px; gap: 10px; }
  .ledger-total { grid-template-columns: minmax(0, 1fr) auto 72px; }
}

@media (max-width: 420px) {
  .period-stats { gap: 16px; }
  .track-labels { font-size: 11px; }
  .mix-row { grid-template-columns: minmax(80px, 1fr) minmax(40px, 1fr) auto; }
  .mix-pay { display: none; }
  .band--row { display: none; }
  .sf-actions .btn-ghost { padding: 0 12px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

@media print {
  .backdrop, .frame, .rail, .topbar, .tabbar, .demo-strip, .toasts { display: none !important; }
  .main { padding: 0; }
  body { color: #000; background: #fff; }
}
