/* ─────────────────────────────────────────────────────────────────────────────
   Epigroup company hub
   Palette, fonts and status colours copied from epigroup-msms/static/css/main.css,
   which takes them from the Epigroup brand. Colours live on :root only: a raw hex
   value in a component rule is a defect.
   ───────────────────────────────────────────────────────────────────────────── */

@font-face { font-family: 'MD Nichrome'; src: url("../fonts/md-nichrome-regular.da483dd8a92b.otf") format('opentype'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'MD Nichrome Dark'; src: url("../fonts/md-nichrome-dark.7389021a08c8.otf") format('opentype'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Sohne Buch'; src: url("../fonts/sohne-buch.21d3634c0c0f.otf") format('opentype'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Sohne Kraftig'; src: url("../fonts/sohne-kraftig.de0f7e228d88.otf") format('opentype'); font-weight: 500; font-display: swap; }

:root {
  --font-display: 'MD Nichrome Dark', 'MD Nichrome', system-ui, sans-serif;
  --font-body: 'Sohne Buch', system-ui, sans-serif;
  --font-strong: 'Sohne Kraftig', 'Sohne Buch', system-ui, sans-serif;

  --rich-black: #08141f;
  --ink-2: #0e2233;
  --vivid-yellow: #e5ff00;
  --soft-grey: #f2f2f2;
  --cool-grey: #dde4e4;
  --dark-grey: #8d9aa4;
  --white: #fff;
  --red: #f8333c;
  --sand: #faa948;
  --sky: #4378b4;
  --sea: #7ccccd;
  --indigo: #6b7cff;
  --green: #65e585;

  --text-muted: rgb(8 20 31 / 0.68);
  --text-soft: rgb(8 20 31 / 0.82);
  --text-on-dark: var(--soft-grey);
  --text-on-dark-muted: rgb(242 242 242 / 0.62);
  --line: var(--cool-grey);
  --line-strong: rgb(8 20 31 / 0.2);
  --line-on-dark: rgb(242 242 242 / 0.12);
  --hover: var(--soft-grey);
  --surface: var(--white);

  /* Status: a mark and a word, never colour alone. */
  --ok: var(--green);
  --ok-tint: color-mix(in srgb, var(--green) 25%, #fff);
  --ok-line: color-mix(in srgb, var(--green) 75%, #fff);
  --ok-ink: #1d6b33;
  --progress: var(--sky);
  --progress-tint: color-mix(in srgb, var(--sky) 20%, #fff);
  --progress-line: color-mix(in srgb, var(--sky) 50%, #fff);
  --overdue: var(--sand);
  --overdue-tint: color-mix(in srgb, var(--sand) 25%, #fff);
  --overdue-line: color-mix(in srgb, var(--sand) 75%, #fff);
  --gap: var(--red);
  --gap-tint: color-mix(in srgb, var(--red) 18%, #fff);
  --gap-line: color-mix(in srgb, var(--red) 50%, #fff);
  --neutral-tint: var(--cool-grey);
  --info-tint: color-mix(in srgb, var(--indigo) 20%, #fff);

  /* Charts: one hue for magnitude (sky), light to dark. */
  --chart-1: var(--sky);
  --chart-1-soft: color-mix(in srgb, var(--sky) 40%, #fff);
  --chart-grid: var(--cool-grey);
  --chart-ref: var(--rich-black);
  --load-free: var(--white);
  --load-part: color-mix(in srgb, var(--sky) 18%, #fff);
  --load-full: color-mix(in srgb, var(--sky) 45%, #fff);
  --load-over: color-mix(in srgb, var(--sand) 55%, #fff);

  --radius: 10px;
  --radius-sm: 6px;
  --shadow-pop: 0 8px 28px rgb(8 20 31 / 0.16);
  --duration-fast: 150ms;
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --sidebar-width: 236px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; font-family: var(--font-body); font-size: 15px; line-height: 1.5;
  color: var(--rich-black); background: var(--soft-grey); min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
strong, b, th { font-family: var(--font-strong); font-weight: 500; }
button, input, select, textarea { font: inherit; line-height: inherit; color: inherit; }
h1, h2, h3 { font-family: var(--font-display); font-weight: 400; line-height: 1.2; margin: 0; }
.num, .mono { font-variant-numeric: tabular-nums; white-space: nowrap; }
.muted { color: var(--text-muted); }
.small { font-size: 13px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 2px solid var(--rich-black); outline-offset: 2px; }

/* ── App shell ──────────────────────────────────────────────────────────── */

.app { display: grid; grid-template-columns: var(--sidebar-width) minmax(0, 1fr); min-height: 100vh; }
.sidebar {
  background: var(--rich-black); color: var(--text-on-dark); position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column; padding: 20px 12px 16px; overflow-y: auto;
}
.sidebar__brand { display: flex; flex-direction: column; gap: 6px; padding: 4px 10px 22px; text-decoration: none; }
.sidebar__brand img { width: 128px; height: auto; }
.sidebar__brand span { font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-on-dark-muted); }
.nav-label { font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-on-dark-muted); padding: 16px 10px 6px; }
.nav-link {
  display: flex; align-items: center; gap: 10px; min-height: 40px; padding: 8px 10px; border-radius: var(--radius-sm);
  color: var(--text-on-dark-muted); text-decoration: none; font-size: 14px; position: relative;
  transition: background var(--duration-fast) var(--ease-out), color var(--duration-fast) var(--ease-out);
}
.nav-link svg { width: 18px; height: 18px; flex: none; }
.nav-link:hover { background: var(--line-on-dark); color: var(--text-on-dark); }
.nav-link[aria-current="page"] { background: var(--line-on-dark); color: var(--text-on-dark); font-family: var(--font-strong); }
.nav-link[aria-current="page"]::before { content: ""; position: absolute; left: -12px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: var(--vivid-yellow); }
.nav-link:focus-visible { outline-color: var(--vivid-yellow); }
.nav-badge { margin-left: auto; font-size: 11px; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--vivid-yellow); color: var(--rich-black); display: inline-flex; align-items: center; justify-content: center; font-family: var(--font-strong); }
.sidebar__foot { margin-top: auto; padding: 16px 10px 0; font-size: 12px; color: var(--text-on-dark-muted); border-top: 1px solid var(--line-on-dark); }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 16px; height: 60px; padding: 0 28px;
  background: var(--surface); border-bottom: 1px solid var(--line);
}
.search { flex: 1; max-width: 520px; position: relative; }
.search input {
  width: 100%; height: 40px; padding: 0 12px 0 38px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--soft-grey);
}
.search input:focus { outline: 2px solid var(--rich-black); outline-offset: 0; background: var(--surface); }
.search svg { position: absolute; left: 12px; top: 11px; width: 18px; height: 18px; color: var(--text-muted); }
.topbar__spacer { flex: 1; }
.sync-pill { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-muted); text-decoration: none; white-space: nowrap; }
.sync-pill .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); }
.sync-pill .dot--bad { background: var(--gap); }
.user-menu { position: relative; }
.user-menu summary { list-style: none; display: flex; align-items: center; gap: 10px; cursor: pointer; min-height: 44px; }
.user-menu summary::-webkit-details-marker { display: none; }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--rich-black); color: var(--vivid-yellow); display: inline-flex; align-items: center; justify-content: center; font-family: var(--font-strong); font-size: 13px; flex: none; }
.avatar--sm { width: 26px; height: 26px; font-size: 11px; background: var(--cool-grey); color: var(--rich-black); }
.user-menu__who { display: flex; flex-direction: column; line-height: 1.25; }
.user-menu__who small { color: var(--text-muted); font-size: 12px; }
.user-menu__panel {
  position: absolute; right: 0; top: calc(100% + 6px); width: 280px; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow-pop); padding: 8px; z-index: 30;
}
.user-menu__panel h3 { font-family: var(--font-body); font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-muted); padding: 8px 10px 4px; }
.menu-item { display: flex; width: 100%; align-items: center; gap: 8px; min-height: 40px; padding: 8px 10px; border: 0; background: none; border-radius: var(--radius-sm); text-align: left; text-decoration: none; cursor: pointer; font-size: 14px; }
.menu-item:hover { background: var(--hover); }
.menu-item small { color: var(--text-muted); margin-left: auto; font-size: 12px; }
.menu-sep { border: 0; border-top: 1px solid var(--line); margin: 6px 0; }

.demo-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 28px;
  background: var(--vivid-yellow); color: var(--rich-black); font-size: 14px;
}
.demo-bar form { margin: 0; }
.demo-bar button { border: 1px solid var(--rich-black); background: transparent; border-radius: 999px; padding: 4px 12px; cursor: pointer; font-family: var(--font-strong); font-size: 13px; }

.content { padding: 28px 28px 64px; max-width: 1360px; width: 100%; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head h1 { font-size: 30px; }
.page-head p { margin: 6px 0 0; color: var(--text-muted); }
.eyebrow { font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-muted); margin-bottom: 6px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.eyebrow a { text-decoration: none; }
.eyebrow a:hover { text-decoration: underline; }
.head-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

.messages { list-style: none; margin: 0 0 18px; padding: 0; display: grid; gap: 8px; }
.message { padding: 12px 16px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); font-size: 14px; }
.message--success { background: var(--ok-tint); border-color: var(--ok-line); }
.message--error { background: var(--gap-tint); border-color: var(--gap-line); }
.message--warning { background: var(--overdue-tint); border-color: var(--overdue-line); }

/* ── Building blocks ────────────────────────────────────────────────────── */

.grid { display: grid; gap: 20px; }
.grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid--main { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); align-items: start; }
.stack { display: grid; gap: 20px; align-content: start; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 22px; min-width: 0; }
.card--flush { padding: 0; overflow: hidden; }
.card__head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.card--flush .card__head { padding: 18px 22px 0; }
.card__title { font-family: var(--font-display); font-size: 19px; }
.card__title small { font-family: var(--font-body); font-size: 13px; color: var(--text-muted); margin-left: 6px; }
.card__link { font-size: 13px; color: var(--text-muted); text-decoration: none; white-space: nowrap; }
.card__link:hover { color: var(--rich-black); text-decoration: underline; }
.card__note { font-size: 13px; color: var(--text-muted); margin: 12px 0 0; }
.section-title { font-family: var(--font-display); font-size: 21px; margin: 30px 0 14px; display: flex; align-items: center; gap: 10px; }

.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; margin-bottom: 22px; }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; display: flex; flex-direction: column; gap: 4px; min-width: 0; text-decoration: none; }
a.tile:hover { border-color: var(--line-strong); }
.tile__label { font-size: 13px; color: var(--text-muted); }
.tile__value { font-family: var(--font-strong); font-size: 28px; line-height: 1.15; font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.tile__sub { font-size: 13px; color: var(--text-soft); display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.tile--hero .tile__value { font-size: 40px; }

.chip { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px; border-radius: 999px; font-size: 12px; white-space: nowrap; border: 1px solid var(--line-strong); background: var(--surface); color: var(--rich-black); }
.chip::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--dark-grey); flex: none; }
.chip--plain::before { display: none; }
.chip--green { background: var(--ok-tint); border-color: var(--ok-line); }
.chip--green::before { background: var(--ok-ink); }
.chip--amber { background: var(--overdue-tint); border-color: var(--overdue-line); }
.chip--amber::before { background: var(--rich-black); border-radius: 1px; transform: rotate(45deg); }
.chip--red { background: var(--gap-tint); border-color: var(--gap-line); }
.chip--red::before { background: var(--red); border-radius: 1px; }
.chip--none::before { background: transparent; border: 1px solid var(--dark-grey); }
.chip--stage { background: var(--info-tint); border-color: transparent; }
.chip--stage::before { display: none; }
.chip--dark { background: var(--rich-black); color: var(--text-on-dark); border-color: var(--rich-black); }
.chip--dark::before { display: none; }
.chip--lock::before { display: none; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 8px 16px;
  border-radius: 8px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--rich-black);
  font-family: var(--font-strong); font-size: 14px; text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: background var(--duration-fast) var(--ease-out), box-shadow var(--duration-fast) var(--ease-out);
}
.btn:hover { background: var(--hover); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn--primary { background: var(--vivid-yellow); border-color: transparent; box-shadow: inset 0 0 0 1px rgb(8 20 31 / 0.12); }
.btn--primary:hover { background: var(--vivid-yellow); box-shadow: inset 0 0 0 1px rgb(8 20 31 / 0.3); }
.btn--dark { background: var(--rich-black); color: var(--text-on-dark); border-color: var(--rich-black); }
.btn--dark:hover { background: var(--ink-2); }
.btn--small { min-height: 32px; padding: 4px 12px; font-size: 13px; }
.btn--quiet { border-color: transparent; background: transparent; text-decoration: underline; text-underline-offset: 2px; padding-inline: 4px; }
.inline-form { display: inline; margin: 0; }

.table-wrap { overflow-x: auto; position: relative; } /* keeps .sr-only labels in wide tables from widening the page */
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-size: 12px; letter-spacing: 0.04em; text-transform: uppercase; color: var(--rich-black); background: var(--dark-grey); padding: 9px 14px; white-space: nowrap; }
.table td { padding: 11px 14px; border-top: 1px solid var(--line); vertical-align: middle; }
.table tbody tr:hover { background: var(--hover); }
.table .r, .table th.r { text-align: right; }
.table a { text-decoration: none; }
.table a:hover { text-decoration: underline; }
.table .strong { font-family: var(--font-strong); }
.table td:first-child { min-width: 200px; }
.table--compact td { padding: 8px 14px; }
.cell-sub { display: block; font-size: 12px; color: var(--text-muted); }

