/* ============================================================
   base-theme.css — extracted from inline <style> in index.html (line 11-3405)
   Round 11 Phase D extraction (2026-05-14T09:29:15.196Z)
   This is the ORIGINAL dark theme. Solva brand overrides live in solva-theme.css
   which must load AFTER this file in the cascade.
   ============================================================ */

/* ================================================================
   RESET & BASE
   ================================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --base: #0A0A0A;
  --surface: #111111;
  --surface-2: #1A1A1A;
  --surface-3: #222222;
  --border: rgba(255,255,255,0.06);
  --border-hover: rgba(255,255,255,0.12);
  --text: #F0F0F0;
  --muted: #888888;
  --dim: #555555;
  --accent: #7C3AED;
  --accent-glow: rgba(124,58,237,0.2);
  --blue: #3B82F6;
  --green: #10B981;
  --amber: #F59E0B;
  --red: #EF4444;
  --teal: #14B8A6;
  --purple: #8B5CF6;
  /* 2026-05-03 — Mark requested cyan accent for accessibility (slightly colour-blind).
     Cyan is a colour-blind-safe choice (most colour-blindness types preserve blue/cyan perception).
     #22D3EE = Tailwind cyan-400, ~10:1 contrast on var(--surface-3), ~6:1 on white. WCAG AAA compliant. */
  --cyan: #22D3EE;
  --cyan-deep: #06B6D4;
  /* --bg-subtle alias — many legacy widgets reference var(--bg-subtle,#fafaf7) and were silently
     falling back to cream colour because --bg-subtle was never defined for the dark theme.
     Define it once here so every dashboard widget inherits theme-consistent surface colour. */
  --bg-subtle: var(--surface-2);
  --sidebar-w: 220px;
  --sidebar-collapsed: 56px;
  --header-h: 56px;
  --radius: 10px;
  --radius-sm: 6px;
  --t: 150ms ease;
}

html, body {
  height: 100%;
  background: var(--base);
  color: var(--text);
  font-family: 'Inter', -apple-system, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* ================================================================
   LAYOUT
   ================================================================ */
.app {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* ================================================================
   SIDEBAR
   ================================================================ */
.sidebar {
  width: var(--sidebar-w);
  min-width: var(--sidebar-w);
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  transition: width var(--t), min-width var(--t);
  overflow: hidden;
  z-index: 100;
  flex-shrink: 0;
}

.sidebar.collapsed {
  width: var(--sidebar-collapsed);
  min-width: var(--sidebar-collapsed);
}

.sidebar-header {
  height: var(--header-h);
  display: flex;
  align-items: center;
  padding: 0 14px;
  border-bottom: 1px solid var(--border);
  gap: 10px;
  flex-shrink: 0;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  min-width: 0;
  flex: 1;
}

.logo-icon {
  width: 32px; height: 32px;
  background: #e07a2f;
  border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  font: 700 18px/1 Inter, sans-serif;
  color: #fff;
  flex-shrink: 0;
}
.logo-icon svg { display: block; }

.logo-text {
  font-weight: 600;
  font-size: 13px;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
}

.logo-sub {
  font-size: 10px;
  color: var(--muted);
  font-weight: 400;
}

.sidebar-toggle {
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  transition: color var(--t), background var(--t);
  flex-shrink: 0;
  display: flex;
  align-items: center;
}

.sidebar-toggle:hover { color: var(--text); background: var(--surface-2); }

.sidebar-nav {
  flex: 1;
  padding: 8px 0;
  overflow-y: auto;
  overflow-x: hidden;
}

.sidebar-nav::-webkit-scrollbar { width: 0; }

.nav-section {
  padding: 0 8px;
  margin-bottom: 4px;
}

.nav-section-label {
  font-size: 10px;
  font-weight: 600;
  color: var(--dim);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 8px 8px 4px;
  white-space: nowrap;
  overflow: hidden;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 8px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background var(--t), color var(--t);
  color: var(--muted);
  text-decoration: none;
  white-space: nowrap;
  position: relative;
  user-select: none;
}

.nav-item:hover { background: var(--surface-2); color: var(--text); }
.nav-item.active { background: var(--accent-glow); color: var(--text); }
.nav-item.active .nav-icon { color: var(--accent); }

.nav-icon {
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  flex-shrink: 0;
}

.nav-label {
  font-size: 13px;
  font-weight: 500;
  flex: 1;
  min-width: 0;
  overflow: hidden;
}

.nav-badge {
  background: var(--accent);
  color: white;
  font-size: 10px;
  font-weight: 600;
  padding: 1px 5px;
  border-radius: 20px;
  flex-shrink: 0;
}

.nav-badge.amber { background: var(--amber); color: #000; }
.nav-badge.green { background: var(--green); }

.sidebar.collapsed .nav-label,
.sidebar.collapsed .nav-section-label,
.sidebar.collapsed .nav-badge,
.sidebar.collapsed .logo-text,
.sidebar.collapsed .logo-sub {
  display: none;
}

.sidebar.collapsed .nav-item {
  justify-content: center;
  padding: 8px;
}

/* ================================================================
   BUSINESS SELECTOR
   ================================================================ */
.business-selector {
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
}

.business-dropdown {
  width: 100%;
  padding: 8px 10px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 12px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: border-color var(--t), background var(--t);
}

.business-dropdown:hover {
  border-color: var(--border-hover);
  background: var(--surface-3);
}

.business-dropdown:focus {
  outline: none;
  border-color: var(--accent);
}

.business-dropdown option {
  background: var(--surface);
  color: var(--text);
  padding: 8px;
}

.sidebar.collapsed .business-selector {
  display: none;
}

/* Business color indicators */
.business-indicator {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 6px;
}

.business-indicator.solva { background: var(--blue); }
.business-indicator.steady { background: var(--green); }

/* ================================================================
   GLOBAL DASHBOARD STYLES
   ================================================================ */
.time-allocation-row {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.time-alloc-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.time-alloc-bar-wrap {
  height: 24px;
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.time-alloc-bar {
  height: 100%;
  border-radius: var(--radius-sm);
  transition: width 0.5s ease;
}

.time-alloc-bar.solva { background: linear-gradient(90deg, var(--blue), #60a5fa); }
.time-alloc-bar.steady { background: linear-gradient(90deg, var(--green), #34d399); }
.time-alloc-bar.other { background: var(--surface-3); }

.time-alloc-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
}

.time-alloc-value {
  margin-left: auto;
  font-weight: 600;
  color: var(--text);
}

.time-alloc-total {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  font-size: 13px;
  color: var(--muted);
}

/* Priority List */
.priority-list {
  display: flex;
  flex-direction: column;
}

.priority-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  transition: background var(--t);
}

.priority-item:last-child { border-bottom: none; }
.priority-item:hover { background: var(--surface-2); }

.priority-business {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 4px;
  flex-shrink: 0;
}

.priority-business.solva {
  background: rgba(59, 130, 246, 0.15);
  color: var(--blue);
}

.priority-business.steady {
  background: rgba(16, 185, 129, 0.15);
  color: var(--green);
}

.priority-text {
  font-size: 13px;
  color: var(--text);
  flex: 1;
}

/* Business Summary Cards */
.business-summary-card {
  border-left: 3px solid transparent;
}

.business-summary-card.solva { border-left-color: var(--blue); }
.business-summary-card.steady { border-left-color: var(--green); }

.business-stat-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  color: var(--muted);
}

.business-stat-row:last-of-type { border-bottom: none; }

.business-stat-value {
  font-weight: 600;
  color: var(--text);
}

/* ================================================================
   STEADY-SPECIFIC STYLES
   ================================================================ */
.validation-progress-bar {
  height: 12px;
  background: var(--surface-2);
  border-radius: 6px;
  overflow: hidden;
  margin-bottom: 8px;
}

.validation-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--green), var(--teal));
  border-radius: 6px;
  transition: width 0.5s ease;
}

.validation-progress-label {
  font-size: 12px;
  color: var(--muted);
}

.validation-progress-label span {
  font-weight: 600;
  color: var(--green);
}

/* Hypothesis List */
.hypothesis-list {
  display: flex;
  flex-direction: column;
}

.hypothesis-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}

.hypothesis-item:last-child { border-bottom: none; }

.hypothesis-status {
  font-size: 14px;
  flex-shrink: 0;
}

.hypothesis-status.validated { color: var(--green); }
.hypothesis-status.invalidated { color: var(--red); }
.hypothesis-status.pending { color: var(--amber); }

.hypothesis-text {
  font-size: 13px;
  color: var(--text);
  line-height: 1.4;
}

/* Checklist */
.checklist {
  display: flex;
  flex-direction: column;
}

.checklist-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background var(--t);
}

.checklist-item:hover { background: var(--surface-2); }
.checklist-item:last-child { border-bottom: none; }

.checklist-item input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--green);
  cursor: pointer;
}

