/* ============================================================
   ui.css — Allo Simo design system
   ============================================================
   Tokens and recipes follow the Allo Simo Challenge design system
   (soft blue-grey canvas, glass cards, 1.25rem panels, Allo Simo red
   used mostly as tints, navy/red gradients only on hero surfaces).

   This file is hand-written and is the ONLY stylesheet. There is no
   build step: a class exists if it is defined below, nowhere else.
   Layout uses logical properties (inline-start/end), so Arabic RTL
   mirrors without a second set of rules.

   Sections: 1 tokens · 2 base · 3 shell · 4 page · 5 card · 6 button
   7 form · 8 filters · 9 badge · 10 table · 11 stat & hero · 12 list
   13 feedback · 14 overlay · 15 planning · 16 charts · 17 utilities
   ============================================================ */

/* ── 0. Fonts (self-hosted — the CSP allows no third-party origin) ── */
@font-face { font-family: "Lexend Deca"; font-style: normal; font-weight: 300 800; font-display: swap;
  src: url("../fonts/lexend-deca-latin.woff2") format("woff2"); }
@font-face { font-family: "Noto Sans Arabic"; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url("../fonts/noto-sans-arabic.woff2") format("woff2"); unicode-range: U+0600-06FF, U+0750-077F, U+FB50-FDFF, U+FE70-FEFF; }
@font-face { font-family: "JetBrains Mono"; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url("../fonts/jetbrains-mono-latin.woff2") format("woff2"); }