.list { list-style: none; margin: 0; padding: 0; }
.list > li { display: flex; gap: 12px; align-items: flex-start; padding: 12px 0; border-top: 1px solid var(--line); }
.list > li:first-child { border-top: 0; padding-top: 2px; }
.list__body { flex: 1; min-width: 0; }
.list__title { font-family: var(--font-strong); text-decoration: none; display: block; }
a.list__title:hover { text-decoration: underline; }
.list__meta { font-size: 13px; color: var(--text-muted); }
.list__aside { flex: none; text-align: right; font-size: 13px; }

.attention { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.attention li a, .attention li > div { display: flex; gap: 12px; align-items: center; padding: 12px 14px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); text-decoration: none; }
.attention li a:hover { border-color: var(--line-strong); }
.attention__icon { width: 30px; height: 30px; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; flex: none; background: var(--cool-grey); }
.attention__icon svg { width: 16px; height: 16px; }
.attention__icon--red { background: var(--gap-tint); }
.attention__icon--amber { background: var(--overdue-tint); }
.attention__icon--blue { background: var(--progress-tint); }
.attention__text { flex: 1; min-width: 0; }
.attention__text strong { display: block; font-size: 14px; }
.attention__text span { font-size: 13px; color: var(--text-muted); }
.attention__go { color: var(--text-muted); font-size: 13px; white-space: nowrap; }

