/* ORBIT by Enout. Internal operations platform, Phase 1 prototype.
   Layout: fixed left sidebar (240px) + scrolling main column; panels on a whitesmoke ground, white cards with hairline borders, amber accent on pills.
   Tokens are lifted from enout.in: Manrope body, Instrument Sans headings, amber #FEBD59 on near-black. */
:root {
  /* Apple-style system typography: real SF Pro on Apple devices, Inter as the closest web fallback elsewhere. */
  --font-body: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Inter", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-display: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Inter", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

  --bg: #f5f5f7;
  --surface: #ffffff;
  --surface-2: #fbfbfd;
  --surface-3: #f0f0f4;
  /* Apple translucent system fills: controls tint whatever sits behind them. */
  --fill: rgba(120, 120, 128, 0.12);
  --fill-hover: rgba(120, 120, 128, 0.20);
  --fill-solid: #e8e8ed;
  --material: rgba(255, 255, 255, 0.6);
  --menu-bg: rgba(255, 255, 255, 0.98);
  --control-border: rgba(0, 0, 0, 0.07);
  --border: #e5e5ea;
  --border-strong: #d2d2d7;
  --fg: #1d1d1f;
  --fg-2: #424245;
  --fg-3: #6e6e73;
  --fg-4: #a1a1a6;

  --accent: #f6a93b;
  --accent-ink: #1d1d1f;
  --accent-hover: #f09e28;
  --accent-soft: #fff4e2;
  --accent-text: #9a5a00;
  --accent-ring: rgba(246, 169, 59, 0.4);

  --good: #1d7a43;      --good-bg: #e4f5ea;
  --info: #0a6ae0;      --info-bg: #e4eefc;
  --warn: #9a5a00;      --warn-bg: #fff4e2;
  --danger: #d1332e;    --danger-bg: #fde7e6;

  --st-unassigned: #6e6e73;  --st-unassigned-bg: #ececf0;
  --st-assigned: #3b4a6b;    --st-assigned-bg: #e9edf5;
  --st-progress: #0a6ae0;    --st-progress-bg: #e4eefc;
  --st-waiting: #6b3fc9;     --st-waiting-bg: #efe9fb;
  --st-qc: #0b7a74;          --st-qc-bg: #e0f4f2;
  --st-rework: #c0531f;      --st-rework-bg: #fceade;
  --st-revenue: #3d4bb5;     --st-revenue-bg: #e9ebfa;
  --st-revision: #c02b50;    --st-revision-bg: #fce6eb;
  --st-done: #1d7a43;        --st-done-bg: #e4f5ea;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04), 0 1px 1px rgba(0, 0, 0, 0.02);
  --shadow-md: 0 6px 20px rgba(0, 0, 0, 0.08), 0 1px 3px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 20px 48px rgba(0, 0, 0, 0.16), 0 4px 12px rgba(0, 0, 0, 0.06);

  --glass: rgba(255, 255, 255, 0.72);
  --r-sm: 10px; --r-md: 14px; --r-lg: 18px; --r-xl: 22px; --r-pill: 980px;
  --sidebar-w: 248px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #000000; --surface: #1c1c1e; --surface-2: #2c2c2e; --surface-3: #3a3a3c;
    --fill: rgba(120, 120, 128, 0.26); --fill-hover: rgba(120, 120, 128, 0.40); --fill-solid: #3a3a3c;
    --material: rgba(40, 40, 44, 0.6); --menu-bg: rgba(38, 38, 40, 0.98); --control-border: rgba(255, 255, 255, 0.10);
    --border: #38383a; --border-strong: #48484a;
    --fg: #f5f5f7; --fg-2: #d1d1d6; --fg-3: #98989d; --fg-4: #6c6c70;
    --accent: #ffb64d; --accent-ink: #1d1206; --accent-hover: #ffc470; --accent-soft: #3a2b11; --accent-text: #ffc978; --accent-ring: rgba(255, 182, 77, 0.35);
    --good: #5fd08a; --good-bg: #163320; --info: #6fb0ff; --info-bg: #122744; --warn: #ffc978; --warn-bg: #3a2b11; --danger: #ff6b66; --danger-bg: #3f1817;
    --st-unassigned: #b0b0b5; --st-unassigned-bg: #2c2c2e;
    --st-assigned: #b9c4e0; --st-assigned-bg: #242a38;
    --st-progress: #6fb0ff; --st-progress-bg: #122744;
    --st-waiting: #c7b2f5; --st-waiting-bg: #271d44;
    --st-qc: #6fd3cc; --st-qc-bg: #0d2f2c;
    --st-rework: #ffa78a; --st-rework-bg: #3d2014;
    --st-revenue: #b3bbf5; --st-revenue-bg: #1d224c;
    --st-revision: #ff9ab8; --st-revision-bg: #421827;
    --st-done: #5fd08a; --st-done-bg: #163320;
    --glass: rgba(28, 28, 30, 0.72);
    --shadow-sm: 0 1px 2px rgba(0,0,0,.5); --shadow-md: 0 6px 20px rgba(0,0,0,.6); --shadow-lg: 0 20px 48px rgba(0,0,0,.7);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #000000; --surface: #1c1c1e; --surface-2: #2c2c2e; --surface-3: #3a3a3c;
  --fill: rgba(120, 120, 128, 0.26); --fill-hover: rgba(120, 120, 128, 0.40); --fill-solid: #3a3a3c;
  --material: rgba(40, 40, 44, 0.6); --menu-bg: rgba(38, 38, 40, 0.98); --control-border: rgba(255, 255, 255, 0.10);
  --border: #38383a; --border-strong: #48484a;
  --fg: #f5f5f7; --fg-2: #d1d1d6; --fg-3: #98989d; --fg-4: #6c6c70;
  --accent: #ffb64d; --accent-ink: #1d1206; --accent-hover: #ffc470; --accent-soft: #3a2b11; --accent-text: #ffc978; --accent-ring: rgba(255, 182, 77, 0.35);
  --good: #5fd08a; --good-bg: #163320; --info: #6fb0ff; --info-bg: #122744; --warn: #ffc978; --warn-bg: #3a2b11; --danger: #ff6b66; --danger-bg: #3f1817;
  --st-unassigned: #b0b0b5; --st-unassigned-bg: #2c2c2e;
  --st-assigned: #b9c4e0; --st-assigned-bg: #242a38;
  --st-progress: #6fb0ff; --st-progress-bg: #122744;
  --st-waiting: #c7b2f5; --st-waiting-bg: #271d44;
  --st-qc: #6fd3cc; --st-qc-bg: #0d2f2c;
  --st-rework: #ffa78a; --st-rework-bg: #3d2014;
  --st-revenue: #b3bbf5; --st-revenue-bg: #1d224c;
  --st-revision: #ff9ab8; --st-revision-bg: #421827;
  --st-done: #5fd08a; --st-done-bg: #163320;
  --glass: rgba(28, 28, 30, 0.72);
  --shadow-sm: 0 1px 2px rgba(0,0,0,.5); --shadow-md: 0 6px 20px rgba(0,0,0,.6); --shadow-lg: 0 20px 48px rgba(0,0,0,.7);
}

