/* ============================================================================
   CEG WorkHub — design system
   One stylesheet, organised in layers:
     1. Tokens          6. Cards & panels
     2. Base & a11y     7. Tables
     3. App shell       8. Status & badges
     4. Typography      9. Feature blocks (dashboard, board, gantt, calendar…)
     5. Controls       10. States (empty/loading/error) & responsive
   Visual language: dark engineering UI, matches SiteFit (CEG house style).
   ========================================================================= */

/* ---------------------------------------------------------------- 1. TOKENS */
:root {
  /* surfaces */
  --bg: #1a1d21;              /* page */
  --surface: #22262b;         /* card / panel */
  --surface-2: #2a2f35;       /* elevated, nested, hover */
  --surface-3: #15181b;       /* inputs, wells, tracks */
  --sidebar-bg: #1e2227;
  /* legacy aliases (kept so older rules/templates stay valid) */
  --bg-panel: var(--surface); --bg-panel-alt: var(--surface-2); --bg-input: var(--surface-3);

  /* lines */
  --border: #343a42;
  --border-strong: #454c56;

  /* ink */
  --text: #e8eaed;            /* primary */
  --text-2: #b3bac2;          /* secondary */
  --text-3: #959da7;          /* muted / metadata — >=4.9:1 on every surface */
  --text-dim: var(--text-3);  /* legacy alias */
  --heading: #f4f7fa;

  /* semantic — meaning, never decoration */
  --accent: #4da3ff;          /* interactive / active / neutral-info */
  --accent-dim: #2d6db3;
  --accent-soft: rgba(77, 163, 255, .12);
  --ok: #4caf7d;              /* completed / on track */
  --warn: #e0a93e;            /* due soon / waiting */
  --fail: #e05c5c;            /* overdue / at risk — fills, rails, borders */
  --fail-ink: #ea7373;        /* the same red as TEXT (>=4.6:1 on all surfaces) */
  --fail-solid: #b8433f;      /* red behind white text (5.4:1) */
  --review: #b07fd6;          /* in review */

  /* Wrike status hues — templates resolve these dynamically: var(--{{ color }}) */
  --DarkRed: #c95555; --Red: #e05c5c; --Purple: #b07fd6; --Indigo: #7d8ce8;
  --Blue: #4da3ff; --DarkCyan: #3fb8c4; --Yellow: #d9b13b; --Orange: #e08b3e;
  --YellowGreen: #a3c65c; --Green: #4caf7d; --Gray: #9aa2ab; --Turquoise: #3ec9a7;
  --Brown: #b08968;

  /* geometry */
  --r-sm: 4px; --r: 6px; --r-lg: 10px; --r-pill: 999px;
  --radius: var(--r); --radius-sm: var(--r-sm);      /* legacy aliases */
  --sp-1: 4px; --sp-2: 8px; --sp-3: 12px; --sp-4: 16px; --sp-5: 24px; --sp-6: 32px;
  --sbw: 248px;               /* sidebar width; overridden when collapsed */
  --content-max: 1440px;

  /* type */
  --font: 'Segoe UI', system-ui, -apple-system, sans-serif;
  --fs-h1: 26px; --fs-h2: 17px; --fs-section: 12px;
  --fs-kpi: 30px; --fs-body: 13px; --fs-sm: 12px; --fs-meta: 11px;

  /* depth & motion */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .25);
  --shadow: 0 3px 10px rgba(0, 0, 0, .30);
  --shadow-lg: 0 12px 32px rgba(0, 0, 0, .45);
  --t: 140ms cubic-bezier(.4, 0, .2, 1);
  --hover: rgba(255, 255, 255, .06);
}