.empty { padding: 26px 20px; text-align: center; color: var(--text-muted); font-size: 14px; border: 1px dashed var(--line-strong); border-radius: 8px; }
.empty strong { display: block; color: var(--rich-black); margin-bottom: 2px; }

.bar { height: 6px; border-radius: 3px; background: var(--cool-grey); overflow: hidden; position: relative; }
.bar > span { display: block; height: 100%; border-radius: 3px; background: var(--chart-1); }
.bar--warn > span { background: var(--sand); }
.bar--bad > span { background: var(--red); }
.bar__marker { position: absolute; top: -3px; bottom: -3px; width: 2px; background: var(--rich-black); border-radius: 1px; }

.kv { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 8px 18px; margin: 0; font-size: 14px; }
.kv dt { color: var(--text-muted); }
.kv dd { margin: 0; min-width: 0; }

.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin: 0 0 22px; overflow-x: auto; }
.tabs a { padding: 10px 14px; text-decoration: none; color: var(--text-muted); font-size: 14px; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs a:hover { color: var(--rich-black); }
.tabs a[aria-current="page"] { color: var(--rich-black); border-bottom-color: var(--rich-black); font-family: var(--font-strong); }
.tabs .count { font-size: 11px; background: var(--cool-grey); border-radius: 999px; padding: 1px 7px; margin-left: 4px; }

.filters { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; }
.filters select, .filters input[type="search"], .form-input {
  height: 40px; padding: 0 12px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--surface);
}
textarea.form-input { height: auto; padding: 10px 12px; min-height: 84px; width: 100%; resize: vertical; }
.form-input { width: 100%; }
.form-input:focus, .filters select:focus, .filters input:focus { outline: 2px solid var(--rich-black); outline-offset: 0; }
.seg { display: inline-flex; border: 1px solid var(--line-strong); border-radius: 8px; overflow: hidden; background: var(--surface); }
.seg a { padding: 8px 14px; text-decoration: none; font-size: 14px; color: var(--text-muted); min-height: 38px; display: inline-flex; align-items: center; }
.seg a + a { border-left: 1px solid var(--line-strong); }
.seg a[aria-current="true"] { background: var(--rich-black); color: var(--text-on-dark); }
.field { display: grid; gap: 6px; margin-bottom: 14px; }
.field label, .field .label { font-size: 13px; color: var(--text-muted); }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 0 14px; }