.checklist-item label {
  font-size: 13px;
  color: var(--text);
  cursor: pointer;
  flex: 1;
}

.checklist-item input:checked + label {
  text-decoration: line-through;
  color: var(--muted);
}

/* Data Table */
.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table th {
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
}

.data-table td {
  padding: 12px 16px;
  font-size: 13px;
  border-bottom: 1px solid var(--border);
}

.data-table tr:hover td {
  background: var(--surface-2);
}

/* Global Docs Styles */
.docs-section-header {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 8px 12px;
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  margin-bottom: 4px;
}

.docs-tree-section {
  padding: 4px 0;
  max-height: 200px;
  overflow-y: auto;
}

.docs-tree-section::-webkit-scrollbar {
  width: 4px;
}

.docs-tree-section::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 2px;
}

.docs-folder {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  font-size: 12px;
  color: var(--text);
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: background var(--t);
}

.docs-folder:hover {
  background: var(--surface-2);
}

.docs-folder-icon {
  font-size: 14px;
}

.docs-file-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px 5px 24px;
  font-size: 12px;
  color: var(--muted);
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: background var(--t), color var(--t);
}

.docs-file-item:hover {
  background: var(--surface-2);
  color: var(--text);
}

.loading-placeholder {
  padding: 12px;
  font-size: 12px;
  color: var(--dim);
}

/* Grid helpers */
.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

@media (max-width: 768px) {
  .grid-2 { grid-template-columns: 1fr; }
}

.sidebar-footer {
  padding: 12px 8px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

.sidebar-status {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: var(--radius-sm);
  cursor: default;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  flex-shrink: 0;
  box-shadow: 0 0 6px var(--green);
}

.status-dot.pulse {
  animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; box-shadow: 0 0 6px var(--green); }
  50% { opacity: 0.5; box-shadow: 0 0 2px var(--green); }
}

.status-text {
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
}

/* ================================================================
   MAIN AREA
   ================================================================ */
.main {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-width: 0;
}

/* ================================================================
   HEADER
   ================================================================ */
.header {
  height: var(--header-h);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 20px;
  gap: 16px;
  flex-shrink: 0;
  position: relative;
  z-index: 50;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 140px;
}

.header-greeting {
  font-size: 13px;
  color: var(--muted);
}

.header-greeting strong {
  color: var(--text);
  font-weight: 600;
}

.header-search {
  flex: 1;
  max-width: 480px;
  margin: 0 auto;
}

.search-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.search-input-wrap svg {
  position: absolute;
  left: 10px;
  color: var(--muted);
  pointer-events: none;
}

.search-input {
  width: 100%;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 7px 12px 7px 34px;
  color: var(--text);
  font-size: 13px;
  font-family: inherit;
  transition: border-color var(--t), background var(--t);
  outline: none;
}

.search-input:focus { border-color: var(--accent); background: var(--surface-3); }
.search-input::placeholder { color: var(--dim); }

.search-shortcut {
  position: absolute;
  right: 8px;
  font-size: 11px;
  color: var(--dim);
  background: var(--surface-3);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 1px 5px;
  pointer-events: none;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 140px;
  justify-content: flex-end;
}

.btn-pause {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--muted);
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--t);
  font-family: inherit;
}

.btn-pause:hover { border-color: var(--amber); color: var(--amber); }

.avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #e88a3e 0%, #e07a2f 45%, #c96a22 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #fff;
  cursor: pointer;
  border: 1px solid rgba(255,255,255,0.10);
  box-shadow:
    0 4px 12px -4px rgba(224,122,47,0.55),
    inset 0 1px 0 rgba(255,255,255,0.18);
  transition: transform 180ms cubic-bezier(0.32, 0.72, 0, 1),
              box-shadow 180ms cubic-bezier(0.32, 0.72, 0, 1);
  flex-shrink: 0;
}
.avatar:active { transform: scale(0.96); }

.avatar:hover { border-color: var(--accent); }

/* ================================================================
   CONTENT
   ================================================================ */
.content {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
}

.content::-webkit-scrollbar { width: 5px; }
.content::-webkit-scrollbar-track { background: transparent; }
.content::-webkit-scrollbar-thumb { background: var(--surface-3); border-radius: 99px; }

.section {
  display: none;
  height: 100%;
  animation: fadeIn 200ms ease;
}

.section.active { display: flex; flex-direction: column; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Section padding wrapper */
.section-body {
  padding: 24px;
  flex: 1;
  overflow-y: auto;
}

.section-body::-webkit-scrollbar { width: 5px; }
.section-body::-webkit-scrollbar-track { background: transparent; }
.section-body::-webkit-scrollbar-thumb { background: var(--surface-3); border-radius: 99px; }

/* ================================================================
   SECTION HEADER
   ================================================================ */
.section-header {
  padding: 16px 24px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.section-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
}

.section-subtitle {
  font-size: 13px;
  color: var(--muted);
  margin-top: 2px;
}

/* ================================================================
   CARDS
   ================================================================ */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform var(--t), border-color var(--t), box-shadow var(--t);
}

.card:hover {
  transform: translateY(-2px);
  border-color: var(--border-hover);
  box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

.card-header {
  padding: 14px 16px 10px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.card-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.card-body { padding: 16px; }

/* ================================================================
   BUTTONS
   ================================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--t);
  font-family: inherit;
  border: none;
  padding: 7px 14px;
}

.btn-primary {
  background: var(--accent);
  color: white;
}
.btn-primary:hover { background: #6D28D9; }

.btn-secondary {
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-secondary:hover { border-color: var(--border-hover); background: var(--surface-3); }

.btn-ghost {
  background: transparent;
  color: var(--muted);
  border: 1px solid transparent;
}
.btn-ghost:hover { background: var(--surface-2); color: var(--text); border-color: var(--border); }

.btn-danger {
  background: transparent;
  color: var(--red);
  border: 1px solid var(--border);
}
.btn-danger:hover { background: rgba(239,68,68,0.1); border-color: var(--red); }

.btn-sm { padding: 4px 10px; font-size: 12px; }
.btn-xs { padding: 2px 8px; font-size: 11px; }

/* ================================================================
   STATUS BADGE
   ================================================================ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 500;
  white-space: nowrap;
}

.badge-blue { background: rgba(59,130,246,0.15); color: var(--blue); }
.badge-green { background: rgba(16,185,129,0.15); color: var(--green); }
.badge-amber { background: rgba(245,158,11,0.15); color: var(--amber); }
.badge-red { background: rgba(239,68,68,0.15); color: var(--red); }
.badge-teal { background: rgba(20,184,166,0.15); color: var(--teal); }
.badge-purple { background: rgba(139,92,246,0.15); color: var(--purple); }
.badge-gray { background: rgba(255,255,255,0.08); color: var(--muted); }

/* Priority badges */
.priority-high { background: rgba(239,68,68,0.15); color: var(--red); }
.priority-medium { background: rgba(245,158,11,0.15); color: var(--amber); }
.priority-low { background: rgba(16,185,129,0.15); color: var(--green); }

/* ================================================================
   GRIDS
   ================================================================ */
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }

@media (max-width: 1200px) { .grid-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 900px) {
  .grid-4, .grid-3, .grid-2 { grid-template-columns: 1fr; }
}

/* ================================================================
   KPI CARD
   ================================================================ */
.kpi-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  position: relative;
  overflow: hidden;
  transition: transform var(--t), border-color var(--t);
}