html, body { height: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--fg);
  font-family: var(--font-body); font-size: 14.5px; line-height: 1.47; letter-spacing: -0.006em;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
* { box-sizing: border-box; }
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 600; letter-spacing: -0.022em; margin: 0; text-wrap: balance; color: var(--fg); }
h1 { font-size: 28px; line-height: 1.14; font-weight: 700; letter-spacing: -0.03em; }
h2 { font-size: 21px; line-height: 1.2; letter-spacing: -0.025em; }
h3 { font-size: 16px; line-height: 1.3; }
h4 { font-size: 14px; line-height: 1.3; }
p { margin: 0; }
a { color: var(--accent-text); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--fg-3); }
.small { font-size: 12px; }
.strong { font-weight: 600; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; }
.nowrap { white-space: nowrap; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- App shell ---------- */
.app { display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); min-height: 100vh; }
.sidebar {
  position: sticky; top: env(safe-area-inset-top, 0px); height: 100vh; overflow-y: auto;
  background: var(--glass); -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column; padding: 18px 12px; gap: 3px;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 16px; border-bottom: 1px solid var(--border); margin-bottom: 10px; }
.brand img { height: 30px; width: auto; display: block; }
.brand img.logo-dark { display: none; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .brand img.logo-light { display: none; } :root:not([data-theme="light"]) .brand img.logo-dark { display: block; } }
:root[data-theme="dark"] .brand img.logo-light { display: none; }
:root[data-theme="dark"] .brand img.logo-dark { display: block; }
.brand-product { display: flex; flex-direction: column; line-height: 1.1; }
.brand-product .name { font-family: var(--font-display); font-weight: 700; font-size: 16px; letter-spacing: 0.02em; }
.brand-product .sub { font-size: 11px; color: var(--fg-3); }
.nav-group-label { font-size: 11px; color: var(--fg-3); letter-spacing: 0.02em; padding: 12px 12px 4px; font-weight: 600; }
.nav-item {
  display: flex; align-items: center; gap: 11px; padding: 8px 12px; border-radius: var(--r-sm);
  color: var(--fg); background: transparent; border: 0; width: 100%; text-align: left; font-weight: 500; font-size: 14.5px;
  transition: background .15s ease;
}
.nav-item svg { width: 19px; height: 19px; flex: none; color: var(--fg-3); }
.nav-item:hover { background: var(--fill); }
.nav-item.active { background: var(--accent); color: var(--accent-ink); font-weight: 600; }
.nav-item.active svg { color: var(--accent-ink); }
.nav-item .count { margin-left: auto; font-size: 11.5px; font-weight: 600; background: var(--fill); color: var(--fg-2); border-radius: var(--r-pill); padding: 1px 8px; }
.nav-item.active .count { background: rgba(0,0,0,0.14); color: var(--accent-ink); }
.nav-item.disabled { color: var(--fg-4); cursor: not-allowed; }
.nav-item.disabled .count { background: transparent; border: 1px solid var(--border); color: var(--fg-4); font-weight: 500; }
.sidebar-foot { margin-top: auto; padding: 12px 8px 4px; border-top: 1px solid var(--border); font-size: 12px; color: var(--fg-3); display: flex; flex-direction: column; gap: 8px; }
.sidebar-foot button { padding: 0; background: none; border: 0; color: var(--accent-text); text-align: left; font-size: 12px; font-weight: 600; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 30;
  display: flex; align-items: center; gap: 12px; padding: 11px 28px;
  background: var(--glass); -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px); border-bottom: 1px solid var(--border);
}
.topbar .menu-btn { display: none; }
.search { flex: 1; max-width: 460px; position: relative; }
.search input { width: 100%; padding: 9px 14px 9px 38px; border-radius: var(--r-pill); border: 1px solid transparent; background: var(--fill); transition: background .15s, box-shadow .15s; }
.search input:focus { outline: none; background: var(--surface); box-shadow: 0 0 0 4px var(--accent-ring); }
.search svg { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--fg-3); }
.search-results { position: absolute; top: calc(100% + 6px); left: 0; right: 0; background: var(--menu-bg); -webkit-backdrop-filter: saturate(180%) blur(30px); backdrop-filter: saturate(180%) blur(30px); border: 1px solid var(--border); border-radius: var(--r-md); box-shadow: var(--shadow-md); z-index: 40; overflow: hidden; }
.search-results button { display: flex; width: 100%; gap: 10px; align-items: center; padding: 10px 14px; border: 0; background: none; text-align: left; }
.search-results button:hover { background: var(--surface-2); }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.icon-btn { position: relative; width: 38px; height: 38px; border-radius: var(--r-pill); border: 1px solid transparent; background: var(--fill); display: inline-flex; align-items: center; justify-content: center; color: var(--fg-2); transition: background .15s; }
.icon-btn:hover { background: var(--fill-hover); color: var(--fg); }
.icon-btn svg { width: 18px; height: 18px; }
.icon-btn .dot { position: absolute; top: 6px; right: 7px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px; background: var(--danger); color: #fff; font-size: 10px; font-weight: 700; display: flex; align-items: center; justify-content: center; border: 2px solid var(--bg); }
.user-switch { display: flex; align-items: center; gap: 10px; padding: 5px 12px 5px 6px; border-radius: var(--r-pill); border: 1px solid transparent; background: var(--fill); transition: background .15s; }
.user-switch:hover { background: var(--fill-hover); }
.user-switch .who { display: flex; flex-direction: column; line-height: 1.15; text-align: left; }
.user-switch .who .name { font-weight: 600; font-size: 13px; }
.user-switch .who .role { font-size: 11px; color: var(--fg-3); }
.user-switch svg { width: 14px; height: 14px; color: var(--fg-3); }

.page { padding: 24px 28px 56px; display: flex; flex-direction: column; gap: 20px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.page-head .eyebrow { font-size: 12px; color: var(--accent-text); font-weight: 600; margin-bottom: 4px; }
.page-head .lede { color: var(--fg-3); margin-top: 4px; max-width: 60ch; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* ---------- Buttons (Apple: rounded, filled, soft press) ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 9px 18px; border-radius: var(--r-pill);
  border: 1px solid transparent; font-weight: 500; font-size: 14px; line-height: 1.2; white-space: nowrap; letter-spacing: -0.01em;
  transition: background .18s ease, border-color .18s ease, transform .12s ease, box-shadow .18s ease;
}
.btn svg { width: 16px; height: 16px; }
.btn:active:not(:disabled) { transform: scale(0.97); }
.btn:disabled { opacity: .4; cursor: not-allowed; transform: none; }
.btn-primary { background: var(--accent); color: var(--accent-ink); border-color: transparent; font-weight: 600; }
.btn-primary:hover:not(:disabled) { background: var(--accent-hover); }
.btn-secondary { background: var(--fill); color: var(--fg); border-color: transparent; }
.btn-secondary:hover:not(:disabled) { background: var(--fill-hover); }
.btn-ghost { background: transparent; color: var(--accent-text); border-color: transparent; font-weight: 500; }
.btn-ghost:hover:not(:disabled) { background: var(--fill); color: var(--accent-text); }
.btn-danger { background: var(--danger-bg); color: var(--danger); border-color: transparent; }
.btn-danger:hover:not(:disabled) { filter: brightness(.96); }
.btn-dark { background: var(--fg); color: var(--bg); border-color: var(--fg); }
.btn-dark:hover:not(:disabled) { opacity: .9; }
.btn-sm { padding: 6px 12px; font-size: 12.5px; }
.btn-xs { padding: 4px 10px; font-size: 12px; }
.btn-block { width: 100%; }
.link-btn { background: none; border: 0; padding: 0; color: var(--accent-text); font-weight: 600; font-size: inherit; }
.link-btn:hover { text-decoration: underline; }

/* ---------- Panels ---------- */
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--shadow-sm); display: flex; flex-direction: column; min-width: 0; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .panel { border-color: transparent; } }
:root[data-theme="dark"] .panel { border-color: transparent; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.panel-head h3 { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.panel-head .hint { color: var(--fg-3); font-size: 12px; }
.panel-body { padding: 16px 18px; }
.panel-body.flush { padding: 0; }
.panel-foot { padding: 12px 18px; border-top: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.panel.subtle { box-shadow: none; background: var(--surface-2); }
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
/* Self-adjusting stat rows: tiles reflow to fit the available width. */
.grid-5 { grid-template-columns: repeat(auto-fit, minmax(168px, 1fr)); }
.grid-6 { grid-template-columns: repeat(auto-fit, minmax(166px, 1fr)); }
.span-2 { grid-column: span 2; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.row.end { justify-content: flex-end; }

/* Stat tiles */
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 14px 16px; display: flex; flex-direction: column; gap: 4px; text-align: left; cursor: pointer; transition: border-color .15s, transform .1s; min-width: 0; }
.stat:hover { border-color: var(--border-strong); transform: translateY(-1px); }
.stat .label { font-size: 12px; color: var(--fg-3); font-weight: 500; }
.stat .value { font-family: var(--font-display); font-size: 28px; font-weight: 600; letter-spacing: -0.03em; line-height: 1.1; }
.stat .delta { font-size: 11.5px; color: var(--fg-3); display: flex; align-items: center; gap: 6px; }
.stat.alert .value { color: var(--danger); }
.stat.accent { border-color: var(--accent); background: var(--accent-soft); }

/* ---------- Badges & chips ---------- */
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: var(--r-pill); font-size: 11.5px; font-weight: 600; line-height: 1.4; white-space: nowrap; background: var(--surface-3); color: var(--fg-2); }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex: none; }
.badge.plain::before { display: none; }
.badge[data-status="Unassigned"] { background: var(--st-unassigned-bg); color: var(--st-unassigned); }
.badge[data-status="Assigned"] { background: var(--st-assigned-bg); color: var(--st-assigned); }
.badge[data-status="In Progress"] { background: var(--st-progress-bg); color: var(--st-progress); }
.badge[data-status="Waiting for Revenue"] { background: var(--st-waiting-bg); color: var(--st-waiting); }
.badge[data-status="Submitted for QC"] { background: var(--st-qc-bg); color: var(--st-qc); }
.badge[data-status="QC Rework"] { background: var(--st-rework-bg); color: var(--st-rework); }
.badge[data-status="Submitted to Revenue"] { background: var(--st-revenue-bg); color: var(--st-revenue); }
.badge[data-status="Revision Requested"] { background: var(--st-revision-bg); color: var(--st-revision); }
.badge[data-status="Completed"] { background: var(--st-done-bg); color: var(--st-done); }
.badge.overdue { background: var(--danger-bg); color: var(--danger); }
.badge.overdue::before { display: none; }
.badge.good { background: var(--good-bg); color: var(--good); }
.badge.info { background: var(--info-bg); color: var(--info); }
.badge.warn { background: var(--warn-bg); color: var(--warn); }
.badge.danger { background: var(--danger-bg); color: var(--danger); }
.badge.neutral { background: var(--surface-3); color: var(--fg-2); }
.badge.accent { background: var(--accent); color: var(--accent-ink); }
.badge svg { width: 12px; height: 12px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 11px; border-radius: var(--r-pill); border: 1px solid transparent; font-size: 12px; background: var(--fill); color: var(--fg-2); }
.chip.on { background: var(--accent); color: var(--accent-ink); border-color: transparent; font-weight: 600; }
.prio { display: inline-flex; align-items: center; justify-content: center; min-width: 30px; padding: 2px 8px; border-radius: 7px; font-size: 11px; font-weight: 700; letter-spacing: 0.01em; }
.prio.P0 { background: var(--danger-bg); color: var(--danger); }
.prio.P1 { background: var(--accent-soft); color: var(--accent-text); }
.prio.P2 { background: var(--surface-3); color: var(--fg-2); }
.type-pill { display: inline-flex; align-items: center; padding: 2px 9px; border-radius: var(--r-pill); font-size: 11px; font-weight: 700; border: 1px solid var(--border-strong); color: var(--fg-2); background: var(--surface); }
.type-pill.DMM { border-color: var(--st-qc); color: var(--st-qc); }
.type-pill.Proposal { border-color: var(--st-revenue); color: var(--st-revenue); }

/* ---------- Avatars ---------- */
.avatar { width: 28px; height: 28px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; color: #fff; flex: none; letter-spacing: 0.02em; }
.avatar.sm { width: 22px; height: 22px; font-size: 9px; }
.avatar.lg { width: 40px; height: 40px; font-size: 14px; }
.avatar.unassigned { background: var(--surface-3); color: var(--fg-3); border: 1px dashed var(--border-strong); }
.avatar-stack { display: inline-flex; }
.avatar-stack .avatar { margin-left: -8px; border: 2px solid var(--surface); }
.avatar-stack .avatar:first-child { margin-left: 0; }
.person { display: inline-flex; align-items: center; gap: 8px; min-width: 0; }
.person .pname { font-weight: 600; font-size: 13px; white-space: nowrap; }
.person .prole { font-size: 11.5px; color: var(--fg-3); }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th { text-align: left; font-weight: 600; font-size: 11.5px; color: var(--fg-3); padding: 10px 14px; border-bottom: 1px solid var(--border); white-space: nowrap; background: var(--surface-2); }
.table th:first-child { padding-left: 18px; }
.table td { padding: 11px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table td:first-child { padding-left: 18px; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr.click { cursor: pointer; }
.table tbody tr.click:hover { background: var(--surface-2); }
.table .primary { font-weight: 600; color: var(--fg); }
.table .sub { font-size: 12px; color: var(--fg-3); }
.table th.sortable { cursor: pointer; user-select: none; }
.table th.sortable:hover { color: var(--fg); }

/* ---------- Filters ---------- */
.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; padding: 12px 18px; border-bottom: 1px solid var(--border); background: var(--material); -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px); border-radius: var(--r-lg) var(--r-lg) 0 0; }
.filters select, .filters input { height: 34px; padding: 0 13px; border-radius: 9px; border: 1px solid var(--control-border); background-color: var(--fill); font-size: 13px; color: var(--fg); flex: 0 1 auto; transition: background-color .15s, box-shadow .15s; }
.filters select { -webkit-appearance: none; appearance: none; padding-right: 30px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238e8e93' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; background-size: 12px; cursor: pointer; }
.filters select:hover, .filters input:hover { background-color: var(--fill-hover); }
.filters select:focus, .filters input:focus { outline: none; background-color: var(--surface); border-color: transparent; box-shadow: 0 0 0 3px var(--accent-ring); }
.filters input[type="search"] { flex: 1 1 220px; min-width: 150px; }
.filters .spacer { flex: 1 0 12px; }
.result-count { font-size: 12px; color: var(--fg-3); }

/* ---------- Forms ---------- */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field label { font-size: 12.5px; font-weight: 600; color: var(--fg-2); display: flex; gap: 6px; align-items: center; }
.field label .req { color: var(--danger); font-weight: 700; }
.field label .opt { color: var(--fg-4); font-weight: 500; font-size: 11px; }
.field input, .field select, .field textarea {
  width: 100%; padding: 10px 13px; border-radius: var(--r-sm); border: 1px solid transparent; background: var(--fill); font-size: 14.5px; color: var(--fg); transition: background .15s, box-shadow .15s;
}
.field textarea { min-height: 84px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; background: var(--surface); box-shadow: 0 0 0 4px var(--accent-ring); }
.field.invalid input, .field.invalid select, .field.invalid textarea { border-color: var(--danger); }
.field .error { font-size: 12px; color: var(--danger); }
.field .help { font-size: 12px; color: var(--fg-3); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; }
.form-grid .full { grid-column: 1 / -1; }
.form-section { display: flex; flex-direction: column; gap: 14px; padding: 16px; border: 1px solid var(--border); border-radius: var(--r-md); background: var(--surface-2); }
.form-section > h4 { display: flex; align-items: center; gap: 8px; }
.form-section > h4 .hint { font-weight: 500; color: var(--fg-3); font-size: 12px; }
.checks { display: flex; flex-wrap: wrap; gap: 8px; }
.checks label { display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; border-radius: var(--r-pill); border: 1px solid transparent; font-size: 13px; cursor: pointer; background: var(--fill); transition: background .15s; }
.checks label.on { background: var(--accent); color: var(--accent-ink); font-weight: 600; }
.checks input { position: absolute; opacity: 0; pointer-events: none; }
.segmented { display: inline-flex; align-self: flex-start; border: 0; border-radius: 10px; padding: 2px; background: var(--fill); gap: 2px; }
.segmented button { border: 0; background: transparent; padding: 6px 15px; border-radius: 8px; font-weight: 500; font-size: 13px; color: var(--fg); transition: background .15s, box-shadow .15s; }
.segmented button.on { background: var(--surface); color: var(--fg); font-weight: 600; box-shadow: 0 1px 3px rgba(0,0,0,0.12); }
.room-split { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.inline-note { font-size: 12.5px; color: var(--fg-3); padding: 10px 12px; border-radius: var(--r-sm); background: var(--surface-3); display: flex; gap: 8px; align-items: flex-start; }
.inline-note.warn { background: var(--warn-bg); color: var(--warn); }
.inline-note.danger { background: var(--danger-bg); color: var(--danger); }
.inline-note.good { background: var(--good-bg); color: var(--good); }
.inline-note.info { background: var(--info-bg); color: var(--info); }
.inline-note svg { width: 16px; height: 16px; flex: none; margin-top: 1px; }

/* ---------- Tabs ---------- */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); overflow-x: auto; }
.tab { padding: 10px 14px; border: 0; background: none; color: var(--fg-3); font-weight: 600; font-size: 13.5px; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; display: inline-flex; gap: 8px; align-items: center; }
.tab:hover { color: var(--fg); }
.tab.on { color: var(--fg); border-bottom-color: var(--accent); }
.tab .count { font-size: 11px; background: var(--surface-3); border-radius: var(--r-pill); padding: 1px 7px; color: var(--fg-2); }
.tab.on .count { background: var(--accent); color: var(--accent-ink); }
.subtabs { display: flex; gap: 6px; flex-wrap: wrap; }
.subtabs button { border: 1px solid transparent; background: var(--fill); border-radius: var(--r-pill); padding: 7px 14px; font-size: 13px; font-weight: 500; color: var(--fg); display: inline-flex; gap: 6px; align-items: center; transition: background .15s; }
.subtabs button:hover { background: var(--fill-hover); }
.subtabs button.on { background: var(--accent); color: var(--accent-ink); border-color: transparent; font-weight: 600; }
.subtabs button .count { font-size: 11px; opacity: .8; }

/* ---------- Modal & drawer ---------- */
.modal-backdrop { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.3); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); z-index: 100; display: flex; align-items: flex-start; justify-content: center; padding: 48px 16px; overflow-y: auto; }
.modal { background: var(--surface); border-radius: var(--r-xl); width: 100%; max-width: 640px; box-shadow: var(--shadow-lg); border: 1px solid var(--border); display: flex; flex-direction: column; }
.modal.wide { max-width: 900px; }
.modal.narrow { max-width: 460px; }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 20px 24px 14px; border-bottom: 1px solid var(--border); }
.modal-head .lede { color: var(--fg-3); font-size: 13px; margin-top: 3px; }
.modal-body { padding: 20px 24px; display: flex; flex-direction: column; gap: 16px; }
.modal-foot { padding: 14px 24px 18px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.modal-foot .left { margin-right: auto; }
.close-x { width: 30px; height: 30px; border-radius: 50%; border: 0; background: var(--fill); color: var(--fg-3); display: inline-flex; align-items: center; justify-content: center; flex: none; transition: background .15s; }
.close-x:hover { background: var(--fill-hover); color: var(--fg); }
.close-x svg { width: 14px; height: 14px; }
.drawer-backdrop { position: fixed; inset: 0; z-index: 90; background: rgba(0, 0, 0, 0.28); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(720px, 100%); background: var(--surface); border-left: 1px solid var(--border); box-shadow: var(--shadow-lg); z-index: 95; display: flex; flex-direction: column; padding-top: env(safe-area-inset-top, 0px); }
.drawer-head { padding: 18px 24px 12px; border-bottom: 1px solid var(--border); display: flex; flex-direction: column; gap: 10px; }
.drawer-body { flex: 1; overflow-y: auto; padding: 18px 24px 40px; display: flex; flex-direction: column; gap: 16px; }
.drawer .actions-bar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* ---------- Key/value lists ---------- */
.kv { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 8px 14px; font-size: 13px; }
.kv dt { color: var(--fg-3); }
.kv dd { margin: 0; color: var(--fg); min-width: 0; overflow-wrap: anywhere; }
.kv-compact { grid-template-columns: 120px minmax(0, 1fr); font-size: 12.5px; }
.meta-row { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12.5px; color: var(--fg-3); }
.meta-row b { color: var(--fg); font-weight: 600; }

/* ---------- Segmented progress bar ---------- */
.seg-bar { display: flex; height: 12px; border-radius: 6px; overflow: hidden; gap: 2px; background: var(--surface-3); }
.seg-bar span { display: block; height: 100%; min-width: 2px; }
.legend { display: flex; flex-wrap: wrap; gap: 8px 16px; font-size: 12px; color: var(--fg-2); }
.legend .lg { display: inline-flex; align-items: center; gap: 6px; }
.legend .sw { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.progress-mini { display: flex; align-items: center; gap: 8px; min-width: 120px; }
.progress-mini .bar { flex: 1; height: 6px; border-radius: 3px; background: var(--surface-3); overflow: hidden; }
.progress-mini .bar i { display: block; height: 100%; background: var(--good); }
.progress-mini .txt { font-size: 11.5px; color: var(--fg-3); white-space: nowrap; }

/* ---------- Lifecycle strip ---------- */
.lifecycle { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.lifecycle .step { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: var(--r-pill); border: 1px solid var(--border); font-size: 12px; font-weight: 600; color: var(--fg-3); background: var(--surface); }
.lifecycle .step.on { border-color: var(--accent); background: var(--accent-soft); color: var(--fg); }
.lifecycle .step.done { color: var(--good); border-color: var(--good-bg); background: var(--good-bg); }
.lifecycle .step.future { color: var(--fg-4); border-style: dashed; }
.lifecycle .arrow { color: var(--fg-4); font-size: 12px; }

/* ---------- Lists & cards ---------- */
.list { display: flex; flex-direction: column; }
.list-item { display: flex; align-items: center; gap: 12px; padding: 12px 18px; border-bottom: 1px solid var(--border); background: none; border-left: 0; border-right: 0; border-top: 0; width: 100%; text-align: left; }
.list-item:last-child { border-bottom: 0; }
button.list-item:hover { background: var(--surface-2); }
.list-item .ttl { font-weight: 600; font-size: 13.5px; }
.list-item .sub { font-size: 12px; color: var(--fg-3); }
.list-item .right { margin-left: auto; display: flex; align-items: center; gap: 8px; flex: none; }
.component-card { border: 1px solid var(--border); border-radius: var(--r-md); padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; background: var(--surface); cursor: pointer; transition: border-color .15s; min-width: 0; }
.component-card:hover { border-color: var(--border-strong); }
.component-card.overdue { border-left: 3px solid var(--danger); }
.component-card .top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.component-card .top > div { min-width: 0; }
.component-card .name { font-weight: 600; font-size: 14px; }
.component-card .brief { font-size: 12.5px; color: var(--fg-3); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.component-card .foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; font-size: 12px; color: var(--fg-3); }

/* ---------- Activity & chatter ---------- */
.activity { display: flex; flex-direction: column; }
.activity-item { display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 10px; padding: 10px 0; position: relative; }
.activity-item::before { content: ""; position: absolute; left: 13px; top: 32px; bottom: -10px; width: 2px; background: var(--border); }
.activity-item:last-child::before { display: none; }
.activity-item .ico { width: 28px; height: 28px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: var(--surface-3); color: var(--fg-2); position: relative; z-index: 1; }
.activity-item .ico svg { width: 14px; height: 14px; }
.activity-item .ico.good { background: var(--good-bg); color: var(--good); }
.activity-item .ico.danger { background: var(--danger-bg); color: var(--danger); }
.activity-item .ico.info { background: var(--info-bg); color: var(--info); }
.activity-item .ico.warn { background: var(--warn-bg); color: var(--warn); }
.activity-item .ico.accent { background: var(--accent-soft); color: var(--accent-text); }
.activity-item .txt { font-size: 13px; }
.activity-item .txt b { font-weight: 600; }
.activity-item .when { font-size: 11.5px; color: var(--fg-3); margin-top: 2px; display: flex; gap: 8px; flex-wrap: wrap; }
.activity-item .delta { font-size: 12px; color: var(--fg-3); margin-top: 3px; }
.activity-item .delta code { font-family: inherit; background: var(--surface-3); padding: 1px 6px; border-radius: 4px; color: var(--fg-2); }
.post { display: grid; grid-template-columns: 32px minmax(0, 1fr); gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--border); }
.post:last-child { border-bottom: 0; }
.post .head { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.post .head .who { font-weight: 600; }
.post .head .when { font-size: 11.5px; color: var(--fg-3); }
.post .body { margin-top: 4px; font-size: 13.5px; white-space: pre-wrap; overflow-wrap: anywhere; }
.post .body .mention { color: var(--accent-text); font-weight: 600; background: var(--accent-soft); padding: 0 4px; border-radius: 4px; }
.post .attach { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.post .attach span, .attach-chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: var(--r-pill); border: 1px solid var(--border-strong); font-size: 12px; background: var(--surface); }
.attach-chip svg { width: 13px; height: 13px; color: var(--fg-3); }
.post .tools { display: flex; gap: 10px; margin-top: 6px; }
.post.system { grid-template-columns: 32px minmax(0, 1fr); background: var(--surface-2); margin: 0 -18px; padding: 10px 18px; border-bottom: 1px solid var(--border); }
.post.system .body { font-size: 12.5px; color: var(--fg-2); }
.post.system .sys-ico { width: 32px; height: 32px; border-radius: 50%; background: var(--surface-3); display: flex; align-items: center; justify-content: center; color: var(--fg-3); }
.post.system .sys-ico svg { width: 15px; height: 15px; }
.replies { margin-top: 10px; padding-left: 12px; border-left: 2px solid var(--border); display: flex; flex-direction: column; }
.replies .post { padding: 10px 0; }
.composer { display: flex; flex-direction: column; gap: 8px; border: 1px solid var(--border-strong); border-radius: var(--r-md); padding: 12px; background: var(--surface); position: relative; }
.composer textarea { border: 0; resize: vertical; min-height: 70px; padding: 4px; background: transparent; width: 100%; }
.composer textarea:focus { outline: none; }
.composer .bar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.composer .bar .spacer { flex: 1; }
.mention-menu { position: absolute; left: 12px; bottom: 56px; background: var(--menu-bg); -webkit-backdrop-filter: saturate(180%) blur(30px); backdrop-filter: saturate(180%) blur(30px); border: 1px solid var(--border); border-radius: var(--r-md); box-shadow: var(--shadow-md); z-index: 20; min-width: 240px; overflow: hidden; }
.mention-menu button { display: flex; align-items: center; gap: 8px; width: 100%; text-align: left; border: 0; background: none; padding: 8px 12px; font-size: 13px; }
.mention-menu button:hover { background: var(--surface-2); }
.mention-menu .lbl { font-size: 11px; color: var(--fg-3); padding: 6px 12px 2px; }

/* ---------- Versions ---------- */
.version { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border); align-items: start; }
.version:last-child { border-bottom: 0; }
.version .vno { font-family: var(--font-display); font-weight: 700; font-size: 15px; width: 44px; height: 44px; border-radius: var(--r-sm); background: var(--surface-3); display: flex; align-items: center; justify-content: center; }
.version.latest .vno { background: var(--accent); color: var(--accent-ink); }
.version .vname { font-weight: 600; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.version .vmeta { font-size: 12px; color: var(--fg-3); display: flex; gap: 10px; flex-wrap: wrap; margin-top: 2px; }
.version .vnotes { font-size: 13px; margin-top: 6px; }
.version .vfeedback { margin-top: 8px; font-size: 12.5px; padding: 8px 10px; border-radius: var(--r-sm); background: var(--surface-2); border-left: 3px solid var(--border-strong); }
.version .vfeedback.danger { border-left-color: var(--danger); }
.version .vfeedback.good { border-left-color: var(--good); }
.compare-grid { display: grid; grid-template-columns: 130px repeat(2, minmax(0, 1fr)); font-size: 13px; border: 1px solid var(--border); border-radius: var(--r-md); overflow: hidden; }
.compare-grid > div { padding: 9px 12px; border-bottom: 1px solid var(--border); min-width: 0; overflow-wrap: anywhere; }
.compare-grid > div:nth-child(3n+1) { color: var(--fg-3); background: var(--surface-2); }
.compare-grid > div.hd { font-weight: 700; background: var(--surface-3); }
.compare-grid > div.diff { background: var(--accent-soft); }

/* ---------- Notifications popover ---------- */
.popover { position: absolute; right: 0; top: calc(100% + 8px); width: 380px; max-width: calc(100vw - 32px); background: var(--menu-bg); -webkit-backdrop-filter: saturate(180%) blur(30px); backdrop-filter: saturate(180%) blur(30px); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--shadow-lg); z-index: 60; overflow: hidden; }
.popover-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.popover-list { max-height: 420px; overflow-y: auto; }
.notif { display: grid; grid-template-columns: 10px minmax(0, 1fr); gap: 10px; padding: 11px 16px; border-bottom: 1px solid var(--border); width: 100%; text-align: left; background: none; border-left: 0; border-right: 0; border-top: 0; }
.notif:hover { background: var(--surface-2); }
.notif .nd { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); margin-top: 6px; }
.notif.read .nd { background: transparent; border: 1px solid var(--border-strong); }
.notif .nt { font-weight: 600; font-size: 13px; }
.notif .nb { font-size: 12.5px; color: var(--fg-2); }
.notif .nw { font-size: 11px; color: var(--fg-3); margin-top: 2px; }

/* ---------- Toasts ---------- */
.toasts { position: fixed; bottom: calc(20px + env(safe-area-inset-bottom, 0px)); left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; z-index: 200; width: min(460px, calc(100vw - 32px)); }
.toast { background: rgba(28,28,30,0.9); color: #fff; -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); padding: 12px 18px; border-radius: var(--r-pill); box-shadow: var(--shadow-lg); font-size: 13.5px; font-weight: 500; display: flex; gap: 10px; align-items: center; animation: toast-in .2s ease-out; }
.toast.error { background: var(--danger); color: #fff; }
.toast.success::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); flex: none; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ---------- Empty & loading ---------- */
.empty { padding: 36px 20px; text-align: center; color: var(--fg-3); display: flex; flex-direction: column; align-items: center; gap: 8px; }
.empty .ttl { font-family: var(--font-display); font-weight: 600; color: var(--fg); font-size: 15px; }
.empty svg { width: 34px; height: 34px; color: var(--fg-4); }
.skeleton { background: linear-gradient(90deg, var(--surface-3) 25%, var(--surface-2) 50%, var(--surface-3) 75%); background-size: 200% 100%; animation: shimmer 1.2s infinite; border-radius: var(--r-sm); height: 14px; }
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
.boot { min-height: 100vh; display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 14px; color: var(--fg-3); }
.boot .ring { width: 28px; height: 28px; border-radius: 50%; border: 3px solid var(--border-strong); border-top-color: var(--accent); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Rating ---------- */
.stars { display: inline-flex; gap: 4px; }
.stars button { border: 0; background: none; padding: 2px; color: var(--border-strong); }
.stars button.on, .stars span.on { color: var(--accent); }
.stars svg { width: 22px; height: 22px; }
.stars.ro svg { width: 16px; height: 16px; }
.stars span { color: var(--border-strong); display: inline-flex; }

/* ---------- Demo marker ---------- */
.demo-pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: var(--r-pill); font-size: 11px; font-weight: 600; background: var(--surface-3); color: var(--fg-3); border: 1px dashed var(--border-strong); }

/* ---------- Simple task screen (executives) ---------- */
.home-hi { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.home-hi h1 { font-size: 30px; }
.home-hi .lede { font-size: 16px; color: var(--fg-2); margin-top: 6px; }
.home-count { display: inline-flex; align-items: center; gap: 8px; padding: 8px 16px; border-radius: var(--r-pill); background: var(--accent-soft); color: var(--accent-text); font-weight: 700; font-size: 15px; }
.task-list { display: flex; flex-direction: column; gap: 12px; }
.task-card { display: flex; align-items: center; gap: 16px; padding: 18px 20px; background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--border-strong); border-radius: var(--r-lg); box-shadow: var(--shadow-sm); }
.task-card.urgent { border-left-color: var(--danger); }
.task-card.go { border-left-color: var(--accent); }
.task-card .tc-ico { width: 48px; height: 48px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: var(--accent-soft); color: var(--accent-text); flex: none; }
.task-card .tc-ico svg { width: 24px; height: 24px; }
.task-card .tc-ico.urgent { background: var(--danger-bg); color: var(--danger); }
.task-card .tc-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.task-card .tc-title { font-size: 17px; font-weight: 700; font-family: var(--font-display); letter-spacing: -0.01em; }
.task-card .tc-sub { font-size: 14px; color: var(--fg-2); }
.task-card .tc-meta { font-size: 12.5px; color: var(--fg-3); display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-top: 2px; }
.task-card .tc-action { flex: none; }
.big-btn { font-size: 16px; padding: 13px 26px; border-radius: var(--r-pill); font-weight: 700; }
.big-btn svg { width: 18px; height: 18px; }
.home-section-title { font-family: var(--font-display); font-weight: 700; font-size: 18px; margin: 8px 0 2px; }
.home-allclear { text-align: center; padding: 48px 20px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); display: flex; flex-direction: column; align-items: center; gap: 10px; }
.home-allclear .big { width: 64px; height: 64px; border-radius: 50%; background: var(--good-bg); color: var(--good); display: flex; align-items: center; justify-content: center; }
.home-allclear .big svg { width: 32px; height: 32px; }
.home-allclear h2 { font-size: 22px; }
.simple-row { display: flex; align-items: center; gap: 14px; padding: 14px 18px; border-bottom: 1px solid var(--border); background: none; border-left: 0; border-right: 0; border-top: 0; width: 100%; text-align: left; }
.simple-row:last-child { border-bottom: 0; }
button.simple-row:hover { background: var(--surface-2); }
.simple-row .sr-title { font-size: 15px; font-weight: 600; }
.simple-row .sr-sub { font-size: 13px; color: var(--fg-3); }
.simple-row .sr-right { margin-left: auto; display: flex; align-items: center; gap: 10px; flex: none; }
.plain-status { font-size: 13px; color: var(--fg-2); }

/* ---------- What to do now (drawer) ---------- */
.todo-card { background: var(--accent-soft); border: 1px solid var(--accent); border-radius: var(--r-lg); padding: 18px 20px; display: flex; flex-direction: column; gap: 12px; }
.todo-card.done { background: var(--good-bg); border-color: var(--good-bg); }
.todo-card.waiting { background: var(--surface-2); border-color: var(--border); }
.todo-card .td-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.todo-card .td-now { font-size: 12px; font-weight: 700; letter-spacing: 0.04em; color: var(--accent-text); }
.todo-card.waiting .td-now { color: var(--fg-3); }
.todo-card .td-say { font-size: 17px; font-weight: 600; font-family: var(--font-display); letter-spacing: -0.01em; color: var(--fg); line-height: 1.35; }
.todo-card .td-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

/* ---------- Dashboard extras (leadership) ---------- */
.workload-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--border); }
.workload-row:last-child { border-bottom: 0; }
.workload-row .wl-bars { display: flex; gap: 3px; align-items: center; }
.workload-row .wl-chip { font-size: 11.5px; font-weight: 600; padding: 2px 9px; border-radius: var(--r-pill); background: var(--surface-3); color: var(--fg-2); white-space: nowrap; }
.workload-row .wl-chip.over { background: var(--danger-bg); color: var(--danger); }
.pipe-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; font-size: 13px; }
.pipe-row .pipe-bar { flex: 1; height: 8px; border-radius: 4px; background: var(--surface-3); overflow: hidden; }
.pipe-row .pipe-bar i { display: block; height: 100%; }
.pipe-row .pipe-n { font-variant-numeric: tabular-nums; font-weight: 600; min-width: 24px; text-align: right; }

