:root {
  --bg: #0a0e17;
  --surface: #111827;
  --surface-2: #1a2235;
  --border: #1e293b;
  --text: #e2e8f0;
  --text-dim: #94a3b8;
  --accent: #3b82f6;
  --accent-dim: #1e3a5f;
  --green: #22c55e;
  --green-dim: #14532d;
  --red: #ef4444;
  --red-dim: #7f1d1d;
  --yellow: #eab308;
  --yellow-dim: #713f12;
  --orange: #f97316;
  --purple: #a855f7;
  --radius: 8px;
  --sidebar-w: 240px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  width: var(--sidebar-w);
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 100;
}

.sidebar-header {
  padding: 24px 20px 16px;
  border-bottom: 1px solid var(--border);
}

.sidebar-header h1 {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--accent);
}

.sidebar-header .subtitle {
  font-size: 11px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 1.5px;
}

.nav-links {
  list-style: none;
  padding: 12px 0;
  flex: 1;
}

.nav-links li a {
  display: block;
  padding: 10px 20px;
  color: var(--text-dim);
  text-decoration: none;
  font-size: 14px;
  transition: all 0.15s;
  border-left: 3px solid transparent;
}

.nav-links li a:hover {
  background: var(--surface-2);
  color: var(--text);
}

.nav-links li a.active {
  color: var(--accent);
  background: var(--accent-dim);
  border-left-color: var(--accent);
}

.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--border);
}

.status-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-dim);
}

.status-indicator .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--yellow);
}

.status-indicator.connected .dot { background: var(--green); }
.status-indicator.error .dot { background: var(--red); }

.last-refresh {
  font-size: 11px;
  color: var(--text-dim);
  margin-top: 6px;
}

/* Main content */
.content {
  flex: 1;
  margin-left: var(--sidebar-w);
  padding: 32px;
  max-width: 1200px;
}

.view { display: none; }
.view.active { display: block; }

.view-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.view-header h2 {
  font-size: 22px;
  font-weight: 600;
}

.header-controls {
  display: flex;
  gap: 10px;
  align-items: center;
}

select {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 8px 12px;
  border-radius: var(--radius);
  font-size: 13px;
  cursor: pointer;
}

.btn-refresh {
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-dim);
  padding: 8px 16px;
  border-radius: var(--radius);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.15s;
}

.btn-refresh:hover {
  background: var(--accent-dim);
  color: var(--accent);
  border-color: var(--accent);
}

/* Stats grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

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

.stat-card .label {
  font-size: 12px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}

.stat-card .value {
  font-size: 28px;
  font-weight: 700;
}

.stat-card .sub {
  font-size: 12px;
  color: var(--text-dim);
  margin-top: 4px;
}

/* Cards */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 16px;
}

.card h3 {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 16px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}

/* Recommendation box */
.recommendation-box {
  font-size: 14px;
  line-height: 1.6;
}

.recommendation-box .model-pick {
  font-size: 20px;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 8px;
}

.recommendation-box .confidence {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
}

/* Activity list */
.activity-list {
  font-size: 13px;
}

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

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

.activity-item .worker-tag {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 4px;
  background: var(--surface-2);
  color: var(--text-dim);
  white-space: nowrap;
}

.activity-item .time {
  font-size: 11px;
  color: var(--text-dim);
  white-space: nowrap;
}

/* Tables */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.data-table th {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 2px solid var(--border);
  color: var(--text-dim);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
}

.data-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

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

/* Badges */
.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
}

.badge-high { background: var(--red-dim); color: var(--red); }
.badge-medium { background: var(--yellow-dim); color: var(--yellow); }
.badge-low { background: var(--green-dim); color: var(--green); }
.badge-critical { background: var(--red-dim); color: var(--red); border: 1px solid var(--red); }

.badge-validated { background: var(--green-dim); color: var(--green); }
.badge-active { background: var(--accent-dim); color: var(--accent); }
.badge-invalidated { background: var(--red-dim); color: var(--red); }
.badge-needs_data { background: var(--yellow-dim); color: var(--yellow); }

/* Confidence bar */
.confidence-bar {
  width: 100%;
  height: 6px;
  background: var(--surface-2);
  border-radius: 3px;
  overflow: hidden;
  margin-top: 4px;
}

.confidence-bar .fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.3s;
}

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

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

.model-card-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  font-weight: 600;
  font-size: 15px;
}

.model-card-header.retail { border-top: 3px solid var(--green); }
.model-card-header.saas { border-top: 3px solid var(--accent); }
.model-card-header.hybrid { border-top: 3px solid var(--purple); }

.model-card-body {
  padding: 16px 20px;
}

.score-row {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}

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

.score-row .dim { color: var(--text-dim); }
.score-row .val { font-weight: 600; font-variant-numeric: tabular-nums; }

.overall-score {
  text-align: center;
  padding: 16px;
  border-top: 1px solid var(--border);
}

.overall-score .number {
  font-size: 32px;
  font-weight: 700;
}

.overall-score .label {
  font-size: 11px;
  color: var(--text-dim);
  text-transform: uppercase;
  margin-top: 4px;
}

/* Report viewer */
.report-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 16px;
  overflow: hidden;
}

.report-card-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
}

.report-card-header:hover {
  background: var(--surface-2);
}

.report-card-body {
  padding: 20px;
  display: none;
  font-size: 14px;
  line-height: 1.7;
  white-space: pre-wrap;
}

.report-card-body.open { display: block; }

/* Pro Forma version */
.proforma-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 16px;
  overflow: hidden;
}

.proforma-header {
  padding: 16px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
}

.proforma-header:hover { background: var(--surface-2); }

.proforma-header .version {
  font-weight: 700;
  color: var(--accent);
}

