/* ═══════════════════════════════════════════════════════════════════════════
   WorkTrac Dashboard — shell v2 (redesign, see documents/DASHBOARD_REDESIGN_PLAN.md)

   Everything in this file is scoped under body.shell-v2 so the dashboard is
   byte-identical without the flag. Turn it on with ?shell=v2 (sets a cookie),
   off with ?shell=v1. Loaded after style.css; wins on specificity, not order.

   Phase 0 (2026-10-21): font + tokens only. No layout or component rules yet.
   ═══════════════════════════════════════════════════════════════════════════ */

/* Inter, variable weight, latin subset, self-hosted (SIL OFL 1.1, see
   fonts/LICENSE-Inter.txt). Self-hosted so the CSP font-src stays 'self'. */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url(./fonts/inter-latin-wght-normal.woff2) format('woff2-variations');
}

/* ── Tokens ────────────────────────────────────────────────────────────────
   New names on the left; the legacy names style.css and org css_overrides
   rely on (--surface, --border, --text, --muted, …) are re-pointed below so
   existing page CSS picks the new palette up without edits. Brand colors
   (--primary & friends) are NOT set here: applyBranding() keeps writing them
   from the org's chosen colors at runtime. */
body.shell-v2 {
  --wt-bg:          #F7F7FA;
  --wt-surface:     #FFFFFF;
  --wt-surface-2:   #F7F7FA;
  --wt-border:      #E8E8EE;
  --wt-divider:     #F0F0F4;
  --wt-text:        #0E0A2E;
  --wt-text-2:      #3C3C4E;
  --wt-muted:       #6B6B7B;
  --wt-faint:       #A0A0B0;

  --wt-success:     #1F7A4D;  --wt-success-bg: #E6F4EC;
  --wt-warning:     #B45309;  --wt-warning-bg: #FEF3E2;
  --wt-danger:      #B42318;  --wt-danger-bg:  #FDECEA;
  --wt-info:        #4A3FB0;  --wt-info-bg:    #EEEDF8;

  --wt-radius:      12px;
  --wt-radius-sm:   8px;
  --wt-radius-pill: 999px;
  --wt-sidebar-w:   232px;
  --wt-font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

  /* legacy aliases */
  --surface:        var(--wt-surface);
  --surface3:       var(--wt-bg);
  --primary-bg:     var(--wt-bg);
  --border:         var(--wt-border);
  --border-light:   var(--wt-divider);
  --text:           var(--wt-text);
  --text-secondary: var(--wt-text-2);
  --muted:          var(--wt-muted);
  --faint:          var(--wt-faint);
  --success:        var(--wt-success);  --success-bg: var(--wt-success-bg);
  --danger:         var(--wt-danger);   --danger-bg:  var(--wt-danger-bg);
  --warning:        var(--wt-warning);  --warning-bg: var(--wt-warning-bg);
  --info:           var(--wt-info);     --info-bg:    var(--wt-info-bg);
  --radius:         var(--wt-radius-sm);
  --radius-lg:      var(--wt-radius);
  --fs-body:        14px;
  --fs-md:          14px;
  --fs-sm:          13px;
  --fs-xs:          12px;
  --sidebar-bg:        var(--wt-surface);
  --sidebar-fg:        var(--wt-text-2);
  --sidebar-active-bg: var(--wt-surface-2);
  --sidebar-active-fg: var(--wt-text);
}

body.shell-v2.dark {
  --wt-bg:          #0F0C2B;
  --wt-surface:     #171433;
  --wt-surface-2:   #1A1640;
  --wt-border:      #2A2653;
  --wt-divider:     #221E4A;
  --wt-text:        #F2F2F7;
  --wt-text-2:      #C9C9DA;
  --wt-muted:       #A0A0B8;
  --wt-faint:       #7C7C96;

  --wt-success:     #7FD1A1;  --wt-success-bg: #163A2A;
  --wt-warning:     #F4B266;  --wt-warning-bg: #3E2A10;
  --wt-danger:      #F49A8F;  --wt-danger-bg:  #4A1A16;
  --wt-info:        #C7C2F2;  --wt-info-bg:    #2A2653;

  --sidebar-bg:        #120F2E;
  --sidebar-fg:        var(--wt-text-2);
  --sidebar-active-bg: var(--wt-surface-2);
  --sidebar-active-fg: var(--wt-text);
}

body.shell-v2 {
  font-family: var(--wt-font);
  font-size: var(--fs-body);
  background: var(--wt-bg);
  color: var(--wt-text);
}

/* Icon sprite helper: <svg class="wt-icon"><use href="#i-sun"/></svg> */
body.shell-v2 .wt-icon {
  width: 20px; height: 20px; flex-shrink: 0;
  fill: none; stroke: currentColor; stroke-width: 2;
  stroke-linecap: round; stroke-linejoin: round;
}
body.shell-v2 .wt-icon.sm { width: 16px; height: 16px; }

/* ═══════════════════════════════════════════════════════════════════════════
   Phase 1 — the shell: destinations sidebar, header with sub-tabs, jump
   palette. Elements that only exist for v2 are hidden unscoped so the
   classic shell never shows them.
   ═══════════════════════════════════════════════════════════════════════════ */
.jump-btn, .page-tabs, .jump-palette, .topbar-sub { display: none; }
.topbar-title-wrap { display: flex; flex-direction: column; min-width: 0; }

/* ── Sidebar ─────────────────────────────────────────────────────────── */
body.shell-v2 .sidebar {
  width: var(--wt-sidebar-w);
  background: var(--sidebar-bg);
  border-right: 1px solid var(--wt-border);
}
body.shell-v2 .sidebar-header { padding: 18px 20px 12px; border-bottom: 0; }
body.shell-v2 .sidebar .logo-icon { color: var(--primary); font-size: 20px; }
body.shell-v2 .sidebar .logo-text { color: var(--wt-text); font-size: 16px; font-weight: 700; letter-spacing: -0.01em; }

body.shell-v2 .org-picker { padding: 0 12px 6px; }
body.shell-v2 .org-current {
  padding: 10px; border-radius: 10px;
  border: 1px solid var(--wt-border); background: var(--wt-surface-2);
  color: var(--wt-text); font-size: 13px; font-weight: 600;
}
body.shell-v2 .org-current:hover { border-color: var(--primary); }
body.shell-v2 .org-list { background: var(--wt-surface); border: 1px solid var(--wt-border); box-shadow: var(--shadow-md); }
body.shell-v2 .org-list-item { color: var(--wt-text-2); }
body.shell-v2 .org-list-item:hover { background: var(--wt-surface-2); }
body.shell-v2 .org-list-item.active { color: var(--wt-text); font-weight: 600; }

