/* ============================================
   NGO Capacity-Building Audit Tool
   Design System & Styles
   ============================================ */

/* --- Design Tokens --- */
:root,
[data-theme='light'] {
  /* Surfaces */
  --color-bg: #f7f6f2;
  --color-surface: #f9f8f5;
  --color-surface-2: #fbfbf9;
  --color-surface-offset: #f0ede8;
  --color-surface-dynamic: #e6e4df;
  --color-divider: #dcd9d5;
  --color-border: #d4d1ca;
  --color-border-strong: #c0bdb4;

  /* Text */
  --color-text: #28251d;
  --color-text-muted: #6b6a64;
  --color-text-faint: #a8a7a0;

  /* Primary — Deep Forest (growth, capacity) */
  --color-primary: #1a5d4a;
  --color-primary-hover: #144a3b;
  --color-primary-active: #0f382c;
  --color-primary-light: #e8f2ed;

  /* Semantic */
  --color-success: #437a22;
  --color-success-light: #e8f0e0;
  --color-warning: #b87420;
  --color-warning-light: #faf0e0;
  --color-error: #a13544;
  --color-error-light: #f5e0e2;
  --color-info: #2c6f9e;
  --color-info-light: #e0edf5;

  /* Chart colors */
  --chart-1: #1a5d4a;
  --chart-2: #b87420;
  --chart-3: #2c6f9e;
  --chart-4: #944454;
  --chart-5: #d19900;
  --chart-benchmark: #c0bdb4;

  /* Radius */
  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(40, 37, 29, 0.06);
  --shadow-md: 0 4px 12px rgba(40, 37, 29, 0.08);
  --shadow-lg: 0 12px 32px rgba(40, 37, 29, 0.12);

  /* Type scale */
  --text-xs: clamp(0.75rem, 0.7rem + 0.25vw, 0.875rem);
  --text-sm: clamp(0.875rem, 0.8rem + 0.35vw, 1rem);
  --text-base: clamp(1rem, 0.95rem + 0.25vw, 1.125rem);
  --text-lg: clamp(1.125rem, 1rem + 0.75vw, 1.5rem);
  --text-xl: clamp(1.5rem, 1.2rem + 1.25vw, 2.25rem);

  /* Spacing */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;

  /* Fonts */
  --font-display: 'Cabinet Grotesk', 'Inter', sans-serif;
  --font-body: 'General Sans', 'Inter', sans-serif;

  --transition: 200ms cubic-bezier(0.16, 1, 0.3, 1);
}

[data-theme='dark'] {
  --color-bg: #14130f;
  --color-surface: #1b1a16;
  --color-surface-2: #201f1b;
  --color-surface-offset: #1d1c18;
  --color-surface-dynamic: #2d2c28;
  --color-divider: #2a2925;
  --color-border: #36342f;
  --color-border-strong: #45423d;

  --color-text: #d4d3cd;
  --color-text-muted: #8a8983;
  --color-text-faint: #5a5953;

  --color-primary: #5fae92;
  --color-primary-hover: #4a937b;
  --color-primary-active: #3a7863;
  --color-primary-light: #1f2e26;

  --color-success: #7dba50;
  --color-success-light: #1f2d16;
  --color-warning: #d49a4a;
  --color-warning-light: #2d2415;
  --color-error: #d4665f;
  --color-error-light: #2d191c;
  --color-info: #5a9fd0;
  --color-info-light: #16242e;

  --chart-1: #5fae92;
  --chart-2: #d49a4a;
  --chart-3: #5a9fd0;
  --chart-4: #c47a85;
  --chart-5: #e8af34;
  --chart-benchmark: #45423d;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.5);
}

/* --- Base --- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  -webkit-text-size-adjust: none;
  text-size-adjust: none;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  min-height: 100dvh;
  line-height: 1.6;
  font-family: var(--font-body);
  font-size: var(--text-base);
  color: var(--color-text);
  background-color: var(--color-bg);
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  text-wrap: balance;
  line-height: 1.2;
  font-weight: 700;
}

input, button, textarea, select {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  background: none;
  border: none;
}

a, button, [role='button'], input, textarea, select {
  transition: color var(--transition), background var(--transition),
    border-color var(--transition), box-shadow var(--transition);
}

::selection {
  background: color-mix(in srgb, var(--color-primary) 25%, transparent);
  color: var(--color-text);
}

:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

.tabular {
  font-variant-numeric: tabular-nums lining-nums;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

/* --- Layout --- */
.app-shell {
  display: grid;
  grid-template-columns: 260px 1fr;
  grid-template-rows: auto 1fr;
  height: 100dvh;
  overflow: hidden;
}