.kpi-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-hover);
}

.kpi-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 6px;
}

.kpi-value {
  font-size: 28px;
  font-weight: 700;
  color: var(--text);
  line-height: 1;
  margin-bottom: 6px;
}

.kpi-sub {
  font-size: 12px;
  color: var(--muted);
}

.kpi-accent {
  position: absolute;
  top: 0;
  left: 0;
  width: 3px;
  height: 100%;
  border-radius: 99px 0 0 99px;
}

/* ================================================================
   DASHBOARD SECTION
   ================================================================ */
#dash-activity {
  max-height: 320px;
  overflow-y: auto;
}

#dash-activity::-webkit-scrollbar { width: 3px; }
#dash-activity::-webkit-scrollbar-thumb { background: var(--surface-3); border-radius: 99px; }

.dash-layout {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 20px;
  height: 100%;
}

@media (max-width: 1100px) { .dash-layout { grid-template-columns: 1fr; } }

.activity-item {
  display: flex;
  gap: 10px;
  padding: 9px 0;
  border-bottom: 1px solid var(--border);
  align-items: flex-start;
}

.activity-item:last-child { border-bottom: none; }

.activity-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-top: 5px;
  flex-shrink: 0;
}

.activity-content { flex: 1; min-width: 0; }
.activity-agent { font-size: 12px; font-weight: 600; }
.activity-text {
  font-size: 12px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.activity-time { font-size: 11px; color: var(--dim); margin-top: 2px; }

/* ================================================================
   AGENT CARDS
   ================================================================ */
.agent-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  display: flex;
  gap: 12px;
  align-items: flex-start;
  transition: transform var(--t), border-color var(--t);
  position: relative;
  overflow: hidden;
}

.agent-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-hover);
}

.agent-card::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
}

.agent-emoji-wrap {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
  background: var(--surface-2);
}

.agent-info { flex: 1; min-width: 0; }
.agent-name { font-weight: 600; font-size: 14px; }
.agent-role { font-size: 11px; color: var(--muted); margin-top: 1px; }
.agent-task {
  font-size: 12px;
  color: var(--muted);
  margin-top: 6px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.agent-status-wrap {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 6px;
}

.agent-status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

.agent-status-text {
  font-size: 11px;
  font-weight: 500;
}

/* Online pulse animation */
.agent-card.online .agent-status-dot {
  animation: pulse-dot 2s ease-in-out infinite;
}

/* ================================================================
   KANBAN BOARD
   ================================================================ */
.kanban-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 24px 12px;
  flex-wrap: wrap;
  flex-shrink: 0;
}

.filter-group {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 3px;
}

.filter-btn {
  padding: 4px 10px;
  border-radius: 4px;
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--t);
  font-family: inherit;
  white-space: nowrap;
}

.filter-btn.active { background: var(--surface-3); color: var(--text); }
.filter-btn:hover { color: var(--text); }

.kanban-select {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  padding: 6px 10px;
  font-size: 12px;
  font-family: inherit;
  cursor: pointer;
  outline: none;
  transition: border-color var(--t);
}

.kanban-select:focus { border-color: var(--accent); }
.kanban-select option { background: var(--surface-2); }

.kanban-wrap {
  flex: 1;
  overflow-x: auto;
  padding: 0 24px 24px;
}

.kanban-wrap::-webkit-scrollbar { height: 5px; }
.kanban-wrap::-webkit-scrollbar-track { background: transparent; }
.kanban-wrap::-webkit-scrollbar-thumb { background: var(--surface-3); border-radius: 99px; }

.kanban-board {
  display: flex;
  gap: 14px;
  min-width: max-content;
  height: 100%;
  min-height: calc(100vh - 200px);
}

.kanban-col {
  width: 280px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
}

.kanban-col-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius) var(--radius) 0 0;
  margin-bottom: 0;
  border-bottom: none;
}

/* v9.2: category filter accent — Tasks page only, scoped via class on #section-tasks */
#section-tasks.cat-active .kanban-col-header {
  border-top: 3px solid var(--cat-accent-hdr);
}
#section-tasks.cat-active .btn-primary,
#section-tasks.cat-active .btn-ghost:not(#widgetChartBtn):not(#widgetTableBtn):not(.filter-btn),
#section-tasks.cat-active .add-task-btn {
  box-shadow: 0 0 0 1.5px var(--cat-accent-btn);
}

/* v9.3: allocation widget collapse */
#allocationWidget.allocation-collapsed #allocationLegend,
#allocationWidget.allocation-collapsed #allocationViewToggle,
#allocationWidget.allocation-collapsed #askClaudeBtn,
#allocationWidget.allocation-collapsed #allocationBody {
  display: none !important;
}
#allocationWidget.allocation-collapsed {
  padding-bottom: 6px;
  margin-bottom: 8px;
}
#allocationToggleBtn {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--muted);
  font-size: 10px;
  padding: 2px 4px;
  line-height: 1;
  border-radius: 3px;
}
#allocationToggleBtn:hover { color: var(--text); }

.col-title-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.col-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.col-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
}

.col-count {
  font-size: 11px;
  color: var(--muted);
  background: var(--surface-2);
  padding: 1px 7px;
  border-radius: 20px;
}

.kanban-cards {
  flex: 1;
  background: var(--surface);
  border: 1px solid var(--border);
  border-top: none;
  border-radius: 0 0 var(--radius) var(--radius);
  padding: 8px;
  overflow-y: auto;
  min-height: 200px;
  transition: background var(--t);
}

.kanban-cards::-webkit-scrollbar { width: 3px; }
.kanban-cards::-webkit-scrollbar-thumb { background: var(--surface-3); border-radius: 99px; }

.kanban-cards.drag-over {
  background: rgba(124,58,237,0.06);
  border-color: rgba(124,58,237,0.2);
}

.task-card {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 8px;
  cursor: grab;
  transition: transform var(--t), border-color var(--t), box-shadow var(--t), opacity var(--t);
  position: relative;
}

.task-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-hover);
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.task-card.dragging {
  opacity: 0.5;
  cursor: grabbing;
}

.task-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}

.task-title {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  flex: 1;
  cursor: pointer;
}

.task-title:hover { color: var(--accent); }

.task-card-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.task-assignee {
  font-size: 11px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 4px;
}

.task-due {
  font-size: 11px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 3px;
}

.task-due.overdue { color: var(--red); }
.task-due.due-soon { color: var(--amber); }

.task-card-actions {
  position: absolute;
  top: 8px;
  right: 8px;
  display: flex;
  gap: 4px;
  opacity: 0;
  transition: opacity var(--t);
}

.task-card:hover .task-card-actions { opacity: 1; }

.task-action-btn {
  width: 22px;
  height: 22px;
  border: none;
  background: var(--surface-3);
  border-radius: 4px;
  color: var(--muted);
  cursor: pointer;
  font-size: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--t);
}

.task-action-btn:hover { background: var(--accent); color: white; }
.task-action-btn.del:hover { background: var(--red); color: white; }

.add-task-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 8px;
  border-radius: 6px;
  border: none;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 12px;
  font-family: inherit;
  transition: all var(--t);
  width: 100%;
  margin-top: 4px;
}

