/* Shepherd design system: FinAcc tokens (Sept 2026 chase-board restyle, Oct 2026 Sora + Inter).
   Every component reads these tokens; no hard-coded colors below the token blocks. */

@font-face { font-family: 'Sora'; font-style: normal; font-weight: 600; font-display: swap; src: url('/static/fonts/sora/sora-latin-600-normal.woff2') format('woff2'); }
@font-face { font-family: 'Sora'; font-style: normal; font-weight: 700; font-display: swap; src: url('/static/fonts/sora/sora-latin-700-normal.woff2') format('woff2'); }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 300; font-display: swap; src: url('/static/fonts/inter/inter-latin-300-normal.woff2') format('woff2'); }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 400; font-display: swap; src: url('/static/fonts/inter/inter-latin-400-normal.woff2') format('woff2'); }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 500; font-display: swap; src: url('/static/fonts/inter/inter-latin-500-normal.woff2') format('woff2'); }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 600; font-display: swap; src: url('/static/fonts/inter/inter-latin-600-normal.woff2') format('woff2'); }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 700; font-display: swap; src: url('/static/fonts/inter/inter-latin-700-normal.woff2') format('woff2'); }

:root {
  --bg: #eef2f5; --surface: #ffffff; --surface-2: #e4ebf0; --border: #d2dde3;
  --ink: #1f3345; --ink-muted: #54677a; --ink-faint: #8798a7;
  --accent: #2f7fa0; --accent-ink: #ffffff; --accent-soft: #e2eef3;
  --accent-2: #f6a10e; --accent-2-soft: #fdecd1;
  --good: #2f8f5b; --good-soft: #e3f2e9;
  --bad: #b93c4b; --bad-soft: #f6e3e5;
  --warn: #96650a; --warn-soft: #f4ecd9;
  --violet: #7a5c9e; --slate: #52708a; --slate-soft: #e7edf1;
  --rail: #0b1220; --rail-border: rgba(255, 255, 255, 0.10);
  --nav-on-bg: rgba(47, 127, 160, 0.28); --nav-on-border: rgba(78, 168, 222, 0.55);
  --shadow: 0 1px 2px rgba(31, 51, 69, 0.07), 0 6px 20px -8px rgba(31, 51, 69, 0.16);
  --font-display: 'Sora', -apple-system, 'Segoe UI', sans-serif;
  --font-ui: 'Inter', -apple-system, 'Segoe UI', sans-serif;
  --font-mono: 'SFMono-Regular', Consolas, 'Liberation Mono', monospace;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #070b14; --surface: #121a2b; --surface-2: #1a2438; --border: rgba(255, 255, 255, 0.10);
    --ink: #f1f5f9; --ink-muted: #94a3b8; --ink-faint: #64748b;
    --accent: #ff6b2c; --accent-ink: #070b14; --accent-soft: rgba(255, 107, 44, 0.12);
    --accent-2: #4ea8de; --accent-2-soft: rgba(78, 168, 222, 0.08);
    --good: #5fd095; --good-soft: #163527;
    --bad: #fecaca; --bad-soft: rgba(69, 10, 10, 0.40);
    --warn: #f5c14a; --warn-soft: rgba(245, 193, 74, 0.14);
    --violet: #b39ad4; --slate: #cbd5e1; --slate-soft: rgba(71, 85, 105, 0.28);
    --nav-on-bg: rgba(255, 107, 44, 0.14); --nav-on-border: rgba(255, 107, 44, 0.50);
    --shadow: 0 0 0 1px rgba(255, 255, 255, 0.04), 0 18px 50px rgba(0, 0, 0, 0.35);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #070b14; --surface: #121a2b; --surface-2: #1a2438; --border: rgba(255, 255, 255, 0.10);
  --ink: #f1f5f9; --ink-muted: #94a3b8; --ink-faint: #64748b;
  --accent: #ff6b2c; --accent-ink: #070b14; --accent-soft: rgba(255, 107, 44, 0.12);
  --accent-2: #4ea8de; --accent-2-soft: rgba(78, 168, 222, 0.08);
  --good: #5fd095; --good-soft: #163527;
  --bad: #fecaca; --bad-soft: rgba(69, 10, 10, 0.40);
  --warn: #f5c14a; --warn-soft: rgba(245, 193, 74, 0.14);
  --violet: #b39ad4; --slate: #cbd5e1; --slate-soft: rgba(71, 85, 105, 0.28);
  --nav-on-bg: rgba(255, 107, 44, 0.14); --nav-on-border: rgba(255, 107, 44, 0.50);
  --shadow: 0 0 0 1px rgba(255, 255, 255, 0.04), 0 18px 50px rgba(0, 0, 0, 0.35);
  color-scheme: dark;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font-ui); font-weight: 300; font-size: 14px; line-height: 1.45; }