.app-header {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-4) var(--space-6);
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  z-index: 20;
}

.app-header-left {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.app-logo {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.app-logo svg {
  width: 32px;
  height: 32px;
  color: var(--color-primary);
}

.app-logo-text {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--text-lg);
  letter-spacing: -0.02em;
}

.app-logo-text span {
  color: var(--color-primary);
}

.app-header-right {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.sidebar {
  grid-row: 2;
  background: var(--color-surface);
  border-right: 1px solid var(--color-border);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: var(--space-4) var(--space-3);
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.sidebar-section-label {
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-faint);
  padding: var(--space-2) var(--space-3);
  margin-bottom: var(--space-1);
}

.nav-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3);
  border-radius: var(--radius-md);
  color: var(--color-text-muted);
  font-size: var(--text-sm);
  font-weight: 500;
  width: 100%;
  text-align: left;
}

.nav-item:hover {
  background: var(--color-surface-offset);
  color: var(--color-text);
}

.nav-item.active {
  background: var(--color-primary-light);
  color: var(--color-primary);
  font-weight: 600;
}

.nav-item svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.nav-badge {
  margin-left: auto;
  font-size: var(--text-xs);
  font-weight: 600;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  background: var(--color-surface-dynamic);
  color: var(--color-text-muted);
}

.nav-item.active .nav-badge {
  background: var(--color-primary);
  color: #fff;
}

.main {
  grid-column: 2;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: var(--space-6) var(--space-8);
}

.main-content {
  max-width: 1100px;
  margin: 0 auto;
}

/* --- View Transitions --- */
.view {
  display: none;
  animation: fadeIn 300ms ease;
}

.view.active {
  display: block;
}

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

/* --- Page Header --- */
.page-header {
  margin-bottom: var(--space-8);
}

.page-title {
  font-size: var(--text-xl);
  margin-bottom: var(--space-1);
}

.page-subtitle {
  color: var(--color-text-muted);
  font-size: var(--text-sm);
}

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-5);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  font-weight: 600;
  border: 1px solid transparent;
  white-space: nowrap;
}

.btn-primary {
  background: var(--color-primary);
  color: #fff;
}

.btn-primary:hover {
  background: var(--color-primary-hover);
}

.btn-secondary {
  background: var(--color-surface-2);
  color: var(--color-text);
  border-color: var(--color-border);
}

.btn-secondary:hover {
  background: var(--color-surface-offset);
  border-color: var(--color-border-strong);
}

.btn-ghost {
  color: var(--color-text-muted);
  padding: var(--space-2);
}

.btn-ghost:hover {
  background: var(--color-surface-offset);
  color: var(--color-text);
}

.btn-icon {
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  color: var(--color-text-muted);
}

.btn-icon:hover {
  background: var(--color-surface-offset);
  color: var(--color-text);
}

.btn-sm {
  padding: var(--space-2) var(--space-3);
  font-size: var(--text-xs);
}

/* --- Cards --- */
.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-4);
}

.card-title {
  font-size: var(--text-lg);
  font-family: var(--font-display);
  font-weight: 700;
}

.card-subtitle {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  margin-top: var(--space-1);
}

/* --- KPI Cards --- */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--space-4);
  margin-bottom: var(--space-6);
}

.kpi-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  position: relative;
  overflow: hidden;
}

.kpi-label {
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-text-muted);
  margin-bottom: var(--space-2);
}

.kpi-value {
  font-size: 2rem;
  font-weight: 700;
  font-family: var(--font-display);
  font-variant-numeric: tabular-nums lining-nums;
  line-height: 1.1;
}

.kpi-value .unit {
  font-size: 1rem;
  color: var(--color-text-muted);
  font-weight: 500;
}

.kpi-delta {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: var(--text-xs);
  font-weight: 600;
  margin-top: var(--space-2);
}