.proforma-body {
  display: none;
  padding: 20px;
  font-size: 13px;
  line-height: 1.7;
  white-space: pre-wrap;
}

.proforma-body.open { display: block; }

.kill-criteria-met {
  border-color: var(--red);
  box-shadow: 0 0 0 1px var(--red);
}

/* Competitive cards */
.competitor-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 12px;
}

.competitor-card .name {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 4px;
}

.competitor-card .category {
  font-size: 12px;
  color: var(--text-dim);
  margin-bottom: 12px;
}

.competitor-card .threat {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
}

.threat-high { background: var(--red-dim); color: var(--red); }
.threat-medium { background: var(--yellow-dim); color: var(--yellow); }
.threat-low { background: var(--green-dim); color: var(--green); }

/* Empty state */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-dim);
}

.empty-state .icon { font-size: 40px; margin-bottom: 12px; }
.empty-state .msg { font-size: 15px; }

/* Worker Schedule */
.schedule-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

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

.schedule-card.has-data {
  border-left: 3px solid var(--green);
}

.schedule-card.no-data {
  border-left: 3px solid var(--yellow);
}

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

.schedule-card-header .worker-name {
  font-weight: 600;
  font-size: 14px;
}

.cadence-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 12px;
  background: var(--accent-dim);
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.schedule-card-body {
  padding: 16px 20px;
}

.schedule-detail {
  font-size: 12px;
  color: var(--text-dim);
  margin-bottom: 14px;
}

.schedule-row {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  font-size: 13px;
}

.schedule-label {
  color: var(--text-dim);
}

.schedule-value {
  font-weight: 600;
}

.schedule-value.next-run {
  color: var(--accent);
}

.countdown-bar {
  margin-top: 12px;
  text-align: center;
  padding: 8px;
  background: var(--surface-2);
  border-radius: var(--radius);
}

.countdown-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-dim);
}

/* GTM Roadmap */
.gtm-version {
  font-size: 13px;
  color: var(--text-dim);
  margin-bottom: 20px;
}

.gtm-year-header {
  font-size: 16px;
  font-weight: 700;
  color: var(--accent);
  padding: 12px 0 8px;
  border-bottom: 2px solid var(--accent-dim);
  margin-bottom: 16px;
  margin-top: 24px;
}

.gtm-timeline {
  position: relative;
  padding-left: 24px;
  border-left: 3px solid var(--border);
  margin-bottom: 12px;
}

.gtm-phase-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 16px;
  overflow: hidden;
  position: relative;
}

.gtm-phase-card::before {
  content: '';
  position: absolute;
  left: -30px;
  top: 20px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--border);
  border: 2px solid var(--bg);
}

.gtm-phase-card.active::before { background: var(--accent); }
.gtm-phase-card.completed::before { background: var(--green); }
.gtm-phase-card.active { border-left: 3px solid var(--accent); }
.gtm-phase-card.completed { border-left: 3px solid var(--green); }

.gtm-phase-header {
  padding: 16px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  border-bottom: 1px solid var(--border);
}

.gtm-phase-header:hover { background: var(--surface-2); }

.gtm-phase-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.gtm-quarter {
  font-weight: 700;
  font-size: 15px;
  color: var(--accent);
  min-width: 48px;
}

.gtm-phase-name {
  font-weight: 600;
  font-size: 14px;
}

.gtm-phase-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.gtm-theme {
  font-size: 12px;
  color: var(--text-dim);
  font-style: italic;
}

.gtm-phase-body {
  display: none;
  padding: 20px;
  font-size: 13px;
  line-height: 1.6;
}

.gtm-phase-card.expanded .gtm-phase-body { display: block; }

.gtm-vision-alignment {
  background: var(--accent-dim);
  border-radius: var(--radius);
  padding: 12px 16px;
  margin-bottom: 16px;
  font-size: 13px;
  border-left: 3px solid var(--accent);
}

.gtm-section-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.gtm-section {
  background: var(--surface-2);
  border-radius: var(--radius);
  padding: 14px;
}

.gtm-section h4 {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-dim);
  margin-bottom: 8px;
}

.gtm-section ul {
  list-style: none;
  padding: 0;
}

.gtm-section ul li {
  padding: 3px 0;
  font-size: 12px;
  padding-left: 12px;
  position: relative;
}

.gtm-section ul li::before {
  content: '\2022';
  color: var(--accent);
  position: absolute;
  left: 0;
}

.gtm-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-dim);
  text-transform: uppercase;
  margin-top: 6px;
  margin-bottom: 2px;
}

.gtm-metric {
  display: flex;
  justify-content: space-between;
  padding: 4px 0;
  font-size: 13px;
  border-bottom: 1px solid var(--border);
}

.gtm-metric span:last-child {
  font-weight: 600;
}

.gtm-metrics-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.gtm-metric-item {
  display: flex;
  justify-content: space-between;
  padding: 6px 10px;
  background: var(--surface-2);
  border-radius: 4px;
  font-size: 12px;
}

.gtm-risk {
  padding: 6px 0;
  font-size: 12px;
  border-bottom: 1px solid var(--border);
}

.gtm-risk:last-child { border-bottom: none; }

/* Responsive */
@media (max-width: 1024px) {
  .two-col { grid-template-columns: 1fr; }
  .scorecard-grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .sidebar {
    width: 100%;
    height: auto;
    position: relative;
  }
  .sidebar-header { padding: 16px; }
  .nav-links { display: flex; overflow-x: auto; padding: 0; }
  .nav-links li a {
    border-left: none;
    border-bottom: 3px solid transparent;
    white-space: nowrap;
    padding: 10px 16px;
  }
  .nav-links li a.active { border-bottom-color: var(--accent); border-left-color: transparent; }
  .sidebar-footer { display: none; }
  .content { margin-left: 0; padding: 16px; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
}