/* Lifecycle stepper */
.stepper { list-style: none; margin: 0 0 22px; padding: 0; display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 4px; }
.stepper li { position: relative; padding-top: 14px; font-size: 13px; color: var(--text-muted); }
.stepper li::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 6px; border-radius: 3px; background: var(--cool-grey); }
.stepper li.done::before { background: var(--rich-black); }
.stepper li.done { color: var(--text-soft); }
.stepper li.current::before { background: var(--vivid-yellow); box-shadow: inset 0 0 0 1px rgb(8 20 31 / 0.25); }
.stepper li.current { color: var(--rich-black); font-family: var(--font-strong); }
.stepper small { display: block; font-size: 12px; color: var(--text-muted); font-family: var(--font-body); }
.stepper--lost li::before { background: var(--cool-grey); }

/* Job board */
.board { display: grid; align-items: start; grid-auto-flow: column; grid-auto-columns: minmax(230px, 1fr); gap: 12px; overflow-x: auto; padding-bottom: 8px; }
.board__col { background: var(--cool-grey); border-radius: var(--radius); padding: 10px; min-height: 120px; display: flex; flex-direction: column; gap: 8px; }
.board__col h2 { font-family: var(--font-strong); font-size: 13px; letter-spacing: 0.04em; text-transform: uppercase; display: flex; justify-content: space-between; padding: 2px 4px 4px; }
.job-card { background: var(--surface); border-radius: 8px; padding: 10px 12px; text-decoration: none; display: grid; gap: 6px; border: 1px solid transparent; }
.job-card:hover { border-color: var(--line-strong); }
.job-card__ref { font-size: 12px; color: var(--text-muted); display: flex; justify-content: space-between; gap: 6px; }
.job-card__name { font-family: var(--font-strong); font-size: 14px; line-height: 1.3; }
.job-card__client { font-size: 13px; color: var(--text-soft); }
.job-card__foot { display: flex; justify-content: space-between; align-items: center; gap: 6px; font-size: 12px; color: var(--text-muted); }