.kpi-delta.up { color: var(--color-success); }
.kpi-delta.down { color: var(--color-error); }
.kpi-delta.flat { color: var(--color-text-faint); }

.kpi-bar {
  margin-top: var(--space-3);
  height: 6px;
  background: var(--color-surface-dynamic);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.kpi-bar-fill {
  height: 100%;
  border-radius: var(--radius-full);
  transition: width 800ms cubic-bezier(0.16, 1, 0.3, 1);
}

/* --- Assessment Wizard --- */
.wizard-progress {
  display: flex;
  align-items: center;
  gap: 0;
  margin-bottom: var(--space-8);
}

.wizard-step {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex: 1;
  position: relative;
}

.wizard-step:not(:last-child)::after {
  content: '';
  flex: 1;
  height: 2px;
  background: var(--color-border);
  margin: 0 var(--space-2);
  transition: background var(--transition);
}

.wizard-step.completed:not(:last-child)::after {
  background: var(--color-primary);
}

.wizard-step-num {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-sm);
  font-weight: 700;
  font-family: var(--font-display);
  background: var(--color-surface-2);
  border: 2px solid var(--color-border);
  color: var(--color-text-muted);
  flex-shrink: 0;
  transition: all var(--transition);
}

.wizard-step.active .wizard-step-num {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: #fff;
}

.wizard-step.completed .wizard-step-num {
  background: var(--color-primary-light);
  border-color: var(--color-primary);
  color: var(--color-primary);
}

.wizard-step-label {
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--color-text-muted);
  white-space: nowrap;
}

.wizard-step.active .wizard-step-label {
  color: var(--color-text);
}

/* --- Assessment Items --- */
.pillar-header {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-6);
  padding-bottom: var(--space-4);
  border-bottom: 1px solid var(--color-border);
}

.pillar-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-primary-light);
  color: var(--color-primary);
  flex-shrink: 0;
}

.pillar-icon svg {
  width: 24px;
  height: 24px;
}

.pillar-title {
  font-size: var(--text-lg);
  font-family: var(--font-display);
  font-weight: 700;
}

.pillar-desc {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}

.assessment-item {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  margin-bottom: var(--space-4);
}

.assessment-item-header {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-3);
}

.assessment-item-title {
  font-size: var(--text-sm);
  font-weight: 600;
  line-height: 1.4;
  flex: 1;
}

.assessment-item-tag {
  font-size: var(--text-xs);
  font-weight: 600;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  white-space: nowrap;
  flex-shrink: 0;
}

.tag-structured {
  background: var(--color-info-light);
  color: var(--color-info);
}

.assessment-item-desc {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  margin-bottom: var(--space-3);
  line-height: 1.5;
}

/* --- Help Toggle & Panel --- */
.help-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: var(--radius-full);
  border: 1px solid var(--color-border);
  background: var(--color-surface-alt);
  color: var(--color-text-muted);
  cursor: pointer;
  flex-shrink: 0;
  transition: all 180ms ease;
}

.help-toggle:hover {
  background: var(--color-primary-light);
  color: var(--color-primary);
  border-color: var(--color-primary);
}

.help-toggle.active {
  background: var(--color-primary);
  color: #fff;
  border-color: var(--color-primary);
}

.help-panel {
  max-height: 0;
  overflow: hidden;
  transition: max-height 300ms ease, margin 300ms ease;
  margin-bottom: 0;
}

.help-panel.open {
  max-height: 500px;
  margin-bottom: var(--space-3);
}

.help-panel-content {
  background: var(--color-surface-alt);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-4);
}

.help-panel-text {
  font-size: var(--text-xs);
  color: var(--color-text);
  line-height: 1.6;
  margin-bottom: var(--space-3);
}

.help-panel-scale {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.help-scale-item {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  line-height: 1.4;
}

.help-scale-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: var(--radius-full);
  background: var(--color-border);
  color: var(--color-text);
  font-weight: 700;
  font-size: 11px;
  flex-shrink: 0;
}

.help-scale-label {
  font-weight: 600;
  color: var(--color-text);
  flex-shrink: 0;
}

.help-scale-desc {
  color: var(--color-text-muted);
}

/* --- Scale Selector --- */
.scale-group {
  display: flex;
  gap: var(--space-2);
}