.add-task-btn:hover { background: var(--surface-3); color: var(--text); }

/* ================================================================
   TASK MODAL
   ================================================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(4px);
  animation: fadeOverlay 150ms ease;
}

@keyframes fadeOverlay {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal {
  background: var(--surface);
  border: 1px solid var(--border-hover);
  border-radius: 12px;
  width: 100%;
  max-width: 540px;
  max-height: 90vh;
  overflow-y: auto;
  animation: slideModal 150ms ease;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}

@keyframes slideModal {
  from { opacity: 0; transform: scale(0.97) translateY(-8px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-header {
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-title { font-size: 16px; font-weight: 600; }

.modal-close {
  width: 28px;
  height: 28px;
  border: none;
  background: var(--surface-2);
  border-radius: 6px;
  color: var(--muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--t);
}

.modal-close:hover { background: var(--surface-3); color: var(--text); }

.modal-body { padding: 20px; }
.modal-footer {
  padding: 14px 20px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

/* ================================================================
   FORM ELEMENTS
   ================================================================ */
.form-group { margin-bottom: 14px; }
.form-label {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.form-input, .form-select, .form-textarea {
  width: 100%;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  color: var(--text);
  font-size: 13px;
  font-family: inherit;
  transition: border-color var(--t);
  outline: none;
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--accent);
}

.form-select option { background: #1A1A1A; }
.form-textarea { resize: vertical; min-height: 72px; }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* ================================================================
   OFFICE SECTION — PIXEL ART VIRTUAL OFFICE
   ================================================================ */
#section-office .section-body {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding-bottom: 0;
}

.office-layout {
  display: flex;
  gap: 0;
  align-items: stretch;
  flex: 1;
  min-height: 500px;
  overflow: hidden;
}

.office-layout.office-fullwidth {
  /* Full width layout - no sidebar */
}

.office-layout.office-fullwidth .office-floor-wrap {
  max-width: 100%;
}

.office-layout.office-fullwidth .office-floor {
  aspect-ratio: 16 / 9;
  max-height: calc(100vh - 200px);
}

.office-floor-wrap {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.office-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  flex-wrap: wrap;
  gap: 8px;
}

.office-title-block .office-main-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
}

.office-title-block .office-subtitle {
  font-size: 12px;
  color: var(--dim);
  margin-top: 2px;
}

.office-legend {
  display: flex;
  gap: 12px;
  font-size: 11px;
  color: var(--muted);
}

