/* Accere OS — one stylesheet for team and portal */
@font-face { font-family: "Marcellus"; src: url("../assets/fonts/marcellus-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Source Sans 3"; src: url("../assets/fonts/source-sans-3-var.woff2") format("woff2"); font-weight: 200 900; font-display: swap; }

:root {
  --blue: #3342b6; --blue-dark: #27339a; --blue-tint: #eef0fb; --blue-tint-2: #dfe3f7;
  --magenta: #ad1fa9; --magenta-tint: #f8e9f8;
  --ink: #404040; --ink-strong: #262626; --muted: #6b6b73; --faint: #707078;
  --line: #e3e4ea; --line-strong: #cfd1da;
  --bg: #f5f6f8; --surface: #ffffff; --surface-2: #fafbfc;
  --nav: #1d2140; --nav-ink: #c9cce0; --nav-hover: #2a2f57; --nav-active: #353b6e;
  --ok: #1d7a46; --ok-bg: #e6f4ec; --warn: #8a5a00; --warn-bg: #fdf3dc; --bad: #b42318; --bad-bg: #fdecea;
  --info: #3342b6; --info-bg: #eef0fb; --neutral-bg: #eeeff2;
  --radius: 8px; --radius-sm: 5px;
  --shadow: 0 1px 2px rgba(20, 22, 40, .06), 0 4px 16px rgba(20, 22, 40, .06);
  --shadow-lg: 0 10px 40px rgba(20, 22, 40, .18);
  --sans: "Source Sans 3", system-ui, -apple-system, "Segoe UI", sans-serif;
  --serif: "Marcellus", Georgia, serif;
  --nav-w: 232px; --top-h: 56px;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; }
body { font-family: var(--sans); font-size: 15px; line-height: 1.5; color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { color: var(--ink-strong); margin: 0; line-height: 1.25; }
h1.page-title { font-family: var(--serif); font-weight: 400; font-size: 28px; letter-spacing: .01em; }
h2 { font-size: 18px; font-weight: 650; }
h3 { font-size: 15px; font-weight: 650; }
p { margin: 0 0 .75em; }
small, .small { font-size: 13px; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.nowrap { white-space: nowrap; }
.num { font-variant-numeric: tabular-nums; }
.right { text-align: right; }
.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(--blue); outline-offset: 2px; border-radius: 3px; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--surface); padding: 8px 12px; z-index: 100; border-radius: var(--radius-sm); }
.skip:focus { left: 8px; }
svg { width: 18px; height: 18px; flex: none; }
a > svg, button > svg, span > svg { vertical-align: -3px; }
hr { border: 0; border-top: 1px solid var(--line); margin: 16px 0; }

/* ---------- Layout ---------- */
.app { display: grid; grid-template-columns: var(--nav-w) 1fr; min-height: 100vh; }
.sidebar { background: var(--nav); color: var(--nav-ink); position: sticky; top: 0; height: 100vh; overflow-y: auto; display: flex; flex-direction: column; z-index: 30; }
.brand { display: flex; align-items: center; gap: 10px; padding: 16px 18px 14px; color: #fff; }
.brand img { width: 26px; height: 30px; }
.brand b { font-family: var(--serif); font-weight: 400; font-size: 19px; letter-spacing: .02em; }
.brand span { display: block; font-size: 11px; color: var(--nav-ink); letter-spacing: .08em; text-transform: uppercase; }
.nav-group { padding: 6px 10px; }
.nav-group h4 { font-size: 11px; font-weight: 650; text-transform: uppercase; letter-spacing: .09em; color: #8d91b6; padding: 10px 10px 4px; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: var(--radius-sm); color: var(--nav-ink); font-size: 14.5px; }
.nav a:hover { background: var(--nav-hover); color: #fff; text-decoration: none; }
.nav a[aria-current="page"] { background: var(--nav-active); color: #fff; box-shadow: inset 3px 0 0 var(--magenta); }
.nav a svg { width: 17px; height: 17px; flex: none; opacity: .85; }
.nav a .count { margin-left: auto; background: var(--magenta); color: #fff; font-size: 11px; font-weight: 700; border-radius: 10px; padding: 0 6px; line-height: 18px; }
.nav a .ext { margin-left: auto; opacity: .8; font-size: 12px; }
.sidebar-foot { margin-top: auto; padding: 12px 18px 16px; font-size: 12px; color: #8d91b6; border-top: 1px solid rgba(255,255,255,.07); }
.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { height: var(--top-h); background: var(--surface); border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 12px; padding: 0 20px; position: sticky; top: 0; z-index: 20; }
.topbar .menu-btn { display: none; }
.search-btn { flex: 1; max-width: 440px; display: flex; align-items: center; gap: 8px; height: 36px; padding: 0 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface-2); color: var(--muted); font: inherit; cursor: pointer; text-align: left; }
.search-btn:hover { border-color: var(--line-strong); }
.search-btn kbd { margin-left: auto; }
.search-btn svg { width: 17px; height: 17px; }
.search-btn span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
kbd { font-family: var(--sans); font-size: 11px; border: 1px solid var(--line-strong); border-bottom-width: 2px; border-radius: 4px; padding: 0 5px; color: var(--muted); background: #fff; }
.topbar .spacer { flex: 1; }
.icon-btn { position: relative; width: 36px; height: 36px; display: inline-grid; place-items: center; border: 0; border-radius: 50%; background: transparent; color: var(--ink); cursor: pointer; }
.icon-btn:hover { background: var(--neutral-bg); }
.icon-btn svg { width: 20px; height: 20px; }
.icon-btn .dot { position: absolute; top: 4px; right: 3px; min-width: 16px; height: 16px; border-radius: 8px; background: var(--magenta); color: #fff; font-size: 10px; font-weight: 700; display: grid; place-items: center; padding: 0 4px; }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--blue-tint-2); color: var(--blue); display: inline-grid; place-items: center; font-weight: 700; font-size: 13px; flex: none; overflow: hidden; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar.lg { width: 64px; height: 64px; font-size: 22px; }
.content { padding: 22px 28px 60px; max-width: 1400px; width: 100%; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.page-head .sub { color: var(--muted); margin-top: 4px; }
.page-head .actions { display: flex; gap: 8px; flex-wrap: wrap; }
.crumbs { font-size: 13px; color: var(--muted); margin-bottom: 4px; }
.crumbs a { color: var(--muted); }

/* ---------- Buttons & forms ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 36px; padding: 0 14px; border-radius: var(--radius-sm); border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink-strong); font: inherit; font-weight: 600; font-size: 14px; cursor: pointer; white-space: nowrap; text-decoration: none !important; }
.btn:hover { background: var(--surface-2); border-color: #b9bcc8; }
.btn.primary { background: var(--blue); border-color: var(--blue); color: #fff; }
.btn.primary:hover { background: var(--blue-dark); }
.btn.danger { color: var(--bad); }
.btn.ghost { border-color: transparent; background: transparent; color: var(--blue); }
.btn.ghost:hover { background: var(--blue-tint); }
.btn.sm { height: 30px; padding: 0 10px; font-size: 13px; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.btn svg { width: 16px; height: 16px; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
label.field, .field { display: block; margin-bottom: 14px; }
.field > span, .field-label { display: block; font-size: 13px; font-weight: 600; color: var(--ink-strong); margin-bottom: 4px; }
.field .hint { font-size: 12.5px; color: var(--muted); margin-top: 3px; }
input[type=text], input[type=email], input[type=password], input[type=tel], input[type=number], input[type=date], input[type=datetime-local], input[type=url], input[type=search], select, textarea {
  width: 100%; height: 36px; padding: 6px 10px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: #fff; font: inherit; font-size: 14.5px; color: var(--ink-strong); }
textarea { height: auto; min-height: 84px; resize: vertical; line-height: 1.45; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(51, 66, 182, .15); }
input[type=checkbox], input[type=radio] { accent-color: var(--blue); width: 16px; height: 16px; vertical-align: -3px; }
.check { display: flex; gap: 8px; align-items: flex-start; font-size: 14.5px; margin-bottom: 8px; cursor: pointer; }
.check input { margin-top: 3px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 16px; }
.form-error { background: var(--bad-bg); color: var(--bad); padding: 8px 12px; border-radius: var(--radius-sm); font-size: 14px; margin-bottom: 12px; }
.form-ok { background: var(--ok-bg); color: var(--ok); padding: 8px 12px; border-radius: var(--radius-sm); font-size: 14px; margin-bottom: 12px; }

/* ---------- Cards, stats ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 1px 2px rgba(20,22,40,.04); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.card-head h2, .card-head h3 { font-size: 15px; }
.card-body { padding: 14px 16px; }
.card + .card { margin-top: 16px; }
.cols { display: grid; grid-template-columns: 2fr 1fr; gap: 16px; align-items: start; }
.cols-even { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
.stack > * + * { margin-top: 16px; }
.cols > *, .cols-even > *, .grid-2 > *, .grid-3 > *, .stack > * { min-width: 0; }
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; margin-bottom: 18px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; display: block; color: inherit; }
a.stat:hover { border-color: var(--blue); text-decoration: none; }
.stat .label { font-size: 12.5px; color: var(--muted); font-weight: 600; }
.stat .value { font-size: 26px; font-weight: 650; color: var(--ink-strong); font-variant-numeric: tabular-nums; line-height: 1.2; margin-top: 2px; }
.stat .value.bad { color: var(--bad); }
.stat .note { font-size: 12px; color: var(--faint); }
.list { list-style: none; margin: 0; padding: 0; }
.list li { padding: 9px 16px; border-bottom: 1px solid var(--line); display: flex; gap: 10px; align-items: center; }
.list li:last-child { border-bottom: 0; }
.list li .grow { flex: 1; min-width: 0; }
.list li .title { color: var(--ink-strong); font-weight: 600; }
.list a.row-link { color: inherit; display: block; }
.list a.row-link:hover .title { color: var(--blue); }
.empty { padding: 28px 16px; text-align: center; color: var(--muted); font-size: 14px; }
.empty b { display: block; color: var(--ink-strong); margin-bottom: 4px; font-size: 15px; }
.kv { display: grid; grid-template-columns: 140px 1fr; gap: 6px 12px; font-size: 14px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; color: var(--ink-strong); min-width: 0; overflow-wrap: anywhere; }

/* ---------- Status badges (always text + colour) ---------- */
.badge { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 650; padding: 1px 8px; border-radius: 10px; white-space: nowrap; line-height: 18px; background: var(--neutral-bg); color: var(--ink); }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .8; }
.badge.plain::before { display: none; }
.badge.ok { background: var(--ok-bg); color: var(--ok); }
.badge.warn { background: var(--warn-bg); color: var(--warn); }
.badge.bad { background: var(--bad-bg); color: var(--bad); }
.badge.info { background: var(--info-bg); color: var(--info); }
.badge.accent { background: var(--magenta-tint); color: var(--magenta); }
.tag { display: inline-block; font-size: 12px; padding: 0 7px; border-radius: 4px; background: var(--neutral-bg); color: var(--ink); line-height: 20px; margin: 1px 2px 1px 0; }
.due-bad { color: var(--bad); font-weight: 650; }
.due-soon { color: var(--warn); font-weight: 650; }

/* ---------- Tables ---------- */
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; }
.toolbar input[type=search] { max-width: 260px; }
.toolbar select { width: auto; min-width: 140px; }
.toolbar .spacer { flex: 1; }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 16px; overflow-x: auto; scrollbar-width: none; }
.tabs a, .tabs button { padding: 9px 14px; font-weight: 600; font-size: 14px; color: var(--muted); border: 0; background: none; border-bottom: 2px solid transparent; margin-bottom: -1px; cursor: pointer; white-space: nowrap; font-family: inherit; }
.tabs a:hover, .tabs button:hover { color: var(--ink-strong); text-decoration: none; }
.tabs [aria-selected="true"] { color: var(--blue); border-bottom-color: var(--blue); }
.tabs .count { font-size: 11px; background: var(--neutral-bg); border-radius: 8px; padding: 0 6px; margin-left: 4px; color: var(--ink); }
.table-wrap { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: 14px; }
table.data th { text-align: left; font-size: 12px; font-weight: 650; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; padding: 8px 12px; border-bottom: 1px solid var(--line); background: var(--surface-2); white-space: nowrap; position: sticky; top: 0; }
table.data th button { all: unset; cursor: pointer; display: inline-flex; gap: 4px; align-items: center; }
table.data th button:focus-visible { outline: 2px solid var(--blue); }
table.data th .arrow { font-size: 10px; color: var(--blue); }
table.data td { padding: 8px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.data tr:last-child td { border-bottom: 0; }
table.data tbody tr.clickable { cursor: pointer; }
table.data tbody tr.clickable:hover td { background: #f8f9fd; }
table.data td .title { color: var(--ink-strong); font-weight: 600; }
table.data td.actions { white-space: nowrap; text-align: right; }
.table-foot { font-size: 12.5px; color: var(--muted); padding: 8px 2px; }

/* ---------- Side panel, modal, toast ---------- */
.scrim { position: fixed; inset: 0; background: rgba(20, 22, 40, .35); z-index: 60; animation: fade .15s; }
.panel { position: fixed; top: 0; right: 0; bottom: 0; width: min(620px, 100vw); background: var(--surface); z-index: 61; box-shadow: var(--shadow-lg); display: flex; flex-direction: column; animation: slide .18s ease-out; }
.panel.wide { width: min(860px, 100vw); }
.panel-head { display: flex; align-items: flex-start; gap: 10px; padding: 16px 20px 12px; border-bottom: 1px solid var(--line); }
.panel-head h2 { font-size: 19px; flex: 1; }
.panel-head .eyebrow { font-size: 12.5px; color: var(--muted); margin-bottom: 2px; }
.panel-body { flex: 1; overflow-y: auto; padding: 16px 20px 24px; }
.panel-foot { padding: 12px 20px; border-top: 1px solid var(--line); display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; background: var(--surface-2); }
.modal { position: fixed; left: 50%; top: 10vh; transform: translateX(-50%); width: min(560px, calc(100vw - 24px)); max-height: 80vh; background: var(--surface); border-radius: 10px; z-index: 71; box-shadow: var(--shadow-lg); display: flex; flex-direction: column; animation: pop .15s; }
.modal.wide { width: min(760px, calc(100vw - 24px)); }
.modal + .scrim, .scrim.top { z-index: 70; }
.modal-head { padding: 16px 20px 0; }
.modal-body { padding: 14px 20px; overflow-y: auto; }
.modal-foot { padding: 12px 20px 16px; display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
.toasts { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); z-index: 90; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast { background: var(--ink-strong); color: #fff; padding: 10px 16px; border-radius: 8px; font-size: 14px; box-shadow: var(--shadow-lg); animation: pop .15s; pointer-events: auto; max-width: min(520px, calc(100vw - 32px)); }
.toast.bad { background: var(--bad); }
@keyframes slide { from { transform: translateX(30px); opacity: 0; } }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { transform: translate(-50%, 8px); opacity: 0; } }
.toast { animation: none; }

/* Search palette */
.palette { position: fixed; left: 50%; top: 12vh; transform: translateX(-50%); width: min(620px, calc(100vw - 24px)); background: var(--surface); border-radius: 10px; z-index: 81; box-shadow: var(--shadow-lg); overflow: hidden; }
.palette input { border: 0; border-bottom: 1px solid var(--line); border-radius: 0; height: 52px; font-size: 17px; padding: 0 18px; box-shadow: none !important; }
.palette ul { list-style: none; margin: 0; padding: 6px; max-height: 56vh; overflow-y: auto; }
.palette li a { display: flex; gap: 10px; align-items: center; padding: 8px 12px; border-radius: 6px; color: var(--ink); }
.palette li a[aria-selected="true"], .palette li a:hover { background: var(--blue-tint); text-decoration: none; }
.palette li .kind { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); width: 70px; flex: none; }
.palette li .t { color: var(--ink-strong); font-weight: 600; }
.palette .hint { padding: 10px 18px; font-size: 12.5px; color: var(--muted); border-top: 1px solid var(--line); }
.scrim.palette-scrim { z-index: 80; }

/* Notifications dropdown */
.dropdown { position: absolute; right: 12px; top: calc(var(--top-h) - 4px); width: min(400px, calc(100vw - 24px)); background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow-lg); z-index: 50; max-height: 70vh; display: flex; flex-direction: column; }
.dropdown .list { overflow-y: auto; }
.dropdown .list li { align-items: flex-start; }
.dropdown .list li.unread { background: #f7f8fe; }
.dropdown .list li.unread .title::after { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--magenta); margin-left: 6px; vertical-align: 2px; }
.menu { min-width: 200px; width: auto; }
.menu a, .menu button { display: block; width: 100%; text-align: left; padding: 9px 16px; border: 0; background: none; font: inherit; color: var(--ink); cursor: pointer; }
.menu a:hover, .menu button:hover { background: var(--surface-2); text-decoration: none; }

/* ---------- Tasks ---------- */
.kanban { display: grid; grid-template-columns: repeat(6, minmax(220px, 1fr)); gap: 12px; overflow-x: auto; padding-bottom: 8px; }
.kanban .col { background: #eceef3; border-radius: var(--radius); padding: 8px; min-height: 120px; }
.kanban .col h3 { font-size: 13px; padding: 4px 6px 8px; display: flex; justify-content: space-between; }
.kanban .col.drop { outline: 2px dashed var(--blue); }
.kcard { background: var(--surface); border: 1px solid var(--line); border-radius: 6px; padding: 8px 10px; margin-bottom: 8px; cursor: pointer; font-size: 13.5px; }
.kcard:hover { border-color: var(--blue); }
.kcard .t { font-weight: 600; color: var(--ink-strong); }
.kcard .m { color: var(--muted); font-size: 12.5px; display: flex; gap: 8px; flex-wrap: wrap; margin-top: 3px; }
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--surface); }
.cal .dow { background: var(--surface-2); font-size: 12px; font-weight: 650; color: var(--muted); padding: 6px 8px; border-bottom: 1px solid var(--line); text-transform: uppercase; }
.cal .day { min-width: 0; min-height: 104px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 4px 6px; font-size: 12.5px; }
.cal .day:nth-child(7n) { border-right: 0; }
.cal .day.other { background: #fafafb; color: var(--faint); }
.cal .day.today .d { background: var(--blue); color: #fff; border-radius: 10px; padding: 0 6px; }
.cal .day.holiday { background: #fbf6fb; }
.cal .d { font-weight: 650; display: inline-block; margin-bottom: 2px; }
.cal .ev { display: block; padding: 1px 5px; border-radius: 3px; background: var(--blue-tint); color: var(--blue-dark); margin-bottom: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; font-size: 12px; border: 0; width: 100%; text-align: left; font-family: inherit; }
.cal .ev.done { background: var(--ok-bg); color: var(--ok); text-decoration: line-through; }
.cal .ev.late { background: var(--bad-bg); color: var(--bad); }
.cal .ev.accent { background: var(--magenta-tint); color: var(--magenta); }
.workload td.cell { text-align: center; font-variant-numeric: tabular-nums; }
.load { display: inline-block; min-width: 46px; padding: 2px 6px; border-radius: 4px; font-weight: 600; font-size: 13px; }
.load.l0 { color: var(--faint); }
.load.l1 { background: var(--ok-bg); color: var(--ok); }
.load.l2 { background: var(--warn-bg); color: var(--warn); }
.load.l3 { background: var(--bad-bg); color: var(--bad); }
.checklist { list-style: none; margin: 0; padding: 0; }
.checklist li { display: flex; gap: 8px; align-items: flex-start; padding: 5px 0; border-bottom: 1px dashed var(--line); }
.checklist li.done span { color: var(--muted); text-decoration: line-through; }
.progress { height: 6px; background: var(--neutral-bg); border-radius: 3px; overflow: hidden; }
.progress > i { display: block; height: 100%; background: var(--blue); }
.comment { padding: 10px 0; border-bottom: 1px solid var(--line); }
.comment .who { font-size: 13px; font-weight: 650; color: var(--ink-strong); }
.comment .when { font-size: 12px; color: var(--faint); margin-left: 6px; font-weight: 400; }
.comment .body { white-space: pre-wrap; font-size: 14px; margin-top: 2px; }
.mention { color: var(--magenta); font-weight: 600; }
.section-title { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 20px 0 8px; }
.section-title:first-child { margin-top: 0; }
.timeline { list-style: none; margin: 0; padding: 0 0 0 18px; border-left: 2px solid var(--line); }
.timeline li { position: relative; padding: 0 0 14px 10px; font-size: 14px; }
.timeline li::before { content: ""; position: absolute; left: -25px; top: 5px; width: 10px; height: 10px; border-radius: 50%; background: var(--surface); border: 2px solid var(--line-strong); }
.timeline li.done::before { background: var(--ok); border-color: var(--ok); }
.timeline li.now::before { background: var(--blue); border-color: var(--blue); }
.timeline li .when { font-size: 12.5px; color: var(--muted); }

/* ---------- Files ---------- */
.files-layout { display: grid; grid-template-columns: 260px 1fr; gap: 16px; align-items: start; }
.tree { list-style: none; margin: 0; padding: 4px 0; font-size: 14px; }
.tree ul { list-style: none; margin: 0; padding-left: 14px; }
.tree a { display: flex; gap: 6px; align-items: center; padding: 4px 10px; border-radius: 4px; color: var(--ink); }
.tree a:hover { background: var(--surface-2); text-decoration: none; }
.tree a[aria-current="true"] { background: var(--blue-tint); color: var(--blue-dark); font-weight: 600; }
.tree svg { width: 15px; height: 15px; flex: none; color: var(--muted); }
.dropzone { border: 2px dashed var(--line-strong); border-radius: var(--radius); padding: 18px; text-align: center; color: var(--muted); font-size: 14px; background: var(--surface-2); }
.dropzone.over { border-color: var(--blue); background: var(--blue-tint); }
.preview { border: 1px solid var(--line); border-radius: var(--radius-sm); max-width: 100%; max-height: 60vh; display: block; margin: 0 auto; }
iframe.preview { width: 100%; height: 60vh; }

/* ---------- Scorecard ---------- */
.score-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; }
.score-area { border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; background: var(--surface); border-left-width: 4px; }
.score-area.strong { border-left-color: var(--ok); }
.score-area.needs_attention { border-left-color: #d49b1a; }
.score-area.at_risk { border-left-color: var(--bad); }
.rating-pick { display: flex; gap: 4px; flex-wrap: wrap; margin: 6px 0; }
.rating-pick label { font-size: 12.5px; border: 1px solid var(--line-strong); border-radius: 14px; padding: 2px 10px; cursor: pointer; }
.rating-pick input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.rating-pick input:focus-visible + span { outline: 2px solid var(--blue); outline-offset: 3px; border-radius: 10px; }
.rating-pick label:has(input:checked) { background: var(--blue); border-color: var(--blue); color: #fff; }

/* ---------- Rich text (KB, notices) ---------- */
.prose { font-size: 15.5px; line-height: 1.6; max-width: 760px; }
.prose h2 { font-size: 20px; margin: 1.3em 0 .4em; }
.prose h3 { font-size: 16.5px; margin: 1.2em 0 .3em; }
.prose ul, .prose ol { padding-left: 1.3em; margin: 0 0 .9em; }
.prose li { margin-bottom: .25em; }
.prose table { border-collapse: collapse; margin: .8em 0; font-size: 14px; }
.prose th, .prose td { border: 1px solid var(--line); padding: 6px 10px; text-align: left; }
.prose th { background: var(--surface-2); }
.prose blockquote { border-left: 3px solid var(--magenta); margin: .8em 0; padding: 2px 14px; color: var(--muted); }
.editor-bar { display: flex; gap: 2px; flex-wrap: wrap; border: 1px solid var(--line-strong); border-bottom: 0; border-radius: var(--radius-sm) var(--radius-sm) 0 0; padding: 4px; background: var(--surface-2); }
.editor-bar button { border: 0; background: none; padding: 4px 8px; border-radius: 4px; cursor: pointer; font: inherit; font-size: 13px; font-weight: 600; color: var(--ink); }
.editor-bar button:hover { background: var(--neutral-bg); }
.editor { border: 1px solid var(--line-strong); border-radius: 0 0 var(--radius-sm) var(--radius-sm); min-height: 320px; padding: 12px 16px; background: #fff; overflow-y: auto; max-height: 60vh; }
.editor:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(51,66,182,.15); }
.suggest-link { position: fixed; right: 18px; bottom: 16px; z-index: 15; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); border-radius: 18px; padding: 6px 14px; font-size: 13px; font-weight: 600; color: var(--blue); cursor: pointer; font-family: inherit; }
.suggest-link:hover { border-color: var(--blue); }

/* ---------- Matrix ---------- */
table.matrix td, table.matrix th { text-align: center; }
table.matrix td:first-child, table.matrix th:first-child { text-align: left; }
table.matrix select { height: 30px; font-size: 13px; padding: 2px 6px; width: auto; }

/* ---------- Auth ---------- */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; background: linear-gradient(160deg, #f5f6f8 0%, #eceef7 100%); }
.auth .card { width: min(420px, 100%); padding: 28px 28px 22px; box-shadow: var(--shadow); }
.auth .logo { height: 42px; margin-bottom: 18px; }
.auth h1 { font-family: var(--serif); font-weight: 400; font-size: 26px; margin-bottom: 4px; }
.auth .lede { color: var(--muted); margin-bottom: 20px; }
.auth .alt { margin-top: 14px; display: flex; justify-content: space-between; gap: 10px; font-size: 14px; flex-wrap: wrap; }
.auth .btn.primary { width: 100%; height: 42px; }
.loading { min-height: 50vh; display: grid; place-items: center; color: var(--muted); }
.spinner { width: 22px; height: 22px; border: 3px solid var(--blue-tint-2); border-top-color: var(--blue); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Portal ---------- */
.portal .sidebar { background: #fff; color: var(--ink); border-right: 1px solid var(--line); }
.portal .brand { color: var(--ink-strong); }
.portal .brand span { color: var(--muted); }
.portal .nav a { color: var(--ink); }
.portal .nav a:hover { background: var(--surface-2); color: var(--ink-strong); }
.portal .nav a[aria-current="page"] { background: var(--blue-tint); color: var(--blue-dark); box-shadow: inset 3px 0 0 var(--magenta); }
.portal .sidebar-foot { color: var(--muted); border-top-color: var(--line); }
.portal .nav-group h4 { color: var(--faint); }
.contact-card { display: flex; gap: 14px; align-items: center; }
.msg-thread { display: flex; flex-direction: column; gap: 10px; padding: 14px 16px; max-height: 60vh; overflow-y: auto; }
.msg { max-width: 78%; padding: 8px 12px; border-radius: 10px; background: var(--neutral-bg); font-size: 14.5px; white-space: pre-wrap; }
.msg.mine { align-self: flex-end; background: var(--blue); color: #fff; }
.msg .meta { font-size: 11.5px; opacity: .75; margin-top: 3px; }
.msg-form { display: flex; gap: 8px; padding: 12px 16px; border-top: 1px solid var(--line); }
.msg-form textarea { min-height: 42px; height: 42px; }
.placeholder-card { padding: 32px; text-align: center; }
.placeholder-card .phase { display: inline-block; font-size: 12px; font-weight: 700; color: var(--magenta); background: var(--magenta-tint); padding: 2px 10px; border-radius: 10px; margin-bottom: 10px; }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .cols { grid-template-columns: 1fr; }
  .content { padding: 18px 18px 70px; }
}
@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; width: 260px; transform: translateX(-100%); transition: transform .2s; box-shadow: var(--shadow-lg); }
  .sidebar.open { transform: none; }
  .topbar { padding: 0 10px; gap: 6px; }
  .topbar .menu-btn { display: inline-grid; }
  .search-btn kbd { display: none; }
  .cols-even, .grid-2, .grid-3, .files-layout { grid-template-columns: 1fr; }
  .content { padding: 14px 12px 80px; }
  h1.page-title { font-size: 23px; }
  .kv { grid-template-columns: 110px 1fr; }
  .cal .day { min-height: 70px; padding: 2px 3px; }
  .cal .ev { font-size: 10.5px; padding: 0 3px; }
  .cal .dow { padding: 4px; font-size: 10px; }
  .panel { width: 100vw; }
  /* tables become stacked cards on phones */
  table.data.stack-sm thead { display: none; }
  table.data.stack-sm, table.data.stack-sm tbody, table.data.stack-sm tr, table.data.stack-sm td { display: block; width: 100%; }
  table.data.stack-sm tr { border-bottom: 1px solid var(--line); padding: 8px 4px; }
  table.data.stack-sm td { border: 0; padding: 2px 10px; }
  table.data.stack-sm td[data-label]:not(:first-child)::before { content: attr(data-label) ": "; color: var(--muted); font-size: 12.5px; }
  table.data.stack-sm td.actions { text-align: left; }
  table.data.stack-sm td:empty { display: none; }
  .toolbar input[type=search] { max-width: none; flex: 1 1 100%; }
  .toolbar select { flex: 1 1 45%; min-width: 0; }
  .suggest-link { bottom: 10px; right: 10px; }
  .msg { max-width: 90%; }
}
@media print {
  .sidebar, .topbar, .suggest-link, .page-head .actions { display: none !important; }
  .app { display: block; }
  body { background: #fff; }
}