.scale-option {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: var(--space-2);
  border-radius: var(--radius-md);
  border: 2px solid var(--color-border);
  background: var(--color-surface-2);
  cursor: pointer;
  transition: all var(--transition);
}

.scale-option:hover {
  border-color: var(--color-primary);
  background: var(--color-primary-light);
}

.scale-option.selected {
  border-color: var(--color-primary);
  background: var(--color-primary-light);
}

.scale-option-num {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--text-base);
  color: var(--color-primary);
}

.scale-option-label {
  font-size: 10px;
  color: var(--color-text-muted);
  text-align: center;
  line-height: 1.2;
}

.scale-option.selected .scale-option-label {
  color: var(--color-text);
}

/* --- Benchmark Bars --- */
.benchmark-bar-container {
  margin-bottom: var(--space-5);
}

.benchmark-bar-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: var(--space-2);
}

.benchmark-bar-label {
  font-size: var(--text-sm);
  font-weight: 600;
}

.benchmark-bar-scores {
  font-size: var(--text-xs);
  font-variant-numeric: tabular-nums;
  color: var(--color-text-muted);
}

.benchmark-bar-scores strong {
  color: var(--color-text);
}

.benchmark-bar-track {
  position: relative;
  height: 28px;
  background: var(--color-surface-dynamic);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.benchmark-bar-fill {
  height: 100%;
  border-radius: var(--radius-sm);
  transition: width 800ms cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-right: var(--space-2);
  font-size: var(--text-xs);
  font-weight: 700;
  color: #fff;
  font-variant-numeric: tabular-nums;
}

.benchmark-bar-target {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--color-text-muted);
  z-index: 2;
}

.benchmark-bar-target::after {
  content: attr(data-target);
  position: absolute;
  top: -20px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 10px;
  font-weight: 600;
  color: var(--color-text-muted);
  white-space: nowrap;
}

/* --- Gap Analysis Table --- */
.gap-table {
  width: 100%;
  border-collapse: collapse;
}

.gap-table th {
  text-align: left;
  padding: var(--space-3);
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-text-muted);
  border-bottom: 2px solid var(--color-border);
  position: sticky;
  top: 0;
  background: var(--color-surface);
  z-index: 1;
}

.gap-table td {
  padding: var(--space-3);
  font-size: var(--text-sm);
  border-bottom: 1px solid var(--color-divider);
}

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

.priority-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: 600;
}

.priority-critical {
  background: var(--color-error-light);
  color: var(--color-error);
}

.priority-high {
  background: var(--color-warning-light);
  color: var(--color-warning);
}

.priority-medium {
  background: var(--color-info-light);
  color: var(--color-info);
}

.priority-low {
  background: var(--color-surface-dynamic);
  color: var(--color-text-muted);
}

/* --- Action Plan --- */
.timeline {
  position: relative;
  padding-left: var(--space-8);
}

.timeline::before {
  content: '';
  position: absolute;
  left: 15px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--color-border);
}

.quarter {
  margin-bottom: var(--space-8);
  position: relative;
}

.quarter-marker {
  position: absolute;
  left: -29px;
  top: 0;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  background: var(--color-primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-xs);
  font-weight: 700;
  font-family: var(--font-display);
  z-index: 1;
}

.quarter-header {
  margin-bottom: var(--space-4);
  padding-left: var(--space-4);
}

.quarter-title {
  font-size: var(--text-base);
  font-family: var(--font-display);
  font-weight: 700;
}

.quarter-desc {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}

.action-item {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  margin-bottom: var(--space-3);
  margin-left: var(--space-4);
}

.action-item-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-3);
  margin-bottom: var(--space-2);
}

.action-item-title {
  font-size: var(--text-sm);
  font-weight: 600;
  line-height: 1.4;
}

.action-item-body {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  line-height: 1.5;
}

.action-item-meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-top: var(--space-3);
}

.meta-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-size: 10px;
  font-weight: 600;
  background: var(--color-surface-dynamic);
  color: var(--color-text-muted);
}

.meta-chip svg {
  width: 12px;
  height: 12px;
}

/* --- Settings --- */
.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-4) 0;
  border-bottom: 1px solid var(--color-divider);
}

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

.settings-label {
  font-size: var(--text-sm);
  font-weight: 600;
}