.office-floor {
  position: relative;
  width: 100%;
  flex: 1;
  background: 
    radial-gradient(ellipse at 50% 80%, rgba(139,92,246,0.08) 0%, transparent 50%),
    radial-gradient(ellipse at 20% 30%, rgba(59,130,246,0.06) 0%, transparent 40%),
    radial-gradient(ellipse at 80% 30%, rgba(16,185,129,0.06) 0%, transparent 40%),
    linear-gradient(180deg, #1a1a1a 0%, #141414 100%);
  border: 2px solid #333;
  border-radius: 8px;
  overflow: visible;
  box-shadow: inset 0 0 60px rgba(0,0,0,0.5);
}

/* Corner plants */
.office-plant {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  z-index: 2;
}

.plant-leaves {
  width: 28px;
  height: 24px;
  background: #16a34a;
  border-radius: 50% 50% 40% 40%;
  box-shadow: -8px 4px 0 #15803d, 8px 4px 0 #15803d, 0 -6px 0 #22c55e;
  position: relative;
}

.plant-pot {
  width: 20px;
  height: 14px;
  background: #92400e;
  border-radius: 0 0 6px 6px;
  margin-top: 2px;
  border-top: 3px solid #b45309;
}

/* Meeting table in center */
.office-meeting-table {
  position: absolute;
  left: 40%;
  top: 38%;
  width: 120px;
  height: 72px;
  background: #44403c;
  border: 3px solid #57534e;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  color: #a8a29e;
  letter-spacing: 0.05em;
  font-weight: 600;
  z-index: 2;
  box-shadow: 0 4px 16px rgba(0,0,0,0.5);
}

/* Agent desks */
.pixel-agent {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  z-index: 5;
}

.pixel-agent.idle {
  opacity: 0.85;
  filter: none;
}

/* All agents get base glow */
.pixel-agent .pixel-desk {
  box-shadow: 0 0 12px var(--agent-color, #888), 0 0 24px rgba(255,255,255,0.1);
  border-color: var(--agent-color, #888);
}

/* Avatar: head + body */
.pixel-avatar {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 2px;
}

.pixel-head {
  width: 20px;
  height: 20px;
  border-radius: 4px;
  background: #f5d0a9;
  border: 2px solid #c4956a;
  position: relative;
  z-index: 2;
}

/* ================================================================
   AGENT ACCESSORIES
   ================================================================ */

/* French beret for Podrick - purple with red accent */
.pixel-agent.acc-beret .pixel-head::before {
  content: '';
  position: absolute;
  top: -8px;
  left: 50%;
  transform: translateX(-50%);
  width: 26px;
  height: 12px;
  background: linear-gradient(135deg, #7C3AED 0%, #9333EA 50%, #DC2626 100%);
  border-radius: 50% 50% 40% 40%;
  z-index: 10;
  box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}
.pixel-agent.acc-beret .pixel-head::after {
  content: '';
  position: absolute;
  top: -10px;
  left: 60%;
  width: 6px;
  height: 6px;
  background: #DC2626;
  border-radius: 50%;
  z-index: 11;
}

/* DNA Helix for Luca */
.pixel-agent.acc-dna-helix .pixel-accessory {
  position: absolute;
  top: -18px;
  left: 50%;
  transform: translateX(-50%);
  width: 16px;
  height: 16px;
  z-index: 15;
}
.pixel-agent.acc-dna-helix .pixel-accessory::before,
.pixel-agent.acc-dna-helix .pixel-accessory::after {
  content: '';
  position: absolute;
  width: 4px;
  height: 14px;
  border-radius: 2px;
  animation: dna-spin 2s linear infinite;
}
.pixel-agent.acc-dna-helix .pixel-accessory::before {
  background: #7C3AED;
  left: 2px;
}
.pixel-agent.acc-dna-helix .pixel-accessory::after {
  background: #A78BFA;
  right: 2px;
  animation-delay: -1s;
}
@keyframes dna-spin {
  0%, 100% { transform: scaleX(1) translateY(0); }
  25% { transform: scaleX(0.3) translateY(-1px); }
  50% { transform: scaleX(1) translateY(0); }
  75% { transform: scaleX(0.3) translateY(1px); }
}

/* Magnifying Glass for Scout */
.pixel-agent.acc-magnifying-glass .pixel-accessory {
  position: absolute;
  top: -14px;
  right: -8px;
  width: 14px;
  height: 14px;
  border: 3px solid #3B82F6;
  border-radius: 50%;
  z-index: 15;
  background: rgba(59,130,246,0.2);
}
.pixel-agent.acc-magnifying-glass .pixel-accessory::after {
  content: '';
  position: absolute;
  bottom: -6px;
  right: -2px;
  width: 3px;
  height: 8px;
  background: #3B82F6;
  border-radius: 2px;
  transform: rotate(-45deg);
}

/* Quill for Scribe */
.pixel-agent.acc-quill .pixel-accessory {
  position: absolute;
  top: -16px;
  left: 50%;
  transform: translateX(-50%) rotate(-30deg);
  width: 4px;
  height: 18px;
  background: linear-gradient(to bottom, #10B981 0%, #065F46 100%);
  border-radius: 1px 1px 0 0;
  z-index: 15;
}
.pixel-agent.acc-quill .pixel-accessory::before {
  content: '';
  position: absolute;
  top: 0;
  left: -3px;
  width: 10px;
  height: 6px;
  background: #10B981;
  clip-path: polygon(50% 0%, 100% 100%, 0% 100%);
}
.pixel-agent.acc-quill .pixel-accessory::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 4px;
  height: 4px;
  background: #1e3a5f;
  border-radius: 0 0 2px 2px;
}

/* Wisdom Orb for Atlas */
.pixel-agent.acc-wisdom-orb .pixel-accessory {
  position: absolute;
  top: -16px;
  left: 50%;
  transform: translateX(-50%);
  width: 14px;
  height: 14px;
  background: radial-gradient(circle at 30% 30%, #FCD34D, #F59E0B, #B45309);
  border-radius: 50%;
  z-index: 15;
  box-shadow: 0 0 10px rgba(245,158,11,0.6), 0 0 20px rgba(245,158,11,0.3);
  animation: orb-glow 2s ease-in-out infinite;
}
@keyframes orb-glow {
  0%, 100% { box-shadow: 0 0 10px rgba(245,158,11,0.6), 0 0 20px rgba(245,158,11,0.3); }
  50% { box-shadow: 0 0 15px rgba(245,158,11,0.8), 0 0 30px rgba(245,158,11,0.5); }
}

/* Golf Visor for Golfie */
.pixel-agent.acc-golf-visor .pixel-accessory {
  position: absolute;
  top: -4px;
  left: 50%;
  transform: translateX(-50%);
  width: 24px;
  height: 6px;
  background: #14B8A6;
  border-radius: 10px 10px 0 0;
  z-index: 15;
}
.pixel-agent.acc-golf-visor .pixel-accessory::after {
  content: '';
  position: absolute;
  top: 4px;
  left: 50%;
  transform: translateX(-50%);
  width: 30px;
  height: 4px;
  background: #0D9488;
  border-radius: 0 0 4px 4px;
}

/* Duck Bill for Gooby */
.pixel-agent.acc-duck-bill .pixel-head {
  background: #FBBF24 !important;
  border-color: #D97706 !important;
}
.pixel-agent.acc-duck-bill .pixel-accessory {
  position: absolute;
  top: 8px;
  left: 50%;
  transform: translateX(-50%);
  width: 16px;
  height: 8px;
  background: #F97316;
  border-radius: 0 0 8px 8px;
  z-index: 20;
}

/* ================================================================
   STATUS GLOW EFFECTS
   ================================================================ */
.pixel-agent.status-working {
  --status-glow: rgba(34,197,94,0.4);
}
.pixel-agent.status-working .pixel-desk {
  box-shadow: 0 0 15px var(--status-glow), 0 0 30px var(--status-glow);
  animation: desk-pulse 2s ease-in-out infinite;
}
.pixel-agent.status-thinking {
  --status-glow: rgba(59,130,246,0.4);
}
.pixel-agent.status-thinking .pixel-desk {
  box-shadow: 0 0 15px var(--status-glow);
  animation: think-pulse 1s ease-in-out infinite;
}
.pixel-agent.status-error {
  --status-glow: rgba(239,68,68,0.5);
}
.pixel-agent.status-error .pixel-desk {
  box-shadow: 0 0 20px var(--status-glow);
  border-color: #ef4444 !important;
  animation: error-flash 0.5s ease-in-out infinite;
}
.pixel-agent.status-ratelimit {
  --status-glow: rgba(245,158,11,0.4);
}
.pixel-agent.status-ratelimit .pixel-desk {
  box-shadow: 0 0 15px var(--status-glow);
}

@keyframes desk-pulse {
  0%, 100% { box-shadow: 0 0 15px var(--status-glow), 0 0 30px var(--status-glow); }
  50% { box-shadow: 0 0 20px var(--status-glow), 0 0 40px var(--status-glow); }
}
@keyframes think-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}
@keyframes error-flash {
  0%, 100% { border-color: #ef4444; }
  50% { border-color: #fca5a5; }
}

/* Typing animation when working - uses blinking cursor effect */
.pixel-agent.status-working .pixel-monitor::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 50%;
  transform: translateX(-50%);
  width: 8px;
  height: 4px;
  background: var(--agent-color);
  border-radius: 1px;
  animation: typing-blink 0.6s ease-in-out infinite;
}
@keyframes typing-blink {
  0%, 100% { opacity: 1; width: 8px; }
  50% { opacity: 0.3; width: 4px; }
}

/* Thought bubble for thinking */
.pixel-agent.status-thinking .pixel-avatar::after {
  content: '💭';
  position: absolute;
  top: -24px;
  right: -16px;
  font-size: 14px;
  animation: thought-float 1.5s ease-in-out infinite;
}
@keyframes thought-float {
  0%, 100% { transform: translateY(0) scale(1); opacity: 0.8; }
  50% { transform: translateY(-4px) scale(1.1); opacity: 1; }
}

/* ================================================================
   OFFICE DOGS
   ================================================================ */
.office-dog {
  position: absolute;
  z-index: 8;
  cursor: pointer;
}
.office-dog:hover {
  filter: brightness(1.2);
}

/* Rottweiler - larger dog */
.dog-rottweiler {
  width: 42px;
  height: 32px;
}
.dog-rottweiler .dog-body {
  width: 32px;
  height: 20px;
  background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
  border-radius: 8px 12px 6px 6px;
  position: relative;
  box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}
.dog-rottweiler .dog-body::before {
  content: '';
  position: absolute;
  bottom: 0;
  left: 4px;
  width: 24px;
  height: 6px;
  background: #8B4513;
  border-radius: 0 0 4px 4px;
}
.dog-rottweiler .dog-head {
  width: 18px;
  height: 16px;
  background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
  border-radius: 6px 6px 4px 4px;
  position: absolute;
  top: -8px;
  left: -6px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}
.dog-rottweiler .dog-head::before {
  content: '';
  position: absolute;
  top: 6px;
  left: 2px;
  width: 10px;
  height: 6px;
  background: #8B4513;
  border-radius: 2px;
}
.dog-rottweiler .dog-head::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 4px;
  height: 4px;
  background: #333;
  border-radius: 50%;
  box-shadow: 6px 0 0 #333;
}
.dog-rottweiler .dog-ear {
  width: 8px;
  height: 10px;
  background: #1a1a1a;
  border-radius: 4px 4px 0 0;
  position: absolute;
  top: -14px;
}
.dog-rottweiler .dog-ear.left { left: -2px; transform: rotate(-10deg); }
.dog-rottweiler .dog-ear.right { left: 10px; transform: rotate(10deg); }
.dog-rottweiler .dog-tail {
  width: 6px;
  height: 12px;
  background: #1a1a1a;
  border-radius: 3px;
  position: absolute;
  top: -4px;
  right: -4px;
  transform-origin: bottom;
  animation: tail-wag 0.4s ease-in-out infinite;
}
.dog-rottweiler .dog-legs {
  position: absolute;
  bottom: -8px;
  left: 4px;
  display: flex;
  gap: 16px;
}
.dog-rottweiler .dog-leg {
  width: 5px;
  height: 10px;
  background: #1a1a1a;
  border-radius: 0 0 2px 2px;
}

/* English Staffy - smaller dog (60% of rottweiler) */
.dog-staffy {
  width: 30px;
  height: 23px;
}
.dog-staffy .dog-body {
  width: 23px;
  height: 14px;
  background: linear-gradient(135deg, #d4a574 0%, #c4956a 100%);
  border-radius: 6px 10px 4px 4px;
  position: relative;
  box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}
.dog-staffy .dog-body::before {
  content: '';
  position: absolute;
  top: 2px;
  left: 8px;
  width: 10px;
  height: 8px;
  background: white;
  border-radius: 4px;
}
.dog-staffy .dog-head {
  width: 14px;
  height: 12px;
  background: linear-gradient(135deg, #d4a574 0%, #c4956a 100%);
  border-radius: 5px 5px 3px 3px;
  position: absolute;
  top: -6px;
  left: -5px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}
.dog-staffy .dog-head::before {
  content: '';
  position: absolute;
  top: 4px;
  left: 2px;
  width: 8px;
  height: 5px;
  background: #8B6914;
  border-radius: 2px;
}
.dog-staffy .dog-head::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 3px;
  height: 3px;
  background: #333;
  border-radius: 50%;
  box-shadow: 5px 0 0 #333;
}
.dog-staffy .dog-ear {
  width: 6px;
  height: 8px;
  background: #d4a574;
  border-radius: 3px 3px 0 0;
  position: absolute;
  top: -10px;
}
.dog-staffy .dog-ear.left { left: -1px; transform: rotate(-15deg); }
.dog-staffy .dog-ear.right { left: 8px; transform: rotate(15deg); }
.dog-staffy .dog-tail {
  width: 4px;
  height: 8px;
  background: #d4a574;
  border-radius: 2px;
  position: absolute;
  top: -2px;
  right: -3px;
  transform-origin: bottom;
  animation: tail-wag 0.3s ease-in-out infinite;
}
.dog-staffy .dog-legs {
  position: absolute;
  bottom: -6px;
  left: 3px;
  display: flex;
  gap: 12px;
}
.dog-staffy .dog-leg {
  width: 4px;
  height: 7px;
  background: #d4a574;
  border-radius: 0 0 2px 2px;
}

@keyframes tail-wag {
  0%, 100% { transform: rotate(-15deg); }
  50% { transform: rotate(15deg); }
}

/* Dog idle animation */
.office-dog.idle {
  animation: dog-breathe 4s ease-in-out infinite;
}
@keyframes dog-breathe {
  0%, 100% { transform: scaleY(1); }
  50% { transform: scaleY(1.02); }
}

/* Dog walking animation - 50% slower */
.office-dog.walking .dog-leg {
  animation: dog-walk 0.6s ease-in-out infinite alternate;
}
.office-dog.walking .dog-leg:nth-child(2) {
  animation-delay: 0.3s;
}
@keyframes dog-walk {
  0% { transform: rotate(-10deg); }
  100% { transform: rotate(10deg); }
}

/* Slower tail wag */
.dog-rottweiler .dog-tail {
  animation: tail-wag 0.8s ease-in-out infinite;
}
.dog-staffy .dog-tail {
  animation: tail-wag 0.6s ease-in-out infinite;
}

/* ================================================================
   ENHANCED TOOLTIPS
   ================================================================ */
.pixel-tooltip {
  position: absolute;
  bottom: calc(100% + 12px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px;
  min-width: 200px;
  display: none;
  z-index: 100;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}
.pixel-tooltip::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: var(--surface);
}
.tooltip-name {
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 4px;
}
.tooltip-role {
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 8px;
}
.tooltip-task {
  font-size: 12px;
  padding: 6px 8px;
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
}
.tooltip-status {
  font-size: 11px;
  font-weight: 600;
}
.tooltip-meta {
  font-size: 10px;
  color: var(--dim);
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}
.tooltip-activity {
  font-size: 11px;
  margin-top: 8px;
}
.tooltip-activity-item {
  padding: 4px 0;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
}
.tooltip-activity-item:last-child {
  border-bottom: none;
}

.pixel-body {
  width: 24px;
  height: 18px;
  border-radius: 3px 3px 2px 2px;
  margin-top: 1px;
  position: relative;
  z-index: 2;
}

.pixel-agent.active .pixel-avatar {
  animation: agent-bob 1.6s ease-in-out infinite;
}

@keyframes agent-bob {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-3px); }
}

/* Status dot */
.pixel-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #4b5563;
  margin-bottom: 3px;
  position: absolute;
  top: -4px;
  right: -4px;
  border: 1.5px solid #111;
}

.pixel-agent.active .pixel-status-dot {
  background: #22c55e;
  animation: dot-pulse 2s ease-in-out infinite;
}

@keyframes dot-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(34,197,94,0.6); }
  50% { box-shadow: 0 0 0 4px rgba(34,197,94,0); }
}