/* Timeline */
.timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.timeline::before { content: ""; position: absolute; left: 15px; top: 6px; bottom: 6px; width: 2px; background: var(--cool-grey); }
.timeline li { position: relative; display: flex; gap: 14px; padding: 0 0 18px; }
.timeline__mark { position: relative; z-index: 1; width: 32px; height: 32px; flex: none; border-radius: 50%; background: var(--surface); border: 2px solid var(--cool-grey); display: inline-flex; align-items: center; justify-content: center; font-size: 10px; font-family: var(--font-strong); letter-spacing: 0.02em; }
.timeline__mark--hub { background: var(--rich-black); color: var(--vivid-yellow); border-color: var(--rich-black); }
.timeline__body { flex: 1; min-width: 0; padding-top: 4px; }
.timeline__title { font-family: var(--font-strong); font-size: 14px; }
.timeline__title a { text-decoration: none; }
.timeline__title a:hover { text-decoration: underline; }
details.earlier > summary { cursor: pointer; list-style: none; display: flex; align-items: center; justify-content: space-between; min-height: 44px; font-family: var(--font-display); font-size: 19px; }
details.earlier > summary::-webkit-details-marker { display: none; }
details.earlier > summary::after { content: "Show"; font-family: var(--font-body); font-size: 13px; color: var(--text-muted); }
details.earlier[open] > summary::after { content: "Hide"; }
details.earlier[open] > summary { margin-bottom: 12px; }
.timeline__meta { font-size: 13px; color: var(--text-muted); }
.timeline__text { font-size: 14px; color: var(--text-soft); margin-top: 4px; }