/* ── 1. Tokens ───────────────────────────────────────────── */
:root {
  --accent-800: #8e1219;
  --accent-700: #da262f;
  --accent-600: #e5444c;
  --accent-400: #f28b90;

  --color-brand: var(--accent-700);
  --color-brand-strong: #b81e26;
  --color-brand-soft: rgb(218 38 47 / .12);
  --color-on-brand: #ffffff;
  --color-accent: #c11f28;
  --color-accent-soft: rgb(218 38 47 / .08);
  --color-deep: #0f1e3c;

  --color-page: #eef2f5;
  --color-card: rgb(255 255 255 / .65);
  --color-surface: #ffffff;
  --color-surface-muted: #f4f7f8;
  --color-border: rgb(120 115 110 / .2);
  --color-border-strong: rgb(120 115 110 / .28);

  --color-text: #082f32;
  --color-text-2: #3b4658;
  --color-text-3: #55617a;

  --color-success: #16704a;
  --color-success-soft: rgb(52 180 120 / .12);
  --color-success-fill: #1f9d63;
  --color-warning: #a44b08;
  --color-warning-soft: rgb(250 172 80 / .16);
  --color-danger: #c0262d;
  --color-danger-strong: #b42318;
  --color-danger-soft: rgb(239 68 68 / .1);
  --color-info: #076a7b;
  --color-info-soft: rgb(6 145 169 / .1);

  --radius-xs: 8px;
  --radius-sm: 12px;
  --radius: 14px;
  --radius-lg: 20px;

  --shadow-card: 0 .15625rem .625rem 0 rgb(15 30 60 / .1);
  --shadow-hover: 0 .5rem 2rem rgb(15 30 60 / .12);
  --shadow-pop: 0 0 0 1px rgb(120 115 110 / .16), 0 18px 48px -16px rgb(15 30 60 / .3);

  --brand-gradient: linear-gradient(135deg, #da262f 0%, #8e1219 100%);
  --dark-gradient: linear-gradient(to bottom, #0f1e3c, #49619b);
  --dark-gradient-diag: linear-gradient(135deg, #0f1e3c 0%, #2a3c6b 100%);

  --focus-ring: var(--accent-700);
  --chart-1: #2a78d6;
  --chart-2: #eb6834;
  --chart-grid: rgb(120 115 110 / .16);

  --font-sans: "Lexend Deca", "Noto Sans Arabic", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;

  --rail-gradient: linear-gradient(180deg, #0c1933 0%, #14254c 55%, #22366b 100%);
  --brand-glow: 0 10px 22px -10px rgb(218 38 47 / .7);
  --sidebar-w: 264px;
  --topbar-h: 64px;
  --bottomnav-h: 62px;
}

:root[data-theme="dark"] {
  --color-brand-strong: var(--accent-600);
  --color-brand-soft: rgb(229 68 76 / .18);
  --color-accent: var(--accent-400);
  --color-accent-soft: rgb(229 68 76 / .16);

  --color-page: #14151c;
  --color-card: #1f222a;
  --color-surface: #1f222a;
  --color-surface-muted: #282b35;
  --rail-gradient: linear-gradient(180deg, #0b1220 0%, #101a33 55%, #18274f 100%);
  --color-border: #343744;
  --color-border-strong: #4a4d5b;

  --color-text: #ffffff;
  --color-text-2: #d0d2dc;
  --color-text-3: #b0b3c1;

  --color-success: #3fc98c;
  --color-success-soft: rgb(63 201 140 / .14);
  --color-warning: #fbb763;
  --color-warning-soft: rgb(251 183 99 / .14);
  --color-danger: #f06b6b;
  --color-danger-strong: #c4242b;
  --color-danger-soft: rgb(239 91 91 / .14);
  --color-info: #26b3cc;
  --color-info-soft: rgb(38 179 204 / .14);

  --shadow-card: 0 .15625rem .625rem 0 rgb(0 0 0 / .35);
  --shadow-hover: 0 .5rem 2rem rgb(0 0 0 / .45);
  --shadow-pop: 0 0 0 1px #474a56, 0 18px 48px -16px rgb(0 0 0 / .8);
  --focus-ring: var(--accent-400);
  --chart-1: #3987e5;
  --chart-2: #d95926;
  --chart-grid: #3a3d48;
  color-scheme: dark;
}

/* ── 2. Base ─────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
* { scrollbar-width: thin; scrollbar-color: var(--color-border-strong) transparent; }
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-thumb { border-radius: 999px; background: var(--color-border-strong); }

html { -webkit-text-size-adjust: 100%; }
html, body { margin: 0; background: var(--color-page); color: var(--color-text); }
body {
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.55;
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
}
h1, h2, h3, h4, p { margin: 0; }
h1, h2, h3, h4 { letter-spacing: -.02em; font-weight: 700; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
img, svg { max-width: 100%; }
svg.ico { flex-shrink: 0; display: block; }
table { border-collapse: collapse; width: 100%; }
[x-cloak] { display: none !important; }
[hidden] { display: none !important; }
:focus-visible { outline: none; box-shadow: 0 0 0 2px var(--color-surface), 0 0 0 4px var(--focus-ring); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ── 3. Shell: left sidebar · top bar · content ──────────── */
.shell { min-height: 100vh; }

.sidebar {
  position: fixed; inset-block: 0; inset-inline-start: 0;
  width: var(--sidebar-w);
  display: flex; flex-direction: column;
  background: var(--rail-gradient); color: #fff;
  z-index: 40;
  transition: transform .25s ease;
}
/* soft light in the corner, like the DNA hero surfaces */
.sidebar::before {
  content: ""; position: absolute; width: 260px; height: 260px; border-radius: 50%;
  top: -120px; inset-inline-end: -110px; background: rgb(255 255 255 / .05); pointer-events: none;
}
.sidebar > * { position: relative; }

.sidebar__brand {
  display: flex; align-items: center; gap: 12px;
  height: var(--topbar-h); padding: 0 20px; flex-shrink: 0;
  box-shadow: inset 0 -1px 0 rgb(255 255 255 / .08);
}
.brand-mark {
  width: 38px; height: 38px; border-radius: var(--radius-sm);
  background: #fff; display: grid; place-items: center; overflow: hidden; flex-shrink: 0;
  box-shadow: 0 6px 16px -6px rgb(0 0 0 / .5);
}
.brand-mark img { width: 100%; height: 100%; object-fit: contain; }
.brand-name { font-weight: 700; font-size: 15.5px; line-height: 1.2; letter-spacing: -.01em; }
.brand-sub  { font-size: 12.5px; color: rgb(255 255 255 / .7); letter-spacing: .02em; }
.card .brand-name, .card .brand-sub { color: inherit; }

.nav { flex: 1; overflow-y: auto; padding: 16px 14px; display: flex; flex-direction: column; gap: 3px; scrollbar-color: rgb(255 255 255 / .2) transparent; }
.nav__label {
  font-size: 12px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase;
  color: rgb(255 255 255 / .6); padding: 18px 12px 8px;
}
.nav__link {
  position: relative; display: flex; align-items: center; gap: 12px;
  padding: 9px 10px; border-radius: var(--radius);
  font-size: 15px; font-weight: 500; color: rgb(255 255 255 / .72);
  transition: background .2s ease, color .2s ease;
}
.nav__link:hover { background: rgb(255 255 255 / .07); color: #fff; }
.nav__ico {
  width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; flex-shrink: 0;
  background: rgb(255 255 255 / .06); color: rgb(255 255 255 / .8); transition: background .2s ease, color .2s ease;
}
.nav__link.is-active { background: rgb(255 255 255 / .1); color: #fff; font-weight: 600; box-shadow: inset 0 0 0 1px rgb(255 255 255 / .08); }
.nav__link.is-active .nav__ico { background: var(--brand-gradient); color: #fff; box-shadow: var(--brand-glow); }
.nav__link.is-active::before {
  content: ""; position: absolute; inset-inline-start: -14px; top: 9px; bottom: 9px; width: 4px;
  border-radius: 0 4px 4px 0; background: var(--color-brand);
}
[dir="rtl"] .nav__link.is-active::before { border-radius: 4px 0 0 4px; }
.nav .btn--primary { height: 46px; font-size: 15px; margin-bottom: 12px; }

.sidebar__foot { padding: 14px; box-shadow: inset 0 1px 0 rgb(255 255 255 / .08); display: flex; flex-direction: column; gap: 12px; }
.sidebar__foot .seg { background: rgb(255 255 255 / .06); box-shadow: inset 0 0 0 1px rgb(255 255 255 / .08); }
.sidebar__foot .seg__item { color: rgb(255 255 255 / .6); min-height: 30px; }
.sidebar__foot .seg__item:hover { color: #fff; }
.sidebar__foot .seg__item.is-active { background: rgb(255 255 255 / .16); color: #fff; box-shadow: none; }
.sidebar__foot .faint { color: rgb(255 255 255 / .55); }
.sidebar__foot .icon-btn { color: rgb(255 255 255 / .7); }
.sidebar__foot .icon-btn:hover { background: rgb(255 255 255 / .1); color: #fff; }
.user-row { display: flex; align-items: center; gap: 10px; min-width: 0; padding: 8px; border-radius: var(--radius); background: rgb(255 255 255 / .06); }
.avatar {
  width: 36px; height: 36px; border-radius: var(--radius-sm); flex-shrink: 0;
  display: grid; place-items: center; font-size: 13.5px; font-weight: 700; color: #fff;
  background: var(--brand-gradient);
}
.avatar--sm { width: 30px; height: 30px; font-size: 12.5px; border-radius: 10px; }
.avatar--muted { background: var(--color-surface-muted); color: var(--color-text-2); box-shadow: inset 0 0 0 1px var(--color-border); }

.shell__main { min-height: 100vh; display: flex; flex-direction: column; padding-inline-start: var(--sidebar-w); }

.topbar {
  position: sticky; top: 0; z-index: 30;
  height: var(--topbar-h); padding: 0 24px;
  display: flex; align-items: center; gap: 12px;
  background: color-mix(in srgb, var(--color-surface) 82%, transparent);
  -webkit-backdrop-filter: blur(12px) saturate(1.4); backdrop-filter: blur(12px) saturate(1.4);
  box-shadow: inset 0 -1px 0 var(--color-border);
}
.topbar__title { font-size: 16px; font-weight: 700; letter-spacing: -.01em; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar__meta { font-size: 13px; color: var(--color-text-3); white-space: nowrap; }
.topbar__spacer { flex: 1; }

.content { flex: 1; padding: 28px; width: 100%; max-width: 1480px; margin-inline: auto; }
.content--narrow { max-width: 760px; }
.content--mid { max-width: 1040px; }

.scrim { position: fixed; inset: 0; background: rgb(8 15 30 / .5); z-index: 35; }

.bottom-nav { display: none; }

@media (max-width: 1023px) {
  .sidebar { transform: translateX(-100%); box-shadow: 0 0 60px rgb(0 0 0 / .5); width: min(300px, 86vw); }
  [dir="rtl"] .sidebar { transform: translateX(100%); }
  .sidebar.is-open { transform: none; }
  .shell__main { padding-inline-start: 0; }
  .topbar { padding: 0 14px; }
  .content { padding: 18px 14px; }
  .page-title { font-size: 24px; }
  .hero { padding: 22px 20px; border-radius: 22px; }
  .hero__value { font-size: 38px; }
  .hero__title { font-size: 24px; }
  .stat__value { font-size: 26px; }

  .has-bottom-nav .content { padding-bottom: calc(var(--bottomnav-h) + 24px + env(safe-area-inset-bottom, 0px)); }
  .has-bottom-nav .bottom-nav {
    position: fixed; inset-inline: 0; bottom: 0; z-index: 30;
    display: grid; grid-auto-flow: column; grid-auto-columns: 1fr;
    height: calc(var(--bottomnav-h) + env(safe-area-inset-bottom, 0px));
    padding-bottom: env(safe-area-inset-bottom, 0px);
    background: color-mix(in srgb, var(--color-surface) 94%, transparent);
    -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
    box-shadow: inset 0 1px 0 var(--color-border);
  }
  .bottom-nav__item {
    position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
    font-size: 12.5px; font-weight: 600; color: var(--color-text-3);
  }
  .bottom-nav__ico { width: 44px; height: 26px; border-radius: 999px; display: grid; place-items: center; }
  .bottom-nav__item.is-active { color: var(--color-accent); font-weight: 600; }
  .bottom-nav__item.is-active .bottom-nav__ico { background: var(--brand-gradient); color: #fff; box-shadow: var(--brand-glow); }
  .bottom-nav__item.is-active::before {
    content: ""; position: absolute; top: 0; width: 28px; height: 3px; border-radius: 0 0 3px 3px; background: var(--color-brand);
  }
}
@media (min-width: 1024px) {
  .only-mobile { display: none !important; }
  .scrim { display: none !important; }
}
@media (max-width: 1023px) { .only-desktop { display: none !important; } }

/* ── 4. Page header ──────────────────────────────────────── */
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 14px 16px; margin-bottom: 22px; }
.page-head__main { min-width: 0; }
.eyebrow { font-size: 12.5px; font-weight: 700; letter-spacing: .12em; margin-bottom: 4px; text-transform: uppercase; color: var(--color-accent); }
.page-title { font-size: 28px; line-height: 1.15; font-weight: 700; letter-spacing: -.03em; }
.page-sub { font-size: 14.5px; color: var(--color-text-2); margin-top: 6px; }
.page-head__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.back-link { display: inline-flex; align-items: center; gap: 6px; font-size: 13.5px; font-weight: 500; color: var(--color-text-2); margin-bottom: 8px; }
.back-link:hover { color: var(--color-accent); }
[dir="rtl"] .flip-rtl { transform: scaleX(-1); }

/* ── 5. Card ─────────────────────────────────────────────── */
.card {
  background: var(--color-card);
  border-radius: var(--radius-lg);
  box-shadow: inset 0 0 0 1px var(--color-border), var(--shadow-card);
  min-width: 0;
}
.card--solid { background: var(--color-surface); }
.card--pad { padding: 20px; }
.card--clip { overflow: hidden; }
.card__head {
  display: flex; align-items: center; gap: 12px; padding: 16px 20px;
  box-shadow: inset 0 -1px 0 var(--color-border);
}
.card__icon {
  width: 40px; height: 40px; border-radius: var(--radius-sm); flex-shrink: 0;
  display: grid; place-items: center; background: var(--color-accent-soft); color: var(--color-accent);
}
.card__icon--success { background: var(--color-success-soft); color: var(--color-success); }
.card__icon--warning { background: var(--color-warning-soft); color: var(--color-warning); }
.card__icon--info    { background: var(--color-info-soft);    color: var(--color-info); }
.card__icon--neutral { background: var(--color-surface-muted); color: var(--color-text-2); }
.card__titles { min-width: 0; flex: 1; }
.card__title { font-size: 15px; font-weight: 700; letter-spacing: -.01em; }
.card__sub { font-size: 13px; color: var(--color-text-3); margin-top: 2px; }
.card__action { font-size: 13px; font-weight: 600; color: var(--color-accent); white-space: nowrap; display: inline-flex; align-items: center; gap: 4px; }
.card__action:hover { text-decoration: underline; }
.card__body { padding: 20px; }
.card__foot { padding: 12px 18px; box-shadow: inset 0 1px 0 var(--color-border); display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

/* ── 6. Button ───────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 42px; padding: 0 18px; border-radius: var(--radius);
  font-size: 15px; font-weight: 600; letter-spacing: -.005em; white-space: nowrap; cursor: pointer;
  background: var(--color-surface); color: var(--color-text);
  box-shadow: inset 0 0 0 1px var(--color-border-strong), 0 1px 2px rgb(15 30 60 / .06);
  transition: background .2s ease, box-shadow .2s ease, transform .15s ease, color .2s ease, filter .2s ease;
}
.btn:hover { background: var(--color-surface-muted); transform: translateY(-1px); }
.btn:active { transform: translateY(0) scale(.985); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .5; pointer-events: none; }
.btn--primary { background: var(--brand-gradient); color: var(--color-on-brand); font-weight: 700; box-shadow: var(--brand-glow), inset 0 1px 0 rgb(255 255 255 / .18); }
.btn--primary:hover { background: var(--brand-gradient); filter: brightness(1.08); box-shadow: 0 14px 26px -10px rgb(218 38 47 / .8), inset 0 1px 0 rgb(255 255 255 / .18); }
.btn--soft { background: var(--color-accent-soft); color: var(--color-accent); box-shadow: none; }
.btn--soft:hover { background: var(--color-brand-soft); }
.btn--ghost { background: transparent; box-shadow: none; color: var(--color-text-2); }
.btn--ghost:hover { background: var(--color-surface-muted); color: var(--color-text); }
.btn--danger { background: var(--color-danger-strong); color: #fff; box-shadow: none; }
.btn--danger:hover { filter: brightness(1.08); background: var(--color-danger-strong); }
.btn--danger-soft { background: var(--color-danger-soft); color: var(--color-danger); box-shadow: none; }
.btn--danger-soft:hover { background: var(--color-danger-soft); filter: brightness(.96); }
.btn--success { background: var(--color-success-fill); color: #fff; box-shadow: none; }
.btn--success:hover { background: var(--color-success-fill); filter: brightness(1.06); }
.btn--sm { height: 36px; padding: 0 14px; font-size: 14px; border-radius: var(--radius-sm); }
.btn--lg { height: 52px; padding: 0 24px; font-size: 15.5px; border-radius: 16px; }
.btn--block { width: 100%; }
.btn--icon { width: 38px; height: 38px; padding: 0; border-radius: var(--radius-sm); }
.btn--icon.btn--sm { width: 32px; height: 32px; }
.icon-btn {
  width: 40px; height: 40px; border-radius: var(--radius-sm); display: grid; place-items: center;
  color: var(--color-text-2); position: relative; transition: background .2s ease, color .2s ease;
}
.icon-btn:hover { background: var(--color-surface-muted); color: var(--color-text); }
.link { color: var(--color-accent); font-weight: 600; }
.link:hover { text-decoration: underline; }

/* ── 7. Form ─────────────────────────────────────────────── */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.label { font-size: 14px; font-weight: 600; color: var(--color-text); }
.label .req { color: var(--color-danger); }
.label .opt { font-weight: 400; color: var(--color-text-3); }
.hint { font-size: 12.5px; color: var(--color-text-3); }
.input, .select, .textarea {
  width: 100%; height: 44px; padding: 0 14px;
  font: inherit; font-size: 15px; color: var(--color-text);
  background: var(--color-surface-muted);
  border: 0; border-radius: var(--radius);
  box-shadow: inset 0 0 0 1px var(--color-border-strong);
  transition: box-shadow .2s ease, background .2s ease;
  -webkit-appearance: none; appearance: none;
}
.textarea { height: auto; min-height: 84px; padding: 10px 12px; resize: vertical; }
.input::placeholder, .textarea::placeholder { color: var(--color-text-3); opacity: 1; }
.input:focus, .select:focus, .textarea:focus {
  outline: none; background: var(--color-surface);
  box-shadow: inset 0 0 0 1px var(--color-brand), 0 0 0 3px rgb(218 38 47 / .14);
}
.select {
  padding-inline-end: 34px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%235e6b80' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5 9 7 7 7-7'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center;
}
[dir="rtl"] .select { background-position: left 10px center; }
.input--lg { height: 54px; font-size: 19px; font-weight: 700; }
.input--sm, .select--sm { height: 38px; font-size: 14.5px; border-radius: var(--radius-sm); }
.input-wrap { position: relative; }
.input-wrap > .ico-start, .input-wrap > .ico-end {
  position: absolute; top: 0; bottom: 0; display: flex; align-items: center; color: var(--color-text-3);
}
.input-wrap > .ico-start { inset-inline-start: 12px; pointer-events: none; }
.input-wrap > .ico-end { inset-inline-end: 6px; }
.input-wrap > .ico-start ~ .input { padding-inline-start: 38px; }
.input-wrap > .input.has-end { padding-inline-end: 40px; }
.form-grid { display: grid; gap: 14px; }
.form-grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }

.check { display: inline-flex; align-items: center; gap: 10px; font-size: 14px; color: var(--color-text-2); cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--color-brand); margin: 0; }

.switch { position: relative; width: 38px; height: 22px; border-radius: 999px; background: var(--color-border-strong); flex-shrink: 0; transition: background .2s ease; }
.switch::after { content: ""; position: absolute; top: 3px; inset-inline-start: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .2s ease; }
.switch.is-on { background: var(--color-success-fill); }
.switch.is-on::after { transform: translateX(16px); }
[dir="rtl"] .switch.is-on::after { transform: translateX(-16px); }

/* Segmented control */
.seg { display: inline-flex; padding: 3px; gap: 2px; border-radius: var(--radius); background: var(--color-surface-muted); box-shadow: inset 0 0 0 1px var(--color-border); }
.seg--block { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; width: 100%; }
.seg__item {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 36px; padding: 0 16px; border-radius: 11px;
  font-size: 14px; font-weight: 600; color: var(--color-text-2); white-space: nowrap;
  transition: background .2s ease, color .2s ease;
}
.seg__item:hover { color: var(--color-text); }
.seg__item.is-active { background: var(--color-surface); color: var(--color-text); box-shadow: 0 1px 3px rgb(15 30 60 / .14), inset 0 0 0 1px var(--color-border); }

/* Combobox (searchable select) */
.combo { position: relative; }
.combo__panel {
  position: absolute; inset-inline: 0; top: calc(100% + 6px); z-index: 60;
  max-height: 264px; overflow-y: auto;
  background: var(--color-surface); border-radius: var(--radius); box-shadow: var(--shadow-pop);
  animation: pop-in .12s ease-out;
}
.combo__opt {
  display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%;
  padding: 9px 12px; font-size: 14.5px; text-align: start; color: var(--color-text);
}
.combo__opt.is-hl { background: var(--color-accent-soft); color: var(--color-accent); }
.combo__opt mark { background: transparent; color: inherit; font-weight: 700; text-decoration: underline; text-underline-offset: 2px; }
.combo__empty { padding: 12px; font-size: 14px; color: var(--color-text-3); }
.combo__count { position: sticky; bottom: 0; padding: 6px 12px; font-size: 12.5px; color: var(--color-text-3); background: var(--color-surface-muted); box-shadow: inset 0 1px 0 var(--color-border); }
.combo .input.has-value { font-weight: 600; }

/* ── 8. Filters ──────────────────────────────────────────── */
.filterbar { display: flex; flex-direction: column; gap: 12px; padding: 14px 16px; margin-bottom: 20px; }
.filterbar__row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips--scroll { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.chips--scroll::-webkit-scrollbar { display: none; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 15px;
  border-radius: 999px; font-size: 14px; font-weight: 600; white-space: nowrap;
  background: var(--color-surface); color: var(--color-text-2);
  box-shadow: inset 0 0 0 1px var(--color-border-strong);
  transition: background .2s ease, color .2s ease, box-shadow .2s ease;
}
.chip:hover { color: var(--color-text); background: var(--color-surface-muted); }
.chip.is-active { background: var(--brand-gradient); color: #fff; box-shadow: var(--brand-glow); }
.chip--tone.is-active { background: var(--color-accent-soft); color: var(--color-accent); box-shadow: inset 0 0 0 1px rgb(218 38 47 / .3); }

.month-nav { display: inline-flex; align-items: center; gap: 2px; padding: 4px; border-radius: 999px; background: var(--color-surface); box-shadow: inset 0 0 0 1px var(--color-border-strong); }
.month-nav.is-active { box-shadow: inset 0 0 0 2px var(--color-brand); background: var(--color-accent-soft); }
.month-nav__btn { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; color: var(--color-text-2); }
.month-nav__btn:hover { background: var(--color-surface-muted); color: var(--color-text); }
.month-nav__label { position: relative; padding: 0 10px; font-size: 14.5px; font-weight: 700; min-width: 128px; text-align: center; cursor: pointer; white-space: nowrap; }
.month-nav__label input { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; cursor: pointer; }
.filter-fields { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); align-items: end; }
.range-summary { font-size: 13px; color: var(--color-text-3); }
.range-summary strong { color: var(--color-text-2); font-weight: 600; }

/* ── 9. Badge ────────────────────────────────────────────── */
.pill {
  display: inline-flex; align-items: center; gap: 5px; padding: 2px 10px; border-radius: 999px;
  font-size: 13px; font-weight: 600; letter-spacing: .2px; white-space: nowrap; line-height: 1.6;
  background: var(--color-surface-muted); color: var(--color-text-2);
}
.pill--success { background: var(--color-success-soft); color: var(--color-success); }
.pill--warning { background: var(--color-warning-soft); color: var(--color-warning); }
.pill--danger  { background: var(--color-danger-soft);  color: var(--color-danger); }
.pill--info    { background: var(--color-info-soft);    color: var(--color-info); }
.pill--brand   { background: var(--color-accent-soft);  color: var(--color-accent); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; flex-shrink: 0; }
.dot--pulse { animation: pulse 1.8s ease-in-out infinite; }
.count-bubble {
  position: absolute; top: 2px; inset-inline-end: 2px; min-width: 16px; height: 16px; padding: 0 4px;
  border-radius: 999px; background: var(--brand-gradient); color: #fff; font-size: 12px; font-weight: 600;
  display: grid; place-items: center;
}

/* ── 10. Table ───────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }
.table th {
  height: 44px; padding: 0 16px; text-align: start; white-space: nowrap; background: var(--color-surface-muted);
  font-size: 12.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--color-text-3);
  box-shadow: inset 0 -1px 0 var(--color-border);
}
.table td { padding: 13px 16px; font-size: 15px; box-shadow: inset 0 -1px 0 var(--color-border); vertical-align: middle; }
.table tbody tr:last-child td { box-shadow: none; }
.table tbody tr { transition: background .15s ease; }
.table tbody tr:hover { background: rgb(218 38 47 / .03); }
.table .num { text-align: end; white-space: nowrap; }
.table tfoot td { font-weight: 600; background: var(--color-surface-muted); box-shadow: inset 0 1px 0 var(--color-border-strong); }
.table--compact td { padding: 10px 16px; font-size: 14.5px; }
.cell-main { font-weight: 600; }
.cell-sub { font-size: 12.5px; color: var(--color-text-3); margin-top: 1px; }
.row-actions { display: flex; justify-content: flex-end; gap: 4px; }
.row-link { cursor: pointer; }

.pager { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 12px 18px; box-shadow: inset 0 1px 0 var(--color-border); font-size: 13.5px; color: var(--color-text-3); }
.pager__btns { display: flex; gap: 6px; }

/* ── 11. Stat & hero ─────────────────────────────────────── */
.stat { position: relative; padding: 18px 20px; display: flex; flex-direction: column; gap: 8px; min-width: 0; overflow: hidden; }
.stat__top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.stat__label { font-size: 12.5px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: var(--color-text-3); }
.stat__value { font-size: 30px; line-height: 1.1; font-weight: 700; letter-spacing: -.03em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat__value small { font-size: 15px; font-weight: 600; color: var(--color-text-3); letter-spacing: 0; }
.stat__meta { font-size: 13px; color: var(--color-text-3); }
.stat__icon { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--color-accent-soft); color: var(--color-accent); flex-shrink: 0; }
.stat__icon--neutral { background: var(--color-surface-muted); color: var(--color-text-2); }
.stat__icon--info    { background: var(--color-info-soft);    color: var(--color-info); }
.stat__icon--warning { background: var(--color-warning-soft); color: var(--color-warning); }
.stat__icon--success { background: var(--color-success-soft); color: var(--color-success); }
.stat__head { display: flex; align-items: center; gap: 12px; }
/* a coloured edge so the four figures do not read as four identical boxes */
.stat--edge::before { content: ""; position: absolute; inset-block: 0; inset-inline-start: 0; width: 4px; background: var(--edge, var(--color-border-strong)); }
.stat__spark { width: 100%; height: 30px; display: block; }
.delta { font-size: 12.5px; font-weight: 700; padding: 2px 8px; border-radius: 999px; white-space: nowrap; }
.delta--up { background: var(--color-success-soft); color: var(--color-success); }
.delta--down { background: var(--color-danger-soft); color: var(--color-danger); }

.hero {
  position: relative; overflow: hidden; border-radius: 24px; padding: 26px 28px; color: #fff;
  background: var(--dark-gradient-diag); box-shadow: var(--shadow-card);
}
.hero--brand { background: var(--brand-gradient); box-shadow: 0 14px 32px -16px rgb(218 38 47 / .6); }
.hero::before, .hero::after {
  content: ""; position: absolute; border-radius: 50%; background: rgb(255 255 255 / .06); pointer-events: none;
}
.hero::before { width: 260px; height: 260px; top: -110px; inset-inline-end: -70px; }
.hero::after  { width: 170px; height: 170px; bottom: -90px; inset-inline-end: 90px; }
.hero > * { position: relative; z-index: 1; }
.hero__eyebrow { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; opacity: .8; }
.hero__value { font-size: 46px; line-height: 1.05; font-weight: 700; margin-top: 10px; letter-spacing: -.035em; }
.hero__title { font-size: 30px; line-height: 1.15; font-weight: 700; letter-spacing: -.03em; margin-top: 8px; }
.hero__row { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 18px 24px; }
.hero__actions { display: flex; flex-wrap: wrap; gap: 10px; }
.hero .btn { background: rgb(255 255 255 / .1); color: #fff; box-shadow: inset 0 0 0 1px rgb(255 255 255 / .16); }
.hero .btn:hover { background: rgb(255 255 255 / .18); }
.hero .btn--primary { background: #fff; color: var(--color-deep); box-shadow: 0 10px 24px -12px rgb(0 0 0 / .6); filter: none; }
.hero .btn--primary:hover { background: #fff; filter: brightness(.96); }
.hero--brand .btn--primary { color: var(--color-brand-strong); }
.hero__figures { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-top: 22px; }
.hero__figure { padding: 14px 16px; border-radius: 16px; background: rgb(255 255 255 / .07); box-shadow: inset 0 0 0 1px rgb(255 255 255 / .1); min-width: 0; }
.hero__figure .hero__v { font-size: 22px; font-weight: 700; letter-spacing: -.02em; margin-top: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hero__figure .hero__m { font-size: 12.5px; opacity: .7; margin-top: 2px; }
.hero .splitbar { background: rgb(255 255 255 / .12); height: 8px; }
.hero .spinner { border-color: #fff; border-top-color: transparent; }
.hero__sub { font-size: 14.5px; opacity: .9; margin-top: 8px; }
.hero__split { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 18px; padding-top: 14px; border-top: 1px solid rgb(255 255 255 / .16); }
.hero__k { font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; opacity: .85; }
.hero__v { font-size: 17px; font-weight: 700; margin-top: 3px; }
.hero__btn { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; background: rgb(255 255 255 / .12); color: #fff; }
.hero__btn:hover { background: rgb(255 255 255 / .2); }

/* Money equation: label left, amount right, a rule before the result */
.ledger { display: flex; flex-direction: column; }
.ledger__row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 11px 0; font-size: 15px; }
.ledger__row + .ledger__row { box-shadow: inset 0 1px 0 var(--color-border); }
.ledger__k { color: var(--color-text-2); min-width: 0; }
.ledger__k small { display: block; font-size: 12.5px; color: var(--color-text-3); }
.ledger__v { font-weight: 600; white-space: nowrap; }
.ledger__row--total { margin-top: 8px; padding: 14px 16px; align-items: center; border-radius: var(--radius); box-shadow: none !important; font-size: 15px; }
.ledger__row--total .ledger__k { color: inherit; font-weight: 600; }
.ledger__row--total .ledger__v { font-size: 22px; font-weight: 700; letter-spacing: -.02em; }
.tone-warning { background: var(--color-warning-soft); color: var(--color-warning); }
.tone-success { background: var(--color-success-soft); color: var(--color-success); }
.tone-neutral { background: var(--color-surface-muted); color: var(--color-text-2); }
.tone-info    { background: var(--color-info-soft); color: var(--color-info); }
.tone-brand   { background: var(--color-accent-soft); color: var(--color-accent); }

.splitbar { display: flex; height: 10px; border-radius: 999px; overflow: hidden; background: var(--color-surface-muted); }
.splitbar > span { display: block; height: 100%; transition: width .45s cubic-bezier(.4, 0, .2, 1); }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 13px; color: var(--color-text-2); }
.legend__item { display: inline-flex; align-items: center; gap: 6px; }
.swatch { width: 10px; height: 10px; border-radius: 3px; flex-shrink: 0; }

/* ── 12. List ────────────────────────────────────────────── */
.list__row { display: flex; align-items: center; gap: 14px; padding: 14px 20px; min-width: 0; }
.list__row + .list__row { box-shadow: inset 0 1px 0 var(--color-border); }
a.list__row:hover, .list__row--hover:hover { background: rgb(218 38 47 / .03); }
.list__main { min-width: 0; flex: 1; }
.list__title { font-size: 15px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list__meta { font-size: 13.5px; color: var(--color-text-3); margin-top: 2px; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.list__end { text-align: end; flex-shrink: 0; }
.list__amount { font-size: 15.5px; font-weight: 700; letter-spacing: -.01em; white-space: nowrap; }
.group-head {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap;
  padding: 12px 20px; background: var(--color-surface-muted); font-size: 14.5px;
  box-shadow: inset 0 -1px 0 var(--color-border);
}
.group-head strong { font-weight: 600; }
.tile { width: 42px; height: 42px; border-radius: var(--radius-sm); display: grid; place-items: center; flex-shrink: 0; background: var(--color-surface-muted); color: var(--color-text-2); }
.tile--success { background: var(--color-success-soft); color: var(--color-success); }
.tile--warning { background: var(--color-warning-soft); color: var(--color-warning); }
.tile--info { background: var(--color-info-soft); color: var(--color-info); }
.tile--brand { background: var(--color-accent-soft); color: var(--color-accent); }

.rank { display: flex; flex-direction: column; gap: 12px; }
.rank__top { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 5px; }
.rank__name { display: flex; align-items: baseline; gap: 8px; min-width: 0; font-size: 14.5px; font-weight: 500; }
.rank__name span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank__n { font-size: 12.5px; font-weight: 600; color: var(--color-text-3); width: 16px; flex-shrink: 0; }
.rank__val { font-size: 13.5px; font-weight: 600; white-space: nowrap; }
.rank__bar { display: flex; align-items: center; gap: 8px; }
.track { flex: 1; height: 6px; border-radius: 999px; background: var(--color-surface-muted); overflow: hidden; }
.track > span { display: block; height: 100%; border-radius: 999px; background: var(--color-brand); transition: width .45s cubic-bezier(.4, 0, .2, 1); }
.rank__count { font-size: 12.5px; color: var(--color-text-3); width: 34px; text-align: end; flex-shrink: 0; }

/* ── 13. Feedback ────────────────────────────────────────── */
.alert { display: flex; align-items: center; gap: 14px; padding: 14px 18px; border-radius: var(--radius-lg); font-size: 14.5px; background: var(--color-surface-muted); color: var(--color-text-2); }
.alert--success { background: var(--color-success-soft); color: var(--color-success); }
.alert--warning { background: var(--color-warning-soft); color: var(--color-warning); }
.alert--danger  { background: var(--color-danger-soft);  color: var(--color-danger); }
.alert--info    { background: var(--color-info-soft);    color: var(--color-info); }
.alert__body { flex: 1; min-width: 0; }
.alert__title { font-weight: 700; font-size: 15px; }
.alert__text { font-size: 13.5px; opacity: .9; margin-top: 2px; }
.flash-host { padding: 16px 24px 0; max-width: 1480px; width: 100%; margin-inline: auto; display: flex; flex-direction: column; gap: 8px; }
@media (max-width: 1023px) { .flash-host { padding: 12px 14px 0; } }

.empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; padding: 44px 20px; color: var(--color-text-3); }
.empty__icon { width: 48px; height: 48px; border-radius: 16px; display: grid; place-items: center; background: var(--color-surface-muted); color: var(--color-text-3); }
.empty__title { font-size: 15px; font-weight: 600; color: var(--color-text-2); }
.empty__text { font-size: 13.5px; max-width: 340px; }

.toast-host { position: fixed; bottom: 20px; inset-inline-end: 20px; z-index: 80; display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.has-bottom-nav .toast-host { bottom: calc(var(--bottomnav-h) + 16px); }
.toast { pointer-events: auto; width: 290px; max-width: 90vw; display: flex; gap: 10px; padding: 12px 14px; border-radius: var(--radius); background: var(--color-deep); color: #fff; box-shadow: var(--shadow-pop); animation: toast-in .22s cubic-bezier(.2, .9, .3, 1.2); }
.toast__title { font-size: 13.5px; font-weight: 600; }
.toast__body { font-size: 12.5px; opacity: .8; margin-top: 2px; }
.spinner { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--color-brand); border-top-color: transparent; animation: spin .7s linear infinite; }

/* ── 14. Overlay: popover, modal ─────────────────────────── */
.popover { position: absolute; z-index: 60; top: calc(100% + 8px); inset-inline-end: 0; min-width: 220px; background: var(--color-surface); border-radius: var(--radius-lg); box-shadow: var(--shadow-pop); overflow: hidden; animation: pop-in .12s ease-out; }
.popover--wide { width: 340px; max-width: 92vw; }
.menu__item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 14px; font-size: 14px; color: var(--color-text); text-align: start; }
.menu__item:hover { background: var(--color-surface-muted); }
.menu__item--danger { color: var(--color-danger); }
.menu__sep { height: 1px; background: var(--color-border); }

.modal { position: fixed; inset: 0; z-index: 90; display: flex; align-items: center; justify-content: center; padding: 16px; }
.modal__scrim { position: absolute; inset: 0; background: rgb(8 15 30 / .55); -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px); }
.modal__panel { position: relative; width: 100%; max-width: 480px; max-height: calc(100vh - 32px); overflow-y: auto; background: var(--color-surface); border-radius: var(--radius-lg); box-shadow: var(--shadow-pop); animation: pop-in .16s ease-out; }
.modal__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 18px; box-shadow: inset 0 -1px 0 var(--color-border); }
.modal__title { font-size: 15px; font-weight: 600; }
.modal__body { padding: 18px; display: flex; flex-direction: column; gap: 14px; }
.modal__foot { display: flex; align-items: center; gap: 10px; padding: 14px 18px; box-shadow: inset 0 1px 0 var(--color-border); }
@media (max-width: 640px) {
  .modal { align-items: flex-end; padding: 0; }
  .modal__panel { max-width: none; border-radius: var(--radius-lg) var(--radius-lg) 0 0; max-height: 92vh; padding-bottom: env(safe-area-inset-bottom, 0px); }
}

/* Tabs (line) */
.tabs { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; box-shadow: inset 0 -1px 0 var(--color-border); margin-bottom: 16px; }
.tabs::-webkit-scrollbar { display: none; }
.tabs__item { position: relative; display: inline-flex; align-items: center; gap: 8px; padding: 12px 16px; font-size: 15px; font-weight: 600; color: var(--color-text-2); white-space: nowrap; }
.tabs__item:hover { color: var(--color-text); }
.tabs__item.is-active { color: var(--color-accent); font-weight: 700; }
.tabs__item.is-active::after { content: ""; position: absolute; inset-inline: 12px; bottom: 0; height: 3px; border-radius: 3px 3px 0 0; background: var(--color-brand); }

/* ── 15. Planning ────────────────────────────────────────── */
.plan { min-width: 860px; table-layout: fixed; }
.plan th, .plan td { box-shadow: inset 0 -1px 0 var(--color-border), inset -1px 0 0 var(--color-border); vertical-align: top; }
.plan thead th { padding: 10px 8px; text-align: center; font-size: 12.5px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--color-text-3); background: var(--color-surface-muted); }
.plan thead th strong { display: block; font-size: 15px; letter-spacing: 0; color: var(--color-text); text-transform: none; margin-top: 1px; }
.plan thead th small { display: block; font-weight: 500; letter-spacing: 0; text-transform: none; margin-top: 2px; }
.plan thead th.is-today { background: var(--color-accent-soft); color: var(--color-accent); }
.plan thead th.is-today strong { color: var(--color-accent); }
.plan__rider { width: 190px; position: sticky; inset-inline-start: 0; z-index: 2; background: var(--color-surface); padding: 10px 12px !important; text-align: start !important; }
.plan thead .plan__rider { z-index: 3; background: var(--color-surface-muted); }
.plan__rider-name { font-size: 14px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.plan__rider-meta { font-size: 12.5px; color: var(--color-text-3); }
.plan__cell { padding: 6px; height: 62px; }
.plan__cell.is-today { background: rgb(218 38 47 / .025); }
.plan__cell.is-past { opacity: .7; }
.plan__stack { display: flex; flex-direction: column; gap: 4px; height: 100%; }
.shift {
  display: block; width: 100%; text-align: start; padding: 5px 8px; border-radius: 10px; font-size: 13px; line-height: 1.3;
  background: var(--color-info-soft); color: var(--color-info); box-shadow: inset 3px 0 0 currentColor;
  transition: filter .15s ease, transform .1s ease;
}
[dir="rtl"] .shift { box-shadow: inset -3px 0 0 currentColor; }
button.shift:hover { filter: brightness(.95); }
.shift--am   { background: var(--color-warning-soft); color: var(--color-warning); }
.shift--pm   { background: var(--color-info-soft);    color: var(--color-info); }
.shift--full { background: var(--color-success-soft); color: var(--color-success); }
.shift__time { font-weight: 600; white-space: nowrap; }
.shift__zone { font-size: 12.5px; opacity: .85; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.plan__add {
  flex: 1; min-height: 22px; width: 100%; border-radius: 10px; display: grid; place-items: center; color: var(--color-text-3);
  opacity: 0; border: 1px dashed var(--color-border-strong); transition: opacity .15s ease, background .15s ease;
}
.plan__cell:hover .plan__add, .plan__add:focus-visible { opacity: 1; }
.plan__add:hover { background: var(--color-accent-soft); color: var(--color-accent); border-color: var(--color-brand); }
@media (hover: none) { .plan__add { opacity: .55; } }

.daycards { display: grid; gap: 10px; grid-template-columns: repeat(7, minmax(0, 1fr)); }
@media (max-width: 900px) { .daycards { grid-template-columns: 1fr; } }
.daycard { padding: 12px; display: flex; flex-direction: column; gap: 8px; min-height: 108px; }
.daycard.is-today { box-shadow: inset 0 0 0 1.5px var(--color-brand), var(--shadow-card); }
.daycard__day { font-size: 12.5px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--color-text-3); }
.daycard__date { font-size: 18px; font-weight: 600; line-height: 1.1; }
.daycard__off { font-size: 13px; color: var(--color-text-3); }
@media (max-width: 900px) {
  .daycard { flex-direction: row; align-items: center; min-height: 0; gap: 14px; }
  .daycard__when { width: 64px; flex-shrink: 0; }
  .daycard__shifts { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
}

/* ── 16. Charts ──────────────────────────────────────────── */
.chart-grid { stroke: var(--chart-grid); }
.chart-guide { stroke: var(--color-text-3); }
.chart-axis { fill: var(--color-text-3); font-size: 11px; font-family: var(--font-sans); }
.bars { display: flex; align-items: flex-end; justify-content: space-between; gap: 8px; }
.bars__col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: 6px; min-width: 0; }
.bars__val { font-size: 12.5px; font-weight: 600; color: var(--color-text-2); }
.bars__bar { width: 100%; max-width: 44px; border-radius: 7px 7px 2px 2px; background: var(--color-brand); transition: height .45s cubic-bezier(.4, 0, .2, 1); }
.bars__bar--paid { background: var(--color-success-fill); }
.bars__lab { font-size: 12.5px; color: var(--color-text-3); white-space: nowrap; }
.hbar { height: 20px; border-radius: 7px; background: var(--color-surface-muted); overflow: hidden; flex: 1; }
.hbar > span { display: block; height: 100%; border-radius: 7px; background: var(--color-brand); transition: width .45s cubic-bezier(.4, 0, .2, 1); }

/* ── 17. Utilities ───────────────────────────────────────── */
.stack { display: flex; flex-direction: column; gap: 16px; }
.stack--sm { gap: 8px; }
.stack--md { gap: 12px; }
.stack--lg { gap: 20px; }
.row { display: flex; align-items: center; gap: 10px; }
.row--wrap { flex-wrap: wrap; }
.row--between { justify-content: space-between; }
.row--start { align-items: flex-start; }
.row--baseline { align-items: baseline; }
.row--end { justify-content: flex-end; }
.gap-1 { gap: 4px; } .gap-2 { gap: 8px; } .gap-3 { gap: 12px; } .gap-4 { gap: 16px; } .gap-5 { gap: 20px; }
.grow { flex: 1; min-width: 0; }
.shrink-0 { flex-shrink: 0; }
.push-end { margin-inline-start: auto; }
.grid { display: grid; gap: 18px; }
.grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid--2-1 { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.grid--side { grid-template-columns: minmax(0, 1fr) 340px; align-items: start; }
@media (max-width: 1180px) { .grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .grid--side { grid-template-columns: 1fr; } }
@media (max-width: 900px)  { .grid--3, .grid--2-1 { grid-template-columns: 1fr; } .grid--2.grid--stack { grid-template-columns: 1fr; } }
@media (max-width: 520px)  { .form-grid--2.form-grid--stack { grid-template-columns: 1fr; } }
.gap-sm { gap: 10px; }
.mt-1 { margin-top: 4px; } .mt-2 { margin-top: 8px; } .mt-3 { margin-top: 12px; } .mt-4 { margin-top: 16px; } .mt-5 { margin-top: 20px; } .mt-6 { margin-top: 28px; }
.mb-2 { margin-bottom: 8px; } .mb-3 { margin-bottom: 12px; } .mb-4 { margin-bottom: 20px; }
.p-0 { padding: 0 !important; }
.w-full { width: 100%; }
.min-0 { min-width: 0; }
.text-xs { font-size: 12.5px; } .text-sm { font-size: 13.5px; } .text-md { font-size: 15px; } .text-lg { font-size: 16px; } .text-xl { font-size: 20px; }
.fw-5 { font-weight: 500; } .fw-6 { font-weight: 600; } .fw-7 { font-weight: 700; }
.muted { color: var(--color-text-2); }
.faint { color: var(--color-text-3); }
.text-accent { color: var(--color-accent); }
.text-success { color: var(--color-success); }
.text-warning { color: var(--color-warning); }
.text-danger { color: var(--color-danger); }
.text-info { color: var(--color-info); }
.mono { font-family: var(--font-mono); font-size: .92em; }
.num { text-align: end; white-space: nowrap; }
.nowrap { white-space: nowrap; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.center { text-align: center; }
.end { text-align: end; }
.upper { text-transform: uppercase; letter-spacing: .06em; }
.relative { position: relative; }
.inline-form { display: inline; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.divider { height: 1px; background: var(--color-border); border: 0; margin: 0; }
.fade-up { animation: fade-up .4s cubic-bezier(.22, 1, .36, 1) both; }
.fade-up:nth-child(2) { animation-delay: 50ms; } .fade-up:nth-child(3) { animation-delay: 100ms; } .fade-up:nth-child(4) { animation-delay: 150ms; }
@media (max-width: 640px) { .hide-sm { display: none !important; } }
@media (min-width: 641px) { .only-sm { display: none !important; } }
@media (max-width: 900px) { .hide-md { display: none !important; } }

/* Sticky action bar for phone forms */
@media (max-width: 640px) {
  .sticky-submit {
    position: fixed; inset-inline: 0; bottom: 0; z-index: 25;
    padding: 10px 14px calc(10px + env(safe-area-inset-bottom, 0px));
    background: color-mix(in srgb, var(--color-surface) 94%, transparent);
    -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
    box-shadow: inset 0 1px 0 var(--color-border);
  }
  .has-sticky-submit { padding-bottom: 76px; }
  /* iOS zooms the page when a focused field is under 16px */
  .input, .select, .textarea { font-size: 16px; }
}

/* Auth screen */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.auth__box { width: 100%; max-width: 400px; }
.auth__brand { text-align: center; margin-bottom: 22px; }
.auth__logo { width: 68px; height: 68px; margin: 0 auto 12px; border-radius: 20px; background: #fff; display: grid; place-items: center; overflow: hidden; box-shadow: inset 0 0 0 1px var(--color-border), var(--shadow-card); }
.auth__logo img { width: 100%; height: 100%; object-fit: contain; }

@keyframes pop-in { from { opacity: 0; transform: translateY(-4px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes toast-in { from { opacity: 0; transform: translateY(12px) scale(.96); } to { opacity: 1; transform: none; } }
@keyframes fade-up { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }

@media print {
  .sidebar, .topbar, .bottom-nav, .filterbar, .page-head__actions, .toast-host { display: none !important; }
  .shell__main { padding: 0 !important; }
  .card { box-shadow: none; background: #fff; }
}
