/* ==========================================================================
   SiteBound brand layer (SiteBound Brand Guide, Nov 2026).
   Loaded last: maps the brand tokens (brand/sitebound-tokens.css) onto the app's own variables and sets the
   fonts, the navy sidebar with the mark, corners and the sign-in lockup. Light theme is the default
   (<html data-theme="light">); data-theme="dark" gives the navy theme.
   Purple is the accent only: buttons, links, the active nav item, focus and selection. Keep large areas
   field white, white and navy.
   ========================================================================== */

:root, :root[data-theme="light"] {
  /* Softer light: a warm stone page and off-white cards instead of pure white, to cut glare. Text stays navy. */
  --bg: #ECEAE3; --card: #FAF9F5; --fg: var(--sb-navy); --mut: var(--sb-slate); --line: #D6D4CC; --field: #F3F2ED;
  --accent: var(--sb-sitebound-purple); --accent-fg: #fff;
  --pass: var(--sb-status-on-track); --fail: var(--sb-status-late); --warn: var(--sb-status-at-risk);
  --ok: #E5F1E6; --failbg: #FBE5E5;
  /* Status colors: the guide's four (on track, at risk, late, pending), plus the inspection and date
     statuses set to sit alongside them. Same values as packages/report/src/status-colors.ts. */
  --s-on_track: #2E7D32; --s-at_risk: #9A6312; --s-late: #C62828; --s-pending_submittal: #4A5668;
  --s-needs_dates: #6E5700; --s-waiting_inspection: #1B5A96; --s-inspection_overdue: #8E1F55; --s-inspected: #0D6660; --s-cancelled: #7A8591;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: var(--sb-navy); --card: var(--sb-navy-raised); --fg: #fff; --mut: var(--sb-slate-light); --line: #2C3B54;
  --accent: var(--sb-sitebound-purple-on-navy); --accent-fg: var(--sb-navy);
  --s-on_track: #6CC070; --s-at_risk: #E0A04A; --s-late: #FF7B72; --s-pending_submittal: #B8C0CC;
  --s-needs_dates: #E8CF5A; --s-waiting_inspection: #6CB4F0; --s-inspection_overdue: #F28AB8; --s-inspected: #4FD1C5; --s-cancelled: #7A8591;
  --field: #13213A;
  color-scheme: dark;
}

/* ---------- type ---------- */
body { padding: 0; font-family: var(--sb-font-body); font-size: 15px; }
h1, h2, h3, .topbar h1, .panel h3, .auth-card h1 { font-family: var(--sb-font-display); letter-spacing: 0; }
.topbar h1 { font-size: 28px; font-weight: 700; line-height: 1.1; }
.panel h3 { font-size: 18px; font-weight: 700; }
.kpi .val, .rec b { font-family: var(--sb-font-display); font-weight: 700; }
.kpi .val { font-size: 34px; }
.kpi .lbl, .rec .hint { font-weight: 500; }
.tbl th { font-family: var(--sb-font-display); font-weight: 600; font-size: 12px; letter-spacing: .12em; }
.st { font-weight: 600; }
input, select, textarea, button { font-family: var(--sb-font-body); }
input, select, textarea { background: var(--field); }

/* ---------- corners: 6 inputs and buttons, 10 cards, 16 sheets ---------- */
input, select, textarea, .primary, .ghost, button { border-radius: var(--sb-radius-sm); }
.panel, .kpi, .rec, .auth-card, .mini { border-radius: var(--sb-radius-md); }
.bulk { border-radius: var(--sb-radius-lg); }

/* ---------- accent ---------- */
a { color: var(--accent); }
a:hover { color: var(--sb-sitebound-purple-hover); }
.primary { background: var(--accent); color: var(--accent-fg); }
.primary:hover:not(:disabled) { background: var(--sb-sitebound-purple-hover); }
.kpi.sel { outline: 2px solid var(--accent); }
.tbl tbody tr:has(input[type=checkbox]:checked) { background: var(--sb-sitebound-purple-tint); }
input:focus-visible, select:focus-visible, textarea:focus-visible { border-color: var(--accent); box-shadow: 0 0 0 3px var(--sb-sitebound-purple-tint-strong); outline: none; }

/* ---------- wordmark ---------- */
.sb-word { font-size: 24px; letter-spacing: -.005em; color: inherit; }
.sb-word b { color: var(--accent); }