/* Sources strip */
.sources { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 22px; }
.source { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px 6px 6px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); text-decoration: none; font-size: 13px; }
.source:hover { border-color: var(--line-strong); }
.source__badge { width: 26px; height: 26px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 10px; font-family: var(--font-strong); background: var(--cool-grey); }
.source--missing { color: var(--text-muted); border-style: dashed; }

/* Checklist */
.checks { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.check { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; }
.check__box { width: 22px; height: 22px; border-radius: 6px; border: 2px solid var(--line-strong); display: inline-flex; align-items: center; justify-content: center; flex: none; background: var(--surface); cursor: pointer; padding: 0; }
.check__box svg { width: 14px; height: 14px; }
.check--done .check__box { background: var(--rich-black); border-color: var(--rich-black); color: var(--vivid-yellow); }
.check__label { flex: 1; font-size: 14px; }
.check__by { font-size: 12px; color: var(--text-muted); }

/* Resourcing grid */
.res-grid { border-collapse: separate; border-spacing: 2px; font-size: 13px; width: 100%; }
.res-grid th { font-size: 11px; font-family: var(--font-body); color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.04em; padding: 4px 6px; text-align: center; white-space: nowrap; font-weight: 400; }
.res-grid th.person { text-align: left; }
.res-grid td.person { padding: 6px 10px 6px 0; white-space: nowrap; min-width: 190px; }
.res-grid td.cell { text-align: center; height: 40px; min-width: 52px; border-radius: 4px; font-variant-numeric: tabular-nums; position: relative; }
.cell--free { background: var(--load-free); box-shadow: inset 0 0 0 1px var(--line); color: var(--text-muted); }
.cell--part { background: var(--load-part); }
.cell--full { background: var(--load-full); }
.cell--over { background: var(--load-over); font-family: var(--font-strong); }
.cell--over::after { content: "!"; position: absolute; top: 2px; right: 4px; font-size: 10px; }
.cell__tent { display: block; font-size: 10px; color: var(--text-muted); }
.res-grid tr.team-total td { border-top: 2px solid var(--line); font-family: var(--font-strong); }
.legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: 13px; color: var(--text-soft); margin-top: 12px; align-items: center; }
.legend__swatch { display: inline-block; width: 14px; height: 14px; border-radius: 3px; vertical-align: -2px; margin-right: 6px; box-shadow: inset 0 0 0 1px var(--line); }

/* Charts */
.chart { width: 100%; height: auto; display: block; overflow: visible; }
.chart text { font-family: var(--font-body); font-size: 11px; fill: var(--text-muted); }
.chart .grid-line { stroke: var(--chart-grid); stroke-width: 1; }
.chart .bar-actual { fill: var(--chart-1); }
.chart .bar-forecast { fill: var(--chart-1-soft); }
.chart .ref-line { stroke: var(--chart-ref); stroke-width: 2; stroke-linecap: round; }
.chart .threshold { stroke: var(--rich-black); stroke-width: 1; opacity: 0.45; }
.chart .hit:hover + .bar-actual, .chart .hit:hover + .bar-forecast { opacity: 0.8; }
.chart .value { fill: var(--rich-black); font-family: var(--font-strong); }
.chart-legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 13px; color: var(--text-soft); margin: 0 0 10px; }
.chart-legend span::before { content: ""; display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; background: var(--chart-1); }
.chart-legend .k-forecast::before { background: var(--chart-1-soft); }
.chart-legend .k-budget::before { height: 2px; vertical-align: 3px; background: var(--chart-ref); }
details.table-view summary { cursor: pointer; font-size: 13px; color: var(--text-muted); margin-top: 10px; min-height: 32px; display: inline-flex; align-items: center; }
.hbars { display: grid; gap: 12px; }
.hbar { display: grid; grid-template-columns: minmax(120px, 190px) minmax(0, 1fr) 64px 104px; gap: 12px; align-items: center; font-size: 14px; }
.hbar__track { position: relative; height: 12px; }
.hbar__fill { position: absolute; left: 0; top: 0; bottom: 0; background: var(--chart-1); border-radius: 0 4px 4px 0; }
.hbar__line { position: absolute; top: -4px; bottom: -4px; width: 1px; background: var(--rich-black); opacity: 0.4; }
.hbar__axis { position: relative; height: 14px; font-size: 11px; color: var(--text-muted); margin-left: calc(min(190px, 30%) + 12px); }