.settings-desc {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  margin-top: 2px;
}

.settings-input {
  width: 80px;
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface-2);
  font-size: var(--text-sm);
  font-variant-numeric: tabular-nums;
  text-align: center;
}

.settings-input:focus {
  border-color: var(--color-primary);
  outline: none;
}

/* --- Readiness Band --- */
.readiness-band {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-full);
  font-size: var(--text-sm);
  font-weight: 600;
}

.band-critical { background: var(--color-error-light); color: var(--color-error); }
.band-emerging { background: var(--color-warning-light); color: var(--color-warning); }
.band-developing { background: var(--color-info-light); color: var(--color-info); }
.band-ready { background: var(--color-success-light); color: var(--color-success); }

/* --- Chart Container --- */
.chart-container {
  position: relative;
  height: 320px;
  margin: var(--space-4) 0;
}

.chart-container.tall {
  height: 420px;
  padding-bottom: var(--space-4);
}

.chart-container.small {
  height: 200px;
}

/* --- Grid Layouts --- */
.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-6);
  margin-bottom: var(--space-6);
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-4);
  margin-bottom: var(--space-6);
}

/* --- Empty State --- */
.empty-state {
  text-align: center;
  padding: var(--space-16) var(--space-8);
  color: var(--color-text-muted);
}

.empty-state svg {
  width: 48px;
  height: 48px;
  color: var(--color-text-faint);
  margin-bottom: var(--space-4);
}

.empty-state h3 {
  font-size: var(--text-lg);
  color: var(--color-text);
  margin-bottom: var(--space-2);
}

.empty-state p {
  max-width: 36ch;
  margin: 0 auto var(--space-6);
}

/* --- Toast --- */
.toast {
  position: fixed;
  bottom: var(--space-6);
  right: var(--space-6);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-4) var(--space-5);
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: var(--space-3);
  font-size: var(--text-sm);
  font-weight: 500;
  z-index: 100;
  transform: translateY(120%);
  transition: transform 300ms cubic-bezier(0.16, 1, 0.3, 1);
}

.toast.show {
  transform: translateY(0);
}

.toast svg {
  width: 20px;
  height: 20px;
  color: var(--color-success);
}

/* --- Responsive --- */
.mobile-nav {
  display: none;
}

@media (max-width: 900px) {
  .app-shell {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr auto;
  }

  .sidebar {
    display: none;
  }

  .app-header {
    padding: var(--space-3) var(--space-4);
  }

  .main {
    padding: var(--space-4);
    grid-column: 1;
    grid-row: 2;
  }

  .grid-2, .grid-3 {
    grid-template-columns: 1fr;
  }

  .wizard-step-label {
    display: none;
  }

  .scale-option-label {
    display: none;
  }

  .mobile-nav {
    display: flex;
    grid-row: 3;
    grid-column: 1;
    background: var(--color-surface);
    border-top: 1px solid var(--color-border);
    padding: var(--space-2);
    justify-content: space-around;
    z-index: 20;
  }
}

.mobile-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-md);
  color: var(--color-text-muted);
  font-size: 10px;
  font-weight: 600;
  flex: 1;
  max-width: 80px;
}

.mobile-nav-item svg {
  width: 20px;
  height: 20px;
}

.mobile-nav-item.active {
  color: var(--color-primary);
}

.mobile-nav-item:active {
  background: var(--color-surface-offset);
}

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

/* --- Print --- */
@media print {
  .app-shell {
    display: block;
    height: auto;
  }

  .sidebar, .app-header-right, .wizard-nav {
    display: none !important;
  }

  .main {
    overflow: visible;
    padding: 0;
  }

  .view {
    display: block !important;
  }

  .card {
    break-inside: avoid;
    box-shadow: none;
  }
}

/* --- Number Animation --- */
.count-up {
  display: inline-block;
}

/* --- Divider --- */
.divider {
  height: 1px;
  background: var(--color-border);
  margin: var(--space-6) 0;
}

/* --- Badge --- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: 600;
}

.badge-success { background: var(--color-success-light); color: var(--color-success); }
.badge-warning { background: var(--color-warning-light); color: var(--color-warning); }
.badge-error { background: var(--color-error-light); color: var(--color-error); }