/* ---------- Deal header ---------- */
.deal-head { display: flex; flex-direction: column; gap: 14px; }
.deal-head .title-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.deal-head .badges { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 8px; }
.crumbs { font-size: 12.5px; color: var(--fg-3); display: flex; gap: 6px; align-items: center; }
.crumbs button { background: none; border: 0; padding: 0; color: var(--accent-text); font-weight: 600; font-size: inherit; }

/* ---------- Mobile nav ---------- */
.mobile-nav-backdrop { display: none; }
@media (max-width: 960px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; z-index: 120; width: min(300px, 86vw); transform: translateX(-105%); transition: transform .2s ease; height: 100vh; }
  .sidebar.open { transform: none; box-shadow: var(--shadow-lg); }
  .mobile-nav-backdrop.open { display: block; position: fixed; inset: 0; background: rgba(1,1,1,.4); z-index: 110; }
  .topbar { padding: 10px 16px; }
  .topbar .menu-btn { display: inline-flex; }
  .page { padding: 16px 16px 48px; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .grid-5, .grid-6 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .span-2 { grid-column: auto; }
  .form-grid { grid-template-columns: 1fr; }
  .kv { grid-template-columns: 1fr; gap: 2px 0; }
  .kv dt { margin-top: 8px; }
  .user-switch .who { display: none; }
  .topbar .topbar-new { display: none; }
  .modal-backdrop { padding: 16px 8px; }
  .compare-grid { grid-template-columns: 100px repeat(2, minmax(0, 1fr)); }
  .drawer { width: 100%; }
  .filters input[type="search"] { min-width: 0; width: 100%; }
}
@media (max-width: 600px) {
  .grid-6 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat .value { font-size: 24px; }
  .page-head { align-items: flex-start; }
  h1 { font-size: 22px; }
  .list-item { flex-wrap: wrap; }
  .list-item .right { flex-wrap: wrap; margin-left: auto; row-gap: 6px; }
  .task-card { flex-wrap: wrap; }
  .task-card .tc-body { flex-basis: calc(100% - 64px); }
  .task-card .tc-action { width: 100%; }
  .task-card .tc-action .btn { width: 100%; }
  .home-hi h1 { font-size: 24px; }
  .simple-row { flex-wrap: wrap; }
  .simple-row .sr-right { flex-wrap: wrap; row-gap: 4px; flex: 1 1 100%; justify-content: flex-start; margin-left: 0; }
}
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .001s !important; transition-duration: .001s !important; }
}
