/* TeamTracker · navy and gold. Colour only where it carries meaning (late, done, focus). */
:root {
  --navy: #0B1F33;
  --navy-2: #13304D;
  --navy-3: #1E4366;
  --gold: #C9A227;
  --gold-soft: #F6EED3;
  --gold-ink: #7A5F0E;
  --ink: #1A2230;
  --ink-2: #3C4656;
  --ink-3: #626C7A;
  --line: #E4E7EC;
  --line-2: #EEF0F3;
  --bg: #F6F7F9;
  --card: #FFFFFF;
  --late: #B42318;
  --late-soft: #FDECEA;
  --ok: #1F7A4D;
  --ok-soft: #E7F4EC;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 1px 3px rgba(16, 24, 40, .06);
  --font: "IBM Plex Sans", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  --row-alt: #ECF0F5;
}

/* Dark theme (set by each person in My profile). Sidebar stays navy; the main area flips. */
:root[data-theme="dark"] {
  --gold: #D9B65A; --gold-soft: #2B2611; --gold-ink: #E6C860;
  --ink: #E7ECF2; --ink-2: #B6C0CC; --ink-3: #8A94A2;
  --line: #273647; --line-2: #1D2A3A; --bg: #0E1621; --card: #16212F;
  --late: #F08A82; --late-soft: #3A1C19; --ok: #5FCF8F; --ok-soft: #133024;
  --row-alt: #1C2836;
  --shadow: 0 1px 2px rgba(0,0,0,.4), 0 1px 3px rgba(0,0,0,.5);
}
:root[data-theme="dark"] input, :root[data-theme="dark"] select, :root[data-theme="dark"] textarea { border-color: #2E3E50; }
/* headings and accents that were navy-on-light need to flip on dark surfaces */
:root[data-theme="dark"] h1, :root[data-theme="dark"] h2, :root[data-theme="dark"] h3,
:root[data-theme="dark"] .health-num, :root[data-theme="dark"] .kpi b,
:root[data-theme="dark"] .topbar .brand-sm, :root[data-theme="dark"] .iconbtn,
:root[data-theme="dark"] .tab.on, :root[data-theme="dark"] .tab:hover,
:root[data-theme="dark"] .row:hover .row-title, :root[data-theme="dark"] .notif-list .unread .row-title,
:root[data-theme="dark"] .chip-btn, :root[data-theme="dark"] .btn-secondary { color: var(--ink); }
@media (prefers-color-scheme: dark) {
  :root[data-theme="auto"] {
    --gold: #D9B65A; --gold-soft: #2B2611; --gold-ink: #E6C860;
    --ink: #E7ECF2; --ink-2: #B6C0CC; --ink-3: #8A94A2;
    --line: #273647; --line-2: #1D2A3A; --bg: #0E1621; --card: #16212F;
    --late: #F08A82; --late-soft: #3A1C19; --ok: #5FCF8F; --ok-soft: #133024;
    --row-alt: #1C2836;
    --shadow: 0 1px 2px rgba(0,0,0,.4), 0 1px 3px rgba(0,0,0,.5);
  }
  :root[data-theme="auto"] input, :root[data-theme="auto"] select, :root[data-theme="auto"] textarea { border-color: #2E3E50; }
  :root[data-theme="auto"] h1, :root[data-theme="auto"] h2, :root[data-theme="auto"] h3,
  :root[data-theme="auto"] .health-num, :root[data-theme="auto"] .kpi b,
  :root[data-theme="auto"] .topbar .brand-sm, :root[data-theme="auto"] .iconbtn,
  :root[data-theme="auto"] .tab.on, :root[data-theme="auto"] .tab:hover,
  :root[data-theme="auto"] .row:hover .row-title, :root[data-theme="auto"] .notif-list .unread .row-title,
  :root[data-theme="auto"] .chip-btn, :root[data-theme="auto"] .btn-secondary { color: var(--ink); }
}

/* Text size (set by each person in My profile) */
:root[data-text="s"] body { font-size: 15px; }
:root[data-text="l"] body { font-size: 18px; }

/* Profile link in the sidebar footer */
.side-me a.who { text-decoration: none; color: inherit; display: flex; flex-direction: column; }
.side-me a.who:hover b { text-decoration: underline; }

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 16px/1.55 var(--font); color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased; }
a { color: var(--navy-3); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0 0 .4em; line-height: 1.25; color: var(--navy); }
h1 { font-size: 1.6rem; font-weight: 700; letter-spacing: -.01em; }
h2, .h2 { font-size: 1.1rem; font-weight: 650; }
h3, .h3 { font-size: .98rem; font-weight: 650; }
p { margin: 0 0 .6em; }
ol, ul { margin: 0 0 .6em; padding-left: 1.2em; }
code { background: var(--line-2); padding: 1px 5px; border-radius: 4px; font-size: .9em; }
small, .small { font-size: .85rem; }
.muted { color: var(--ink-3); }
.help { color: var(--ink-3); font-size: .83rem; margin: .25em 0 0; }
.eyebrow { display: block; font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); font-weight: 600; margin-bottom: .3em; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.skip { position: absolute; left: -999px; top: 8px; background: var(--gold); color: var(--navy); padding: 8px 12px; border-radius: 6px; z-index: 99; }
.skip:focus { left: 8px; }
.txt-late { color: var(--late); font-weight: 600; }
.txt-soon { color: var(--gold-ink); font-weight: 600; }
.txt-gold { color: var(--gold); }
.txt-late-light { color: #FF9B91; }
.txt-ok-light { color: #8FE0B5; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }

/* Layout */
.shell { display: flex; min-height: 100vh; }
.side { width: 248px; flex: 0 0 248px; background: var(--navy); color: #C9D3DF; padding: 18px 14px; position: sticky; top: 0; height: 100vh; overflow: hidden; display: flex; flex-direction: column; gap: 14px; }
.side .nav { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; scrollbar-gutter: stable; display: flex; flex-direction: column; gap: 2px; margin: 0 -4px; padding: 0 2px; }
.side ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 2px; }
.nav-group { margin-top: 6px; padding-top: 6px; border-top: 1px solid rgba(255,255,255,.07); }
.nav-group > summary { display: flex; align-items: center; gap: 8px; padding: 7px 10px; margin-bottom: 2px; border-radius: 8px; color: #8294AB; font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; cursor: pointer; list-style: none; }
.nav-group > summary::-webkit-details-marker { display: none; }
.nav-group > summary:hover { color: #EAF0F7; background: rgba(255,255,255,.05); }
.nav-group > summary .nav-group-label { flex: 1; }
.nav-group > summary .chev { width: 7px; height: 7px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(-45deg); opacity: .6; }
.nav-group[open] > summary .chev { transform: rotate(45deg); }
.nav-group.has-current > summary { color: var(--gold); }
.nav-group.has-current > summary .here { color: var(--gold); font-size: 1.1rem; line-height: 0; margin-left: -2px; }
.nav-group > summary .count { background: var(--gold); color: var(--navy); font-size: .72rem; border-radius: 10px; padding: 1px 7px; font-weight: 800; }
.side ul a { display: flex; align-items: center; gap: 11px; padding: 10px 11px; border-radius: 9px; color: #C9D3DF; font-weight: 500; }
.side ul a .ic { color: #93A3B8; flex: 0 0 auto; }
.side ul a:hover { background: var(--navy-2); color: #fff; text-decoration: none; }
.side ul a:hover .ic { color: #EAF0F7; }
.side ul a[aria-current="page"] { background: linear-gradient(90deg, rgba(201,162,39,.16), var(--navy-2) 40%); color: #fff; box-shadow: inset 3px 0 0 var(--gold); font-weight: 600; }
.side ul a[aria-current="page"] .ic { color: var(--gold); }
.side ul a span { flex: 1; }
.side .count { background: var(--late); color: #fff; font-size: .72rem; border-radius: 10px; padding: 1px 7px; }
.side-search input { width: 100%; background: var(--navy-2); border: 1px solid var(--navy-3); color: #fff; }
.side-search input::placeholder { color: #8A9BB0; }
.side-me { margin-top: auto; display: flex; align-items: center; gap: 10px; padding-top: 12px; border-top: 1px solid var(--navy-2); }
.side-me .who { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.side-me .who b { color: #fff; font-weight: 600; font-size: .9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-me .who small { color: #8A9BB0; }
.side-me .link { color: #C9D3DF; font-size: .8rem; }
.brand { display: flex; align-items: center; gap: 10px; color: #fff; font-size: 1.15rem; letter-spacing: -.01em; }
.brand:hover { text-decoration: none; }
.brand b { color: var(--gold); font-weight: 700; }
.brand-lg { font-size: 1.5rem; color: var(--navy); justify-content: center; margin-bottom: 18px; }
.main-wrap { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { display: flex; align-items: center; gap: 8px; padding: 10px 24px; background: var(--card); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.topbar .brand-sm { display: none; color: var(--navy); font-size: 1.05rem; }
.spacer { flex: 1; }
.main { padding: 24px; max-width: 1180px; width: 100%; margin: 0 auto; }
.iconbtn { position: relative; display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 10px; color: var(--navy); }
.iconbtn:hover { background: var(--line-2); text-decoration: none; }
.ic { width: 20px; height: 20px; flex: 0 0 auto; }
.badge { position: absolute; top: 3px; right: 2px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--late); color: #fff; font-size: .7rem; font-weight: 700; display: grid; place-items: center; border: 2px solid var(--card); }
.badge[hidden] { display: none; }
.net { background: var(--gold-soft); color: var(--gold-ink); font-size: .8rem; border-radius: 20px; padding: 3px 10px; }
.net[hidden] { display: none; }
.bottom { display: none; }

/* Cards and sections */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); margin-bottom: 14px; }
.sub-card { border-top: 1px solid var(--line); margin-top: 14px; padding-top: 14px; }
.section { margin-top: 22px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.section-head h2 { margin: 0; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.page-head h1 { margin: 0; }
.page-head p { flex-basis: 100%; margin: 0; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.grid-2 > .card, .grid-3 > .card { margin-bottom: 0; }
.empty { color: var(--ink-3); text-align: center; padding: 22px; }
.note { background: var(--line-2); border-radius: var(--radius-sm); padding: 10px 12px; margin: 10px 0; }
.note p:last-child { margin: 0; }
.note.warn, .warn .note { background: var(--late-soft); }
.highlight { border-color: var(--gold); box-shadow: 0 0 0 3px var(--gold-soft); }
.ok-box { background: var(--ok-soft); color: var(--ok); border-radius: var(--radius-sm); padding: 8px 12px; }
.count-pill { display: inline-block; background: var(--line-2); color: var(--ink-2); font-size: .78rem; font-weight: 600; border-radius: 10px; padding: 1px 8px; vertical-align: middle; }
.crumbs { font-size: .85rem; color: var(--ink-3); margin-bottom: 10px; }

/* Hero */
.hero { display: grid; grid-template-columns: 1.3fr 1fr; gap: 22px; background: linear-gradient(135deg, var(--navy) 0%, var(--navy-2) 100%); color: #DCE4EE; border-radius: 16px; padding: 26px; margin-bottom: 18px; position: relative; overflow: hidden; }
.hero::after { content: ""; position: absolute; right: -60px; top: -60px; width: 220px; height: 220px; border: 2px solid rgba(201, 162, 39, .25); border-radius: 50%; }
.hero h1 { color: #fff; font-size: 1.75rem; }
.hero .eyebrow { color: var(--gold); }
.hero-sub { color: #9FB0C4; }
.quote { margin: 14px 0 0; padding: 0 0 0 14px; border-left: 3px solid var(--gold); color: #E8EDF3; font-size: 1rem; font-style: italic; }
.quote .eyebrow { font-style: normal; color: #9FB0C4; }
.quote cite { display: block; font-size: .82rem; color: #9FB0C4; margin-top: 4px; font-style: normal; }
.hero-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; align-content: center; position: relative; z-index: 1; }
.stat { background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .1); border-radius: 12px; padding: 12px 14px; color: #9FB0C4; display: flex; flex-direction: column; }
a.stat:hover { background: rgba(255, 255, 255, .1); text-decoration: none; }
.stat b { font-size: 1.8rem; color: #fff; line-height: 1.1; font-weight: 700; }
.stat span { font-size: .8rem; }
.banner { display: block; background: var(--gold-soft); color: var(--gold-ink); border: 1px solid #EAD9A0; border-radius: var(--radius); padding: 12px 16px; font-weight: 600; margin-bottom: 14px; }
.health { display: grid; grid-template-columns: auto 1fr; gap: 6px 18px; align-items: center; }
.health .small { grid-column: 1 / -1; margin: 0; }
.health-num { font-size: 1.6rem; color: var(--navy); }

/* Progress */
.progress { height: 6px; background: var(--line-2); border-radius: 4px; overflow: hidden; margin: 8px 0 4px; }
.progress span { display: block; height: 100%; background: var(--gold); border-radius: 4px; }
.progress-lg { height: 10px; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 9px 16px; border-radius: 9px; border: 1px solid transparent; font: inherit; font-weight: 600; font-size: .9rem; cursor: pointer; text-decoration: none; line-height: 1.2; white-space: nowrap; background: none; }
.btn:hover { text-decoration: none; }
.btn .ic { width: 16px; height: 16px; }
.btn-primary { background: var(--navy); color: #fff; }
.btn-primary:hover { background: var(--navy-2); }
.btn-gold { background: var(--gold); color: var(--navy); }
.btn-gold:hover { background: #D8B23A; }
.btn-secondary { background: var(--card); color: var(--navy); border-color: var(--line); }
.btn-secondary:hover { background: var(--line-2); }
.btn-ok { background: var(--ok); color: #fff; }
.btn-ok:hover { background: #18663F; }
.btn-ghost { color: var(--ink-2); }
.btn-ghost:hover { background: var(--line-2); }
.btn-sm { padding: 6px 11px; font-size: .82rem; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.link { background: none; border: 0; padding: 0; font: inherit; color: var(--navy-3); cursor: pointer; font-weight: 600; }
.link:hover { text-decoration: underline; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 10px; }
.actions form { margin: 0; }
.row-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.inline { display: inline-flex; gap: 8px; align-items: center; margin: 0; }
.steps { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 4px 0 2px; font-size: 13px; }
.steps .st { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; background: var(--row-alt); color: var(--ink-3); font-weight: 600; }
.steps .st.on { background: var(--gold-soft); color: var(--gold-ink); }
.steps .st.done { background: var(--ok-soft); color: var(--ok); }
.steps .sep { color: var(--ink-3); }

/* Chips */
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0; }
.chip { display: inline-flex; align-items: center; font-size: .74rem; font-weight: 600; border-radius: 6px; padding: 2px 8px; background: var(--line-2); color: var(--ink-2); white-space: nowrap; }
.chip-plain { background: transparent; border: 1px solid var(--line); color: var(--ink-3); }
.chip-focus { background: var(--gold-soft); color: var(--gold-ink); }
.chip-late { background: var(--late-soft); color: var(--late); }
.chip-p-high { background: var(--navy); color: #fff; }
.chip-p-medium { background: var(--line-2); color: var(--ink-2); }
.chip-p-low { background: transparent; border: 1px solid var(--line); color: var(--ink-3); }
.chip-s-done { background: var(--ok-soft); color: var(--ok); }
.chip-s-requested { background: var(--gold-soft); color: var(--gold-ink); }
.chip-s-declined { background: var(--late-soft); color: var(--late); }
/* Status shown by a shape (dot) as well as colour, so it reads in B/W and for colour-blind staff */
[class*="chip-s-"]::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; margin-right: 6px; flex: 0 0 7px; }
.chip-btn { font: inherit; font-size: .82rem; background: var(--card); border: 1px solid var(--line); color: var(--navy); border-radius: 20px; padding: 5px 12px; cursor: pointer; }
.chip-btn:hover { border-color: var(--gold); background: var(--gold-soft); }
.quick-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0; }

/* Rows */
.rows { list-style: none; padding: 0; margin: 0; }
.rows { border-radius: var(--radius-sm); overflow: hidden; }
.row { display: flex; align-items: center; gap: 12px; padding: 13px 14px; border-bottom: 1px solid var(--line-2); transition: background .08s; }
.row:nth-child(even) { background: var(--row-alt); }
.row:hover { background: var(--gold-soft); }
.row:hover .row-title { color: var(--navy); }
.row:last-child { border-bottom: 0; }
.row[aria-current="true"], .row.selected { background: var(--gold-soft); box-shadow: inset 4px 0 0 var(--gold); }
.row-main { flex: 1; min-width: 0; display: block; color: inherit; }
a.row-main:hover { text-decoration: none; }
.row-title { color: var(--ink); font-weight: 600; display: block; }
.row-title:hover { color: var(--navy-3); }
.row-meta { display: flex; flex-wrap: wrap; gap: 4px 12px; color: var(--ink-3); font-size: .82rem; margin-top: 2px; }
.row-chips { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.notif-list .unread .row-title { color: var(--navy); }
.dot-new { width: 9px; height: 9px; border-radius: 50%; background: var(--late); flex: 0 0 9px; }
.fold > summary { list-style: none; cursor: pointer; display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.fold > summary::-webkit-details-marker { display: none; }
.fold > summary h2 { margin: 0; }
.fold > summary::after { content: "▾"; margin-left: auto; color: var(--ink-3); }
.fold:not([open]) > summary::after { content: "▸"; }
.fold[open] > summary { margin-bottom: 8px; }

/* Top 3 */
.top3 { display: grid; gap: 12px; }
.top-card { display: flex; gap: 16px; margin: 0; }
.top-num { flex: 0 0 40px; height: 40px; border-radius: 50%; background: var(--navy); color: var(--gold); display: grid; place-items: center; font-weight: 700; font-size: 1.1rem; }
.top-body { flex: 1; min-width: 0; }
.top-title { font-size: 1.05rem; font-weight: 650; color: var(--ink); }
.inline-menu { position: relative; }
.inline-menu > summary { list-style: none; }
.inline-menu > summary::-webkit-details-marker { display: none; }
.menu { position: absolute; z-index: 10; top: 100%; left: 0; background: var(--card); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 8px 24px rgba(16, 24, 40, .12); padding: 4px; min-width: 170px; margin-top: 4px; }
.menu-item { display: block; width: 100%; text-align: left; background: none; border: 0; padding: 8px 10px; font: inherit; border-radius: 6px; cursor: pointer; }
.menu-item:hover { background: var(--line-2); }
.ai-panel { margin-top: 10px; border-top: 1px dashed var(--line); padding-top: 10px; }
.ai-out { white-space: pre-wrap; font-size: .9rem; color: var(--ink); }
.ai-out:not(:empty) { background: var(--gold-soft); border-radius: var(--radius-sm); padding: 10px 12px; margin-top: 8px; }
.ai-out.big { font-size: .95rem; }
.ai-out .copy { display: block; margin-top: 6px; }
.card-title { display: block; font-weight: 650; color: var(--ink); margin-bottom: 4px; }

/* Forms */
.stack { display: flex; flex-direction: column; gap: 8px; }
.stack > label { font-weight: 600; font-size: .88rem; margin-top: 4px; }
.field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.field > label, legend { font-weight: 600; font-size: .88rem; color: var(--ink); }
fieldset { border: 0; padding: 0; margin: 0; }
input, select, textarea { font: inherit; font-size: .95rem; color: var(--ink); background: var(--card); border: 1px solid #CDD3DB; border-radius: 8px; padding: 9px 11px; width: 100%; min-width: 0; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--navy-3); box-shadow: 0 0 0 3px rgba(30, 67, 102, .15); }
input[type="checkbox"], input[type="radio"] { width: auto; accent-color: var(--navy); }
input[type="file"] { padding: 6px; }
textarea { resize: vertical; }
.check { display: flex; align-items: flex-start; gap: 8px; font-weight: 500; font-size: .9rem; cursor: pointer; }
.check input { margin-top: 3px; }
.checks { gap: 8px; }
.form-wide { max-width: 760px; }
.hint:not(:empty) { font-size: .85rem; background: var(--gold-soft); color: var(--gold-ink); border-radius: 8px; padding: 7px 10px; }
.hint button { font: inherit; background: none; border: 0; padding: 0; color: var(--navy); text-decoration: underline; cursor: pointer; font-weight: 600; }
.hint ul { margin: 4px 0 0; }
.inline-field { display: flex; align-items: center; gap: 10px; margin-top: 8px; }
.inline-field input { width: 90px; }
.seg { display: inline-flex; flex-wrap: wrap; gap: 6px; }
.seg label { cursor: pointer; }
.seg input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.seg span { display: inline-flex; flex-direction: column; border: 1px solid var(--line); border-radius: 8px; padding: 6px 12px; font-size: .85rem; background: var(--card); }
.seg input:checked + span { border-color: var(--navy); background: var(--navy); color: #fff; }
.seg input:checked + span small { color: #C9D3DF; }
.seg input:focus-visible + span { outline: 3px solid var(--gold); outline-offset: 2px; }
.seg-wide { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); width: 100%; }
.seg-wide span { padding: 10px 12px; height: 100%; }
.seg small { color: var(--ink-3); font-size: .78rem; }
.hours { display: grid; gap: 8px; margin-top: 6px; }
.hours-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.watch-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 6px; margin-top: 8px; }
.filters { display: grid; grid-template-columns: 2fr 1fr 1fr auto; gap: 8px; align-items: center; }
.filter-box { margin-bottom: 14px; max-width: 360px; }
.code-input { font-size: 1.6rem; letter-spacing: .4em; text-align: center; font-variant-numeric: tabular-nums; }

/* Tabs */
.tabs { display: flex; gap: 4px; overflow-x: auto; border-bottom: 1px solid var(--line); margin-bottom: 14px; scrollbar-width: none; }
.tab { padding: 9px 13px; color: var(--ink-2); font-weight: 600; font-size: .88rem; border-bottom: 2px solid transparent; white-space: nowrap; }
.tab:hover { color: var(--navy); text-decoration: none; }
.tab.on { color: var(--navy); border-bottom-color: var(--gold); }

/* Flash */
.flash { border-radius: 10px; padding: 11px 14px; margin-bottom: 12px; font-weight: 500; border: 1px solid; }
.flash-success { background: var(--ok-soft); color: var(--ok); border-color: #BFE3CD; }
.flash-error { background: var(--late-soft); color: var(--late); border-color: #F6C4BE; }
.flash-info { background: var(--gold-soft); color: var(--gold-ink); border-color: #EAD9A0; }

/* People */
.avatar { display: inline-grid; place-items: center; width: 36px; height: 36px; flex: 0 0 36px; border-radius: 50%; background: var(--navy-2); color: var(--gold); font-weight: 700; font-size: .82rem; letter-spacing: .02em; }
.avatar.sm { width: 28px; height: 28px; flex-basis: 28px; font-size: .7rem; }
.avatar.lg { width: 56px; height: 56px; flex-basis: 56px; font-size: 1.15rem; }
.avatar.has-photo { background-size: cover; background-position: center; background-repeat: no-repeat; color: transparent; }
.profile-top { display: flex; align-items: center; gap: 16px; }
.hub-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; margin-bottom: 18px; }
.hub-card { display: flex; flex-direction: column; gap: 3px; margin: 0; text-decoration: none; transition: border-color .12s, transform .12s; }
.hub-card:hover { border-color: var(--gold); transform: translateY(-1px); text-decoration: none; }
.hub-card .hub-ic { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 9px; background: var(--gold-soft); color: var(--gold-ink); margin-bottom: 4px; }
.hub-card b { color: var(--ink); }
.hub-card small { line-height: 1.35; }
.cp-score { display: flex; gap: 18px; align-items: center; }
.score-badge { flex: 0 0 auto; width: 92px; height: 92px; border-radius: 50%; display: grid; place-items: center; line-height: 1; color: #fff; box-shadow: var(--shadow); }
.score-badge b { font-size: 2rem; font-weight: 800; }
.score-badge span { font-size: .85rem; font-weight: 700; opacity: .92; margin-top: 2px; }
.score-badge.grade-A { background: linear-gradient(135deg, #1F7A4D, #2E9D66); }
.score-badge.grade-B { background: linear-gradient(135deg, #B8912E, #D9B65A); }
.score-badge.grade-C { background: linear-gradient(135deg, #C47A1B, #E0962F); }
.score-badge.grade-D { background: linear-gradient(135deg, #B42318, #D1483C); }
.score-main { flex: 1 1 auto; min-width: 0; }
.rank-lines { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.score-bars { display: grid; gap: 6px; max-width: 460px; }
.sbar { display: flex; align-items: center; gap: 10px; font-size: .82rem; }
.sbar-l { flex: 0 0 96px; color: var(--ink-2); }
.sbar-track { flex: 1 1 auto; height: 8px; background: var(--row-alt); border-radius: 5px; overflow: hidden; }
.sbar-fill { display: block; height: 100%; background: var(--gold); border-radius: 5px; }
.sbar-v { flex: 0 0 28px; text-align: right; font-weight: 700; color: var(--ink-2); }
@media (max-width: 560px) { .cp-score { flex-direction: column; align-items: flex-start; } }
.code-block { background: var(--navy); color: #E7ECF2; padding: 12px 14px; border-radius: 8px; font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: .8rem; overflow-x: auto; white-space: pre; margin: 8px 0; }
.side .avatar { background: var(--navy-3); }
.people-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; }
.person-card { color: inherit; margin: 0; }
.person-card:hover { border-color: var(--gold); text-decoration: none; }
.person-head { display: flex; align-items: center; gap: 10px; }
.person-head > div { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.mini-stats { display: flex; gap: 12px; font-size: .82rem; color: var(--ink-2); margin-top: 10px; flex-wrap: wrap; }
.mini-stats b { color: var(--ink); }
.person-top { justify-content: flex-start; }
.person-top > div { flex: 1; }
.person-link { display: flex; align-items: center; gap: 10px; color: inherit; }
.person-link span:last-child { display: flex; flex-direction: column; }
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.kpi { display: flex; flex-direction: column; margin: 0; }
.kpi b { font-size: 1.6rem; color: var(--navy); }
.kpi span { color: var(--ink-3); font-size: .82rem; }
.mini-list { list-style: none; padding: 0; font-size: .86rem; }
.mini-list li { padding: 3px 0; }

/* Feed and timeline */
.feed { list-style: none; padding: 0; margin: 0; }
.feed > li { display: flex; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line-2); }
.feed > li:last-child { border-bottom: 0; }
.feed p { margin: 0 0 2px; }
.act-feed > li { align-items: flex-start; }
.act-tag { display: inline-block; font-size: .68rem; font-weight: 700; border-radius: 5px; padding: 0 6px; text-transform: uppercase; letter-spacing: .03em; vertical-align: middle; }
.act-status { background: #E7F0FD; color: #175CD3; }
.act-delay { background: var(--late-soft); color: var(--late); }
.act-comment { background: var(--line-2); color: var(--ink-2); }
.act-meeting { background: var(--gold-soft); color: var(--gold-ink); }
.act-verify { background: var(--ok-soft); color: var(--ok); }
.act-system { background: var(--line-2); color: var(--ink-3); }

/* Dashboard with a right-side live task-news rail */
.dash-wrap { display: flex; gap: 20px; align-items: flex-start; }
.dash-main { flex: 999 1 560px; min-width: 0; }
.news-rail { flex: 0 0 330px; max-width: 100%; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; position: sticky; top: 72px; max-height: calc(100vh - 90px); display: flex; flex-direction: column; }
.news-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 15px; background: var(--navy); color: #fff; font-weight: 650; flex: 0 0 auto; }
.news-live { display: inline-flex; align-items: center; gap: 5px; font-size: .72rem; font-weight: 700; color: #FF9B91; letter-spacing: .04em; }
.news-live i { width: 7px; height: 7px; border-radius: 50%; background: #FF5A4D; animation: pulse 1.4s infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .3; } }
.news-list { list-style: none; margin: 0; padding: 0; overflow-y: auto; flex: 1 1 auto; }
.news-item { border-top: 1px solid var(--line-2); border-left: 4px solid var(--line); }
.news-item:first-child { border-top: 0; }
.news-item a { display: flex; flex-direction: column; gap: 2px; padding: 11px 14px; color: inherit; text-decoration: none; }
.news-item a:hover { background: var(--gold-soft); }
.news-line { font-size: .86rem; color: var(--ink); }
.news-task { font-size: .82rem; color: var(--ink-2); }
.news-ago { font-size: .72rem; color: var(--ink-3); }
.news-status { border-left-color: #175CD3; }
.news-meeting { border-left-color: var(--gold); }
.news-delay { border-left-color: var(--late); }
.news-verify, .news-system { border-left-color: var(--ok); }
.news-comment { border-left-color: var(--navy-3); }
.news-empty { padding: 14px; color: var(--ink-3); font-size: .85rem; }
.news-all { display: block; text-align: center; padding: 10px; border-top: 1px solid var(--line-2); font-weight: 650; font-size: .85rem; flex: 0 0 auto; }
@media (max-width: 900px) {
  .dash-wrap { flex-wrap: wrap; }
  .news-rail { flex-basis: 100%; position: static; max-height: 460px; }
}

.focus-list { margin: 0; padding-left: 1.6em; }
.focus-list > li { padding: 9px 0; border-bottom: 1px solid var(--line-2); }
.focus-list > li::marker { color: var(--gold-ink); font-weight: 700; }
.focus-list.big { padding: 18px 18px 18px 42px; }
.timeline { list-style: none; padding: 0; margin: 0 0 8px; position: relative; }
.timeline > li { display: flex; gap: 12px; padding: 10px 0; position: relative; }
.timeline > li > div { flex: 1; min-width: 0; }
.timeline p { margin: 0 0 3px; }
.timeline .dot { flex: 0 0 28px; height: 28px; border-radius: 50%; background: var(--navy); color: var(--gold); display: grid; place-items: center; font-weight: 700; font-size: .8rem; }
.timeline.compact > li { padding: 8px 0; border-bottom: 1px solid var(--line-2); }
.ev-system p:not(.small) { color: var(--ink-2); font-size: .9rem; }
.ev-delay p:not(.small) { color: var(--late); }
.file { display: inline-flex; align-items: center; gap: 4px; font-size: .85rem; font-weight: 600; }
.file .ic { width: 16px; height: 16px; }

/* Task page */
/* Delivery-style status tracker */
.tracker { list-style: none; display: flex; padding: 0; margin: 16px 0 6px; overflow-x: auto; scrollbar-width: none; }
.tracker::-webkit-scrollbar { display: none; }
.trk { flex: 1 1 0; min-width: 72px; display: flex; flex-direction: column; align-items: center; gap: 6px; position: relative; text-align: center; }
.trk::before { content: ""; position: absolute; top: 15px; left: -50%; width: 100%; height: 3px; background: var(--line); z-index: 0; }
.trk:first-child::before { display: none; }
.trk.done::before, .trk.cur::before { background: var(--gold); }
.trk-dot { position: relative; z-index: 1; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; font-size: .8rem; font-weight: 700; background: var(--line-2); color: var(--ink-3); border: 2px solid var(--card); }
.trk.done .trk-dot { background: var(--ok); color: #fff; }
.trk.cur .trk-dot { background: var(--gold); color: var(--navy); box-shadow: 0 0 0 4px var(--gold-soft); }
.trk.trk-late .trk-dot { background: var(--late); color: #fff; box-shadow: 0 0 0 4px var(--late-soft); }
.trk-lbl { font-size: .78rem; font-weight: 600; color: var(--ink-2); line-height: 1.2; }
.trk.cur .trk-lbl { color: var(--navy); font-weight: 700; }
.trk.future .trk-lbl { color: var(--ink-3); }
.trk-sub { font-size: .7rem; color: var(--ink-3); }
.extend > summary { cursor: pointer; padding: 2px 0; }
.extend[open] { padding-bottom: 16px; }

.task-head h1 { font-size: 1.45rem; margin-top: 6px; }
.facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px 18px; margin: 12px 0; }
.facts dt { font-size: .74rem; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); font-weight: 600; }
.facts dd { margin: 2px 0 0; font-weight: 600; }
.respond select { width: auto; min-width: 160px; }

/* Tables */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.table th { text-align: left; font-size: .74rem; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); font-weight: 600; padding: 8px 10px; border-bottom: 1px solid var(--line); }
.table td { padding: 10px; border-bottom: 1px solid var(--line-2); vertical-align: top; }
.table tbody tr:nth-child(even) { background: var(--row-alt); }
.table tbody tr:hover { background: var(--gold-soft); }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.table td .progress { width: 90px; margin: 6px 0 2px; }
.table small { display: block; }
.row-edit[open] { position: relative; }
.row-edit[open] .person-form { position: absolute; right: 0; z-index: 15; width: min(560px, 90vw); background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; box-shadow: 0 12px 32px rgba(16, 24, 40, .16); }

/* Approvals deck */
.approve-card h2 { font-size: 1.25rem; margin-top: 4px; }
.approve-card h2 a { color: var(--ink); }

/* Calendar */
.cal-wrap { overflow-x: auto; }
.cal { display: grid; grid-template-columns: repeat(7, minmax(110px, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.cal-h { background: var(--line-2); font-size: .74rem; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); padding: 6px 8px; font-weight: 600; }
.cal-d { background: var(--card); min-height: 96px; padding: 6px; display: flex; flex-direction: column; gap: 3px; }
.cal-d.empty { background: var(--bg); }
.cal-d.today { box-shadow: inset 0 0 0 2px var(--gold); }
.cal-n { font-size: .8rem; font-weight: 700; color: var(--ink-2); }
.cal-t { font-size: .74rem; background: var(--line-2); color: var(--ink); border-radius: 4px; padding: 2px 5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-t.late { background: var(--late-soft); color: var(--late); }
.cal-t.done { color: var(--ink-3); text-decoration: line-through; }
.month-label { min-width: 130px; text-align: center; color: var(--navy); }

/* Rules and help */
.rules ol { margin: 0; }
.rules li { padding: 3px 0; }
.help-card { background: var(--gold-soft); border-color: #EAD9A0; }

/* Guest */
body.guest { background: var(--navy); display: grid; place-items: center; min-height: 100vh; padding: 16px; }
.guest-box { width: 100%; max-width: 420px; }
.guest .brand-lg { color: #fff; }
.guest .card { padding: 26px; }

/* Mobile */
@media (max-width: 960px) {
  .hero { grid-template-columns: 1fr; }
  .kpis { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 820px) {
  .side { display: none; }
  .topbar { padding: 10px 16px; }
  .topbar .brand-sm { display: flex; }
  .main { padding: 16px 16px 96px; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .filters { grid-template-columns: 1fr 1fr; }
  .filters input[type="search"] { grid-column: 1 / -1; }
  .hero { padding: 20px; border-radius: 14px; }
  .hero h1 { font-size: 1.4rem; }
  .hero { gap: 14px; }
  .hero::after { display: none; }
  .quote { font-size: .92rem; margin-top: 10px; }
  .hero-stats { grid-template-columns: repeat(4, 1fr); gap: 6px; }
  .stat { padding: 8px 6px; text-align: center; }
  .stat b { font-size: 1.3rem; }
  .stat span { font-size: .68rem; line-height: 1.2; }
  .row { align-items: flex-start; flex-direction: column; gap: 6px; }
  .row-chips { justify-content: flex-start; }
  .top-card { gap: 12px; }
  .top-num { flex-basis: 32px; height: 32px; font-size: .95rem; }
  .bottom { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; background: var(--card); border-top: 1px solid var(--line); padding: 6px 8px calc(6px + env(safe-area-inset-bottom)); justify-content: space-around; align-items: center; }
  .bottom > a, .bottom summary { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: .7rem; color: var(--ink-3); padding: 4px 8px; list-style: none; cursor: pointer; }
  .bottom summary::-webkit-details-marker { display: none; }
  .bottom a[aria-current="page"] { color: var(--navy); font-weight: 700; }
  .bottom .add { width: 50px; height: 50px; border-radius: 50%; background: var(--gold); color: var(--navy); display: grid; place-items: center; margin-top: -18px; box-shadow: 0 4px 12px rgba(11, 31, 51, .25); }
  .bottom .ic-wrap { position: relative; display: inline-flex; }
  .bottom .ic-wrap .badge { top: -6px; right: -10px; }
  .more { position: relative; }
  .more-menu { position: absolute; bottom: 120%; right: 0; background: var(--card); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 -8px 28px rgba(16, 24, 40, .16); padding: 6px; width: 230px; display: grid; }
  .more-menu a { display: flex; align-items: center; gap: 10px; padding: 9px 10px; color: var(--ink); border-radius: 8px; }
  .more-menu .count { background: var(--late); color: #fff; font-size: .7rem; border-radius: 10px; padding: 0 6px; margin-left: auto; }
  .more-menu form { padding: 8px 10px; border-top: 1px solid var(--line-2); }
  .row-edit[open] .person-form { position: static; width: auto; box-shadow: none; padding: 10px 0; border: 0; }
}

@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
@media print { .side, .topbar, .bottom, .actions, form { display: none !important; } .card { box-shadow: none; } }