/* Desk */
.pixel-desk {
  width: 64px;
  height: 32px;
  background: #78716c;
  border: 2px solid #57534e;
  border-radius: 3px;
  position: relative;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 3px;
}

.pixel-agent.active .pixel-desk {
  box-shadow: 0 0 12px var(--agent-color, #888);
  border-color: var(--agent-color, #888);
}

.pixel-monitor {
  width: 28px;
  height: 18px;
  background: #1e3a5f;
  border: 2px solid #3b82f6;
  border-radius: 2px;
  position: relative;
}

.pixel-monitor::after {
  content: '';
  position: absolute;
  bottom: -5px;
  left: 50%;
  transform: translateX(-50%);
  width: 10px;
  height: 4px;
  background: #374151;
  border-radius: 1px;
}

.pixel-agent-label {
  font-size: 10px;
  font-weight: 700;
  color: #e5e7eb;
  text-align: center;
  margin-top: 4px;
  letter-spacing: 0.04em;
  white-space: nowrap;
  text-shadow: 0 1px 3px rgba(0,0,0,0.8);
}

/* Tooltip hover trigger */
.pixel-agent:hover .pixel-tooltip {
  display: block;
}

/* Activity sidebar */
.office-sidebar {
  width: 280px;
  flex-shrink: 0;
  padding-left: 16px;
  border-left: 1px solid var(--border);
  overflow-y: auto;
}

.office-sidebar-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 10px;
}

.office-activity-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.office-activity-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px 10px;
  font-size: 11px;
}

.office-activity-agent {
  font-weight: 700;
  margin-bottom: 2px;
}

.office-activity-text {
  color: var(--muted);
  line-height: 1.3;
}

.office-activity-time {
  font-size: 10px;
  color: var(--dim);
  margin-top: 3px;
}

/* ================================================================
   ACTIVITY SECTION
   ================================================================ */
.activity-section-item {
  display: flex;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  align-items: flex-start;
}

.activity-section-item:last-child { border-bottom: none; }

.activity-agent-dot {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
}

.activity-section-content { flex: 1; min-width: 0; }
.activity-section-agent { font-size: 13px; font-weight: 600; }
.activity-section-action { font-size: 13px; color: var(--muted); margin-top: 2px; }
.activity-section-detail {
  font-size: 12px;
  color: var(--dim);
  margin-top: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.activity-section-time { font-size: 11px; color: var(--dim); margin-top: 4px; }

/* ================================================================
   DOCS SECTION
   ================================================================ */
.docs-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 0;
  height: 100%;
  min-height: calc(100vh - 120px);
}

.docs-tree {
  border-right: 1px solid var(--border);
  padding: 16px;
  overflow-y: auto;
}

.docs-tree::-webkit-scrollbar { width: 3px; }
.docs-tree::-webkit-scrollbar-thumb { background: var(--surface-3); border-radius: 99px; }

.doc-folder {
  margin-bottom: 2px;
}

.doc-folder-header {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 8px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  transition: all var(--t);
  user-select: none;
}

.doc-folder-header:hover { background: var(--surface-2); color: var(--text); }
.doc-folder-header.expanded { color: var(--text); }

.doc-folder-icon { transition: transform var(--t); font-size: 10px; }
.doc-folder-header.expanded .doc-folder-icon { transform: rotate(90deg); }

.doc-folder-children {
  padding-left: 16px;
  display: none;
}

.doc-folder-children.open { display: block; }

.doc-file {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 8px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  color: var(--muted);
  font-size: 12px;
  transition: all var(--t);
}

.doc-file:hover { background: var(--surface-2); color: var(--text); }
.doc-file.active { background: var(--accent-glow); color: var(--accent); }