body.shell-v2 .sidebar-nav { padding: 10px 12px 8px; display: flex; flex-direction: column; }
body.shell-v2 .nav-dest-group { display: flex; flex-direction: column; gap: 2px; }
body.shell-v2 .nav-dest-bottom { margin-top: auto; padding-top: 10px; border-top: 1px solid var(--wt-divider); }
body.shell-v2 .nav-dest {
  display: flex; align-items: center; gap: 12px;
  padding: 9px 10px; border-radius: var(--wt-radius-sm);
  color: var(--wt-text-2); text-decoration: none;
  font-size: 14px; font-weight: 500; line-height: 1.3;
  transition: background var(--transition), color var(--transition);
}
body.shell-v2 .nav-dest:hover { background: var(--wt-surface-2); color: var(--wt-text); }
body.shell-v2 .nav-dest.active { background: var(--primary-weak); color: var(--primary); font-weight: 600; }
body.shell-v2 .nav-dest-label { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

body.shell-v2 .sidebar-footer { padding: 12px 12px 14px; border-top: 1px solid var(--wt-divider); gap: 6px; }
body.shell-v2 .user-email { color: var(--wt-muted); padding: 0 4px; }
body.shell-v2 .btn-logout {
  background: transparent; border: 1px solid var(--wt-border); color: var(--wt-text-2);
  border-radius: var(--wt-radius-sm); padding: 8px 10px; font-weight: 500;
}
body.shell-v2 .btn-logout:hover { border-color: var(--wt-danger); color: var(--wt-danger); background: var(--wt-danger-bg); }
body.shell-v2 .sidebar-footer .btn-sm.ghost { color: var(--wt-muted); }

/* legacy per-item badges (pollers still append them); v2 paints its own */
body.shell-v2 .sos-nav-badge, body.shell-v2 .dm-nav-badge, body.shell-v2 .exp-pending-badge { display: none; }

body.shell-v2 .nav-dest-badge, body.shell-v2 .nav-tab-badge {
  margin-left: auto; font-size: 11px; font-weight: 600; line-height: 1.5;
  border-radius: var(--wt-radius-pill); padding: 1px 7px; flex-shrink: 0;
}
body.shell-v2 .nav-tab-badge { margin-left: 6px; }
body.shell-v2 .tone-info    { color: var(--primary);    background: var(--primary-weak); }
body.shell-v2 .tone-warning { color: var(--wt-warning); background: var(--wt-warning-bg); }
body.shell-v2 .tone-danger  { color: var(--wt-danger);  background: var(--wt-danger-bg); }

/* ── Header ──────────────────────────────────────────────────────────── */
body.shell-v2 .topbar {
  height: auto; min-height: 60px; padding: 10px 32px;
  background: var(--wt-surface); border-bottom: 1px solid var(--wt-border);
  box-shadow: none; gap: 12px;
}
body.shell-v2 .topbar::before { display: none; }
body.shell-v2 .topbar-title { font-size: 20px; font-weight: 700; letter-spacing: -0.02em; color: var(--wt-text); line-height: 1.2; }
body.shell-v2 .topbar-sub { display: block; font-size: 13px; color: var(--wt-muted); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
body.shell-v2 .topbar-sub:empty { display: none; }
body.shell-v2 .refresh-indicator { font-size: 12px; color: var(--wt-faint); white-space: nowrap; }
body.shell-v2 .notif-bell { color: var(--wt-text-2); }

body.shell-v2 .jump-btn {
  display: inline-flex; align-items: center; gap: 8px;
  height: 36px; padding: 0 10px 0 12px; margin-right: 6px;
  border: 1px solid var(--wt-border); border-radius: var(--wt-radius-sm);
  background: var(--wt-surface-2); color: var(--wt-muted);
  font: inherit; font-size: 13px; cursor: pointer;
}
body.shell-v2 .jump-btn:hover { border-color: var(--primary); color: var(--wt-text); }
body.shell-v2 .jump-btn kbd {
  font: inherit; font-size: 11px; color: var(--wt-muted);
  border: 1px solid var(--wt-border); border-radius: 4px; padding: 0 5px; background: var(--wt-surface);
}

body.shell-v2 .page-tabs {
  display: flex; gap: 4px; flex-shrink: 0;
  padding: 0 32px; background: var(--wt-surface);
  border-bottom: 1px solid var(--wt-border); overflow-x: auto; scrollbar-width: none;
}
body.shell-v2 .page-tabs::-webkit-scrollbar { display: none; }
body.shell-v2 .page-tab {
  display: inline-flex; align-items: center;
  padding: 10px 12px; margin: 0;
  font-size: 14px; font-weight: 500; color: var(--wt-text-2);
  text-decoration: none; white-space: nowrap;
  border-radius: 0; border-bottom: 2px solid transparent; margin-bottom: -1px;
}
body.shell-v2 .page-tab:hover { background: transparent; color: var(--wt-text); }
body.shell-v2 .page-tab.active { background: transparent; color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }
body.shell-v2 .page-tab.locked { opacity: .55; }
body.shell-v2 .page-tab .wt-icon.sm { margin-left: 6px; }

body.shell-v2 .content { padding: 24px 32px 32px; }

/* ── Jump palette ────────────────────────────────────────────────────── */
/* Only exists while open — an always-on fixed layer would swallow every click (found in the Oct 21 dev soak). */
body.shell-v2 .jump-palette.open { display: block; position: fixed; inset: 0; z-index: 10001; }
body.shell-v2 .jump-backdrop { position: absolute; inset: 0; background: rgba(14,10,46,.45); }
body.shell-v2 .jump-box {
  position: absolute; left: 50%; top: 12vh; transform: translateX(-50%);
  width: 560px; max-width: calc(100vw - 32px);
  background: var(--wt-surface); color: var(--wt-text);
  border: 1px solid var(--wt-border); border-radius: var(--wt-radius);
  box-shadow: 0 24px 64px rgba(14,10,46,.35); overflow: hidden;
}
body.shell-v2 .jump-input-row { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--wt-divider); color: var(--wt-muted); }
body.shell-v2 .jump-input-row input { flex: 1; min-width: 0; border: 0; outline: none; background: transparent; font: inherit; font-size: 15px; color: var(--wt-text); }
body.shell-v2 .jump-hint { font-size: 11px; color: var(--wt-muted); border: 1px solid var(--wt-border); border-radius: 4px; padding: 0 5px; }
body.shell-v2 .jump-list { max-height: 50vh; overflow-y: auto; padding: 6px; }
body.shell-v2 .jump-row { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: var(--wt-radius-sm); cursor: pointer; }
body.shell-v2 .jump-row.sel { background: var(--wt-surface-2); }
body.shell-v2 .jump-title { flex: 1; min-width: 0; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
body.shell-v2 .jump-sub { font-size: 12px; color: var(--wt-muted); }
body.shell-v2 .jump-empty { padding: 18px 12px; font-size: 13px; color: var(--wt-muted); text-align: center; }

/* ── Phone ───────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  body.shell-v2 .topbar { padding: 8px 14px; }
  body.shell-v2 .page-tabs { padding: 0 14px; }
  body.shell-v2 .content { padding: 14px; }
  body.shell-v2 .jump-btn-label, body.shell-v2 .jump-btn kbd { display: none; }
  body.shell-v2 .jump-btn { padding: 0 9px; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   Phase 2 — Today page (App._renderTodayV2)
   ═══════════════════════════════════════════════════════════════════════════ */
body.shell-v2 .td-dateline { font-size: 13px; color: var(--wt-muted); margin: -6px 0 16px; }
body.shell-v2 .td-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
body.shell-v2 .td-card {
  background: var(--wt-surface); border: 1px solid var(--wt-border); border-radius: var(--wt-radius);
  padding: 4px 0 6px; min-width: 0; box-shadow: none;
}
body.shell-v2 .td-card.span2 { grid-column: span 2; }
body.shell-v2 .td-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 14px 20px 10px; }
body.shell-v2 .td-head h2 { margin: 0; font-size: 15px; font-weight: 600; color: var(--wt-text); }
body.shell-v2 .td-link { font-size: 12px; font-weight: 600; color: var(--primary); text-decoration: none; }
body.shell-v2 .td-row { display: flex; align-items: center; gap: 14px; padding: 12px 20px; border-top: 1px solid var(--wt-divider); }
body.shell-v2 .td-row.td-tight { padding: 9px 20px; gap: 10px; }
body.shell-v2 .td-row.td-quiet { color: var(--wt-muted); font-size: 13px; gap: 10px; }
body.shell-v2 .td-ico { width: 34px; height: 34px; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
body.shell-v2 .td-ico .wt-icon { width: 18px; height: 18px; }
body.shell-v2 .td-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
body.shell-v2 .td-title { font-weight: 600; color: var(--wt-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
body.shell-v2 .td-title.sm { font-size: 13px; }
body.shell-v2 .td-sub { font-size: 13px; color: var(--wt-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
body.shell-v2 .td-sub.danger { color: var(--wt-danger); }
body.shell-v2 .td-meta { font-size: 12px; color: var(--wt-muted); white-space: nowrap; }
body.shell-v2 .td-time { width: 64px; flex-shrink: 0; font-size: 13px; font-weight: 600; color: var(--wt-text-2); }
body.shell-v2 .td-btn {
  font-size: 13px; font-weight: 600; text-decoration: none; white-space: nowrap;
  padding: 7px 12px; border: 1px solid var(--wt-border); border-radius: var(--wt-radius-sm); color: var(--wt-text); background: var(--wt-surface);
}
body.shell-v2 .td-btn:hover { border-color: var(--primary); color: var(--primary); }
body.shell-v2 .td-foot { padding: 10px 20px 6px; border-top: 1px solid var(--wt-divider); font-size: 12px; color: var(--wt-muted); }
body.shell-v2 .td-pill { font-size: 12px; font-weight: 600; border-radius: var(--wt-radius-pill); padding: 3px 10px; white-space: nowrap; }
body.shell-v2 .td-pill.success { color: var(--wt-success); background: var(--wt-success-bg); }
body.shell-v2 .td-pill.danger  { color: var(--wt-danger);  background: var(--wt-danger-bg); }
body.shell-v2 .td-pill.info    { color: var(--primary);    background: var(--primary-weak); }
body.shell-v2 .td-pill.muted   { color: var(--wt-text-2);  background: var(--wt-surface-2); }
body.shell-v2 .td-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border-top: 1px solid var(--wt-divider); }
body.shell-v2 .td-stat { padding: 14px 20px; display: flex; flex-direction: column; gap: 2px; border-bottom: 1px solid var(--wt-divider); }
body.shell-v2 .td-stat:nth-child(odd) { border-right: 1px solid var(--wt-divider); }
body.shell-v2 .td-stat:nth-last-child(-n+2) { border-bottom: 0; }
body.shell-v2 .td-num { font-size: 22px; font-weight: 700; letter-spacing: -0.02em; color: var(--wt-text); }
body.shell-v2 .td-denom { font-size: 14px; font-weight: 500; color: var(--wt-muted); }
body.shell-v2 .td-up { font-size: 12px; color: var(--wt-success); }
body.shell-v2 .td-down { font-size: 12px; color: var(--wt-warning); }
body.shell-v2 .td-bar-wrap { padding: 14px 20px 8px; border-top: 1px solid var(--wt-divider); display: flex; flex-direction: column; gap: 8px; }
body.shell-v2 .td-bar { height: 8px; border-radius: var(--wt-radius-pill); background: var(--wt-surface-2); overflow: hidden; }
body.shell-v2 .td-bar > div { height: 100%; background: var(--primary); }
body.shell-v2 .td-empty { padding: 40px; color: var(--wt-muted); text-align: center; }
@media (max-width: 1100px) {
  body.shell-v2 .td-grid { grid-template-columns: 1fr; }
  body.shell-v2 .td-card.span2 { grid-column: auto; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   Phase 3a — shared components (2026-10-22). CSS only: re-skins the classes
   every page already uses (cards, stat tiles, tables, pills, chips, tabs,
   buttons, inputs, modals, empty states) so all 80 sections lift at once.
   Page-specific markup (inline styles, emoji headings, kanban, scorecards)
   waits for the 3b page passes. Every selector mirrors the shape of the
   style.css rule it replaces — including the body.dark ones — so it ties on
   specificity and wins on load order; nothing here needs !important.
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Page-body type ──────────────────────────────────────────────────── */
body.shell-v2 .content h1 { font-size: 22px; font-weight: 700; letter-spacing: -0.02em; color: var(--wt-text); }
body.shell-v2 .content h2 { font-size: 18px; font-weight: 700; letter-spacing: -0.01em; color: var(--wt-text); }
body.shell-v2 .content h3 { font-size: 15px; font-weight: 600; color: var(--wt-text); }
body.shell-v2 .content h4 { font-size: 13px; font-weight: 600; color: var(--wt-text-2); }
body.shell-v2 .section-title { font-size: 16px; font-weight: 600; color: var(--wt-text); margin-bottom: 14px; }
body.shell-v2 .section-subtitle { font-size: 13px; color: var(--wt-muted); margin-bottom: 14px; }
body.shell-v2 .greeting-header { font-size: 22px; font-weight: 700; letter-spacing: -0.02em; color: var(--wt-text); }
body.shell-v2 .insight-line { color: var(--wt-text-2); }
body.shell-v2 .insight-line strong { color: var(--wt-text); }
body.shell-v2 ::-webkit-scrollbar-thumb { background: rgba(14,10,46,.18); }
body.shell-v2.dark ::-webkit-scrollbar-thumb { background: rgba(242,242,247,.18); }

/* ── Cards ───────────────────────────────────────────────────────────── */
body.shell-v2 .card, body.shell-v2 .stat-card, body.shell-v2 .task-card,
body.shell-v2 .template-card, body.shell-v2 .kpi-card, body.shell-v2 .invoice-preview,
body.shell-v2 .sc-mini-card {
  background: var(--wt-surface); border: 1px solid var(--wt-border);
  border-radius: var(--wt-radius); box-shadow: none;
}
body.shell-v2 .card { padding: 20px 24px; margin-bottom: 20px; }
body.shell-v2 .card-header {
  margin-bottom: 18px; padding-bottom: 14px;
  border-bottom: 1px solid var(--wt-divider); color: var(--wt-text);
}
body.shell-v2 .card-title { font-size: 16px; font-weight: 600; color: var(--wt-text); }
body.shell-v2 .card-grid { gap: 16px; }
body.shell-v2 .card-grid .card { padding: 18px 20px; transition: border-color var(--transition); }
body.shell-v2 .card-grid .card:hover { box-shadow: none; border-color: var(--wt-faint); }
body.shell-v2 .template-card { padding: 18px 20px; }
body.shell-v2 .template-title { font-size: 15px; font-weight: 600; color: var(--wt-text); }
body.shell-v2 .task-card { border-left: 1px solid var(--wt-border); margin-bottom: 12px; }
body.shell-v2 .task-title { font-size: 15px; font-weight: 600; color: var(--wt-text); }
body.shell-v2 .notes-area { border-top-color: var(--wt-divider); }
body.shell-v2 .kpi-card { --card: var(--wt-surface); text-align: left; padding: 18px 20px; }
body.shell-v2 .kpi-card.accent { background: var(--primary); color: var(--on-primary); border-color: var(--primary); }
body.shell-v2 .kpi-value { font-size: 24px; font-weight: 700; letter-spacing: -0.02em; }
body.shell-v2 .kpi-label { font-size: 12px; color: var(--wt-muted); }
body.shell-v2 .kpi-card.accent .kpi-label { color: var(--on-primary); opacity: .8; }

/* Stat tiles: no colored top bar, no lift on hover, number leads */
body.shell-v2 .stat-grid { gap: 16px; margin-bottom: 24px; }
body.shell-v2 .stat-card { padding: 18px 20px; transition: border-color var(--transition); }
body.shell-v2 .stat-card::before { display: none; }
body.shell-v2 .stat-card:hover { transform: none; box-shadow: none; }
body.shell-v2 .stat-card.clickable-stat:hover { border-color: var(--primary); }
body.shell-v2 .stat-label { font-size: 12px; font-weight: 500; color: var(--wt-muted); text-transform: none; letter-spacing: 0; margin-bottom: 6px; }
body.shell-v2 .stat-value { font-size: 24px; font-weight: 700; letter-spacing: -0.02em; color: var(--wt-text); line-height: 1.1; }
body.shell-v2 .stat-sub { font-size: 12px; color: var(--wt-muted); margin-top: 4px; }

/* ── Tables ──────────────────────────────────────────────────────────── */
body.shell-v2 table { font-size: 14px; }
body.shell-v2 th, body.shell-v2 .skills-matrix th {
  padding: 11px 16px; font-size: 12px; font-weight: 600; letter-spacing: 0; text-transform: none;
  color: var(--wt-muted); background: transparent; border-bottom: 1px solid var(--wt-border);
}
body.shell-v2 td, body.shell-v2 .skills-matrix td { padding: 12px 16px; color: var(--wt-text); border-bottom: 1px solid var(--wt-divider); }
body.shell-v2 tr:hover td, body.shell-v2 .clickable-row:hover td, body.shell-v2 .sec-row:hover td,
body.shell-v2 .skills-matrix tr:hover td { background: var(--wt-surface-2); }
body.shell-v2 .th-sortable:hover { background: var(--wt-surface-2); }
body.shell-v2 .m-scroll thead th { background: var(--wt-surface); }
body.shell-v2 .sos-active-row, body.shell-v2 .sos-active-row td { background: var(--wt-danger-bg); }
body.shell-v2 .da-section-title { background: var(--wt-surface-2); }
body.shell-v2 .da-section-title:hover { background: var(--wt-divider); }

/* ── Pills & badges: color AND words, sentence case ───────────────────── */
body.shell-v2 .pill, body.shell-v2 .badge, body.shell-v2 .status-badge,
body.shell-v2 .time-chip, body.shell-v2 .m-chip, body.shell-v2 .stat-badge {
  display: inline-block; padding: 3px 10px; border-radius: var(--wt-radius-pill);
  font-size: 12px; font-weight: 600; line-height: 1.5; letter-spacing: 0; text-transform: none;
  white-space: nowrap; border: 0;
}
body.shell-v2 .m-chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; }
body.shell-v2 .pill-success, body.shell-v2 .status-badge.done, body.shell-v2 .badge-active, body.shell-v2 .m-chip-ok
  { background: var(--wt-success-bg); color: var(--wt-success); }
body.shell-v2 .pill-danger, body.shell-v2 .status-badge.canceled, body.shell-v2 .badge-suspended, body.shell-v2 .m-chip-alert
  { background: var(--wt-danger-bg); color: var(--wt-danger); }
body.shell-v2 .pill-warning { background: var(--wt-warning-bg); color: var(--wt-warning); }
body.shell-v2 .pill-info, body.shell-v2 .status-badge.active, body.shell-v2 .badge-owner
  { background: var(--primary-weak); color: var(--primary); }
body.shell-v2 .pill-muted, body.shell-v2 .badge-manager, body.shell-v2 .badge-employee,
body.shell-v2 .time-chip, body.shell-v2 .stat-badge
  { background: var(--wt-surface-2); color: var(--wt-text-2); }
body.shell-v2 .avatar, body.shell-v2 .msg-avatar { background: var(--primary-weak); color: var(--primary); }
/* Person-colored avatars (avatarHtml sets an inline hsl background): keep the
   initials white. The brand-blue text above was unreadable on red/green/purple. */
body.shell-v2 .avatar[style*="background:"], body.shell-v2 .msg-avatar[style*="background:"] { color: #fff; }

/* ── Filter chips & segmented tabs ───────────────────────────────────── */
body.shell-v2 .chip, body.shell-v2 .admin-tab {
  padding: 7px 12px; border: 1px solid var(--wt-border); border-radius: var(--wt-radius-pill);
  background: var(--wt-surface); color: var(--wt-text-2); font-size: 13px; font-weight: 500;
  transition: border-color var(--transition), color var(--transition);
}
body.shell-v2 .chip:hover, body.shell-v2 .admin-tab:hover { border-color: var(--wt-faint); color: var(--wt-text); }
body.shell-v2 .chip-active, body.shell-v2 .admin-tab.active,
body.shell-v2 .chip-active:hover, body.shell-v2 .admin-tab.active:hover
  { background: var(--wt-text); color: var(--wt-surface); border-color: var(--wt-text); font-weight: 600; }
body.shell-v2 .range-tabs, body.shell-v2 .reports-tabs { background: var(--wt-surface); border: 1px solid var(--wt-border); border-radius: 10px; padding: 3px; gap: 2px; }
body.shell-v2 .range-tab, body.shell-v2 .reports-tab {
  padding: 6px 14px; border-radius: 8px; font-size: 13px; font-weight: 500;
  color: var(--wt-text-2); border: 1px solid transparent; background: transparent; box-shadow: none;
}
body.shell-v2 .range-tab:hover, body.shell-v2 .reports-tab:hover { color: var(--wt-text); }
body.shell-v2 .range-tab.active, body.shell-v2 .reports-tab.active
  { background: var(--wt-surface-2); border-color: transparent; color: var(--primary); font-weight: 600; box-shadow: none; }

/* ── Buttons ─────────────────────────────────────────────────────────── */
body.shell-v2 .btn-sm {
  min-height: 34px; padding: 0 12px; gap: 6px; border-radius: var(--wt-radius-sm);
  font: inherit; font-size: 13px; font-weight: 600; line-height: 1.2;
  border: 1px solid transparent; transition: background var(--transition), border-color var(--transition), color var(--transition);
}
body.shell-v2 .btn-sm:disabled { opacity: .5; cursor: not-allowed; }
body.shell-v2 .btn-sm.primary { background: var(--primary); color: var(--on-primary); border: 1px solid var(--primary-border); }
body.shell-v2 .btn-sm.primary:hover { background: var(--primary-strong); }
/* outline = the neutral secondary button from the mock; ghost = bare text; cancel is neutral, not red */
body.shell-v2 .btn-sm.outline, body.shell-v2 .btn-sm.cancel {
  background: var(--wt-surface); border: 1px solid var(--wt-border); color: var(--wt-text);
}
body.shell-v2 .btn-sm.outline:hover { background: var(--wt-surface); border-color: var(--primary); color: var(--primary); }
body.shell-v2 .btn-sm.cancel { color: var(--wt-text-2); }
body.shell-v2 .btn-sm.cancel:hover { background: var(--wt-surface-2); border-color: var(--wt-border); color: var(--wt-text); }
body.shell-v2 .btn-sm.ghost { background: transparent; color: var(--wt-text-2); }
body.shell-v2 .btn-sm.ghost:hover { background: var(--wt-surface-2); color: var(--wt-text); }
body.shell-v2 .btn-sm.danger { background: var(--wt-surface); border: 1px solid var(--wt-border); color: var(--wt-danger); }
body.shell-v2 .btn-sm.danger:hover { background: var(--wt-danger-bg); border-color: var(--wt-danger); color: var(--wt-danger); }
body.shell-v2 .topbar-actions { gap: 8px; }
/* Topbar buttons keep their label on one line and their own width; the row
   may wrap between buttons on narrow screens, never inside one. */
body.shell-v2 .topbar-actions { flex-wrap: wrap; justify-content: flex-end; align-items: center; }
body.shell-v2 .topbar-actions .btn-sm { white-space: nowrap; flex: none; }
body.shell-v2 .topbar-actions .btn-sm.is-on { background: var(--primary-weak, color-mix(in srgb, var(--primary) 12%, var(--wt-surface))); border-color: var(--primary); color: var(--primary); }

/* ── Inputs ──────────────────────────────────────────────────────────── */
body.shell-v2 .form-input, body.shell-v2 .form-select, body.shell-v2 .form-textarea,
body.shell-v2 .modal-field input, body.shell-v2 .modal-field select, body.shell-v2 .modal-field textarea,
body.shell-v2 .field input, body.shell-v2 .field select, body.shell-v2 .field textarea,
body.shell-v2 .filter-bar select, body.shell-v2 .profile-field input, body.shell-v2 .color-input,
body.shell-v2 input.full, body.shell-v2 select.full, body.shell-v2 textarea.full, body.shell-v2 .notes-textarea, body.shell-v2 .compose-box textarea {
  padding: 8px 12px; border: 1px solid var(--wt-border); border-radius: var(--wt-radius-sm);
  background: var(--wt-surface); color: var(--wt-text);
  font-family: inherit; font-size: 14px; line-height: 1.4; outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}
body.shell-v2 .color-input { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; }
body.shell-v2 textarea.full { font-family: inherit; }
body.shell-v2 .form-input:focus, body.shell-v2 .form-select:focus, body.shell-v2 .form-textarea:focus,
body.shell-v2 .modal-field input:focus, body.shell-v2 .modal-field select:focus, body.shell-v2 .modal-field textarea:focus,
body.shell-v2 .field input:focus, body.shell-v2 .field select:focus, body.shell-v2 .field textarea:focus,
body.shell-v2 .filter-bar select:focus, body.shell-v2 .profile-field input:focus, body.shell-v2 .color-input:focus,
body.shell-v2 input.full:focus, body.shell-v2 select.full:focus, body.shell-v2 textarea.full:focus, body.shell-v2 .notes-textarea:focus, body.shell-v2 .compose-box textarea:focus {
  border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-weak);
}
body.shell-v2 .modal-field input[type="checkbox"], body.shell-v2 .modal-field input[type="radio"],
body.shell-v2 input[type="checkbox"], body.shell-v2 input[type="radio"] { accent-color: var(--primary); box-shadow: none; }
body.shell-v2 .form-label, body.shell-v2 .modal-field label, body.shell-v2 .profile-field label, body.shell-v2 .color-label
  { font-size: 13px; font-weight: 500; color: var(--wt-text-2); }
body.shell-v2 .form-hint, body.shell-v2 .profile-hint, body.shell-v2 .modal-check .mc-hint { font-size: 12px; color: var(--wt-muted); }
body.shell-v2 .modal-check .mc-title { font-weight: 500; color: var(--wt-text); }
body.shell-v2 .filter-bar { gap: 8px; margin-bottom: 16px; }
body.shell-v2 .filter-bar select { padding: 7px 10px; font-size: 13px; }
body.shell-v2 .compose-box { background: var(--wt-surface); border-color: var(--wt-border); border-radius: var(--wt-radius); }

/* ── Modals ──────────────────────────────────────────────────────────── */
body.shell-v2 .modal-overlay { background: rgba(14,10,46,.45); }
body.shell-v2 .modal, body.shell-v2 .modal-content {
  background: var(--wt-surface); color: var(--wt-text);
  border: 1px solid var(--wt-border); border-radius: var(--wt-radius);
  box-shadow: 0 24px 64px rgba(14,10,46,.25);
}
body.shell-v2 .modal { padding: 24px; }
body.shell-v2 .modal-header { margin-bottom: 16px; }
body.shell-v2 .modal-header h2, body.shell-v2 .modal-title { font-size: 16px; font-weight: 600; color: var(--wt-text); }
body.shell-v2 .modal-field { margin-bottom: 14px; }
body.shell-v2 .modal-footer { margin-top: 20px; gap: 8px; }
body.shell-v2 .branded-modal-header {
  background: var(--wt-surface); color: var(--wt-text);
  padding: 16px 24px; font-size: 16px; font-weight: 600;
  border-bottom: 1px solid var(--wt-divider);
}
body.shell-v2 .branded-modal-close, body.shell-v2 .modal-close {
  width: 32px; height: 32px; border-radius: var(--wt-radius-sm); font-size: 14px;
  background: transparent; border: 1px solid var(--wt-border); color: var(--wt-text-2);
}
body.shell-v2 .branded-modal-close:hover, body.shell-v2 .modal-close:hover
  { background: var(--wt-surface-2); border-color: var(--wt-border); color: var(--wt-text); }
body.shell-v2 .branded-modal-body { padding: 20px 24px; }
body.shell-v2 .branded-modal-footer { padding: 14px 24px; gap: 8px; background: var(--wt-surface); border-top: 1px solid var(--wt-divider); }
@media (max-width: 768px) {
  body.shell-v2 .modal-content { border-radius: var(--wt-radius) var(--wt-radius) 0 0 !important; border-bottom: 0; }
}

/* ── Empty states, info boxes, toasts, small shared bits ─────────────── */
body.shell-v2 .empty, body.shell-v2 .empty-state { padding: 40px 20px; font-size: 14px; line-height: 1.5; color: var(--wt-muted); }
body.shell-v2 .empty-sm { padding: 20px 16px; font-size: 13px; color: var(--wt-muted); }
body.shell-v2 .info-box, body.shell-v2 .link-box {
  background: var(--wt-surface-2); border: 1px solid var(--wt-border); border-radius: var(--wt-radius-sm); color: var(--wt-text);
}
body.shell-v2 .link-box { font-size: 12px; }
body.shell-v2 .toast {
  background: var(--wt-text); color: var(--wt-bg); border-radius: 10px;
  font-size: 14px; font-weight: 500; box-shadow: 0 12px 32px rgba(14,10,46,.3);
}
body.shell-v2 .toast.success { border-left: 3px solid var(--wt-success); }
body.shell-v2 .toast.error   { border-left: 3px solid var(--wt-danger); }
body.shell-v2 .progress-track, body.shell-v2 .member-bar-track, body.shell-v2 .inv-prev-line { background: var(--wt-divider); }
body.shell-v2 .progress-track { height: 8px; }
body.shell-v2 .message-post { border-bottom-color: var(--wt-divider); }
body.shell-v2 .message-post.pinned { background: var(--wt-warning-bg); border-left-color: var(--wt-warning); }
body.shell-v2 .msg-meta strong { color: var(--wt-text); }
body.shell-v2 .msg-body { color: var(--wt-text-2); }
body.shell-v2 .reply-thread { border-color: var(--wt-border); }
body.shell-v2 .m-section { border-top-color: var(--wt-border); }
body.shell-v2 .m-section-head { font-size: 16px; font-weight: 600; }
body.shell-v2 .notif-dropdown {
  background: var(--wt-surface); border: 1px solid var(--wt-border); border-radius: var(--wt-radius);
  box-shadow: 0 16px 48px rgba(14,10,46,.2);
}
body.shell-v2 .notif-dropdown-item { border-bottom-color: var(--wt-divider); }
body.shell-v2 .notif-dropdown-item:hover { background: var(--wt-surface-2); }
body.shell-v2 .notif-dropdown-item .notif-title { color: var(--wt-text); }
body.shell-v2 .notif-dropdown-item .notif-body { color: var(--wt-muted); }

/* ═══════════════════════════════════════════════════════════════════════════
   Phase 3b — shell fixes from the first Chrome look at dev (2026-10-22):
   sprite icons replace the header emoji and the theme-toggle emoji, and the
   sidebar footer collapses into one user row + account menu (mock Sidebar
   board). Everything under body.shell-v2 except the two toggling helpers.
   ═══════════════════════════════════════════════════════════════════════════ */
/* index.php carries both the emoji glyph and the sprite icon; each shell shows one */
.v2-icon { display: none; }
body.shell-v2 .v2-icon { display: inline-block; }
body.shell-v2 .v1-glyph { display: none; }

/* ── Header icon buttons (quick links, bell, hamburger) ─────────────── */
body.shell-v2 .notif-bell {
  width: 36px; height: 36px; padding: 0; margin-right: 0;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--wt-border); border-radius: var(--wt-radius-sm);
  background: var(--wt-surface); color: var(--wt-text-2); font-size: 0;
}
body.shell-v2 .notif-bell:hover { border-color: var(--primary); color: var(--wt-text); }
body.shell-v2 .notif-bell .wt-icon { width: 18px; height: 18px; }
body.shell-v2 .notif-bell .notif-count { top: -5px; right: -5px; font-size: 10px; background: var(--wt-danger); }
body.shell-v2 .hamburger-btn { color: var(--wt-text-2); }
body.shell-v2 .hamburger-btn .wt-icon { width: 22px; height: 22px; }

/* ── Sidebar footer: user row + account menu ─────────────────────────── */
body.shell-v2 .sidebar-footer { padding: 8px 12px 10px; gap: 0; overflow: visible; }
body.shell-v2 .sidebar-footer > .user-email { display: none; }
body.shell-v2 .acct-wrap { position: relative; }
body.shell-v2 .acct-btn {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 8px 10px; border: 0; border-radius: var(--wt-radius-sm);
  background: transparent; color: var(--wt-text); text-align: left; font: inherit; cursor: pointer;
}
body.shell-v2 .acct-btn:hover, body.shell-v2 .acct-btn[aria-expanded="true"] { background: var(--wt-surface-2); }
body.shell-v2 .acct-btn > .wt-icon { color: var(--wt-muted); }
body.shell-v2 .acct-avatar {
  width: 30px; height: 30px; border-radius: 50%; flex-shrink: 0;
  background: var(--primary-weak); color: var(--primary);
  font-size: 12px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center;
}
body.shell-v2 .acct-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
body.shell-v2 .acct-name, body.shell-v2 .acct-email { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
body.shell-v2 .acct-name { font-size: 13px; font-weight: 600; line-height: 1.3; }
body.shell-v2 .acct-email { font-size: 11px; color: var(--wt-muted); line-height: 1.3; }
body.shell-v2 .acct-menu {
  position: absolute; left: 0; right: 0; bottom: calc(100% + 6px); z-index: 60;
  display: flex; flex-direction: column; gap: 12px; padding: 12px;
  background: var(--wt-surface); border: 1px solid var(--wt-border); border-radius: var(--wt-radius);
  box-shadow: 0 16px 48px rgba(14,10,46,.22);
}
body.shell-v2 .acct-menu[hidden] { display: none; }
body.shell-v2 .acct-row { display: flex; flex-direction: column; gap: 6px; }
body.shell-v2 .acct-label { font-size: 11px; font-weight: 600; color: var(--wt-muted); text-transform: uppercase; letter-spacing: .04em; }
body.shell-v2 .acct-actions { display: flex; flex-direction: column; gap: 4px; padding-top: 10px; border-top: 1px solid var(--wt-divider); }
body.shell-v2 .acct-actions .btn-sm, body.shell-v2 .acct-actions .btn-logout {
  width: 100%; justify-content: flex-start; text-align: left; margin: 0 !important; font-size: 13px !important;
}
body.shell-v2 .acct-actions .btn-sm.ghost { color: var(--wt-text-2); padding: 8px 10px; }
body.shell-v2 .acct-actions .btn-sm.ghost:hover { background: var(--wt-surface-2); color: var(--wt-text); }

/* theme toggle → segmented control (beats body.branded-sidebar / body:not(.dark) rules on load order) */
body.shell-v2 .theme-toggle, body.shell-v2.dark .theme-toggle, body.shell-v2:not(.dark) .theme-toggle {
  height: 34px; margin: 0; border-radius: var(--wt-radius-sm);
  background: var(--wt-surface-2); border: 1px solid var(--wt-border);
}
body.shell-v2 .theme-toggle-slider, body.shell-v2.dark .theme-toggle-slider, body.shell-v2:not(.dark) .theme-toggle-slider {
  top: 2px; left: 2px; width: calc(50% - 2px); height: calc(100% - 4px);
  background: var(--wt-surface); border-radius: 6px; box-shadow: 0 1px 2px rgba(14,10,46,.14);
}
body.shell-v2 .theme-toggle-option, body.shell-v2.dark .theme-toggle-option:not(.active) { font-size: 13px; font-weight: 500; color: var(--wt-muted); gap: 6px; }
body.shell-v2 .theme-toggle-option.active, body.shell-v2.dark .theme-toggle-option.active, body.shell-v2:not(.dark) .theme-toggle-option.active { color: var(--wt-text); font-weight: 600; }
body.shell-v2 .theme-toggle-option .wt-icon { width: 15px; height: 15px; }

/* language picker (no inline style under v2) */
body.shell-v2 .lang-picker {
  width: 100%; padding: 7px 10px; font: inherit; font-size: 13px;
  border: 1px solid var(--wt-border); border-radius: var(--wt-radius-sm);
  background: var(--wt-surface); color: var(--wt-text);
}

/* ── Phase 3b · Work pass: Tasks ─────────────────────────────────────── */
body.shell-v2 .filter-bar.tf-top { margin-bottom: 10px; }
body.shell-v2 .tf-chips { display: flex; flex-wrap: wrap; gap: 6px; }
body.shell-v2 .tf-spacer { flex: 1; }
body.shell-v2 button.chip { font: inherit; font-size: 13px; cursor: pointer; line-height: 1.3; }
body.shell-v2 .card.card-flush { padding: 0; overflow: hidden; }
body.shell-v2 .card-flush > .card-header { padding: 14px 20px; margin: 0; border-bottom: 1px solid var(--wt-divider); }
body.shell-v2 .card-flush th:first-child, body.shell-v2 .card-flush td:first-child { padding-left: 20px; }
body.shell-v2 .card-flush th:last-child,  body.shell-v2 .card-flush td:last-child  { padding-right: 20px; }
body.shell-v2 .card-flush tbody tr:last-child td { border-bottom: 0; }
body.shell-v2 .card-flush .empty-state { margin: 0; }
body.shell-v2 .tbl-foot { padding: 10px 20px; font-size: 12px; color: var(--wt-muted); border-top: 1px solid var(--wt-divider); }
body.shell-v2 .tk-cell { min-width: 0; }
body.shell-v2 .tk-title { display: flex; align-items: center; gap: 8px; min-width: 0; font-weight: 600; color: var(--wt-text); }
body.shell-v2 .tk-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
body.shell-v2 .tk-sub { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin-top: 3px; padding-left: 16px; font-size: 12px; color: var(--wt-muted); }
body.shell-v2 .task-group-row .tk-sub { padding-left: 22px; }
body.shell-v2 .tk-sub > span:not(.tk-chip) + span:not(.tk-chip)::before { content: '·'; margin-right: 6px; color: var(--wt-faint); }
body.shell-v2 .tk-chip { display: inline-block; padding: 1px 8px; border-radius: var(--wt-radius-pill); font-size: 11px; font-weight: 600; line-height: 1.5; background: var(--wt-surface-2); color: var(--wt-text-2); white-space: nowrap; }
body.shell-v2 .tk-chip.warn { background: var(--wt-warning-bg); color: var(--wt-warning); }
body.shell-v2 .task-group-badge { margin-left: 2px; padding: 1px 8px; border-radius: var(--wt-radius-pill); font-size: 11px; font-weight: 600; letter-spacing: 0; background: var(--primary-weak); color: var(--primary); }
body.shell-v2 .group-chevron { display: inline-flex !important; align-items: center; color: var(--wt-muted); margin-right: 0 !important; }
body.shell-v2 .group-chevron .wt-icon { width: 14px; height: 14px; }
body.shell-v2 .task-group-row td, body.shell-v2 .task-group-row:hover td { background: var(--wt-surface-2); }
body.shell-v2 .th-sort-arrow { color: var(--wt-muted); }
body.shell-v2 .due-overdue { color: var(--wt-danger) !important; }
body.shell-v2 .priority-dot.urgent { background: var(--wt-danger); }
body.shell-v2 .priority-dot.high   { background: var(--wt-warning); }
body.shell-v2 .priority-dot.medium { background: var(--primary); }
body.shell-v2 .priority-dot.low    { background: var(--wt-faint); }

/* inline selects (priority / status / board project) → small bordered controls with a chevron */
body.shell-v2 .status-select, body.shell-v2 .priority-select, body.shell-v2 .board-topbar select,
body.shell-v2.dark .status-select, body.shell-v2.dark .priority-select, body.shell-v2.dark .board-topbar select {
  font: inherit; font-size: 13px; font-weight: 500; line-height: 1.3;
  padding: 5px 26px 5px 10px; border: 1px solid var(--wt-border); border-radius: var(--wt-radius-sm);
  background-color: var(--wt-surface); color: var(--wt-text); cursor: pointer; max-width: 100%;
  appearance: none; -webkit-appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%237C7C96' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='m6 9 6 6 6-6'/></svg>");
  background-repeat: no-repeat; background-position: right 8px center; background-size: 14px;
}
body.shell-v2 .status-select:hover, body.shell-v2 .priority-select:hover, body.shell-v2 .board-topbar select:hover { border-color: var(--wt-faint); }
body.shell-v2 .status-select:focus, body.shell-v2 .priority-select:focus, body.shell-v2 .board-topbar select:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-weak); }
body.shell-v2 .status-select[data-status="open"]        { color: var(--primary); }
body.shell-v2 .status-select[data-status="in_progress"] { color: var(--wt-warning); }
body.shell-v2 .status-select[data-status="review"]      { color: var(--wt-info); }
body.shell-v2 .status-select[data-status="done"]        { color: var(--wt-success); }
body.shell-v2 .status-select[data-status="canceled"]    { color: var(--wt-danger); }
body.shell-v2 .board-topbar select { padding-top: 7px; padding-bottom: 7px; }

/* pagination → quiet pills, active = ink (ties body.dark rules, wins on order) */
body.shell-v2 .tasks-pagination { gap: 4px; }
body.shell-v2 .tasks-pagination .pg-btn, body.shell-v2.dark .tasks-pagination .pg-btn {
  min-width: 30px; padding: 4px 8px; border-radius: 6px; font-size: 12px; font-weight: 500;
  border: 1px solid var(--wt-border); background: var(--wt-surface); color: var(--wt-text-2);
}
body.shell-v2 .tasks-pagination .pg-btn:hover, body.shell-v2.dark .tasks-pagination .pg-btn:hover { background: var(--wt-surface-2); border-color: var(--wt-border); color: var(--wt-text); }
body.shell-v2 .tasks-pagination .pg-btn.active, body.shell-v2.dark .tasks-pagination .pg-btn.active { background: var(--wt-text); color: var(--wt-surface); border-color: var(--wt-text); }
body.shell-v2 .tasks-pagination .pg-gap { color: var(--wt-faint); }

/* ── Phase 3b · Work pass: Board (kanban) ────────────────────────────── */
body.shell-v2 .board-topbar { margin-bottom: 16px; }
body.shell-v2 .kanban-wrapper { gap: 16px; }
body.shell-v2 .kanban-column, body.shell-v2.dark .kanban-column {
  background: var(--wt-surface-2); border: 1px solid var(--wt-border); border-radius: var(--wt-radius); padding: 10px;
}
body.shell-v2 .kanban-column-header {
  display: flex; align-items: center; gap: 8px; margin-bottom: 8px; padding: 6px 6px 8px;
  background: transparent; color: var(--wt-text); border-radius: 0;
  font-size: 13px; font-weight: 600; text-transform: none; letter-spacing: 0;
}
body.shell-v2 .kanban-column-header::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--kb-dot, var(--wt-faint)); flex-shrink: 0; }
body.shell-v2 .kanban-column-header.col-open        { --kb-dot: var(--primary); }
body.shell-v2 .kanban-column-header.col-in_progress { --kb-dot: var(--wt-warning); }
body.shell-v2 .kanban-column-header.col-review      { --kb-dot: var(--wt-info); }
body.shell-v2 .kanban-column-header.col-done        { --kb-dot: var(--wt-success); }
body.shell-v2 .kanban-column-header .col-count, body.shell-v2.dark .kanban-column-header .col-count {
  margin-left: auto; min-width: 22px; height: 20px; border-radius: var(--wt-radius-pill);
  background: var(--wt-surface); border: 1px solid var(--wt-border); color: var(--wt-muted); font-size: 11px; font-weight: 600;
}
body.shell-v2 .kanban-card, body.shell-v2.dark .kanban-card {
  background: var(--wt-surface); color: var(--wt-text); border: 1px solid var(--wt-border); border-radius: 10px;
  padding: 12px 14px; box-shadow: none; transition: border-color var(--transition), opacity .15s;
}
body.shell-v2 .kanban-card:hover { border-color: var(--wt-faint); }
body.shell-v2 .kanban-card-title { font-size: 14px; font-weight: 600; margin-bottom: 8px; }
body.shell-v2 .kanban-card-meta, body.shell-v2.dark .kanban-card-meta { color: var(--wt-muted); font-size: 12px; }
body.shell-v2 .kanban-add-btn, body.shell-v2.dark .kanban-add-btn { border: 1px dashed var(--wt-border); border-radius: 10px; color: var(--wt-muted); font-weight: 500; }
body.shell-v2 .kanban-add-btn:hover, body.shell-v2.dark .kanban-add-btn:hover { border-color: var(--primary); color: var(--primary); }
body.shell-v2 .kanban-column.drag-over { background: var(--primary-weak); outline: 2px dashed var(--primary); }
body.shell-v2 .kanban-cards.drag-over, body.shell-v2.dark .kanban-cards.drag-over { background: transparent; }
/* style.css has `body.dark button:not(.btn-sm)…{ color: inherit }` at (0,5,2); the ink-filled
   chip / page button must keep its surface-colored text in dark mode */
body.shell-v2 .chip-active, body.shell-v2 .admin-tab.active, body.shell-v2 .tasks-pagination .pg-btn.active { color: var(--wt-surface) !important; }

/* ── Phase 3b · People pass: Members, Announcements ──────────────────── */
body.shell-v2 .filter-bar .form-input { width: auto; flex: 0 1 280px; min-width: 180px; padding: 7px 12px; font-size: 13px; }
body.shell-v2 .mem-cell { display: flex; align-items: center; gap: 12px; min-width: 0; }
body.shell-v2 .mem-cell .avatar { margin: 0; }
body.shell-v2 .mem-text { display: flex; flex-direction: column; min-width: 0; }
body.shell-v2 .mem-name { font-weight: 600; color: var(--wt-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
body.shell-v2 .mem-email { font-size: 12px; color: var(--wt-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
body.shell-v2 .mem-done { color: var(--wt-text); font-weight: 600; }
body.shell-v2 .member-suspended { opacity: 1; }
body.shell-v2 .member-suspended td { color: var(--wt-muted) !important; }
body.shell-v2 .member-suspended .mem-name { color: var(--wt-muted); }
body.shell-v2 .member-disabled-badge { font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: var(--wt-radius-pill); background: var(--wt-danger-bg); color: var(--wt-danger); }
body.shell-v2 .role-select, body.shell-v2 .etype-select, body.shell-v2.dark .role-select, body.shell-v2.dark .etype-select {
  font: inherit; font-size: 13px; font-weight: 500; line-height: 1.3;
  padding: 5px 26px 5px 10px; border: 1px solid var(--wt-border); border-radius: var(--wt-radius-sm);
  background-color: var(--wt-surface); color: var(--wt-text); cursor: pointer; max-width: 100%;
  appearance: none; -webkit-appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%237C7C96' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='m6 9 6 6 6-6'/></svg>");
  background-repeat: no-repeat; background-position: right 8px center; background-size: 14px;
}
body.shell-v2 .role-select:hover, body.shell-v2 .etype-select:hover { border-color: var(--wt-faint); }
body.shell-v2 .role-select:focus, body.shell-v2 .etype-select:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-weak); }
body.shell-v2 th.th-actions { width: 56px; }
body.shell-v2 .td-actions { text-align: right; }
body.shell-v2 .row-menu { position: relative; display: inline-block; }
body.shell-v2 .row-menu-btn { width: 34px; padding: 0; justify-content: center; border: 1px solid transparent; }
body.shell-v2 .row-menu-btn[aria-expanded="true"], body.shell-v2 .row-menu-btn:hover { background: var(--wt-surface-2); border-color: var(--wt-border); color: var(--wt-text); }
body.shell-v2 .row-menu-pop {
  position: absolute; right: 0; top: calc(100% + 4px); z-index: 40; min-width: 200px;
  display: flex; flex-direction: column; gap: 2px; padding: 6px;
  background: var(--wt-surface); border: 1px solid var(--wt-border); border-radius: var(--wt-radius-sm);
  box-shadow: 0 12px 32px rgba(14,10,46,.18); text-align: left;
}
body.shell-v2 .row-menu-pop[hidden] { display: none; }
body.shell-v2 .row-menu-pop .btn-sm { width: 100%; justify-content: flex-start; text-align: left; border-color: transparent; background: transparent; font-weight: 500; }
body.shell-v2 .row-menu-pop .btn-sm:hover { background: var(--wt-surface-2); border-color: transparent; }
body.shell-v2 .row-menu-pop .btn-sm.danger { color: var(--wt-danger); }
body.shell-v2 .row-menu-pop .btn-sm.danger:hover { background: var(--wt-danger-bg); }
body.shell-v2 .row-menu-pop .btn-sm.primary { color: var(--primary); }
body.shell-v2 .card-flush .paged-pager { padding: 0 !important; border: 0 !important; font-size: 12px; color: var(--wt-muted); }
body.shell-v2 .card-flush .paged-pager .btn-sm { min-height: 28px; padding: 0 8px; font-size: 12px; }
body.shell-v2 .card-flush .clickable-row td { cursor: pointer; }
body.shell-v2 .tk-chip.info { background: var(--primary-weak); color: var(--primary); }

/* announcements */
body.shell-v2 .announcement-card { border: 1px solid var(--wt-border); border-radius: var(--wt-radius); padding: 18px 20px; margin-bottom: 12px; background: var(--wt-surface); }
body.shell-v2 .announcement-card:hover { box-shadow: none; }
body.shell-v2 .ann-pinned, body.shell-v2 .ann-unread, body.shell-v2 .ann-pinned.ann-unread { border-left: 1px solid var(--wt-border); background: var(--wt-surface); }
body.shell-v2 .ann-unread { border-color: var(--primary); }
body.shell-v2 .ann-title { font-size: 15px; font-weight: 600; color: var(--wt-text); display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; }
body.shell-v2 .ann-actions .btn-sm { width: 32px; min-height: 32px; padding: 0; justify-content: center; }
body.shell-v2 .ann-body { color: var(--wt-text-2); }
body.shell-v2 .ann-meta { color: var(--wt-muted); }
body.shell-v2 .read-count { display: inline-flex; align-items: center; gap: 4px; }
body.shell-v2 .read-count .wt-icon { width: 14px; height: 14px; }

/* ── Sidebar brand mark (shell v2): the real WorkTrac logo instead of the ▲ glyph ── */
body.shell-v2 .sidebar-header { display: flex; align-items: center; gap: 8px; }
body.shell-v2 .wt-logo { width: 28px; height: 28px; margin: -3px 0; flex-shrink: 0; }
/* dark sidebar: outline the indigo half so the triangle keeps its edge */
body.shell-v2.dark .wt-logo .wt-logo-tri { stroke: #9C94E0; stroke-width: 3.5; }

/* ── Phase 3b · Time pass: Clock, Timesheets, Schedule, Shifts ──────── */
body.shell-v2 .wt-banner { border: 1px solid var(--wt-border); border-radius: var(--wt-radius); background: var(--wt-surface); padding: 14px 18px; }
body.shell-v2 .wt-banner.warn { border-color: var(--wt-warning); background: var(--wt-warning-bg); }
body.shell-v2 .wt-banner-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
body.shell-v2 .wt-banner.warn > .wt-banner-row > .wt-icon { color: var(--wt-warning); }
body.shell-v2 .wt-banner-text { flex: 1; min-width: 200px; display: flex; flex-direction: column; gap: 2px; }
body.shell-v2 .wt-banner-text strong { color: var(--wt-text); }
body.shell-v2 .wt-banner-text span { font-size: 13px; color: var(--wt-text-2); }
body.shell-v2 .wt-banner-details { margin-top: 10px; }
body.shell-v2 .wt-banner-details summary { cursor: pointer; font-size: 12px; color: var(--wt-muted); }
body.shell-v2 .wt-banner-line { padding: 4px 0; font-size: 13px; border-top: 1px solid var(--wt-divider); }
body.shell-v2 .warn-text { color: var(--wt-warning); }
body.shell-v2 .tf-label { font-size: 13px; color: var(--wt-muted); }
body.shell-v2 .filter-bar input[type="date"].form-input { width: auto; flex: 0 0 auto; min-width: 0; }
body.shell-v2 .ws-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; }
body.shell-v2 .ws-tile { border: 1px solid var(--wt-border); border-radius: var(--wt-radius-sm); padding: 12px 14px; background: var(--wt-surface); }
body.shell-v2 .ws-name { font-weight: 600; color: var(--wt-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
body.shell-v2 .ws-total { font-size: 20px; font-weight: 700; letter-spacing: -0.02em; margin-top: 4px; color: var(--wt-text); }
body.shell-v2 .ws-sub { font-size: 12px; color: var(--wt-muted); }
body.shell-v2 .te-table { width: 100%; border-collapse: collapse; }
body.shell-v2 .te-table th { text-align: left; }
body.shell-v2 .te-deleted td { opacity: .55; text-decoration: line-through; }
body.shell-v2 .timer-chip { display: inline-block; padding: 2px 8px; border-radius: var(--wt-radius-pill); background: var(--wt-surface-2); color: var(--wt-text-2); font-size: 12px; font-weight: 600; }
body.shell-v2 .timer-chip.running { background: var(--wt-success-bg); color: var(--wt-success); }
body.shell-v2 .icon-btn { width: 32px; min-height: 32px; padding: 0; justify-content: center; }
body.shell-v2 .icon-btn.danger-text { color: var(--wt-danger); }
body.shell-v2 .icon-btn.danger-text:hover { background: var(--wt-danger-bg); color: var(--wt-danger); }
body.shell-v2 .stat-grid.ts-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
body.shell-v2 .stat-card.attention { border-color: var(--wt-warning); }
body.shell-v2 .ts-status { padding: 3px 10px; border-radius: var(--wt-radius-pill); font-size: 12px; font-weight: 600; text-transform: capitalize; }
body.shell-v2 .ts-status-submitted { background: var(--wt-warning-bg); color: var(--wt-warning); }
body.shell-v2 .ts-status-approved  { background: var(--wt-success-bg); color: var(--wt-success); }
body.shell-v2 .ts-status-rejected  { background: var(--wt-danger-bg);  color: var(--wt-danger); }
body.shell-v2 .ts-reopen-badge { background: var(--wt-warning-bg) !important; color: var(--wt-warning) !important; }
/* schedule */
body.shell-v2 .wk-nav { display: inline-flex; align-items: center; border: 1px solid var(--wt-border); border-radius: var(--wt-radius-sm); background: var(--wt-surface); overflow: hidden; }
body.shell-v2 .wk-btn { width: 36px; height: 36px; border: 0; background: transparent; color: var(--wt-text-2); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
body.shell-v2 .wk-btn:hover { background: var(--wt-surface-2); color: var(--wt-text); }
body.shell-v2 .wk-label { padding: 0 14px; font-weight: 600; line-height: 36px; color: var(--wt-text); border-left: 1px solid var(--wt-border); border-right: 1px solid var(--wt-border); }
body.shell-v2 .sched-day { padding: 0; overflow: hidden; margin-bottom: 0; }
body.shell-v2 .sched-day-head { border-bottom-color: var(--wt-divider) !important; color: var(--wt-text); }
body.shell-v2 .sched-day.is-today { border-color: var(--primary); }
body.shell-v2 .sched-day.is-today .sched-day-head { background: var(--primary-weak); color: var(--primary); }

/* ── Phase 3b · Money pass: Estimates, Invoicing, Job costing, Job health, Payroll, Service plans ── */
body.shell-v2 .inv-tabs { display: inline-flex; gap: 2px; padding: 3px; margin-bottom: 16px; border: 1px solid var(--wt-border); border-radius: 10px; background: var(--wt-surface); }
body.shell-v2 .inv-tab { padding: 6px 14px; margin-bottom: 0; border-radius: 8px; font-size: 13px; font-weight: 500; color: var(--wt-text-2); border: 1px solid transparent; }
body.shell-v2 .inv-tab:hover { color: var(--wt-text); }
body.shell-v2 .inv-tab.active { background: var(--wt-surface-2); color: var(--primary); font-weight: 600; border-bottom-color: transparent; }
body.shell-v2 .invoice-row { box-shadow: none !important; border: 1px solid var(--wt-border); border-radius: var(--wt-radius) !important; transition: border-color var(--transition); }
body.shell-v2 .invoice-row:hover { border-color: var(--wt-faint); box-shadow: none !important; transform: none !important; }
body.shell-v2 .inv-status { padding: 3px 10px; border-radius: var(--wt-radius-pill); font-size: 12px; font-weight: 600; }
body.shell-v2 .inv-status-draft, body.shell-v2 .inv-status-fully_credited, body.shell-v2 .inv-status-refunded { background: var(--wt-surface-2); color: var(--wt-text-2); }
body.shell-v2 .inv-status-sent { background: var(--primary-weak); color: var(--primary); }
body.shell-v2 .inv-status-paid { background: var(--wt-success-bg); color: var(--wt-success); }
body.shell-v2 .inv-status-overdue { background: var(--wt-danger-bg); color: var(--wt-danger); }
body.shell-v2 .inv-status-partially_credited { background: var(--wt-warning-bg); color: var(--wt-warning); }
body.shell-v2 .stat-grid.money-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin-bottom: 16px; }
body.shell-v2 .jc-hub-callout { background: var(--wt-surface) !important; border: 1px solid var(--wt-border) !important; border-radius: var(--wt-radius) !important; }
body.shell-v2 .jh-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 8px; vertical-align: middle; }
body.shell-v2 .btn-sm.warning { background: var(--wt-surface); border: 1px solid var(--wt-border); color: var(--wt-warning); }
body.shell-v2 .btn-sm.warning:hover { background: var(--wt-warning-bg); border-color: var(--wt-warning); }
body.shell-v2 .btn-sm.success { background: var(--wt-surface); border: 1px solid var(--wt-border); color: var(--wt-success); }
body.shell-v2 .btn-sm.success:hover { background: var(--wt-success-bg); border-color: var(--wt-success); }
body.shell-v2 .range-tabs, body.shell-v2 .reports-tabs { width: fit-content; max-width: 100%; }
body.shell-v2 .resp-cards td[data-label=""] { white-space: nowrap; }

/* ── Phase 3b · Clients pass: client / subcontractor cards, activity lists, partners, marketplace ── */
body.shell-v2 .cl-card { padding: 18px 20px; cursor: pointer; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
body.shell-v2 .cl-card:hover { border-color: var(--wt-faint); }
body.shell-v2 .cl-head { display: flex; align-items: flex-start; gap: 12px; }
body.shell-v2 .cl-avatar { width: 40px; height: 40px; border-radius: 10px; flex-shrink: 0; background: var(--primary-weak); color: var(--primary); font-size: 13px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }
body.shell-v2 .cl-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
body.shell-v2 .cl-name { font-weight: 600; font-size: 15px; color: var(--wt-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
body.shell-v2 .cl-sub { font-size: 12px; color: var(--wt-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
body.shell-v2 .cl-contact { font-size: 12px; color: var(--wt-muted); border-top: 1px solid var(--wt-divider); padding-top: 10px; }
body.shell-v2 .act-row { padding: 12px 20px; border-top: 1px solid var(--wt-divider); font-size: 13px; }
body.shell-v2 .card-flush .act-row:first-child { border-top: 0; }
body.shell-v2 .act-line { color: var(--wt-text); }
body.shell-v2 .act-line strong { color: var(--wt-text); }
body.shell-v2 .act-line em { font-style: normal; font-weight: 500; }
body.shell-v2 .act-meta { color: var(--wt-muted); }
body.shell-v2 .act-body { color: var(--wt-text-2); margin-top: 3px; }
body.shell-v2 .card-flush > .empty-sm, body.shell-v2 .card-flush > #clientActivity > .empty-sm, body.shell-v2 .card-flush > #subActivity > .empty-sm { padding: 20px; }
body.shell-v2 .card-flush #subActivity > div, body.shell-v2 .card-flush #clientActivity > div:not(.act-row):not(.spinner-wrap) { padding-left: 20px; padding-right: 20px; }
body.shell-v2 .cl-head { flex-wrap: wrap; }
body.shell-v2 .cl-text { flex: 1 1 150px; }
body.shell-v2 .cl-head > .flex { margin-left: auto; }
body.shell-v2 .cl-card .cl-name { white-space: normal; overflow: visible; line-height: 1.3; }
body.shell-v2 .card-flush #subActivity { padding: 4px 20px 8px; }

/* ── Phase 3b · Field pass: Live map panel, proof chain, inventory ────── */
body.shell-v2 .lm-wrap { display: flex; gap: 20px; height: calc(100vh - 150px); min-height: 480px; }
body.shell-v2 .lm-map { flex: 1; min-width: 0; border: 1px solid var(--wt-border); border-radius: var(--wt-radius); overflow: hidden; background: var(--wt-surface-2); }
body.shell-v2 .lm-side { width: 300px; flex-shrink: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 16px; }
body.shell-v2 .lm-card { margin-bottom: 0; flex-shrink: 0; }
body.shell-v2 .lm-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
body.shell-v2 .lm-tools { display: flex; align-items: center; gap: 6px; }
body.shell-v2 .lm-live { animation: pulse 1.5s infinite; }
body.shell-v2 .lm-list { padding: 8px 20px 12px; font-size: 13px; color: var(--wt-text-2); }
body.shell-v2 .lm-opt { display: flex; align-items: center; gap: 8px; padding: 10px 20px 14px; border-top: 1px solid var(--wt-divider); font-size: 13px; color: var(--wt-text-2); cursor: pointer; }
body.shell-v2 .lm-hist { padding: 12px 20px; display: flex; flex-direction: column; gap: 8px; border-bottom: 1px solid var(--wt-divider); }
body.shell-v2 .lm-dates { display: flex; gap: 8px; }
body.shell-v2 .lm-dates .form-input { flex: 1; min-width: 0; width: 100%; }
body.shell-v2 .lm-list:empty { display: none; }
@media (max-width: 1000px) {
  body.shell-v2 .lm-wrap { flex-direction: column; height: auto; }
  body.shell-v2 .lm-map { min-height: 420px; }
  body.shell-v2 .lm-side { width: auto; }
}

/* ── Phase 3b · Safety pass: incidents, confidential reports, climate, SOS ── */
body.shell-v2 .stat-card { border-top-width: 1px !important; border-top-color: var(--wt-border) !important; }
body.shell-v2 .stat-card.attention { border-top-color: var(--wt-warning) !important; border-color: var(--wt-warning); }
/* the four quick-range rows (Today · Last 7d · …) render as ghost buttons with inline sizes; make them chips */
body.shell-v2 .btn-sm.ghost[data-days] {
  font-size: 13px !important; padding: 6px 12px !important; min-height: 0;
  border: 1px solid var(--wt-border); border-radius: var(--wt-radius-pill); background: var(--wt-surface); color: var(--wt-text-2); font-weight: 500;
}
body.shell-v2 .btn-sm.ghost[data-days]:hover { border-color: var(--wt-faint); color: var(--wt-text); background: var(--wt-surface); }
body.shell-v2 .btn-sm.ghost[data-days].active, body.shell-v2 .btn-sm.ghost[data-days].chip-active { background: var(--wt-text); color: var(--wt-surface) !important; border-color: var(--wt-text); }
body.shell-v2 .sos-clear { margin-bottom: 20px; padding: 36px 20px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 6px; }
body.shell-v2 .sos-clear-ico { width: 40px; height: 40px; color: var(--wt-success); margin-bottom: 6px; }
body.shell-v2 .sos-clear-title { font-size: 16px; font-weight: 600; color: var(--wt-success); }
body.shell-v2 .sos-clear-sub { font-size: 13px; color: var(--wt-muted); }

/* ── Phase 3b · Reports pass: inner tabs, export buttons, audit rows ──── */
body.shell-v2 .reports-tab { display: inline-flex; align-items: center; gap: 6px; }
body.shell-v2 .reports-tab .wt-icon.sm { width: 15px; height: 15px; }
body.shell-v2 .topbar-actions .btn-sm .wt-icon.sm { width: 15px; height: 15px; }
body.shell-v2 .audit-action { text-transform: capitalize; }
body.shell-v2 .audit-row .tk-chip { margin-left: 4px; }

/* ── Phase 3b · Settings pass: branding contrast line, preview, headings ── */
body.shell-v2 .brand-contrast { display: flex; align-items: center; gap: 8px; margin-top: 10px; font-size: 12px; color: var(--wt-muted); }
body.shell-v2 .brand-contrast:empty { display: none; }
body.shell-v2 .brand-contrast.ok { color: var(--wt-success); }
body.shell-v2 .brand-contrast.warn { color: var(--wt-warning); }
body.shell-v2 .brand-contrast.bad { color: var(--wt-danger); }
body.shell-v2 .brand-contrast .wt-icon { width: 15px; height: 15px; flex-shrink: 0; }
body.shell-v2 #dashPreviewWrap { box-shadow: none !important; border-color: var(--wt-border) !important; }
body.shell-v2 .dp-stat > div:first-child, body.shell-v2 .dp-topbar > div:first-child { display: none; }
body.shell-v2 .prev-mode { display: inline-flex; align-items: center; gap: 5px; }
body.shell-v2 .tfa-cta .wt-icon.sm { width: 15px; height: 15px; vertical-align: -2px; }

/* ── Phase 4 · Branding appearance setting ─────────────────────────── */
.appearance-row { margin-top: 18px; }
.appearance-opts { display: flex; flex-wrap: wrap; gap: 8px; }
.appearance-opt { display: inline-flex; align-items: center; gap: 8px; padding: 8px 12px; border: 1px solid var(--border); border-radius: 8px; font-size: 13px; cursor: pointer; }
body.shell-v2 .appearance-opt { border-color: var(--wt-border); color: var(--wt-text); }
body.shell-v2 .appearance-opt:has(input:checked) { border-color: var(--primary); background: var(--primary-weak); }

/* ── Phase 4 · client card metrics + invoices table ──────────────────── */
body.shell-v2 .cl-metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; border-top: 1px solid var(--wt-divider); padding-top: 10px; }
body.shell-v2 .cl-metrics > span { display: flex; flex-direction: column; min-width: 0; }
body.shell-v2 .cl-metric-label { font-size: 11px; color: var(--wt-muted); }
body.shell-v2 .cl-metric-val { font-weight: 600; color: var(--wt-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
body.shell-v2 .card-flush .tk-cell .tk-title { font-size: 14px; }
body.shell-v2 .card-flush .tk-sub { padding-left: 0; }

/* ═══════════════════════════════════════════════════════════════════════════
   Phase 3c — layout pass (2026-10-23). The page compositions from the mock
   that 3b's visual pass did not reach: Tasks columns, Clients chips + card
   actions, Timesheets weekly grid, Incidents master-detail. Every rule is
   under body.shell-v2; the classic shell is untouched.
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Tasks: five mock columns, the Task column keeps real width ─────── */
/* The table is table-layout: fixed; the % columns leave the remainder to
   Task, and a min-width + the wrap's overflow-x stop that remainder from
   collapsing to nothing at narrow viewports. */
body.shell-v2 #tasksTableWrap { overflow-x: auto; }
body.shell-v2 .tk-table { min-width: 820px; }
body.shell-v2 .tk-table .tk-project, body.shell-v2 .tk-table .tk-due { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
body.shell-v2 .tk-table .tk-due .tk-chip { vertical-align: 1px; }
body.shell-v2 .tk-due-day { display: block; white-space: normal; }
body.shell-v2 .tk-due-day .tk-chip { white-space: nowrap; }
body.shell-v2 .tk-due-time { display: block; font-size: 12px; color: var(--wt-muted); }
body.shell-v2 .tk-none { color: var(--wt-faint); }
body.shell-v2 .tk-who { min-width: 0; }
body.shell-v2 .tk-who-wrap { display: flex; align-items: center; gap: 8px; min-width: 0; }
body.shell-v2 .tk-who-wrap > * { flex-shrink: 0; }
body.shell-v2 .tk-who-wrap .text-body { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Tasks: the four selects behind a Filters button */
body.shell-v2 .tf-right { display: flex; align-items: center; gap: 8px; flex-shrink: 0; margin-left: auto; }
body.shell-v2 .tf-toggle { gap: 6px; }
body.shell-v2 .tf-toggle.is-set { border-color: var(--primary); color: var(--primary); }
body.shell-v2 .filter-bar.tf-more { margin-top: -2px; }
body.shell-v2 .filter-bar.tf-more[hidden] { display: none; }

/* ── Clients: chip row + per-card actions ────────────────────────────── */
body.shell-v2 .filter-bar.tf-top #clientSearch { width: 240px; flex: 0 1 240px; }
body.shell-v2 .cl-actions { display: flex; gap: 8px; margin-top: 2px; }
body.shell-v2 .cl-actions .btn-sm { min-height: 32px; padding: 0 12px; font-size: 13px; }

/* ── Timesheets: the week board ──────────────────────────────────────── */
body.shell-v2 .tsw { display: flex; flex-direction: column; gap: 16px; margin-bottom: 24px; }
body.shell-v2 .tsw .filter-bar.tf-top { margin-bottom: 0; }
body.shell-v2 .tsw-bar .wk-nav { margin-right: 4px; }
body.shell-v2 .wk-btn:disabled { opacity: .4; cursor: default; }
body.shell-v2 .wk-btn:disabled:hover { background: transparent; }
body.shell-v2 .stat-grid.tsw-tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin: 0; }
body.shell-v2 .tsw-tiles .stat-sub { font-size: 12px; color: var(--wt-muted); margin-top: 2px; }
body.shell-v2 .tsw-card { margin-bottom: 0; }
body.shell-v2 .tsw-table { width: 100%; border-collapse: collapse; min-width: 860px; }
body.shell-v2 .tsw-table th.tsw-day, body.shell-v2 .tsw-table td.tsw-day { text-align: center; width: 60px; padding-left: 6px; padding-right: 6px; }
body.shell-v2 .tsw-table th .tsw-date { display: block; font-weight: 500; color: var(--wt-faint); font-size: 11px; }
body.shell-v2 .tsw-table th.is-today, body.shell-v2 .tsw-table td.is-today { background: var(--primary-weak); }
body.shell-v2 .tsw-table th.is-today { color: var(--primary); }
body.shell-v2 .tsw-table th.is-today .tsw-date { color: var(--primary); }
body.shell-v2 .tsw-table td.tsw-day { color: var(--wt-text-2); font-variant-numeric: tabular-nums; }
body.shell-v2 .tsw-table td.tsw-long { color: var(--wt-warning); font-weight: 600; }
body.shell-v2 .tsw-dash { color: var(--wt-faint); }
body.shell-v2 .tsw-table th.tsw-total, body.shell-v2 .tsw-table td.tsw-total { text-align: right; font-weight: 600; color: var(--wt-text); white-space: nowrap; padding-right: 16px; }
body.shell-v2 .tsw-ot { font-weight: 500; font-size: 12px; }
body.shell-v2 .tsw-table .mem-sub { font-size: 12px; color: var(--wt-muted); }
body.shell-v2 .tsw-actions { text-align: right; white-space: nowrap; }
body.shell-v2 .tsw-actions .btn-sm + .btn-sm { margin-left: 6px; }
body.shell-v2 .tsw-by { font-size: 12px; color: var(--wt-muted); margin-right: 6px; }
body.shell-v2 .ts-status-none { background: var(--wt-surface-2); color: var(--wt-muted); }
body.shell-v2 .tsw .empty-sm { padding: 20px; }
@media (max-width: 1100px) { body.shell-v2 .stat-grid.tsw-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ── Reports: the mock's two-column card grid ────────────────────────── */
/* The tab body becomes the grid; the existing .chart-grid-2 wrappers
   dissolve into it (display: contents) so every card is one cell. Stat
   tiles, upsells and the cards marked .rp-wide (wide tables, compliance
   score, empty states) span both columns. */
body.shell-v2 .rp-body { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; align-items: start; }
body.shell-v2 .rp-body > .chart-grid-2 { display: contents; }
body.shell-v2 .rp-body > .stat-grid, body.shell-v2 .rp-body > .rp-wide, body.shell-v2 .rp-body > .spinner-wrap, body.shell-v2 .rp-body > .empty-state, body.shell-v2 .rp-body > .upsell-card { grid-column: 1 / -1; }
body.shell-v2 .rp-body .card, body.shell-v2 .rp-body .stat-grid { margin-bottom: 0; }
body.shell-v2 .rp-body > .stat-grid { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }   /* Work's six tiles on one row */
body.shell-v2 .rp-body > .card[style*="max-width:520px"] { max-width: none !important; }
body.shell-v2 .rp-body > .card.rp-wide[style*="margin:48px auto"] { margin: 24px auto !important; }
@media (max-width: 1000px) { body.shell-v2 .rp-body { grid-template-columns: minmax(0, 1fr); } }

/* ── Walkthrough polish (Oct 23 2026): nothing clipped, nothing smushed ── */
/* Today: row sub-lines and the utilization line wrap to two lines instead of
   cutting off job names mid-word */
body.shell-v2 .td-main .td-sub { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; line-height: 1.35; }
body.shell-v2 .td-bar-wrap .td-sub { white-space: normal; overflow: visible; }
/* Clients: the company line under the name wraps */
body.shell-v2 .cl-sub { white-space: normal; overflow: visible; line-height: 1.3; }
/* Job costing: the Labor and Expenses tables are seven columns each, too
   wide for half a page, so they stack full-width instead of overflowing */
body.shell-v2 .grid-2 > .card { min-width: 0; }
body.shell-v2 .grid-2:has(#expTableSlot), body.shell-v2 .grid-2:has(#laborTableSlot) { grid-template-columns: minmax(0, 1fr); }
body.shell-v2 #expTableSlot, body.shell-v2 #laborTableSlot { overflow-x: auto; }
body.shell-v2 #expTableSlot table, body.shell-v2 #laborTableSlot table { width: 100%; }
body.shell-v2 #expTableSlot td, body.shell-v2 #expTableSlot th, body.shell-v2 #laborTableSlot td, body.shell-v2 #laborTableSlot th { white-space: nowrap; }
/* Disabled buttons (Redeem with too few points) stay readable */
body.shell-v2 .btn-sm:disabled, body.shell-v2.dark .btn-sm:disabled { opacity: .6; background: var(--wt-surface-2); color: var(--wt-muted); border: 1px solid var(--wt-border); cursor: not-allowed; }
/* Schedule week view: task cards wrap their title to two lines and keep the
   small lines readable (they were 9–10px) */
body.shell-v2 .sched-day [style*="text-overflow"] { white-space: normal !important; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; line-height: 1.3; }
body.shell-v2 .sched-day [style*="font-size:10px"], body.shell-v2 .sched-day [style*="font-size:9px"] { font-size: 11px !important; }
/* Confidential reports + Work proof: long descriptions wrap to two lines */
body.shell-v2 .griev-row td[style*="text-overflow"], body.shell-v2 #proofTbody td[style*="text-overflow"] { white-space: normal !important; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; line-height: 1.35; word-break: break-word; }

/* ── Money "Needs you" strip + Job costing verdicts ───────────────────── */
body.shell-v2 .needs-you { padding: 4px 0 6px; margin-bottom: 20px; }
body.shell-v2 .ny-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 20px 8px; }
body.shell-v2 .ny-head h2 { margin: 0; font-size: 15px; font-weight: 600; color: var(--wt-text); }
body.shell-v2 .ny-row { display: flex; align-items: center; gap: 12px; padding: 10px 20px; border-top: 1px solid var(--wt-divider); }
body.shell-v2 .ny-row > .wt-icon { width: 20px; height: 20px; flex-shrink: 0; color: var(--wt-warning); }
body.shell-v2 .ny-row.ny-danger > .wt-icon { color: var(--wt-danger); }
body.shell-v2 .ny-row.ny-info > .wt-icon { color: var(--primary); }
body.shell-v2 .ny-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
body.shell-v2 .ny-title { font-weight: 600; color: var(--wt-text); }
body.shell-v2 .ny-main .td-sub { white-space: normal; overflow: visible; }
body.shell-v2 .jc-verdict { font-size: 12px; color: var(--wt-muted); margin-top: 2px; font-weight: 400; }
body.shell-v2 .jc-verdict .warn-text { font-weight: 600; }

/* ── Incidents: master-detail ────────────────────────────────────────── */
body.shell-v2 .inc-split { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); gap: 20px; align-items: start; }
body.shell-v2 .inc-list { margin-bottom: 0; }
body.shell-v2 .inc-list-head { padding: 12px 16px 8px; }
body.shell-v2 .inc-list-tools { display: flex; align-items: center; gap: 8px; padding: 0 16px 10px; flex-wrap: wrap; }
body.shell-v2 .inc-list-tools .tf-chips { gap: 4px; }
body.shell-v2 .chip.chip-sm { padding: 4px 10px; font-size: 12px; }
body.shell-v2 .inc-sev.form-input { width: auto; flex: 0 0 auto; margin-left: auto; padding-top: 5px; padding-bottom: 5px; font-size: 12px; }
body.shell-v2 .inc-row-v2 { display: flex; gap: 12px; padding: 12px 16px; border-top: 1px solid var(--wt-divider); text-decoration: none; color: inherit; }
body.shell-v2 .inc-row-v2:hover { background: var(--wt-surface-2); }
body.shell-v2 .inc-row-v2.is-selected { background: var(--primary-weak); }
body.shell-v2 .inc-row-v2.is-closed { opacity: .7; }
body.shell-v2 .inc-bar { width: 6px; border-radius: 3px; flex-shrink: 0; background: var(--wt-faint); }
body.shell-v2 .inc-bar.sev-near_miss { background: var(--wt-info); }
body.shell-v2 .inc-bar.sev-minor     { background: var(--wt-success); }
body.shell-v2 .inc-bar.sev-moderate  { background: var(--wt-warning); }
body.shell-v2 .inc-bar.sev-serious, body.shell-v2 .inc-bar.sev-fatal { background: var(--wt-danger); }
body.shell-v2 .inc-row-v2.is-closed .inc-bar { background: var(--wt-faint); }
body.shell-v2 .inc-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
body.shell-v2 .inc-line { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
body.shell-v2 .inc-title { font-weight: 600; color: var(--wt-text); }
body.shell-v2 .inc-meta { font-size: 12px; color: var(--wt-muted); }
body.shell-v2 .inc-state { font-size: 12px; color: var(--wt-muted); font-weight: 500; }
body.shell-v2 .inc-pager .paged-pager { border-top: 1px solid var(--wt-divider); border-bottom: 0 !important; }
body.shell-v2 .inc-also { padding: 12px 16px 10px; border-top: 1px solid var(--wt-divider); display: flex; flex-direction: column; gap: 8px; }
body.shell-v2 .inc-also-h { font-size: 12px; font-weight: 600; color: var(--wt-muted); }
body.shell-v2 .inc-also-row { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--wt-text); }
body.shell-v2 .inc-also-row > span:nth-child(2) { flex: 1; }
body.shell-v2 .inc-also-row a { font-size: 12px; font-weight: 600; color: var(--primary); text-decoration: none; }
body.shell-v2 .inc-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
body.shell-v2 .inc-dot.dot-success { background: var(--wt-success); }
body.shell-v2 .inc-dot.dot-danger  { background: var(--wt-danger); }
body.shell-v2 .inc-dot.dot-info    { background: var(--wt-info); }
body.shell-v2 .inc-detail { padding: 0; margin-bottom: 0; min-width: 0; }
body.shell-v2 .inc-detail > .empty-sm { padding: 40px 20px; text-align: center; }
body.shell-v2 .inc-d-head { display: flex; align-items: flex-start; gap: 12px; flex-wrap: wrap; padding: 18px 24px 14px; border-bottom: 1px solid var(--wt-divider); }
body.shell-v2 .inc-d-title { flex: 1; min-width: 200px; display: flex; flex-direction: column; gap: 4px; }
body.shell-v2 .inc-d-title h2 { margin: 0; font-size: 17px; font-weight: 700; color: var(--wt-text); }
body.shell-v2 .inc-d-meta { font-size: 13px; color: var(--wt-muted); }
body.shell-v2 .inc-d-body { display: grid; grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); gap: 20px; padding: 18px 24px 22px; }
body.shell-v2 .inc-d-col { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
body.shell-v2 .inc-field { display: flex; flex-direction: column; gap: 6px; font-size: 14px; color: var(--wt-text); }
body.shell-v2 .inc-field p { margin: 0; white-space: pre-wrap; }
body.shell-v2 .inc-field-h { font-size: 12px; font-weight: 600; color: var(--wt-muted); }
body.shell-v2 .inc-muted { color: var(--wt-muted); }
body.shell-v2 .inc-lbl { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--wt-text-2); }
body.shell-v2 .inc-lbl .form-input { width: 100%; }
body.shell-v2 .inc-form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 8px; }
body.shell-v2 .inc-form-actions { display: flex; justify-content: flex-end; margin-top: 2px; }
body.shell-v2 .inc-timeline { border-top: 1px solid var(--wt-divider); padding-top: 14px; }
body.shell-v2 .inc-tl-row { display: flex; gap: 10px; font-size: 13px; }
body.shell-v2 .inc-tl-row > span:first-child { width: 110px; flex-shrink: 0; color: var(--wt-muted); }
body.shell-v2 .inc-tl-row.warn-text > span:first-child { color: inherit; }
body.shell-v2 .inc-gallery { display: flex; flex-wrap: wrap; gap: 8px; }
body.shell-v2 .inc-gallery figure { margin: 0; width: 120px; }
body.shell-v2 .inc-gallery img { width: 120px; height: 90px; object-fit: cover; border-radius: var(--wt-radius-sm); border: 1px solid var(--wt-border); cursor: pointer; }
body.shell-v2 .inc-gallery figcaption { font-size: 11px; color: var(--wt-muted); margin-top: 2px; }
@media (max-width: 1100px) {
  body.shell-v2 .inc-split { grid-template-columns: minmax(0, 1fr); }
}

/* ── Phone pass (Nov 4 2026) ─────────────────────────────────────────────── */
@media (max-width: 600px) {
  /* The header subtitle only fits as "Clock a…" on a phone; the page and
     its tabs already say where you are. */
  body.shell-v2 .topbar-sub { display: none; }
}
@media (max-width: 768px) {
  /* Security's session + allowlist tables weren't in a scroll box, so the
     whole page scrolled sideways (567px of table in a 394px screen). */
  .ip-allowlist-table { display: block; max-width: 100%; min-width: 0 !important; overflow-x: auto; }
  /* "Add IP" row: input + button overflowed the card instead of wrapping. */
  div:has(> #btnAddIp) { flex-wrap: wrap; }
  div:has(> #btnAddIp) > input { flex: 1 1 160px; min-width: 0; }
}
body.shell-v2 .td-stale { color: var(--wt-warning) !important; font-weight: 600; }

/* ── 1200px laptop pass (Nov 4 2026) ─────────────────────────────────────── */
/* Names, jobs and task titles wrap to a second line instead of "Ahmed …". */
body.shell-v2 .td-title.sm { white-space: normal; overflow-wrap: anywhere; }
body.shell-v2 .tk-name,
body.shell-v2 .tk-who-wrap .text-body,
body.shell-v2 .tk-table .tk-project {
  white-space: normal; overflow: hidden; text-overflow: clip;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}
body.shell-v2 .te-row td[style*="text-overflow"] { white-space: normal !important; overflow: visible !important; }
/* Board: four 260px columns needed 1088px; at a 1200px window the content
   is ~900px, so Done hung off the edge with no scroll cue. */
@media (min-width: 769px) {
  body.shell-v2 .kanban-column { min-width: 200px; }
}
/* Today attention titles: wrap rather than "3 timesheets waiting for …". */
body.shell-v2 .td-title { white-space: normal; }