/* ------------------------------------------------------- 2. BASE & A11Y */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
body { margin: 0; font: var(--fs-body)/1.55 var(--font); color: var(--text); background: var(--bg); }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0; color: var(--heading); }
::selection { background: rgba(77, 163, 255, .32); color: #fff; }

.muted { color: var(--text-3); }
.small { font-size: var(--fs-meta); }
.nowrap { white-space: nowrap; }

/* one focus ring for every interactive element */
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible,
textarea:focus-visible, summary:focus-visible, [tabindex]:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px; border-radius: var(--r-sm);
}
/* keyboard-only skip link */
.skip-link { position: absolute; left: -9999px; top: 0; z-index: 200; padding: 10px 16px;
  background: var(--accent-dim); color: #fff; border-radius: 0 0 var(--r) 0; font-weight: 600; }
.skip-link:focus { left: 0; text-decoration: none; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* themed scrollbars */
* { scrollbar-width: thin; scrollbar-color: var(--border-strong) transparent; }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 6px;
  border: 2px solid transparent; background-clip: padding-box; }
*::-webkit-scrollbar-track { background: transparent; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* --------------------------------------------------------- 3. APP SHELL */
.layout { display: flex; min-height: 100vh; }
.sidebar {
  width: var(--sbw); flex: 0 0 var(--sbw); min-width: 0; overflow: hidden;
  background: var(--sidebar-bg); border-right: 1px solid var(--border);
  display: flex; flex-direction: column; padding: 12px 10px;
  position: sticky; top: 0; height: 100vh;
  transition: width var(--t), flex-basis var(--t);
}
/* brand, main nav and footer keep their size; only the project tree scrolls,
   otherwise a long tree shrinks past its content and paints over the footer */
.sidebar-head, .sidebar > nav[aria-label="Main"], .sidebar-footer { flex: 0 0 auto; }
.main-col { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.content { width: 100%; max-width: var(--content-max); margin: 0; padding: var(--sp-5) var(--sp-5) var(--sp-6);
  transition: margin-right var(--t); }

/* brand */
.sidebar-head { display: flex; align-items: center; justify-content: space-between; padding: 2px 2px 10px; }
.logo { font-weight: 700; font-size: 15px; letter-spacing: .02em; color: var(--heading); white-space: nowrap; }
.logo-ceg { color: var(--heading); }
.logo-hub { color: var(--accent); }
.logo.big { font-size: 24px; text-align: center; display: block; }

/* nav groups + items */
.nav-section { margin: 16px 8px 5px; font-size: 10px; text-transform: uppercase;
  letter-spacing: .1em; color: var(--text-3); font-weight: 700; }
.nav-item { display: flex; align-items: center; gap: 11px; padding: 8px 10px; border-radius: var(--r);
  color: var(--text-2); font-size: var(--fs-body); white-space: nowrap; overflow: hidden;
  transition: background var(--t), color var(--t); }
.nav-item:hover { background: var(--hover); color: var(--text); text-decoration: none; }
.nav-item[aria-current="page"], .nav-item.active {
  background: var(--accent-soft); color: #fff; box-shadow: inset 2px 0 0 var(--accent); font-weight: 600; }
.nav-ico { flex: 0 0 24px; text-align: center; font-size: 18px; line-height: 1; }
.nav-item .unread-badge { margin-left: auto; }

/* project tree */
.nav-tree-wrap { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
.nav-row { display: flex; align-items: center; border-radius: var(--r-sm); min-width: 0;
  transition: background var(--t); }
.nav-row:hover { background: var(--hover); }
.nav-row.active { background: var(--accent-soft); box-shadow: inset 2px 0 0 var(--accent); }
.nav-row.active .nav-label { color: #fff; font-weight: 600; }
.nav-caret { flex: 0 0 18px; background: none; border: 0; color: var(--text-3); font-size: 9px;
  line-height: 1; cursor: pointer; padding: 5px 2px; transition: transform var(--t), color var(--t); }
.nav-caret:hover { color: var(--text); }
.nav-caret.none { pointer-events: none; }
.nav-node.open > .nav-row .nav-caret { transform: rotate(90deg); }
.nav-label { flex: 1; min-width: 0; padding: 3px 4px 3px 0; font-size: var(--fs-sm); color: var(--text-2);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav-label:hover { color: var(--text); text-decoration: none; }
.proj-dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent); margin-right: 6px; vertical-align: 1px; }
.nav-count { flex: 0 0 auto; font-size: 10px; color: var(--text-3); padding: 0 6px; }
.nav-children { display: none; padding-left: 14px; }
.nav-node.open > .nav-children { display: block; }

.new-project summary { cursor: pointer; color: var(--text-3); padding: 7px 10px; font-size: var(--fs-sm);
  border-radius: var(--r-sm); list-style: none; }
.new-project summary::-webkit-details-marker { display: none; }
.new-project summary:hover { color: var(--text); background: var(--hover); }
.new-project form { display: flex; gap: 6px; padding: 6px 8px 2px; }
.new-project input { flex: 1; min-width: 0; }

/* sidebar identity + footer */
.sidebar-footer { margin-top: auto; border-top: 1px solid var(--border); padding-top: 8px; }
.sb-me { display: flex; align-items: center; gap: 9px; padding: 8px 10px 10px; min-width: 0; }
.sb-me-txt { min-width: 0; line-height: 1.3; }
.sb-me-name { font-size: var(--fs-sm); color: var(--text); font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sb-me-role { font-size: 10px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sb-version { display: block; font-size: 10px; color: var(--text-3); padding: 6px 10px 2px;
  font-family: ui-monospace, Consolas, monospace; }

/* topbar */
.topbar { display: flex; align-items: center; gap: var(--sp-3); padding: 10px var(--sp-5);
  background: var(--surface); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 40; }
.topbar-search { flex: 1; max-width: 440px; position: relative; }
.topbar-search input[type=search] { width: 100%; padding-left: 32px; }
.topbar-search::before { content: "⌕"; position: absolute; left: 11px; top: 50%; transform: translateY(-50%);
  color: var(--text-3); font-size: 15px; pointer-events: none; }
.topbar .bell { margin-left: auto; font-size: 16px; }
.topbar .bell .unread-badge { position: absolute; top: -3px; right: -5px; }

.icon-btn { background: none; border: 1px solid transparent; border-radius: var(--r); color: var(--text-2);
  font-size: 15px; padding: 6px 9px; cursor: pointer; position: relative; text-decoration: none;
  transition: background var(--t), color var(--t); }
.icon-btn:hover { color: var(--text); background: var(--hover); text-decoration: none; }
.drawer-btn { display: none; }

/* user menu */
.user-menu { position: relative; }
.user-menu summary { list-style: none; display: flex; align-items: center; gap: 8px; cursor: pointer;
  padding: 4px 8px; border-radius: var(--r); transition: background var(--t); }
.user-menu summary::-webkit-details-marker { display: none; }
.user-menu summary:hover { background: var(--hover); }
.user-name { font-size: var(--fs-sm); color: var(--text); font-weight: 600; }
.user-menu .menu { position: absolute; right: 0; top: calc(100% + 6px); background: var(--surface-2);
  border: 1px solid var(--border-strong); border-radius: var(--r); box-shadow: var(--shadow-lg);
  min-width: 200px; padding: 6px; z-index: 60; }
.user-menu .menu a { display: block; padding: 8px 10px; border-radius: var(--r-sm); color: var(--text); font-size: var(--fs-sm); }
.user-menu .menu a:hover { background: var(--hover); text-decoration: none; }
.menu-id { padding: 7px 10px 9px; border-bottom: 1px solid var(--border); margin-bottom: 5px;
  font-size: var(--fs-sm); color: var(--text); }

/* collapsed sidebar (desktop only) */
body.sb-collapsed { --sbw: 64px; }
body.sb-collapsed .nav-text, body.sb-collapsed .nav-count,
body.sb-collapsed .nav-item .unread-badge, body.sb-collapsed .sb-me-txt { display: none; }
body.sb-collapsed .sidebar .nav-item { justify-content: center; padding: 10px 0; }
body.sb-collapsed .nav-ico { font-size: 20px; }
body.sb-collapsed .sidebar-head, body.sb-collapsed .sb-me { justify-content: center; padding-inline: 0; }
body.sb-collapsed .collapse-btn { transform: rotate(180deg); }

/* mobile drawer */
.backdrop { display: none; }
@media (max-width: 900px) {
  body, body.sb-collapsed { --sbw: 260px; }
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; z-index: 80;
    transform: translateX(-100%); transition: transform var(--t); }
  body.drawer-open .sidebar { transform: translateX(0); box-shadow: var(--shadow-lg); }
  body.drawer-open .backdrop { display: block; position: fixed; inset: 0; background: rgba(0, 0, 0, .55); z-index: 70; }
  .drawer-btn { display: inline-block; }
  .collapse-btn { display: none; }
  body.sb-collapsed .nav-text, body.sb-collapsed .sb-me-txt { display: initial; }
  body.sb-collapsed .sidebar .nav-item { justify-content: flex-start; padding: 8px 10px; }
  .user-name { display: none; }
}

/* ------------------------------------------------------- 4. TYPOGRAPHY */
.page-header { padding-bottom: var(--sp-3); margin-bottom: var(--sp-4); border-bottom: 1px solid var(--border); }
.page-header h1 { font-size: var(--fs-h1); font-weight: 700; letter-spacing: -.01em; }
.subtitle { color: var(--text-3); margin-top: 3px; display: flex; gap: 10px; align-items: center;
  flex-wrap: wrap; font-size: var(--fs-sm); }
.page-header .toolbar:last-child, .page-header .subtitle:last-child { margin-bottom: 0; }

/* breadcrumbs — "where am I" */
.breadcrumb { display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  color: var(--text-3); font-size: var(--fs-sm); margin-bottom: 6px; }
.breadcrumb a { color: var(--text-3); }
.breadcrumb a:hover { color: var(--accent); }
.breadcrumb .sep { opacity: .5; }
.breadcrumb .here { color: var(--text-2); }

/* section headings inside panels */
.dash-panel h3, .detail-side h3 { font-size: var(--fs-section); text-transform: uppercase;
  letter-spacing: .07em; color: var(--text-3); font-weight: 700; }

/* --------------------------------------------------------- 5. CONTROLS */
/* single base for every text-ish control (was repeated in 8 places) */
input[type=text], input[type=search], input[type=email], input[type=password], input[type=date],
input[type=number], input:not([type]), select, textarea {
  padding: 7px 10px; border: 1px solid var(--border); border-radius: var(--r-sm);
  background: var(--surface-3); color: var(--text); font: inherit; font-size: var(--fs-sm);
  transition: border-color var(--t), box-shadow var(--t); max-width: 100%;
}
input::placeholder, textarea::placeholder { color: var(--text-3); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft); }
select { cursor: pointer; }
/* the native dropdown popup: some Windows builds ignore color-scheme there
   and paint a light list — light text vanishes. Style options explicitly. */
option, optgroup { background: var(--surface-2); color: var(--text); }
textarea { resize: vertical; line-height: 1.5; }

/* weekly look-ahead: the Tuesday List */
.la-list { margin: 0; padding-left: 26px; display: flex; flex-direction: column; gap: 14px; }
.la-row::marker { color: var(--text-3); font-weight: 700; }
.la-head { display: flex; gap: 9px; align-items: center; flex-wrap: wrap; }
.la-title { font-weight: 700; }
.la-note-form { display: flex; gap: 4px; align-items: center; margin-top: 5px; max-width: 760px; }
.la-note { flex: 1; font-size: var(--fs-sm); }
.la-note-static { margin-top: 5px; }
.la-prev { font-style: italic; }
.la-meet-form { flex-wrap: wrap; }
.la-meet-form label { display: flex; gap: 6px; align-items: center; flex: 1; min-width: 220px;
  font-size: var(--fs-sm); }
.la-meet-form input { flex: 1; }
.la-auto { margin-top: 4px; color: var(--text-2); }
.la-auto::before { content: "1  "; color: var(--text-3); }
.la-needs { margin-top: 3px; display: flex; gap: 6px; flex-wrap: wrap; }
.la-need { background: color-mix(in srgb, var(--warn, #b45309) 12%, transparent);
  color: var(--warn, #b45309); border: 1px solid color-mix(in srgb, var(--warn, #b45309) 30%, transparent);
  border-radius: 999px; padding: 1px 9px; font-size: var(--fs-xs, 0.75rem); }
/* meeting mode: the projector view */
.la-mode { position: fixed; inset: 0; background: var(--bg); z-index: 120; overflow-y: auto; }
.la-mode-inner { max-width: 860px; margin: 0 auto; padding: 48px 28px; display: flex;
  flex-direction: column; gap: 18px; }
.la-mode-top { display: flex; justify-content: space-between; align-items: center; }
.la-mode h2 { font-size: 2rem; margin: 0; }
.la-mode-auto { font-size: 1.05rem; color: var(--text-2); }
.la-mode-needs { font-size: 1.05rem; color: var(--warn, #b45309); font-weight: 600; }
.la-mode-prev { border-left: 3px solid var(--border-strong); padding-left: 14px; }
.la-mode-prev p { margin: 2px 0 0; font-style: italic; color: var(--text-2); font-size: 1.05rem; }
#lam-note { font-size: 1.15rem; padding: 14px; }
.la-mode-nav { display: flex; justify-content: space-between; align-items: center; }
@media print {
  .sidebar, .topbar, .toolbar, .la-note-form button, .la-meet-form button,
  .la-mode { display: none !important; }
  .la-note, .la-meet-form input { border: none; background: transparent; padding: 0; }
}

/* earned value: contribution $/hr vs the $100 goal */
.ev-good { color: #2ecc71; }
.ev-warn { color: #e6a817; }
.ev-bad { color: #e05c5c; }

/* presence: heartbeat dots + the dashboard online-now strip */
.presence-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%;
  background: var(--text-3); vertical-align: middle; margin-right: 4px; }
.presence-dot.p-online { background: #2ecc71; }
.presence-dot.p-away { background: #e6a817; }
.online-strip { display: flex; flex-wrap: wrap; gap: 10px; }
.online-card { display: flex; align-items: center; gap: 9px; padding: 7px 12px;
  border: 1px solid var(--border); border-radius: var(--r); background: var(--surface-2); }
.online-card.on-clock { border-color: #1E7B34;
  background: color-mix(in srgb, #1E7B34 10%, var(--surface-2)); }
.online-meta { display: flex; align-items: center; gap: 6px; }
.online-card .tt-clock { font-variant-numeric: tabular-nums; color: var(--text-2); }

/* toast for the desktop-timer opener */
.tt-toast { position: fixed; bottom: 22px; left: 50%; transform: translate(-50%, 12px);
  background: var(--surface-2); border: 1px solid var(--border-strong); color: var(--text);
  border-radius: var(--r); box-shadow: var(--shadow-lg); padding: 11px 16px;
  font-size: var(--fs-sm); max-width: 560px; z-index: 90; opacity: 0;
  transition: opacity .25s, transform .25s; }
.tt-toast.on { opacity: 1; transform: translate(-50%, 0); }
.tt-toast a { color: var(--accent); }

/* @mention autocomplete under comment boxes */
.mention-pop { position: absolute; z-index: 80; background: var(--surface-2);
  border: 1px solid var(--border-strong); border-radius: var(--r);
  box-shadow: var(--shadow-lg); padding: 4px; min-width: 220px; max-height: 240px;
  overflow-y: auto; }
.mention-item { display: block; width: 100%; text-align: left; padding: 7px 10px;
  border: 0; border-radius: var(--r-sm); background: transparent; color: var(--text);
  font-size: var(--fs-sm); cursor: pointer; }
.mention-item:hover, .mention-item.sel { background: var(--hover); }
.mention-item .chip { margin-right: 7px; }
input[type=file] { font-size: var(--fs-meta); color: var(--text-3); padding: 5px; }
input[type=checkbox] { accent-color: var(--accent); width: 14px; height: 14px; }
label { color: var(--text-2); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 1px solid var(--border-strong); background: var(--surface-2); color: var(--text);
  border-radius: var(--r-sm); padding: 7px 14px; cursor: pointer; font-weight: 600;
  font-size: var(--fs-sm); font-family: var(--font); white-space: nowrap; text-decoration: none;
  transition: background var(--t), border-color var(--t), color var(--t), transform var(--t); }
.btn:hover { border-color: var(--accent-dim); background: #313740; text-decoration: none; color: var(--text); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--accent-dim); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: #3480d0; }
.btn.small-btn { padding: 4px 10px; font-size: var(--fs-meta); }
.btn.wide { width: 100%; }
.btn.ok-btn { border-color: rgba(76, 175, 125, .55); color: var(--ok); }
.btn.ok-btn:hover { background: rgba(76, 175, 125, .12); }
.btn.fail-btn { border-color: rgba(224, 92, 92, .55); color: var(--fail-ink); }
.btn.fail-btn:hover { background: rgba(224, 92, 92, .12); }
.btn:disabled, .btn.is-loading { opacity: .55; cursor: default; transform: none; pointer-events: none; }
.btn.is-loading::before { content: ""; width: 11px; height: 11px; border-radius: 50%;
  border: 2px solid currentColor; border-top-color: transparent; animation: spin .6s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* segmented control (view / scope switchers) */
.toolbar { display: flex; gap: 10px; margin: 10px 0 0; flex-wrap: wrap; }
.seg { display: inline-flex; border: 1px solid var(--border); border-radius: var(--r);
  overflow: hidden; background: var(--surface); }
.seg a { padding: 6px 13px; color: var(--text-2); font-size: var(--fs-sm); border-right: 1px solid var(--border);
  transition: background var(--t), color var(--t); }
.seg a:last-child { border-right: none; }
.seg a:hover { color: var(--text); text-decoration: none; background: var(--hover); }
.seg a.on { background: var(--accent-dim); color: #fff; font-weight: 600; }
.seg b { font-weight: 700; margin-left: 5px; opacity: .8; }
.stale-toggle { align-self: center; padding: 6px 12px; font-size: var(--fs-sm); color: var(--text-3);
  border: 1px dashed var(--border); border-radius: var(--r); transition: color var(--t), border-color var(--t); }
.stale-toggle:hover { color: var(--text); border-color: var(--text-3); text-decoration: none; }
.stale-toggle.on { color: var(--text-2); border-style: solid; background: var(--surface); }
.task-group { margin-top: 10px; border: 1px solid var(--border); border-radius: var(--r);
  background: var(--surface); }
.task-group-head { font-size: var(--fs-h2); font-weight: 600; color: var(--text);
  padding: 10px 14px; cursor: pointer; list-style: none; }
.task-group-head::-webkit-details-marker { display: none; }
.task-group-head::before { content: "▸"; display: inline-block; margin-right: 9px;
  color: var(--text-3); transition: transform var(--t); }
.task-group[open] > .task-group-head::before { transform: rotate(90deg); }
.task-group[open] > .task-group-head { border-bottom: 1px solid var(--border); }
.task-group .table-scroll { padding: 0 6px 6px; }
.task-group-head b { color: var(--text-3); font-weight: 600; margin-left: 6px; }

/* subtasks folded under their parent row */
.sub-wrap > td { padding: 0 0 0 26px !important; border-bottom: none; }
.sub-rows > summary { cursor: pointer; list-style: none; color: var(--text-3);
  font-size: var(--fs-sm); padding: 2px 0 6px; }
.sub-rows > summary::-webkit-details-marker { display: none; }
.sub-rows > summary::before { content: "▸"; display: inline-block; margin-right: 7px;
  transition: transform var(--t); }
.sub-rows[open] > summary::before { transform: rotate(90deg); }
.sub-rows .table-scroll { border-left: 2px solid var(--border); padding-left: 10px;
  margin-bottom: 8px; }
.sub-table { margin: 0; }

/* forms: inline rows, stacked forms, field grids */
.inline { display: inline; }
.new-task { display: flex; gap: 7px; margin-bottom: var(--sp-3); flex-wrap: wrap; }
.new-task input[name=title] { flex: 1; min-width: 200px; }
.stack-form label { display: block; font-size: var(--fs-sm); color: var(--text-2); margin-bottom: 11px; }
.stack-form input, .stack-form select { display: block; width: 100%; margin-top: 5px; }
.stack-form button { margin-top: 4px; }
.field-row { display: flex; flex-wrap: wrap; gap: var(--sp-3); margin: var(--sp-2) 0; }
.field-row label { display: flex; flex-direction: column; gap: 4px; font-size: var(--fs-meta);
  color: var(--text-3); text-transform: uppercase; letter-spacing: .05em; font-weight: 600; }
.lbl { display: block; font-size: var(--fs-meta); text-transform: uppercase; letter-spacing: .07em;
  color: var(--text-3); font-weight: 700; margin: var(--sp-4) 0 6px; }
.assignee-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(165px, 1fr)); gap: 2px; }
.check { display: flex; align-items: center; gap: 7px; font-size: var(--fs-sm); padding: 5px 7px;
  border-radius: var(--r-sm); color: var(--text-2); cursor: pointer; }
.check:hover { background: var(--hover); color: var(--text); }
.actions { margin-top: var(--sp-4); display: flex; gap: var(--sp-2); align-items: center; }

/* filter bar */
.dash-filters { display: flex; flex-wrap: wrap; gap: var(--sp-2); align-items: center; margin-top: var(--sp-3); }
.dash-filters select, .dash-filters input { max-width: 210px; }
.df-date { display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-sm); color: var(--text-3); }
.filter-note { display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-meta);
  color: var(--accent); background: var(--accent-soft); border-radius: var(--r-pill); padding: 3px 10px; }

/* ---------------------------------------------------- 6. CARDS & PANELS */
.dash-panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r);
  padding: var(--sp-4) var(--sp-4) var(--sp-4); box-shadow: var(--shadow-sm); min-width: 0; }
.dash-panel > h3:first-child, .panel-head { margin-bottom: var(--sp-3); }
.dash-panel.narrow { max-width: 440px; }
.panel-head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--sp-3); flex-wrap: wrap; }
.panel-head h3 { margin: 0; }
.dash-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: var(--sp-3); }
.span-all { grid-column: 1 / -1; }
.scroll-panel { max-height: 320px; overflow-y: auto; }

/* KPI cards */
.kpi-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(158px, 1fr));
  gap: var(--sp-3); margin-bottom: var(--sp-3); }
.kpi { position: relative; overflow: hidden; display: block; color: inherit;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r);
  padding: var(--sp-3) var(--sp-4); box-shadow: var(--shadow-sm);
  transition: transform var(--t), box-shadow var(--t), border-color var(--t); }
.kpi::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
  background: var(--accent); opacity: 0; transition: opacity var(--t); }
.kpi-bad::before { background: var(--fail); opacity: 1; }
.kpi-warn::before { background: var(--warn); opacity: 1; }
.kpi-good::before { background: var(--ok); opacity: 1; }
a.kpi:hover { transform: translateY(-1px); box-shadow: var(--shadow); border-color: var(--border-strong); text-decoration: none; }
a.kpi:hover::before { opacity: 1; }
.kpi-num { font-size: var(--fs-kpi); font-weight: 700; color: var(--heading); line-height: 1.1; }
.kpi-label { font-size: var(--fs-meta); text-transform: uppercase; letter-spacing: .06em; color: var(--text-3); font-weight: 600; }
.kpi-ico { position: absolute; top: 11px; right: 13px; font-size: 15px; color: var(--text-3); }
.kpi-bad .kpi-num, .kpi-bad .kpi-ico { color: var(--fail-ink); }
.kpi-warn .kpi-ico { color: var(--warn); }
.kpi-good .kpi-ico { color: var(--ok); }
.kpi-hint { font-size: 10px; color: var(--text-3); margin-top: 2px; }

/* generic card (board cards, member cards) */
.card { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r-sm);
  padding: 9px 10px; transition: border-color var(--t), transform var(--t), box-shadow var(--t); }

/* attention card (my work) */
.mywork { background: var(--surface); border: 1px solid var(--border);
  border-left: 3px solid var(--accent); border-radius: var(--r); padding: var(--sp-3) var(--sp-4);
  margin-bottom: var(--sp-3); box-shadow: var(--shadow-sm); }
.mywork-head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--sp-3);
  flex-wrap: wrap; margin-bottom: var(--sp-3); }
.mywork-title { font-size: var(--fs-section); text-transform: uppercase; letter-spacing: .07em;
  color: var(--text-3); font-weight: 700; }
.mw-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(132px, 1fr)); gap: var(--sp-2); }
.mw-tile { display: flex; flex-direction: column; gap: 1px; padding: 9px 11px; border-radius: var(--r-sm);
  background: var(--surface-3); border: 1px solid var(--border); color: inherit;
  transition: border-color var(--t), background var(--t); }
a.mw-tile:hover { border-color: var(--accent-dim); background: #191d21; text-decoration: none; }
.mw-tile b { font-size: 20px; font-weight: 700; color: var(--heading); line-height: 1.2; }
.mw-tile span { font-size: var(--fs-meta); color: var(--text-3); }
.mw-tile.bad b { color: var(--fail-ink); } .mw-tile.bad { border-color: rgba(224, 92, 92, .4); }
.mw-tile.warn b { color: var(--warn); } .mw-tile.warn { border-color: rgba(224, 169, 62, .4); }
.mw-tile.zero b { color: var(--text-3); }
/* legacy my-work strip (kept for member page) */
.mw-stat { font-size: var(--fs-sm); color: var(--text-3); }
.mw-stat b { color: var(--text); font-size: 14px; margin-right: 3px; }
.mw-stat.bad b { color: var(--fail-ink); } .mw-stat.warn b { color: var(--warn); }
.mywork-go { margin-left: auto; }

/* ----------------------------------------------------------- 7. TABLES */
.task-table, .mini-table { width: 100%; border-collapse: collapse; }
.task-table { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); overflow: hidden; }
.task-table th, .mini-table th { text-align: left; font-size: 10px; text-transform: uppercase;
  letter-spacing: .06em; color: var(--text-3); font-weight: 700; padding: 9px 11px;
  border-bottom: 1px solid var(--border); white-space: nowrap; }
.task-table th { background: var(--surface-2); }
.mini-table th { padding: 5px 8px; }
.task-table td { padding: 9px 11px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.mini-table td { padding: 7px 8px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.task-table tr:last-child td, .mini-table tr:last-child td { border-bottom: none; }
.task-table tbody tr, .mini-table tbody tr { transition: background var(--t); }
.task-table tbody tr:hover td, .mini-table tbody tr:hover td { background: rgba(255, 255, 255, .03); }
.task-link { color: var(--text); font-weight: 600; }
.task-link:hover { color: var(--accent); text-decoration: none; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.table-scroll { overflow-x: auto; border-radius: var(--r); }
.empty { text-align: center; padding: 26px; color: var(--text-3); font-style: italic; }
td.due-col, .task-table td:last-child { white-space: nowrap; }
.inactive-row td { opacity: .5; }
.team-actions { white-space: nowrap; }
.team-actions form { display: inline; margin-right: 4px; }
.rpt-table td, .rpt-table th { padding: 7px 8px; }
.wl-table th a { color: var(--text-3); }
.wl-table th a.sorted { color: var(--accent); }
.wl-table th a.sorted::after { content: " ↓"; }
.done-n { color: var(--ok); }

/* ------------------------------------------------- 8. STATUS & BADGES */
/* every status carries a glyph or text label — never colour alone */
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px;
  border-radius: var(--r-pill); font-size: var(--fs-meta); font-weight: 600; white-space: nowrap; }
.badge.ok { background: rgba(76, 175, 125, .16); color: var(--ok); }
.badge.fail { background: rgba(224, 92, 92, .16); color: var(--fail-ink); }
.badge.pending { background: rgba(224, 169, 62, .16); color: var(--warn); }
.badge.na { background: rgba(154, 162, 171, .14); color: var(--text-3); }

.chips { display: inline-flex; gap: 4px; flex-wrap: wrap; }
.chip { width: 25px; height: 25px; border-radius: 50%; border: 1px solid rgba(255, 255, 255, .2);
  color: #fff; font-size: 10px; font-weight: 700; display: inline-flex; align-items: center;
  justify-content: center; text-transform: uppercase; flex: 0 0 auto; }
/* deterministic per-person colours; white-text contrast all >= 3.8:1 */
.chip.av-0 { background: #c0504d; } .chip.av-1 { background: #c26d2c; }
.chip.av-2 { background: #997d20; } .chip.av-3 { background: #579048; }
.chip.av-4 { background: #2f8f82; } .chip.av-5 { background: #3f7fc4; }
.chip.av-6 { background: #6165cf; } .chip.av-7 { background: #8f52b8; }
.chip.av-8 { background: #b04d82; } .chip.av-9 { background: #8a6a5f; }
.chip.av-10 { background: #537f6f; } .chip.av-11 { background: #6f7c8a; }

.importance { font-size: var(--fs-meta); padding: 2px 8px; border-radius: var(--r-pill); font-weight: 600; }
.importance.high { background: rgba(224, 92, 92, .16); color: var(--fail-ink); }
.importance.normal { color: var(--text-3); }
.importance.low { color: var(--text-3); opacity: .65; }

.status-pill { display: inline-flex; align-items: center; gap: 5px; font-size: var(--fs-meta);
  font-weight: 600; background: var(--surface-3); border: 1px solid var(--border);
  border-radius: var(--r-pill); padding: 2px 9px; white-space: nowrap; }
.proj-status { font-size: var(--fs-meta); padding: 2px 9px; border-radius: var(--r-pill); font-weight: 600;
  background: rgba(154, 162, 171, .15); color: var(--text-3); }
.proj-status.green { background: rgba(76, 175, 125, .18); color: var(--ok); }
.proj-status.yellow { background: rgba(224, 169, 62, .18); color: var(--warn); }
.proj-status.red { background: rgba(224, 92, 92, .18); color: var(--fail-ink); }

.overdue { color: var(--fail-ink); font-weight: 700; }
.overdue-badge { background: rgba(224, 92, 92, .16); color: var(--fail-ink); border-radius: var(--r-pill);
  padding: 2px 10px; font-size: var(--fs-meta); font-weight: 700; }
/* days-overdue severity: colour + magnitude, tiers documented in template */
.days-over { display: inline-block; font-weight: 700; font-size: var(--fs-meta); padding: 2px 8px;
  border-radius: var(--r-pill); background: rgba(224, 169, 62, .16); color: var(--warn); }
.days-over.sev-2 { background: rgba(224, 139, 62, .18); color: var(--Orange); }
.days-over.sev-3 { background: rgba(224, 92, 92, .18); color: var(--fail-ink); }
.unread-badge { background: var(--fail-solid); color: #fff; border-radius: var(--r-pill); font-size: 10px;
  font-weight: 700; padding: 1px 6px; }

/* inline status dropdown (task tables) */
.status-select { border: 1px solid transparent; border-radius: var(--r-pill); padding: 3px 9px;
  font-weight: 600; font-size: var(--fs-meta); font-family: var(--font); cursor: pointer;
  max-width: 180px; background: var(--surface-3); }
.status-select option { color: var(--text); background: var(--surface); }
select.color-DarkRed { background: rgba(201,85,85,.16); color: var(--DarkRed); border-color: rgba(201,85,85,.4); }
select.color-Red { background: rgba(224,92,92,.16); color: var(--Red); border-color: rgba(224,92,92,.4); }
select.color-Purple { background: rgba(176,127,214,.16); color: var(--Purple); border-color: rgba(176,127,214,.4); }
select.color-Indigo { background: rgba(125,140,232,.16); color: var(--Indigo); border-color: rgba(125,140,232,.4); }
select.color-Blue { background: rgba(77,163,255,.16); color: var(--Blue); border-color: rgba(77,163,255,.4); }
select.color-DarkCyan { background: rgba(63,184,196,.16); color: var(--DarkCyan); border-color: rgba(63,184,196,.4); }
select.color-Yellow { background: rgba(217,177,59,.16); color: var(--Yellow); border-color: rgba(217,177,59,.4); }
select.color-Orange { background: rgba(224,139,62,.16); color: var(--Orange); border-color: rgba(224,139,62,.4); }
select.color-YellowGreen { background: rgba(163,198,92,.16); color: var(--YellowGreen); border-color: rgba(163,198,92,.4); }
select.color-Green { background: rgba(76,175,125,.16); color: var(--Green); border-color: rgba(76,175,125,.4); }
select.color-Gray { background: rgba(154,162,171,.14); color: var(--Gray); border-color: rgba(154,162,171,.35); }
select.color-Turquoise { background: rgba(62,201,167,.16); color: var(--Turquoise); border-color: rgba(62,201,167,.4); }
select.color-Brown { background: rgba(176,137,104,.16); color: var(--Brown); border-color: rgba(176,137,104,.4); }

/* notices */
.notice { border-radius: var(--r-sm); padding: 9px 12px; margin-bottom: var(--sp-3); font-size: var(--fs-sm);
  display: flex; align-items: center; gap: 8px; }
.notice.ok { background: rgba(76, 175, 125, .13); color: var(--ok); border: 1px solid rgba(76, 175, 125, .3); }
.notice.error, .error { background: rgba(224, 92, 92, .13); color: var(--fail-ink);
  border: 1px solid rgba(224, 92, 92, .3); border-radius: var(--r-sm); padding: 9px 12px;
  margin-bottom: var(--sp-3); font-size: var(--fs-sm); }

/* ------------------------------------------------- 9. FEATURE BLOCKS */
/* status bars */
.hbar-row { display: flex; align-items: center; gap: var(--sp-2); margin-bottom: 5px;
  font-size: var(--fs-sm); color: inherit; padding: 3px 5px; border-radius: var(--r-sm); }
a.hbar-row:hover { background: var(--hover); text-decoration: none; }
.hbar-label { flex: 0 0 148px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text-2); }
.hbar-label .dot { margin-right: 7px; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 2px; flex: 0 0 auto; }
.hbar-track { flex: 1; background: var(--surface-3); border-radius: 3px; height: 10px; overflow: hidden; }
.hbar { display: block; height: 100%; border-radius: 3px; background: var(--accent-dim); min-width: 2px; }
.hbar-num { flex: 0 0 30px; text-align: right; color: var(--text); font-weight: 700; font-variant-numeric: tabular-nums; }
.hbar-pct { flex: 0 0 40px; text-align: right; color: var(--text-3); font-size: var(--fs-meta); font-variant-numeric: tabular-nums; }
.waiting-group { margin-top: var(--sp-3); border-top: 1px solid var(--border); padding-top: var(--sp-2); }
.waiting-group summary { cursor: pointer; font-size: var(--fs-sm); color: var(--text-2); padding: 5px;
  border-radius: var(--r-sm); }
.waiting-group summary:hover { color: var(--text); background: var(--hover); }
.waiting-group[open] summary { margin-bottom: var(--sp-2); }

/* workload distribution */
.tier-summary { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.wl-legend { display: flex; gap: var(--sp-3); font-size: var(--fs-meta); color: var(--text-3); flex-wrap: wrap; align-items: center; }
.wl-legend .dot { margin-right: 5px; }
.wl-dist { min-width: 210px; }
.stackbar { display: flex; width: 100%; max-width: 300px; height: 11px; border-radius: 3px;
  overflow: hidden; background: var(--surface-3); }
.seg-fill { display: block; height: 100%; min-width: 3px; box-shadow: inset -2px 0 0 var(--surface); }
.pct-track { display: inline-block; width: 84px; height: 8px; border-radius: 3px; background: var(--surface-3);
  overflow: hidden; vertical-align: middle; margin-right: 7px; }
.pct-fill { display: block; height: 100%; background: var(--ok); border-radius: 3px; }

/* activity feed */
.feed { list-style: none; margin: 0; padding: 0; }
.feed-item { display: flex; gap: 10px; align-items: baseline; padding: 8px 0;
  border-bottom: 1px solid var(--border); font-size: var(--fs-sm); }
.feed-item:last-child { border-bottom: none; }
.feed-ico { flex: 0 0 18px; text-align: center; }
.feed-body { flex: 1; min-width: 0; color: var(--text-2); }
.feed-body strong { color: var(--text); }
.feed-time { flex: 0 0 auto; font-size: var(--fs-meta); }
.activity { list-style: none; margin: 0; padding: 0; }
.activity li { padding: 6px 0; border-bottom: 1px solid var(--border); font-size: var(--fs-sm); color: var(--text-2); }
.activity li:last-child { border-bottom: none; }
.activity strong { color: var(--text); }

/* notifications */
.notif-list { max-width: 720px; }
.notif { display: flex; gap: 11px; padding: 11px 13px; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--r); margin-bottom: 7px; color: var(--text);
  transition: border-color var(--t), transform var(--t); }
.notif:hover { border-color: var(--accent-dim); text-decoration: none; transform: translateX(2px); }
.notif.unread { border-left: 3px solid var(--accent); background: var(--surface-2); }
.notif-icon { font-size: 16px; flex: 0 0 auto; }
.notif-body { font-size: var(--fs-sm); }

/* board */
.board { display: flex; gap: var(--sp-3); overflow-x: auto; align-items: flex-start; padding-bottom: var(--sp-3); }
.board-col { flex: 0 0 248px; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r); box-shadow: var(--shadow-sm); }
.board-col-head { padding: 8px 12px; font-weight: 700; font-size: var(--fs-sm); display: flex;
  justify-content: space-between; border-bottom: 1px solid var(--border);
  border-top: 2px solid var(--Gray); border-radius: var(--r) var(--r) 0 0; }
.board-col-head .count { color: var(--text-3); font-weight: 600; }
.board-col-head.color-DarkRed { border-top-color: var(--DarkRed); color: var(--DarkRed); }
.board-col-head.color-Red { border-top-color: var(--Red); color: var(--Red); }
.board-col-head.color-Purple { border-top-color: var(--Purple); color: var(--Purple); }
.board-col-head.color-Indigo { border-top-color: var(--Indigo); color: var(--Indigo); }
.board-col-head.color-Blue { border-top-color: var(--Blue); color: var(--Blue); }
.board-col-head.color-DarkCyan { border-top-color: var(--DarkCyan); color: var(--DarkCyan); }
.board-col-head.color-Yellow { border-top-color: var(--Yellow); color: var(--Yellow); }
.board-col-head.color-Orange { border-top-color: var(--Orange); color: var(--Orange); }
.board-col-head.color-YellowGreen { border-top-color: var(--YellowGreen); color: var(--YellowGreen); }
.board-col-head.color-Green { border-top-color: var(--Green); color: var(--Green); }
.board-col-head.color-Gray { border-top-color: var(--Gray); color: var(--Gray); }
.board-col-head.color-Turquoise { border-top-color: var(--Turquoise); color: var(--Turquoise); }
.board-col-head.color-Brown { border-top-color: var(--Brown); color: var(--Brown); }
.board-cards { min-height: 40px; padding: 8px; display: flex; flex-direction: column; gap: 8px; }
.board-cards.dragover { outline: 2px dashed var(--accent); outline-offset: -4px; border-radius: var(--r-sm); }
.board .card { cursor: grab; }
.board .card:hover { border-color: var(--accent-dim); transform: translateY(-1px); box-shadow: var(--shadow); }
.card a { color: var(--text); font-weight: 600; display: block; margin-bottom: 5px; font-size: var(--fs-sm); }
.card-meta { display: flex; justify-content: space-between; align-items: center; gap: 6px;
  font-size: var(--fs-meta); color: var(--text-3); }
.card-meta .chip { width: 21px; height: 21px; font-size: 9px; }

/* gantt */
.gantt { display: flex; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r); overflow: hidden; box-shadow: var(--shadow-sm); }
.gantt-labels { flex: 0 0 230px; border-right: 1px solid var(--border); }
.gantt-head { height: 32px; padding: 7px 12px; font-size: 10px; text-transform: uppercase;
  letter-spacing: .06em; color: var(--text-3); background: var(--surface-2);
  border-bottom: 1px solid var(--border); font-weight: 700; }
.gantt-label { height: 34px; padding: 8px 12px; border-bottom: 1px solid var(--border);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: var(--fs-sm); }
.gantt-label a { color: var(--text); font-weight: 600; }
.gantt-chart { flex: 1; min-width: 0; overflow-x: auto; }
.gantt-months { position: relative; }
.gantt-month { position: absolute; top: 7px; font-size: 10px; color: var(--text-3); padding-left: 6px; }
.gantt-rows { position: relative; }
.gantt-gridline { position: absolute; top: 0; bottom: 0; width: 1px; background: var(--border); opacity: .6; }
.gantt-today { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--accent); z-index: 2; }
.gantt-row { position: relative; height: 34px; border-bottom: 1px solid var(--border); }
.gantt-bar { position: absolute; top: 7px; height: 20px; border-radius: var(--r-sm); display: flex;
  align-items: center; padding: 0 7px; font-size: 10px; font-weight: 600; color: #fff;
  overflow: hidden; white-space: nowrap; background: var(--Gray); z-index: 1; }
.gantt-bar:hover { text-decoration: none; filter: brightness(1.15); }
.gantt-bar.bar-overdue { outline: 1px solid var(--fail); }
.bar-DarkRed { background: var(--DarkRed); } .bar-Red { background: var(--Red); }
.bar-Purple { background: var(--Purple); } .bar-Indigo { background: var(--Indigo); }
.bar-Blue { background: var(--Blue); } .bar-DarkCyan { background: var(--DarkCyan); }
.bar-Yellow { background: var(--Yellow); color: #1a1d21; } .bar-Orange { background: var(--Orange); }
.bar-YellowGreen { background: var(--YellowGreen); color: #1a1d21; } .bar-Green { background: var(--Green); }
.bar-Gray { background: var(--Gray); color: #1a1d21; } .bar-Turquoise { background: var(--Turquoise); color: #1a1d21; }
.bar-Brown { background: var(--Brown); }

/* gantt drag affordances */
.gantt-bar { cursor: grab; }
.gantt-bar-label { overflow: hidden; text-overflow: ellipsis; pointer-events: none; }
.gantt-handle { position: absolute; right: 0; top: 0; bottom: 0; width: 9px; cursor: ew-resize;
  border-radius: 0 var(--r-sm) var(--r-sm) 0; }
.gantt-bar:hover .gantt-handle { background: rgba(255, 255, 255, .35); }
.gantt-bar.dragging { cursor: grabbing; z-index: 6; box-shadow: 0 3px 12px rgba(0, 0, 0, .55);
  outline: 2px solid var(--accent); filter: brightness(1.1); }
body.gantt-dragging { user-select: none; cursor: grabbing; }
body.gantt-dragging .gantt-bar:not(.dragging) { opacity: .55; }
/* reset-to-baseline control */
.reset-form { display: inline-flex; }
.drift-count { background: rgba(224, 169, 62, .2); color: var(--warn); border-radius: var(--r-pill);
  padding: 0 6px; font-size: 10px; font-weight: 700; }

/* Plan Tracker link + review handoffs */
.pt-link { display: flex; align-items: center; gap: var(--sp-2); flex-wrap: wrap;
  margin-bottom: var(--sp-3); font-size: var(--fs-sm); }
.pt-badge { display: inline-flex; align-items: center; gap: 4px; background: rgba(62, 201, 167, .14);
  color: var(--Turquoise); border-radius: var(--r-pill); padding: 2px 9px;
  font-size: var(--fs-meta); font-weight: 700; white-space: nowrap; }
.pt-ref { background: var(--surface-3); border: 1px solid var(--border); border-radius: var(--r-sm);
  padding: 3px 8px; font-size: var(--fs-meta); color: var(--text-2); max-width: 420px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pt-form { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.pt-form input { flex: 1; min-width: 260px; }
.attachment-cegpt { background: rgba(62, 201, 167, .07); border: 1px solid rgba(62, 201, 167, .25);
  border-radius: var(--r-sm); padding: 6px 8px !important; margin-bottom: 5px; }
.upload-form select { max-width: 150px; }

/* undo bar after a reschedule */
.undo-bar { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3);
  background: var(--accent-soft); border: 1px solid rgba(77, 163, 255, .35); color: var(--text); }
.undo-msg { font-weight: 600; }

/* day grid + snap guide, shown only while dragging */
.gantt-daygrid { position: absolute; inset: 0; pointer-events: none; opacity: 0;
  transition: opacity var(--t); z-index: 0;
  background-image: repeating-linear-gradient(to right,
    rgba(255, 255, 255, .10) 0 1px, transparent 1px var(--day-px, 12px)); }
body.gantt-dragging .gantt-daygrid.on { opacity: 1; }
.gantt-guide { position: absolute; top: 0; bottom: 0; width: 0; border-left: 1px dashed var(--accent);
  pointer-events: none; z-index: 7; display: none; }
body.gantt-dragging .gantt-guide { display: block; }
.gantt-guide-label { position: absolute; top: -2px; left: 0; transform: translateX(-50%);
  background: var(--accent-dim); color: #fff; border-radius: var(--r-sm); padding: 1px 7px;
  font-size: 10px; font-weight: 700; white-space: nowrap; font-variant-numeric: tabular-nums; }
.gantt-tip { position: fixed; z-index: 300; pointer-events: none; max-width: 240px;
  display: flex; flex-direction: column; gap: 2px;
  background: var(--surface-2); border: 1px solid var(--border-strong); border-radius: var(--r);
  box-shadow: var(--shadow-lg); padding: 9px 11px; font-size: var(--fs-sm); color: var(--text); }
.gantt-tip b { color: var(--heading); }
.gantt-tip .tip-dates { color: var(--text); font-variant-numeric: tabular-nums; }
.gantt-tip .tip-delta { color: var(--accent); font-weight: 700; }
.gantt-tip .tip-note { color: var(--text-3); font-size: var(--fs-meta); }

/* milestone buckets (project table view) */
.bucket { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r);
  margin-bottom: var(--sp-2); box-shadow: var(--shadow-sm); }
.bucket > summary { display: flex; align-items: center; gap: var(--sp-2); flex-wrap: wrap;
  padding: 11px 14px; cursor: pointer; list-style: none; border-radius: var(--r); }
.bucket > summary::-webkit-details-marker { display: none; }
.bucket > summary:hover { background: rgba(255, 255, 255, .03); }
.bucket[open] > summary { border-bottom: 1px solid var(--border); border-radius: var(--r) var(--r) 0 0; }
.bucket-caret { color: var(--text-3); font-size: 10px; transition: transform var(--t); }
.bucket[open] .bucket-caret { transform: rotate(90deg); }
.bucket-name { font-weight: 700; font-size: var(--fs-h2); color: var(--heading); }
a.bucket-name:hover { color: var(--accent); text-decoration: none; }
.bucket-dates { margin-left: auto; font-variant-numeric: tabular-nums; }
.bucket .task-table { border: none; border-radius: 0; background: none; }
.bucket .table-scroll { border-radius: 0 0 var(--r) var(--r); }

/* member donut */
.member-card { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r);
  padding: var(--sp-3) 10px; text-align: center; }
.member-card.borderless { background: none; border: none; display: flex; align-items: center;
  gap: var(--sp-5); text-align: left; padding: 4px 0; }
.donut { width: 112px; height: 112px; flex: 0 0 112px; }
.donut circle { fill: none; stroke-width: 12; }
.donut-track { stroke: var(--surface-3); }
.donut-num { fill: var(--heading); font-size: 22px; font-weight: 700; text-anchor: middle; font-family: var(--font); }
.donut-sub { fill: var(--text-3); font-size: 8px; text-transform: uppercase; letter-spacing: .08em;
  text-anchor: middle; font-family: var(--font); }
.donut-legend { display: flex; flex-direction: column; gap: 3px; font-size: var(--fs-sm); color: var(--text-2); }
.donut-legend i { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 7px; }
.donut-legend b { color: var(--text); float: right; margin-left: var(--sp-3); }

/* calendar */
.cal-panel { margin-top: var(--sp-3); }
.cal-header { display: flex; align-items: center; gap: var(--sp-3); margin-bottom: var(--sp-3); }
.cal-header h3 { margin: 0; flex: 1; text-align: center; font-size: 15px; color: var(--text);
  text-transform: none; letter-spacing: 0; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); border: 1px solid var(--border);
  border-radius: var(--r); overflow: hidden; background: var(--border); gap: 1px; }
.cal-dow { background: var(--surface-2); padding: 6px 8px; font-size: 10px; text-transform: uppercase;
  letter-spacing: .07em; color: var(--text-3); text-align: center; font-weight: 700; }
.cal-cell { background: var(--surface); min-height: 92px; padding: 6px; display: flex;
  flex-direction: column; gap: 3px; min-width: 0; }
.cal-cell.out { background: var(--bg); }
.cal-cell.out .cal-day { opacity: .35; }
.cal-cell.is-today { background: var(--accent-soft); }
.cal-cell.is-today .cal-day { color: var(--accent); font-weight: 700; }
.cal-day { font-size: var(--fs-meta); color: var(--text-3); }
.cal-task { display: block; background: var(--surface-3); border-left: 3px solid var(--Gray);
  border-radius: 3px; padding: 3px 6px; font-size: var(--fs-meta); color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-task:hover { text-decoration: none; background: var(--surface-2); }
.cal-task.done { opacity: .5; text-decoration: line-through; }

/* task detail */
.detail-grid { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(300px, 1fr); gap: var(--sp-4); align-items: start; }
.detail-col { display: flex; flex-direction: column; gap: var(--sp-3); min-width: 0; }

/* rendered rich text (Wrike descriptions arrive as HTML) */
.rich-text { background: var(--surface-3); border: 1px solid var(--border); border-radius: var(--r-sm);
  padding: 11px 13px; font-size: var(--fs-body); color: var(--text-2); line-height: 1.6;
  overflow-wrap: anywhere; }
.rich-text b, .rich-text strong { color: var(--text); }
.rich-text a { text-decoration: underline; }
.rich-text p { margin: 0 0 8px; }
.rich-text p:last-child { margin-bottom: 0; }
.rich-text ul, .rich-text ol { margin: 6px 0 8px; padding-left: 20px; }
.rich-text code, .rich-text pre { background: var(--surface-2); border-radius: 3px; padding: 1px 5px; font-size: var(--fs-sm); }

/* progressive disclosure for editing */
.inline-edit { margin-top: var(--sp-2); }
.inline-edit summary { cursor: pointer; font-size: var(--fs-sm); color: var(--text-3); padding: 4px 6px;
  border-radius: var(--r-sm); list-style: none; display: inline-block; }
.inline-edit summary::-webkit-details-marker { display: none; }
.inline-edit summary:hover { color: var(--accent); background: var(--hover); }
.inline-edit textarea { width: 100%; margin-top: var(--sp-2); font-family: var(--font); }

/* people chips — replaces the old checkbox grid */
.person-list { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: var(--sp-3); }
.person-chip { display: inline-flex; align-items: center; gap: 7px; background: var(--surface-2);
  border: 1px solid var(--border-strong); border-radius: var(--r-pill); padding: 3px 5px 3px 4px;
  font-size: var(--fs-sm); color: var(--text); transition: border-color var(--t); }
.person-chip:hover { border-color: var(--accent-dim); }
.person-chip .chip { width: 22px; height: 22px; font-size: 9px; }
.person-name { white-space: nowrap; }
.chip-x { background: none; border: 0; color: var(--text-3); cursor: pointer; font-size: 15px;
  line-height: 1; padding: 0 5px; border-radius: 50%; transition: color var(--t), background var(--t); }
.chip-x:hover { color: var(--fail-ink); background: rgba(224, 92, 92, .14); }
.assign-add { display: flex; gap: 7px; align-items: center; flex-wrap: wrap; }
.assign-add select { min-width: 190px; }

/* subtasks */
.subtask-list { list-style: none; margin: 0 0 var(--sp-3); padding: 0; }
.subtask { display: flex; align-items: center; gap: var(--sp-2); padding: 7px 4px;
  border-bottom: 1px solid var(--border); font-size: var(--fs-sm); }
.subtask:last-child { border-bottom: none; }
.subtask-title { flex: 1; min-width: 0; color: var(--text); font-weight: 600; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap; }
.subtask-title:hover { color: var(--accent); text-decoration: none; }
.subtask.done .subtask-title { color: var(--text-3); text-decoration: line-through; font-weight: 400; }
.subtask .chips { flex: 0 0 auto; }
.detail-main, .detail-side { background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r); padding: var(--sp-5); box-shadow: var(--shadow-sm); }
.detail-side { padding: var(--sp-4); }
.title-input { width: 100%; font-size: 19px; font-weight: 700; background: transparent; color: var(--heading);
  border: 1px solid transparent; border-radius: var(--r-sm); padding: 6px 9px; margin-bottom: var(--sp-2);
  font-family: var(--font); }
.title-input:hover { border-color: var(--border); }
.title-input:focus { border-color: var(--accent); background: var(--surface-3); }
.detail-main textarea { width: 100%; }
.detail-side h3 { margin: var(--sp-5) 0 var(--sp-2); }
.detail-side h3:first-child { margin-top: 0; }
.comment { border-bottom: 1px solid var(--border); padding: 8px 0; }
.comment:last-of-type { border-bottom: none; }
.comment-head { font-size: var(--fs-meta); display: flex; gap: 8px; align-items: baseline; color: var(--text-3); }
.comment-head strong { color: var(--text); }
.comment-body { white-space: pre-wrap; font-size: var(--fs-sm); color: var(--text-2); margin-top: 2px; }
.mention { color: var(--accent); font-weight: 600; }
.comment-form { margin: var(--sp-3) 0 var(--sp-2); }
.comment-form textarea { width: 100%; margin-bottom: 7px; }
.approval { border-bottom: 1px solid var(--border); padding: 7px 0; font-size: var(--fs-sm); color: var(--text-2); }
.approval:last-of-type { border-bottom: none; }
.decide-form { display: flex; gap: 6px; margin-top: 7px; flex-wrap: wrap; }
.decide-form input { flex: 1; min-width: 120px; }
.request-approval { display: flex; gap: 7px; margin-top: var(--sp-2); }
.request-approval select { flex: 1; min-width: 0; }
.attachment { padding: 5px 0; font-size: var(--fs-sm); }
.upload-form { display: flex; gap: 7px; margin-top: var(--sp-2); align-items: center; flex-wrap: wrap; }

/* templates page */
.tpl { border: 1px solid var(--border); border-radius: var(--r); margin-bottom: var(--sp-2); background: var(--surface-2); }
.tpl summary { cursor: pointer; padding: 10px 13px; display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.tpl summary:hover { background: var(--hover); }
.tpl[open] summary { border-bottom: 1px solid var(--border); }
.tpl > *:not(summary) { margin: 11px 13px; }
.tpl-use { display: flex; gap: 7px; flex-wrap: wrap; align-items: center; }
.tpl-use input[name=title] { flex: 1; min-width: 180px; }

/* login */
.login-body { display: flex; align-items: center; justify-content: center; min-height: 100vh;
  background: var(--bg); font-family: var(--font); padding: var(--sp-4); }
.login-card { position: relative; overflow: hidden; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--r-lg); padding: 34px 38px; width: 100%;
  max-width: 390px; box-shadow: var(--shadow-lg); color: var(--text); }
.login-card::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--Turquoise)); }
.login-card .tagline { text-align: center; color: var(--text-3); margin: 6px 0 20px; font-size: var(--fs-sm); }
.login-card label { display: block; font-size: var(--fs-meta); color: var(--text-3); margin-bottom: 12px;
  text-transform: uppercase; letter-spacing: .05em; font-weight: 600; }
.login-card input { width: 100%; margin-top: 5px; padding: 9px 12px; font-size: var(--fs-body); }

/* ------------------------------ 10. STATES (empty/loading/error) */
.empty-state { display: flex; flex-direction: column; align-items: center; text-align: center;
  gap: 5px; padding: var(--sp-5) var(--sp-4); color: var(--text-3); font-size: var(--fs-sm); }
.empty-state .empty-ico { font-size: 22px; opacity: .65; }
.empty-state strong { color: var(--text-2); font-weight: 600; }
.empty-state .btn { margin-top: var(--sp-2); }

.skeleton { background: linear-gradient(90deg, var(--surface-2) 25%, #31373f 50%, var(--surface-2) 75%);
  background-size: 200% 100%; animation: shimmer 1.2s infinite linear; border-radius: var(--r-sm);
  height: 12px; margin-bottom: 8px; }
@keyframes shimmer { to { background-position: -200% 0; } }
[aria-busy="true"] { opacity: .6; pointer-events: none; }

.error-page { max-width: 520px; margin: 8vh auto; text-align: center; }
.error-code { font-size: 62px; font-weight: 700; color: var(--border-strong); line-height: 1; }
.error-page h1 { font-size: 21px; margin: var(--sp-3) 0 var(--sp-2); }
.error-page p { color: var(--text-3); margin: 0 0 var(--sp-4); }

/* -------------------------------------------------- RESPONSIVE */
@media (max-width: 1100px) {
  .dash-grid { grid-template-columns: 1fr; }
  .detail-grid { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  :root { --fs-h1: 22px; --fs-kpi: 26px; }
  .content { padding: var(--sp-4) var(--sp-3) var(--sp-5); }
  .topbar { padding: 8px var(--sp-3); gap: var(--sp-2); }
  .kpi-row { grid-template-columns: repeat(2, 1fr); }
  .dash-filters select, .dash-filters input { max-width: none; flex: 1 1 140px; }
  .mywork-go { margin-left: 0; }
  .wl-dist { min-width: 130px; }
  .member-card.borderless { flex-direction: column; align-items: flex-start; gap: var(--sp-3); }
  .detail-main, .detail-side { padding: var(--sp-4); }
  .hbar-label { flex-basis: 110px; }
  .cal-cell { min-height: 68px; }
  /* task table collapses into stacked rows (labels come from data-label) */
  .task-table.stack-mobile { border: none; background: none; }
  .task-table.stack-mobile thead { display: none; }
  .task-table.stack-mobile tr { display: block; background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--r); margin-bottom: var(--sp-2); padding: 4px 2px; }
  .task-table.stack-mobile td { display: flex; justify-content: space-between; gap: var(--sp-3);
    align-items: center; border: none; padding: 5px 11px; }
  .task-table.stack-mobile td::before { content: attr(data-label); font-size: 10px;
    text-transform: uppercase; letter-spacing: .06em; color: var(--text-3); font-weight: 700; flex: 0 0 auto; }
  .task-table.stack-mobile td:first-child { padding-top: 9px; }
  .task-table.stack-mobile td:first-child::before { display: none; }
  .task-table.stack-mobile td:first-child { justify-content: flex-start; }
  .task-table.stack-mobile .task-link { font-size: var(--fs-body); }
}

/* task detail — Wrike-style single-column panel */
.task-page { max-width: 960px; }
.task-title { font-size: 22px; margin: 2px 0 6px; }
.task-project-chip { display: flex; align-items: center; gap: 10px; margin: 0 0 14px; }
.proj-chip { display: inline-block; padding: 3px 10px; border: 1px solid var(--border);
  border-radius: var(--r-pill); background: var(--surface); color: var(--text-2); font-size: var(--fs-sm); }
.proj-chip:hover { color: var(--text); text-decoration: none; border-color: var(--border-strong); }

.task-cards { display: grid; grid-template-columns: minmax(150px, .8fr) 1.4fr 1.2fr; gap: 10px; margin: 0 0 14px; }
.t-card { background: var(--surface); border: 1px solid var(--border); border-left: 3px solid var(--border);
  border-radius: var(--r); padding: 8px 12px 10px; min-width: 0; }
.t-card-label { display: block; font-size: var(--fs-meta); color: var(--text-3);
  text-transform: uppercase; letter-spacing: .05em; margin-bottom: 4px; }
.t-card select, .t-card input[type="date"] { background: transparent; border-color: transparent; }
.t-card select:hover, .t-card input[type="date"]:hover { border-color: var(--border-strong); }
.t-card-people { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.t-card-dates { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.t-card-dates input.overdue { color: var(--danger, #ff6b6b); }
.assign-inline select { max-width: 110px; font-size: var(--fs-sm); }

.field-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 28px; margin: 0 0 6px; }
.fg-row { display: grid; grid-template-columns: 130px minmax(0, 1fr); align-items: center;
  gap: 10px; padding: 5px 0; border-bottom: 1px solid var(--border); }
.fg-label { color: var(--text-3); font-size: var(--fs-sm); }
.fg-value { display: flex; align-items: center; gap: 7px; min-width: 0; }
.fg-select, .fg-input { max-width: 200px; }
.fg-input::placeholder { color: var(--text-3); }
.more-fields { margin: 8px 0 4px; }
.more-fields > summary { cursor: pointer; color: var(--text-2); font-size: var(--fs-sm); padding: 4px 0; }
.task-save { margin: 12px 0 4px; }

.task-actionbar { display: flex; gap: 4px; flex-wrap: wrap; border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border); padding: 6px 0; margin: 14px 0; }
.task-actionbar a { padding: 5px 11px; border-radius: var(--r-sm); color: var(--text-2); font-size: var(--fs-sm); }
.task-actionbar a:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }

.task-desc { margin: 0 0 16px; }
.task-page .dash-panel { margin-bottom: 14px; }

.task-feed { border-top: 1px solid var(--border); padding-top: 4px; margin-top: 18px; }
.feed-day { display: flex; align-items: center; gap: 12px; margin: 16px 0 10px; color: var(--text-3);
  font-size: var(--fs-sm); }
.feed-day::before, .feed-day::after { content: ""; flex: 1; border-top: 1px solid var(--border); }
.feed-item { display: flex; gap: 10px; padding: 6px 0; }
.feed-item .chip { flex: 0 0 auto; margin-top: 2px; }
.feed-body { min-width: 0; flex: 1; }
.feed-head { display: flex; align-items: baseline; gap: 8px; }
.feed-head time { color: var(--text-3); font-size: var(--fs-meta); }
.feed-action { color: var(--text-2); }
.feed-comment .comment-body { background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r); padding: 8px 11px; margin-top: 4px; }
.feed-composer { display: flex; gap: 10px; align-items: flex-start; margin-top: 16px;
  border-top: 1px solid var(--border); padding-top: 14px; }
.feed-composer .chip { margin-top: 4px; }
.feed-composer textarea { flex: 1; }

@media (max-width: 860px) {
  .task-cards, .field-grid { grid-template-columns: 1fr; }
}

/* ---- light theme -------------------------------------------------------
   The whole app is painted from the :root tokens, so light mode is one
   override block. Toggled by the topbar button; persisted in localStorage
   and applied to <html data-theme> before first paint to avoid a flash. */
:root { color-scheme: dark; }
[data-theme="light"] {
  color-scheme: light;
  --bg: #f1f2f4;
  --surface: #ffffff;
  --surface-2: #f4f5f7;
  --surface-3: #e9ebee;
  --sidebar-bg: #f8f9fa;
  --border: #dcdfe4;
  --border-strong: #bac1ca;
  --text: #22262b;
  --text-2: #494f57;
  --text-3: #667080;          /* keeps >=4.5:1 on every light surface */
  --heading: #14171a;
  --accent: #1f7ae0;          /* darkened for contrast on white */
  --accent-dim: #1a66bd;
  --accent-soft: rgba(31, 122, 224, .10);
  --ok: #23854f;
  --warn: #9a6d0b;
  --fail: #cc3d3d;
  --fail-ink: #b93535;
  --fail-solid: #b8433f;
  --review: #7d3fbd;
  --DarkRed: #b04040; --Red: #cc3d3d; --Purple: #7d3fbd; --Indigo: #4d5fd1;
  --Blue: #1f7ae0; --DarkCyan: #14808c; --Yellow: #9a6d0b; --Orange: #b56311;
  --YellowGreen: #5f7a1e; --Green: #23854f; --Gray: #667080; --Turquoise: #148a6f;
  --Brown: #8a6244;
  --shadow-sm: 0 1px 2px rgba(20, 25, 35, .10);
  --shadow: 0 3px 10px rgba(20, 25, 35, .12);
  --shadow-lg: 0 12px 32px rgba(20, 25, 35, .18);
  --hover: rgba(0, 0, 0, .05);
}

/* task peek — click a task in any list and it opens beside the list,
   Wrike-style, in the free space on the right. Plain links underneath:
   middle-click, ctrl-click and no-JS all still open the full page. */
.task-peek { position: fixed; top: 0; right: 0; bottom: 0; width: min(720px, 48vw);
  background: var(--bg); border-left: 1px solid var(--border-strong);
  box-shadow: var(--shadow-lg); z-index: 60; display: flex; flex-direction: column; }
.peek-head { display: flex; align-items: center; gap: 8px; padding: 8px 14px;
  border-bottom: 1px solid var(--border); background: var(--surface); flex: 0 0 auto; }
.peek-head .peek-title { font-weight: 600; color: var(--text-2); font-size: var(--fs-sm);
  margin-right: auto; }
.peek-body { overflow-y: auto; padding: 6px 18px 24px; }
.peek-body .task-page { max-width: none; }
body.peek-open .content { margin-right: min(720px, 48vw); }
@media (max-width: 900px) { .task-peek { display: none; } body.peek-open .content { margin-right: 0; } }

/* post-mortem */
.pm-table td { vertical-align: middle; }
.pm-lane { min-width: 220px; }
.pm-track { position: relative; height: 12px; background: var(--surface-2);
  border-radius: var(--r-pill); overflow: hidden; }
.pm-bar { position: absolute; top: 0; bottom: 0; border-radius: var(--r-pill);
  background: var(--accent-dim, #3b82c4); }
.pm-bar.pm-open { background: repeating-linear-gradient(45deg, #c98500, #c98500 6px,
  #a26a00 6px, #a26a00 12px); }
.pm-hours { display: flex; gap: 4px; justify-content: flex-end; }
.pm-hours input { width: 64px; text-align: right; }

/* time tracking */
.clock-btn { font-weight: 700; }
.clock-btn.clock-in { background: #1E7B34; border-color: #1E7B34; color: #fff; }
.clock-btn.clock-in:hover { background: #24913f; }
.clock-btn.clock-out { background: #8f2b2b; border-color: #8f2b2b; color: #fff; }
.clock-btn.clock-out:hover { background: #a53333; }
.tt-chip { display: inline-flex; align-items: center; gap: 7px; padding: 4px 11px;
  border: 1px solid #1E7B34; border-radius: var(--r-pill); background: color-mix(in srgb, #1E7B34 16%, var(--surface));
  color: var(--text); font-size: var(--fs-sm); max-width: 300px; }
.tt-chip:hover { text-decoration: none; border-color: #24913f; }
.tt-chip-task { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.tt-dot { width: 8px; height: 8px; border-radius: 50%; background: #2ecc71; flex: 0 0 auto;
  animation: tt-pulse 2s infinite; }
@keyframes tt-pulse { 0%, 100% { opacity: 1 } 50% { opacity: .35 } }
.tt-clock { font-variant-numeric: tabular-nums; font-weight: 700; }
.tt-running .panel-head h3 { color: #2ecc71; }
.tt-off-form { flex-wrap: wrap; align-items: center; }
.tt-off-form input[type="date"] { width: auto; }
.tt-note-form { display: flex; gap: 4px; align-items: center; flex: 1; max-width: 440px; }
.tt-note { flex: 1; min-width: 120px; font-size: var(--fs-sm); }
.tt-note-missing .tt-note { border-color: #c00000; box-shadow: 0 0 0 2px rgba(192,0,0,.25);
  animation: tt-nag .5s 2; }
@keyframes tt-nag { 50% { transform: translateX(3px) } }
.tt-session-note { color: var(--text-2); font-style: italic; }
.tt-session-row { display: flex; align-items: center; gap: 7px; padding: 2px 0; }
.tt-session-row .tt-session-note { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.tt-session-del { margin-left: auto; }
.tt-proj { border: 1px solid var(--border); border-radius: var(--r); padding: 8px 12px;
  margin-bottom: var(--sp-1, 8px); }

.badge.review-hold { background: color-mix(in srgb, #8c6fd0 18%, var(--surface));
  border: 1px solid #8c6fd0; color: var(--text); }
.team-group td { background: var(--surface-2); font-weight: 700; font-size: var(--fs-xs, 11px);
  text-transform: uppercase; letter-spacing: .05em; color: var(--text-2); padding: 5px 10px; }

/* project stage chip: current milestone + derived state, next to the title */
.stage-chip { display: inline-flex; align-items: center; gap: 7px; vertical-align: middle;
  margin-left: 10px; padding: 3px 12px; border-radius: var(--r-pill);
  font-size: var(--fs-sm); font-weight: 600; border: 1px solid var(--border-strong);
  color: var(--text); background: var(--surface-2); }
.stage-chip:hover { text-decoration: none; filter: brightness(1.12); }
.stage-pct { font-weight: 700; color: var(--text-2); font-size: var(--fs-xs, 11px); }
.stage-in-review { border-color: #8c6fd0; background: color-mix(in srgb, #8c6fd0 18%, var(--surface)); }
.stage-in-progress { border-color: #4da3ff; background: color-mix(in srgb, #4da3ff 15%, var(--surface)); }
.stage-on-hold { border-color: #b8860b; background: color-mix(in srgb, #b8860b 15%, var(--surface)); }
.stage-not-started { color: var(--text-2); }

/* hours budgets: burn bar + timer chip states (informative only, never blocks) */
.bgt-track { height: 10px; border-radius: var(--r-pill); background: var(--surface-2);
  border: 1px solid var(--border); overflow: hidden; margin-bottom: var(--sp-2); }
.bgt-fill { display: block; height: 100%; background: #1E7B34; }
.bgt-fill.bgt-warn { background: #b8860b; }
.bgt-fill.bgt-over { background: #c00000; }
.bgt-form .toolbar { align-items: center; flex-wrap: wrap; }
.tt-chip.tt-warn { border-color: #b8860b; background: color-mix(in srgb, #b8860b 18%, var(--surface)); }
.tt-chip.tt-warn .tt-dot { background: #e6a817; }
.tt-chip.tt-over { border-color: #c00000; background: color-mix(in srgb, #c00000 16%, var(--surface)); }
.tt-chip.tt-over .tt-dot { background: #e05252; }
.tt-chip-budget { font-size: var(--fs-xs, 11px); color: var(--text-2); white-space: nowrap; }
.tt-proj > summary { cursor: pointer; display: flex; gap: 10px; align-items: baseline; }
.tt-proj[open] > summary { margin-bottom: 8px; }

/* quick-switch dropdown (topbar clock button / Ctrl+.) */
.qs-root { position: relative; }
.qs-btn-in { background: #1E7B34; border-color: #1E7B34; color: #fff; font-weight: 700; }
.qs-btn-in:hover { background: #24913f; }
.qs-menu[hidden] { display: none; }   /* display:flex must not defeat [hidden] */
.qs-menu { position: absolute; left: 0; top: calc(100% + 6px); background: var(--surface-2);
  border: 1px solid var(--border-strong); border-radius: var(--r); box-shadow: var(--shadow-lg);
  width: 340px; max-width: 88vw; padding: 8px; z-index: 70;
  display: flex; flex-direction: column; gap: 6px; }
.qs-menu input { width: 100%; font-size: var(--fs-sm); }
.qs-note-bad { border-color: #c00000 !important; box-shadow: 0 0 0 2px rgba(192,0,0,.25); }
.qs-list { max-height: 320px; overflow-y: auto; display: flex; flex-direction: column; gap: 2px; }
.qs-item { display: flex; flex-direction: column; align-items: flex-start; gap: 1px;
  width: 100%; text-align: left; padding: 7px 9px; border: 0; border-radius: var(--r-sm);
  background: transparent; color: var(--text); cursor: pointer; font-size: var(--fs-sm); }
.qs-item:hover, .qs-item:focus { background: var(--hover); }
.qs-title { font-weight: 600; overflow: hidden; white-space: nowrap;
  text-overflow: ellipsis; max-width: 100%; }
.qs-proj { color: var(--text-2); font-size: var(--fs-xs, 11px); }
.qs-empty { color: var(--text-2); font-size: var(--fs-sm); padding: 8px; }
.qs-attrs { display: flex; gap: 6px; align-items: center; }
.qs-attr { display: flex; gap: 4px; align-items: center; color: var(--text);
  font-size: var(--fs-sm); white-space: nowrap; }
.qs-attrs .qs-service { flex: 1; min-width: 0; font-size: var(--fs-sm); }
.qs-attrs .qs-miles { width: 58px; flex: 0 0 auto; }
.qs-out { background: #8f2b2b; border-color: #8f2b2b; color: #fff; font-weight: 700; }
.qs-out:hover { background: #a53333; }
.qs-div { border-top: 1px solid var(--border); margin: 2px 0; }
.qs-cap { color: var(--text-2); font-size: var(--fs-xs, 11px); padding: 0 2px;
  text-transform: uppercase; letter-spacing: .04em; display: flex; gap: 4px; }
.qs-tab { border: 1px solid var(--border); border-radius: var(--r-pill); background: transparent;
  color: var(--text-2); font-size: var(--fs-xs, 11px); font-weight: 700; padding: 2px 11px;
  cursor: pointer; text-transform: uppercase; letter-spacing: .04em; }
.qs-tab:hover { background: var(--hover); }
.qs-tab.on { background: color-mix(in srgb, #4da3ff 22%, transparent);
  border-color: #4da3ff; color: var(--text); }
.qs-mine { background: color-mix(in srgb, #4da3ff 25%, transparent); color: var(--text);
  border-radius: var(--r-pill); padding: 0 6px; font-size: var(--fs-xs, 11px); font-weight: 600; }