/* ---------- navy sidebar with the white mark ---------- */
.side { background: var(--sb-navy); border-right: 0; color: #fff; }
.side .logo { display: flex; align-items: center; gap: 10px; padding: 6px 10px 18px; color: #fff; text-decoration: none; }
.side .logo .mark { width: 28px; height: auto; flex: none; }
.side .sb-word b { color: var(--sb-sitebound-purple-on-navy); }
.side nav a { color: var(--sb-slate-light); font-weight: 500; }
.side nav a:hover { background: var(--sb-navy-raised); color: #fff; }
.side nav a.on { background: var(--sb-navy-raised); color: #fff; font-weight: 600; box-shadow: inset 3px 0 0 var(--sb-sitebound-purple-on-navy); }
.side #badge .chip { background: var(--sb-sitebound-purple-on-navy); color: var(--sb-navy); border: 0; border-radius: 99px; padding: 1px 8px; font-size: 12px; font-weight: 700; margin-left: 4px; }
.who-box { border-top-color: #2C3B54; }
.who-box b { color: #fff; }
.who-box .hint { color: var(--sb-slate-light); }
.who-box .ghost { color: #fff; border-color: #3A4A64; background: transparent; }
.who-box .ghost:hover { background: var(--sb-navy-raised); }

/* ---------- sign-in: lockup, job line, family tagline ---------- */
.auth { background: var(--bg); align-content: center; gap: 18px; }
.auth-card { max-width: 420px; padding: 28px; gap: 14px; }
.lockup { display: flex; align-items: center; gap: 14px; }
.lockup .mark { width: 44px; height: auto; flex: none; }
.lockup .sb-word { font-size: 34px; display: block; color: var(--sb-navy); }
.byline { display: block; margin-top: 4px; font-family: var(--sb-font-display); font-weight: 600; font-size: 10.5px; letter-spacing: .25em; text-transform: uppercase; color: var(--sb-slate); }
.job-line { margin: -4px 0 4px; color: var(--mut); font-size: 14px; }
.tagline { margin: 0; text-align: center; font-family: var(--sb-font-display); font-weight: 600; color: var(--mut); letter-spacing: .02em; }

/* ---------- phone: the navy bar runs across the top ---------- */
@media (max-width: 760px) {
  .side { padding: 8px 12px 10px; gap: 6px; flex-direction: row; flex-wrap: wrap; align-items: center; }
  .side .logo { padding: 2px 4px; margin-right: auto; }
  .side .sb-word { font-size: 20px; }
  .side nav { flex-direction: row; flex-wrap: wrap; gap: 4px; width: 100%; order: 3; }
  .side nav a { padding: 8px 10px; font-size: 14px; }
  .who-box { margin: 0; border: 0; padding: 0; flex-direction: row; align-items: center; gap: 8px; }
  .who-box b, .who-box .hint { display: none; }
  .topbar { flex-direction: column; align-items: stretch; padding: 14px 16px 12px; }
  .topbar h1 { font-size: 24px; }
  .tb-right { flex-wrap: wrap; }
  .page { padding: 16px 16px 32px; }
}
.st[class*=" s-"] { background: color-mix(in srgb, var(--sc) 4%, var(--card)); }
:root[data-theme="dark"] .st[class*=" s-"] { background: color-mix(in srgb, var(--sc) 15%, transparent); }

/* ---------- Light / Navy switch (each person's choice, kept on their computer) ---------- */
.theme-switch { display: inline-flex; border: 1px solid #3A4A64; border-radius: var(--sb-radius-sm); overflow: hidden; margin: 2px 0 6px; align-self: flex-start; }
.theme-switch button { background: transparent; border: 0; border-radius: 0; color: var(--sb-slate-light); padding: 5px 12px; font-size: 13px; font-weight: 500; }
.theme-switch button[aria-pressed="true"] { background: var(--sb-navy-raised); color: #fff; box-shadow: inset 0 -2px 0 var(--sb-sitebound-purple-on-navy); }
@media (max-width: 760px) { .theme-switch { margin: 0; } }

/* ---------- navy theme details ---------- */
:root[data-theme="dark"] .side { border-right: 1px solid #22314A; }
:root[data-theme="dark"] .lockup .sb-word { color: #fff; }
:root[data-theme="dark"] .lockup .sb-word b { color: var(--sb-sitebound-purple-on-navy); }
:root[data-theme="dark"] .byline { color: var(--sb-slate-light); }
.lockup .mark.on-dark, :root[data-theme="dark"] .lockup .mark.on-light { display: none; }
:root[data-theme="dark"] .lockup .mark.on-dark { display: block; }
/* Lighter purple for links on navy. :where() keeps it weak, so the sidebar and button-links keep their own colors. */
:where(:root[data-theme="dark"]) a { color: #A08DF4; }
:where(:root[data-theme="dark"]) a:hover { color: #C2B5F8; }
a.btn:not(.primary), a.ghost { color: var(--fg); }
:root[data-theme="dark"] .primary:hover:not(:disabled) { background: #A08DF4; }
:root[data-theme="dark"] .tbl tbody tr:has(input[type=checkbox]:checked) { background: var(--sb-accent-tint); }
:root[data-theme="dark"] input:focus-visible, :root[data-theme="dark"] select:focus-visible, :root[data-theme="dark"] textarea:focus-visible { box-shadow: 0 0 0 3px #3B3470; }