.docs-content {
  padding: 24px;
  overflow-y: auto;
}

.docs-content::-webkit-scrollbar { width: 5px; }
.docs-content::-webkit-scrollbar-thumb { background: var(--surface-3); border-radius: 99px; }

.docs-content-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: var(--dim);
  gap: 12px;
}

.docs-content-empty .empty-icon { font-size: 40px; opacity: 0.4; }

.doc-rendered { max-width: 800px; line-height: 1.7; }

.doc-rendered h1 { font-size: 22px; font-weight: 700; margin-bottom: 14px; padding-bottom: 10px; border-bottom: 1px solid var(--border); }
.doc-rendered h2 { font-size: 17px; font-weight: 600; margin: 20px 0 10px; }
.doc-rendered h3 { font-size: 14px; font-weight: 600; margin: 14px 0 8px; color: var(--muted); }
.doc-rendered p { margin-bottom: 12px; color: var(--muted); font-size: 14px; }
.doc-rendered ul, .doc-rendered ol { padding-left: 20px; margin-bottom: 12px; color: var(--muted); font-size: 14px; }
.doc-rendered li { margin-bottom: 4px; }
.doc-rendered code {
  font-family: 'JetBrains Mono', monospace;
  background: var(--surface-2);
  border: 1px solid var(--border);
  padding: 1px 5px;
  border-radius: 3px;
  font-size: 12px;
  color: var(--text);
}
.doc-rendered pre {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px;
  overflow-x: auto;
  margin-bottom: 14px;
}
.doc-rendered pre code { background: none; border: none; padding: 0; }
.doc-rendered blockquote {
  border-left: 3px solid var(--accent);
  padding-left: 14px;
  margin: 12px 0;
  color: var(--muted);
}
.doc-rendered table { width: 100%; border-collapse: collapse; margin-bottom: 14px; font-size: 13px; }
.doc-rendered th { background: var(--surface-2); text-align: left; padding: 8px 10px; font-weight: 600; border-bottom: 1px solid var(--border); }
.doc-rendered td { padding: 7px 10px; border-bottom: 1px solid var(--border); color: var(--muted); }
.doc-rendered a { color: var(--accent); text-decoration: none; }
.doc-rendered a:hover { text-decoration: underline; }
.doc-rendered strong { color: var(--text); font-weight: 600; }
.doc-rendered hr { border: none; border-top: 1px solid var(--border); margin: 16px 0; }

/* ================================================================
   CALENDAR
   ================================================================ */
.calendar-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 24px 0;
}

.week-nav-btn {
  width: 32px;
  height: 32px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  color: var(--muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--t);
  font-size: 14px;
}

.week-nav-btn:hover { border-color: var(--border-hover); color: var(--text); }

.week-label { font-size: 14px; font-weight: 600; flex: 1; }

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
  padding: 16px 24px;
}

.calendar-day-col {}
.calendar-day-header {
  text-align: center;
  margin-bottom: 8px;
}

.calendar-day-name {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.calendar-day-num {
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
  margin-top: 2px;
}

.calendar-day-num.today {
  color: var(--accent);
}

.calendar-day-events {
  min-height: 240px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px;
}

.cal-event {
  padding: 5px 7px;
  border-radius: 5px;
  font-size: 11px;
  font-weight: 500;
  margin-bottom: 4px;
  cursor: pointer;
  transition: opacity var(--t);
}

.cal-event:hover { opacity: 0.8; }

/* ================================================================
   MEMORY SECTION
   ================================================================ */
.memory-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 0;
  height: 100%;
  min-height: calc(100vh - 120px);
}

.memory-sidebar {
  border-right: 1px solid var(--border);
  overflow-y: auto;
}

.memory-sidebar::-webkit-scrollbar { width: 3px; }
.memory-sidebar::-webkit-scrollbar-thumb { background: var(--surface-3); border-radius: 99px; }

.memory-section-title {
  font-size: 11px;
  font-weight: 600;
  color: var(--dim);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 14px 16px 6px;
}

.memory-entry {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 16px;
  cursor: pointer;
  color: var(--muted);
  font-size: 13px;
  transition: all var(--t);
}

.memory-entry:hover { background: var(--surface-2); color: var(--text); }
.memory-entry.active { background: var(--accent-glow); color: var(--accent); }

.memory-content {
  padding: 24px;
  overflow-y: auto;
}

.memory-content::-webkit-scrollbar { width: 5px; }
.memory-content::-webkit-scrollbar-thumb { background: var(--surface-3); border-radius: 99px; }

/* ================================================================
   USAGE SECTION
   ================================================================ */
.usage-summary-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.usage-plan-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}

.usage-plan-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.usage-plan-amount {
  font-size: 26px;
  font-weight: 700;
  color: var(--text);
  line-height: 1;
}

.usage-plan-sub {
  font-size: 12px;
  color: var(--muted);
  margin-top: 6px;
}

.usage-token-bar {
  background: var(--surface-2);
  border-radius: 4px;
  height: 6px;
  overflow: hidden;
  margin-top: 10px;
}

.usage-token-fill {
  height: 100%;
  border-radius: 4px;
  background: var(--accent);
  transition: width 500ms ease;
}

.agent-cost-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}

.agent-cost-row:last-child { border-bottom: none; }

.agent-cost-name { font-size: 13px; font-weight: 500; }
.agent-cost-tokens { font-size: 12px; color: var(--muted); }
.agent-cost-amount { font-size: 13px; font-weight: 600; color: var(--green); }

/* ================================================================
   PROJECTS SECTION
   ================================================================ */
.project-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  cursor: pointer;
  transition: all var(--t);
  position: relative;
  overflow: hidden;
}

.project-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-hover);
  box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

.project-color-bar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
}

.project-name { font-size: 16px; font-weight: 600; margin-bottom: 6px; margin-top: 8px; }
.project-desc { font-size: 13px; color: var(--muted); line-height: 1.5; margin-bottom: 14px; }

.project-stats {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 12px;
}

.project-stat {
  font-size: 12px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 4px;
}

.project-progress-track {
  background: var(--surface-2);
  border-radius: 4px;
  height: 5px;
  overflow: hidden;
}

.project-progress-bar {
  height: 100%;
  border-radius: 4px;
  transition: width 600ms ease;
}

.project-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 12px;
}

.project-pct { font-size: 13px; font-weight: 600; }

/* ================================================================
   TOAST
   ================================================================ */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  background: var(--surface-3);
  border: 1px solid var(--border-hover);
  border-radius: var(--radius);
  padding: 10px 16px;
  color: var(--text);
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 8px;
  animation: toast-in 200ms ease;
  max-width: 300px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}

@keyframes toast-in {
  from { opacity: 0; transform: translateX(20px); }
  to { opacity: 1; transform: translateX(0); }
}

.toast.success { border-left: 3px solid var(--green); }
.toast.error { border-left: 3px solid var(--red); }
.toast.info { border-left: 3px solid var(--blue); }

/* ================================================================
   COMMAND PALETTE
   ================================================================ */
.cmd-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  z-index: 2000;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 120px;
  backdrop-filter: blur(4px);
}

.cmd-modal {
  background: var(--surface);
  border: 1px solid var(--border-hover);
  border-radius: 12px;
  width: 100%;
  max-width: 560px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.6);
  overflow: hidden;
  animation: slideModal 150ms ease;
}

.cmd-input-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}

.cmd-input {
  flex: 1;
  background: none;
  border: none;
  color: var(--text);
  font-size: 16px;
  font-family: inherit;
  outline: none;
}

.cmd-results { max-height: 400px; overflow-y: auto; }

.cmd-result-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  cursor: pointer;
  transition: background var(--t);
  font-size: 13px;
}