/* Print: the board pack */
@media print {
  .sidebar, .topbar, .demo-bar, .no-print, .head-actions { display: none !important; }
  .app { display: block; }
  body { background: var(--white); font-size: 12px; }
  .content { padding: 0; max-width: none; }
  .card, .tile { break-inside: avoid; border-color: var(--line-strong); }
  .print-break { break-before: page; }
}

/* ── Sign in ────────────────────────────────────────────────────────────── */

.page-dark { background: var(--rich-black); color: var(--text-on-dark); }
.login { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(360px, 0.9fr); }
.login__intro { padding: 56px; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.login__intro img.logo { width: 200px; height: auto; }
.login__intro h1 { font-size: 48px; max-width: 520px; color: var(--text-on-dark); }
.login__intro p { max-width: 460px; color: var(--text-on-dark-muted); font-size: 16px; }
.login__device { position: absolute; right: -180px; top: -120px; width: 620px; height: 620px; opacity: 0.1; pointer-events: none; }
.login__panel { background: var(--soft-grey); color: var(--rich-black); padding: 56px; display: flex; flex-direction: column; justify-content: center; }
.login__panel h2 { font-size: 28px; margin-bottom: 6px; }
.login__panel .lead { color: var(--text-muted); margin: 0 0 26px; }
.login__panel .btn { width: 100%; min-height: 46px; font-size: 15px; }
.login__or { display: flex; align-items: center; gap: 12px; color: var(--text-muted); font-size: 13px; margin: 20px 0; }
.login__or::before, .login__or::after { content: ""; flex: 1; border-top: 1px solid var(--line-strong); }
.login__note { font-size: 13px; color: var(--text-muted); margin-top: 18px; }
.form-error { color: var(--rich-black); background: var(--gap-tint); border: 1px solid var(--gap-line); padding: 10px 12px; border-radius: 8px; font-size: 14px; margin-bottom: 14px; }

.notice { padding: 14px 16px; border-radius: 8px; background: var(--progress-tint); border: 1px solid var(--progress-line); font-size: 14px; }
.notice--warn { background: var(--overdue-tint); border-color: var(--overdue-line); }
.notice--lock { background: var(--soft-grey); border: 1px solid var(--line-strong); }

/* ── Narrow screens ─────────────────────────────────────────────────────── */

@media (max-width: 1100px) {
  .grid--main, .grid--3 { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 900px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; padding: 10px 12px; gap: 4px; }
  .sidebar__brand { padding: 4px 8px; flex-direction: row; align-items: center; }
  .sidebar__brand img { width: 100px; } /* the brand minimum on screen */
  .sidebar__brand span, .nav-label, .sidebar__foot { display: none; }
  .sidebar nav { display: flex; flex-wrap: nowrap; overflow-x: auto; width: 100%; gap: 2px; }
  .nav-link { white-space: nowrap; }
  .nav-link[aria-current="page"]::before { display: none; }
  .topbar { padding: 0 16px; height: auto; min-height: 60px; flex-wrap: wrap; gap: 8px; padding-block: 8px; }
  .user-menu__who { display: none; }
  .sync-pill span.label { display: none; }
  .content { padding: 20px 16px 48px; }
  .grid--2 { grid-template-columns: minmax(0, 1fr); }
  .stepper { grid-template-columns: repeat(4, minmax(0, 1fr)); row-gap: 12px; }
  .login { grid-template-columns: minmax(0, 1fr); }
  .login__intro { padding: 32px 20px; gap: 28px; }
  .login__intro h1 { font-size: 34px; }
  .login__panel { padding: 32px 20px; }
  .hbar { grid-template-columns: minmax(90px, 120px) minmax(0, 1fr) 56px; }
  .hbar .chip { display: none; }
  .demo-bar { padding: 8px 16px; flex-wrap: wrap; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}

/* Cross-team views */
.heads-up { border-left: 3px solid var(--vivid-yellow); }
.heads-up__title { font-family: var(--font-strong); font-size: 13px; letter-spacing: 0.04em; text-transform: uppercase; color: var(--text-muted); margin: 0 0 8px; }
.digest { max-width: 640px; }
.digest__item { display: flex; gap: 12px; padding: 14px 0; border-top: 1px solid var(--line); }
.digest__item:first-child { border-top: 0; }
.lib-item { display: grid; gap: 6px; }
.lib-item__meta { font-size: 12px; color: var(--text-muted); display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.service-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.service-link { display: flex; justify-content: space-between; gap: 10px; align-items: center; padding: 12px 14px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); text-decoration: none; }
.service-link:hover { border-color: var(--line-strong); }
.service-link span { font-size: 12px; color: var(--text-muted); white-space: nowrap; }
.btn .count { font-size: 11px; background: var(--cool-grey); border-radius: 999px; padding: 1px 7px; font-family: var(--font-body); }
.btn svg { width: 16px; height: 16px; }
.restricted-note { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.restricted-note > svg { width: 18px; height: 18px; flex: none; }
.restricted-note span { flex: 1; }
.card__head svg { width: 14px; height: 14px; vertical-align: -2px; }

/* The locked people cost area (planning/james-hub/manager-people-insights.md) */
.lock-band { display: flex; gap: 12px; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; padding: 12px 16px; border-radius: 8px; background: var(--rich-black); color: var(--text-on-dark); font-size: 14px; margin-bottom: 18px; }
.lock-band svg { width: 18px; height: 18px; flex: none; }
.lock-band small { color: var(--text-on-dark-muted); }
.strip { display: flex; gap: 2px; }
.strip i { display: block; width: 18px; height: 18px; border-radius: 3px; background: var(--load-free); box-shadow: inset 0 0 0 1px var(--line); }
.strip i.fn { margin-left: 6px; }
.strip i.c-green, .cell--green { background: var(--ok-tint); box-shadow: inset 0 0 0 1px var(--ok-line); }
.strip i.c-amber, .cell--amber { background: var(--overdue-tint); box-shadow: inset 0 0 0 1px var(--overdue-line); }
.strip i.c-red, .cell--red { background: var(--gap-tint); box-shadow: inset 0 0 0 1px var(--gap-line); }
.strip i.c-leave, .cell--leave { background: var(--cool-grey); box-shadow: none; }
.flag-repeat::after { content: " \2605"; }
.flag-address::after { content: " \2691"; color: var(--red); }
.neg { color: #b4232a; }
.tabs a svg { width: 14px; height: 14px; vertical-align: -2px; margin-right: 4px; }
.cell--none { background: var(--load-free); box-shadow: inset 0 0 0 1px var(--line); color: var(--text-muted); }
.check-inline { display: inline-flex; gap: 6px; align-items: center; font-size: 14px; }
.attention__icon--green { background: var(--ok-tint); color: var(--ok-ink); }
.gbu-head { font-family: var(--font-strong); font-size: 13px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-muted); margin: 16px 0 6px; }

/* Sign up: pick a level */
.levels { border: 0; margin: 0 0 12px; padding: 0; display: grid; gap: 8px; }
.level { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; cursor: pointer; }
.level:has(input:checked) { border-color: var(--rich-black); }
.level input { margin-top: 4px; flex: none; }
.level strong { display: block; }
.level__help { display: block; font-size: 13px; color: var(--text-muted); }
.level--check { margin-bottom: 18px; }

/* Users page: the extra access ticks stack in one cell */
.access-checks { display: grid; gap: 4px; min-width: 170px; }
.users-table select { min-height: 36px; border: 1px solid var(--line-strong); border-radius: 8px; padding: 4px 8px; background: var(--surface); font: inherit; font-size: 14px; max-width: 280px; }
.users-table td[data-covers].is-idle select, .users-table td[data-covers].is-idle .cell-sub { opacity: 0.35; }
.users-table tr.is-changed td { background: var(--soft-yellow, #fbffd6); }
.users-table [data-save]:disabled { opacity: 0.45; cursor: default; }
.table--min { min-width: 620px; }
@media (max-width: 900px) {
  /* Each person becomes a card, so nothing is cut off at phone width */
  .users-table thead { display: none; }
  .users-table, .users-table tbody, .users-table tr, .users-table td { display: block; width: 100%; }
  .users-table tr { padding: 14px 16px; border-bottom: 1px solid var(--line); }
  .users-table td { padding: 6px 0; border: 0; }
  .users-table td[data-label]::before { content: attr(data-label); display: block; font-size: 12px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 4px; }
  .users-table select { max-width: 100%; width: 100%; }
  .users-table td[data-covers].is-idle { display: none; }
}