a { color: var(--accent); }
button, input, select, textarea { font-family: inherit; }
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 600; margin: 0; }
h1 { font-size: 26px; line-height: 1.2; }
h2 { font-size: 18px; }
h3 { font-size: 15px; }
.num, td.r, .r { font-variant-numeric: tabular-nums; }
.r { text-align: right; }
.muted { color: var(--ink-muted); }
.tiny { font-size: 12px; color: var(--ink-muted); }
.eyebrow { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-muted); font-weight: 500; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Shell */
.shell { display: flex; flex-wrap: wrap; min-height: 100vh; }
.rail { flex: 1 1 236px; max-width: 100%; background: var(--rail); color: #cbd5e1; display: flex; flex-direction: column; gap: 18px; padding: 18px 14px; }
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 6px 14px; border-bottom: 1px solid var(--rail-border); color: inherit; text-decoration: none; }
.brand b { display: block; font-family: var(--font-display); font-weight: 600; font-size: 17px; color: #fff; }
.brand small { display: block; font-size: 11px; color: #94a3b8; font-weight: 400; }
.navgrp { display: flex; flex-direction: column; gap: 2px; }
.navlbl { font-size: 10.5px; text-transform: uppercase; letter-spacing: .08em; color: #8a9bb0; font-weight: 500; padding: 0 10px 6px; }
.nav { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; border: 1px solid transparent; color: rgba(241, 245, 249, .74); text-decoration: none; font-size: 13.5px; font-weight: 400; min-height: 36px; }
.nav:hover { background: rgba(255, 255, 255, .05); color: #fff; }
.nav.on { background: var(--nav-on-bg); border-color: var(--nav-on-border); color: #fff; font-weight: 500; }
.nav svg { width: 16px; height: 16px; flex: none; }
.me { margin-top: auto; display: flex; align-items: center; gap: 10px; padding: 14px 8px 2px; border-top: 1px solid var(--rail-border); }
.me .av { background: rgba(255, 255, 255, .12); color: #fff; }
.me b { display: block; color: #fff; font-weight: 500; font-size: 13px; }
.me small { color: #94a3b8; font-size: 11.5px; }
.me form { margin-left: auto; }
.me button { background: none; border: 0; color: #94a3b8; font-size: 12px; cursor: pointer; padding: 6px; white-space: nowrap; }
.me button:hover { color: #fff; }
.main { flex: 999 1 560px; min-width: 0; padding: 24px 32px 48px; }
.wrap { max-width: 1240px; margin: 0 auto; display: flex; flex-direction: column; gap: 20px; }
.top { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; }
.titlerow { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 4px; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

/* Components */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow); padding: 20px; }
.cardhd { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.card.empty { text-align: left; padding: 32px; }
.card.empty h2 { margin: 6px 0 8px; }
.btn { font-family: inherit; font-size: 13px; font-weight: 500; line-height: 1; border-radius: 8px; border: 1px solid var(--border); background: var(--surface); color: var(--ink); padding: 0 14px; min-height: 38px; display: inline-flex; align-items: center; gap: 6px; cursor: pointer; text-decoration: none; }
.btn:hover { border-color: var(--ink-faint); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.danger { background: var(--bad-soft); border-color: var(--bad-soft); color: var(--bad); }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.sm { min-height: 30px; padding: 0 10px; font-size: 12px; }
.btn svg { width: 15px; height: 15px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.pill { display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; padding: 3px 10px; font-size: 12px; font-weight: 500; white-space: nowrap; line-height: 1.3; }
.pill::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill.good { background: var(--good-soft); color: var(--good); }
.pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.bad { background: var(--bad-soft); color: var(--bad); }
.pill.acc { background: var(--accent-soft); color: var(--accent); }
.pill.slate { background: var(--slate-soft); color: var(--slate); }
.pill.todo { background: transparent; color: var(--ink-muted); border: 1px dashed var(--border); }
.pill.todo::before { background: transparent; border: 1px dashed currentColor; }
.av { width: 32px; height: 32px; border-radius: 50%; background: var(--slate-soft); color: var(--slate); display: inline-flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 600; flex: none; }
.av.sm { width: 28px; height: 28px; font-size: 10px; }
.av.xl { width: 68px; height: 68px; font-size: 22px; }
.who { display: flex; align-items: center; gap: 10px; }
.who b, .who a { font-weight: 500; display: block; text-decoration: none; }
.who small { color: var(--ink-muted); font-size: 12px; display: block; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; }
.kpi .v { font-size: 28px; font-weight: 600; font-variant-numeric: tabular-nums; margin: 6px 0 4px; }
.split { display: flex; flex-wrap: wrap; gap: 20px; align-items: flex-start; }
.split > .a { flex: 3 1 560px; min-width: 0; display: flex; flex-direction: column; gap: 20px; }
.split > .b { flex: 1 1 300px; min-width: 0; display: flex; flex-direction: column; gap: 20px; }
.tbl { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-muted); font-weight: 500; padding: 0 12px 10px; white-space: nowrap; }
th.r { text-align: right; }
td { padding: 11px 12px; border-top: 1px solid var(--border); vertical-align: middle; }
td.nowrap { white-space: nowrap; }
.dl { display: grid; grid-template-columns: auto 1fr; gap: 9px 16px; margin: 0; font-size: 13px; }
.dl dt { color: var(--ink-muted); }
.dl dd { margin: 0; }
.restricted { display: flex; align-items: center; gap: 8px; background: var(--slate-soft); border-radius: 8px; padding: 8px 12px; font-size: 12.5px; margin-bottom: 14px; }
.restricted svg { width: 14px; height: 14px; color: var(--slate); flex: none; }
.banner { display: flex; align-items: center; gap: 10px; border-radius: 10px; padding: 10px 14px; font-size: 13px; }
.banner.warn { background: var(--warn-soft); color: var(--warn); }
.banner.bad { background: var(--bad-soft); color: var(--bad); }
.banner.good { background: var(--good-soft); color: var(--good); }
.banner.info { background: var(--accent-soft); color: var(--ink); }
.problems { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.problems li { font-size: 13px; }
.tl { list-style: none; margin: 0; padding: 0; }
.tl li { position: relative; padding: 0 0 20px 28px; }
.tl li::before { content: ''; position: absolute; left: 5px; top: 10px; bottom: -4px; border-left: 1.5px solid var(--border); }
.tl li:last-child { padding-bottom: 0; }
.tl li:last-child::before { display: none; }
.tl li::after { content: ''; position: absolute; left: 0; top: 4px; width: 12px; height: 12px; border-radius: 50%; background: var(--surface); border: 2px solid var(--accent); }
.tl li:first-child::after { background: var(--accent); }
.tl .when { font-size: 12px; color: var(--ink-muted); font-variant-numeric: tabular-nums; display: flex; gap: 8px; align-items: center; }
.tl b { display: block; font-weight: 500; margin: 2px 0; }
.src { font-size: 10.5px; text-transform: uppercase; letter-spacing: .05em; font-weight: 500; background: var(--surface-2); color: var(--ink-muted); border-radius: 6px; padding: 1px 6px; }

/* Forms: one field pattern everywhere — label above, help text below, errors inline. */
.form { display: flex; flex-direction: column; gap: 14px; max-width: 560px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-muted); font-weight: 500; }
.field label .req { color: var(--bad); margin-left: 2px; }
.field .help { font-size: 12px; color: var(--ink-muted); }
.field .error { font-size: 12px; color: var(--bad); }
input[type=text], input[type=email], input[type=tel], input[type=date], input[type=search], input[type=file], select, textarea {
  font-size: 13px; color: var(--ink); background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; min-height: 38px; width: 100%;
}
textarea { min-height: 80px; resize: vertical; }
input:focus-visible, select:focus-visible, textarea:focus-visible, .btn:focus-visible, .nav:focus-visible, a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.search { display: flex; align-items: center; gap: 8px; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 0 12px; min-height: 38px; min-width: 300px; color: var(--ink-muted); }
.search svg { width: 15px; height: 15px; flex: none; }
.search input { border: 0; background: transparent; padding: 0; min-height: 36px; outline: none; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.filters select { width: auto; }

/* Org chart */
.org-tree, .org-tree ul { list-style: none; margin: 0; padding: 0; }
.org-tree ul { margin-left: 22px; padding-left: 20px; border-left: 1.5px solid var(--border); }
.org-tree li { position: relative; padding-top: 10px; }
.org-tree ul > li::before { content: ''; position: absolute; left: -20px; top: 32px; width: 18px; border-top: 1.5px solid var(--border); }
.pc { display: inline-flex; align-items: center; gap: 10px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 8px 12px; box-shadow: var(--shadow); min-width: 260px; text-decoration: none; color: inherit; }
.pc b { display: block; font-weight: 500; font-size: 13px; line-height: 1.3; }
.pc small { display: block; font-size: 12px; color: var(--ink-muted); }
.pc .cnt { margin-left: auto; font-size: 11.5px; font-weight: 500; color: var(--ink-muted); background: var(--surface-2); border-radius: 999px; padding: 2px 8px; font-variant-numeric: tabular-nums; }

/* Sign-in */
.signin { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.signin .card { width: 100%; max-width: 420px; display: flex; flex-direction: column; gap: 16px; }

.meta { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 6px; font-size: 12px; color: var(--ink-muted); }
.meta > span { white-space: nowrap; }
.meta a { display: inline; }

/* Phones: the sidebar becomes a compact top bar with a swipeable row of links. */
@media (max-width: 760px) {
  .rail { flex: 1 1 100%; flex-direction: row; align-items: center; gap: 6px; padding: 10px 12px; overflow-x: auto; scrollbar-width: none; }
  .rail::-webkit-scrollbar { display: none; }
  .brand { border-bottom: 0; padding: 0 8px 0 0; flex: none; }
  .brand div { display: none; }
  .navgrp { flex-direction: row; flex: none; gap: 2px; }
  .navlbl { display: none; }
  .nav { white-space: nowrap; padding: 6px 10px; }
  .me { margin: 0; padding: 0 0 0 6px; border-top: 0; flex: none; }
  .me > div { display: none; }
  .main { padding: 16px 16px 40px; }
  .search { min-width: 0; flex: 1 1 100%; }
  h1 { font-size: 22px; }
}