.cmd-result-item:hover, .cmd-result-item.selected { background: var(--surface-2); }
.cmd-result-icon { color: var(--muted); font-size: 15px; width: 20px; text-align: center; }
.cmd-result-text { flex: 1; }
.cmd-result-type { font-size: 11px; color: var(--dim); background: var(--surface-3); padding: 2px 7px; border-radius: 20px; }

.cmd-empty { padding: 24px; text-align: center; color: var(--dim); font-size: 13px; }

/* ================================================================
   EMPTY STATES
   ================================================================ */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  color: var(--dim);
  text-align: center;
  gap: 10px;
}

.empty-state .icon { font-size: 32px; opacity: 0.4; }
.empty-state p { font-size: 13px; max-width: 200px; }

/* ================================================================
   LOADING
   ================================================================ */
.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 600ms linear infinite;
  display: inline-block;
}

@keyframes spin { to { transform: rotate(360deg); } }

.loading-overlay {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  color: var(--muted);
  gap: 10px;
  font-size: 13px;
}

/* Scrollbar global */
* { scrollbar-width: thin; scrollbar-color: var(--surface-3) transparent; }

/* ================================================================
   KPI DASHBOARD STYLES
   ================================================================ */
.kpi-tab-bar {
  display: flex;
  gap: 4px;
  background: var(--surface);
  border-radius: var(--radius-sm);
  padding: 4px;
}

.kpi-tab {
  padding: 8px 16px;
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--t);
}

.kpi-tab:hover {
  color: var(--text);
  background: var(--surface-2);
}

.kpi-tab.active {
  background: var(--accent);
  color: white;
}

.kpi-view {
  display: none;
}

.kpi-view.active {
  display: block;
}

.kpi-summary-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.kpi-summary-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  text-align: center;
}

.kpi-summary-value {
  font-size: 32px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
}

.kpi-summary-label {
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.kpi-summary-change {
  font-size: 12px;
  margin-top: 8px;
  color: var(--muted);
}

.kpi-summary-change.positive { color: var(--green); }
.kpi-summary-change.negative { color: var(--red); }

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.kpi-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.kpi-card.full-width {
  grid-column: 1 / -1;
}

.kpi-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
}

.kpi-card-title {
  font-weight: 600;
  font-size: 14px;
}

.kpi-period {
  font-size: 11px;
  color: var(--muted);
  background: var(--surface);
  padding: 4px 8px;
  border-radius: var(--radius-sm);
}

.kpi-metrics {
  padding: 16px;
}

.kpi-metric {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}

.kpi-metric:last-child {
  border-bottom: none;
}

.kpi-metric.highlight {
  background: var(--accent-glow);
  margin: 0 -16px;
  padding: 10px 16px;
  border-radius: 0;
}

.kpi-metric-label {
  font-size: 13px;
  color: var(--muted);
}

.kpi-metric-value {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  font-family: 'JetBrains Mono', monospace;
}

.kpi-funnel {
  padding: 16px;
}

.kpi-funnel-stage {
  display: grid;
  grid-template-columns: 1fr 120px 60px;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.kpi-funnel-stage:last-child {
  margin-bottom: 0;
}

.kpi-funnel-bar {
  height: 24px;
  background: linear-gradient(90deg, var(--accent), var(--blue));
  border-radius: var(--radius-sm);
  transition: width 0.5s ease;
}

.kpi-funnel-label {
  font-size: 12px;
  color: var(--muted);
}

.kpi-funnel-value {
  font-size: 13px;
  font-weight: 600;
  text-align: right;
  font-family: 'JetBrains Mono', monospace;
}

.kpi-table {
  overflow-x: auto;
}

.kpi-table table {
  width: 100%;
  border-collapse: collapse;
}

.kpi-table th,
.kpi-table td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}

.kpi-table th {
  background: var(--surface-2);
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 0.5px;
}

.kpi-table tbody tr:hover {
  background: var(--surface-2);
}

.kpi-status {
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  font-size: 11px;
  font-weight: 600;
}

.kpi-status.good { background: rgba(16, 185, 129, 0.2); color: var(--green); }
.kpi-status.warning { background: rgba(245, 158, 11, 0.2); color: var(--amber); }
.kpi-status.bad { background: rgba(239, 68, 68, 0.2); color: var(--red); }
.kpi-status.neutral { background: var(--surface-2); color: var(--muted); }

.kpi-empty {
  text-align: center;
  color: var(--muted);
  font-style: italic;
  padding: 20px;
}

.kpi-empty-state {
  padding: 40px;
  text-align: center;
  color: var(--muted);
}

.kpi-empty-icon {
  font-size: 32px;
  margin-bottom: 8px;
}

@media (max-width: 1200px) {
  .kpi-summary-row {
    grid-template-columns: repeat(2, 1fr);
  }
  .kpi-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .kpi-summary-row {
    grid-template-columns: 1fr;
  }
  .kpi-grid {
    grid-template-columns: 1fr;
  }
  .kpi-tab-bar {
    flex-wrap: wrap;
  }
}

/* ================================================================
   KPI BENCHMARK STYLES
   ================================================================ */
.kpi-period-bar {
  display: flex;
  gap: 4px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 4px;
  margin-bottom: 20px;
  width: fit-content;
}

.kpi-period-btn {
  padding: 6px 14px;
  background: transparent;
  border: none;
  border-radius: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 150ms ease;
  font-family: inherit;
  white-space: nowrap;
}
.kpi-period-btn:hover { color: var(--text); background: var(--surface-2); }
.kpi-period-btn.active { background: var(--accent); color: white; }

.kpi-bench-status { font-size: 11px; font-weight: 600; white-space: nowrap; flex-shrink: 0; }
.kpi-bench-status.pre-launch { color: var(--muted); }
.kpi-bench-status.below { color: var(--red); }
.kpi-bench-status.approaching { color: var(--amber); }
.kpi-bench-status.on-track { color: var(--green); }
.kpi-bench-status.exceeding { color: var(--blue); }

.kpi-bench-bar-wrap {
  position: relative;
  height: 8px;
  background: var(--surface-2);
  border-radius: 4px;
  overflow: visible;
  flex: 1;
  min-width: 60px;
}
.kpi-bench-bar-fill {
  position: absolute;
  left: 0; top: 0;
  height: 100%;
  border-radius: 4px;
  transition: width 600ms ease, background 300ms ease;
  max-width: 100%;
}
.kpi-bench-target-marker {
  position: absolute;
  top: -3px;
  width: 2px;
  height: 14px;
  background: rgba(255,255,255,0.3);
  border-radius: 1px;
  pointer-events: none;
}
.kpi-bench-target-marker.great {
  background: rgba(16,185,129,0.7);
}

.kpi-benchmark-row {
  display: flex;
  flex-direction: column;
  gap: 5px;
  width: 100%;
}
.kpi-bench-values {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
}
.kpi-bench-yours {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  font-family: 'JetBrains Mono', monospace;
}
.kpi-bench-target-label {
  font-size: 11px;
  color: var(--dim);
}
.kpi-bench-footer {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Benchmark table rows in Sales tab */
.kpi-bench-table-row {
  display: grid;
  grid-template-columns: 1fr 90px 110px 90px;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.kpi-bench-table-row:last-child { border-bottom: none; }
.kpi-bench-table-row:hover { background: var(--surface-2); }
.kpi-bench-table-header {
  font-size: 11px;
  font-weight: 600;
  color: var(--dim);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.kpi-bench-your-val { font-weight: 600; font-family: 'JetBrains Mono', monospace; color: var(--text); }
.kpi-bench-std-val { color: var(--muted); font-size: 12px; }

/* Override kpi-metric to support benchmark layout */
.kpi-metric.has-bench {
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  padding: 12px 0;
}
.kpi-metric.has-bench .kpi-metric-label {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 0;
}
.kpi-metric.has-bench .kpi-metric-value {
  display: none; /* replaced by benchmark row */
}
