/* ========================================
   Motiv till Meriter — Design System
   ======================================== */

/* --- CSS Variables --- */
:root {
  --color-bg: #f8fafb;
  --color-surface: #ffffff;
  --color-surface-hover: #f1f5f7;
  --color-border: #e2e8f0;
  --color-border-light: #edf2f7;
  
  --color-text: #1a2a3a;
  --color-text-secondary: #5a6f7e;
  --color-text-muted: #8fa0b0;
  
  --color-primary: #0f6b4b;
  --color-primary-light: #e6f4ed;
  --color-primary-dark: #0a5238;
  
  --color-accent: #d4891f;
  --color-accent-light: #fef3e2;
  
  --color-danger: #c53030;
  --color-success: #0f6b4b;
  
  --color-phase-1: #3b82f6;
  --color-phase-2: #8b5cf6;
  --color-phase-3: #f59e0b;
  --color-phase-4: #10b981;
  
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.06);
  --shadow-lg: 0 8px 30px rgba(0,0,0,0.08);
  
  --sidebar-width: 240px;
  --topbar-height: 64px;
  
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

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

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

.hidden { display: none !important; }

/* ============================================================
   ONBOARDING & AI MAPPING
   ============================================================ */

.onboarding-overlay, .ai-mapping-overlay { z-index: 1100; }

.onboarding-modal {
  max-width: 560px;
  width: 90%;
  padding: 0;
  overflow: hidden;
}

.onboarding-header {
  text-align: center;
  padding: 32px 32px 20px;
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
  color: #fff;
}
.onboarding-icon { font-size: 40px; margin-bottom: 12px; }
.onboarding-header h2 { color: #fff; margin: 0 0 8px; font-size: 1.4rem; }
.onboarding-header p { color: rgba(255,255,255,0.8); margin: 0; font-size: 0.9rem; }

.onboarding-steps { padding: 24px 32px; min-height: 240px; }
.onboarding-step { display: none; }
.onboarding-step.active { display: block; }
.step-number { font-size: 0.75rem; color: var(--color-text-muted); font-weight: 600; letter-spacing: 1px; text-transform: uppercase; margin-bottom: 12px; }
.onboarding-step h3 { margin: 0 0 20px; font-size: 1.05rem; }

.role-grid, .focus-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.role-btn, .focus-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  background: var(--color-surface);
  border: 2px solid var(--color-border);
  border-radius: 10px;
  cursor: pointer;
  font-size: 0.9rem;
  text-align: left;
  transition: all 0.15s;
  color: var(--color-text);
}
.role-btn:hover, .focus-btn:hover { border-color: var(--color-primary); background: var(--color-surface-hover); }
.role-btn.selected, .focus-btn.selected { border-color: var(--color-primary); background: var(--color-primary-light); }
.role-icon, .focus-icon { font-size: 1.3rem; }

.drive-list { display: flex; flex-direction: column; gap: 8px; }
.drive-btn {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  background: var(--color-surface);
  border: 2px solid var(--color-border);
  border-radius: 10px;
  cursor: pointer;
  text-align: left;
  transition: all 0.15s;
  color: var(--color-text);
}
.drive-btn:hover { border-color: var(--color-primary); background: var(--color-surface-hover); }
.drive-btn.selected { border-color: var(--color-primary); background: var(--color-primary-light); }
.drive-icon { font-size: 1.5rem; flex-shrink: 0; }
.drive-btn strong { display: block; font-size: 0.9rem; }
.drive-desc { font-size: 0.78rem; color: var(--color-text-muted); }

.onboarding-nav {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 32px 24px;
  border-top: 1px solid var(--color-border-light);
}

/* AI Mapping Modal */
.ai-mapping-modal {
  max-width: 680px;
  width: 95%;
  padding: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  max-height: 90vh;
}

.ai-mapping-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--color-border-light);
  background: var(--color-surface);
}
.ai-mapping-title { display: flex; align-items: center; gap: 14px; }
.ai-badge { background: var(--color-primary); color: #fff; padding: 4px 10px; border-radius: 20px; font-size: 0.8rem; font-weight: 600; }
.ai-mapping-title h2 { margin: 0; font-size: 1.1rem; }
.ai-startup-name { margin: 0; font-size: 0.82rem; color: var(--color-text-muted); }

.ai-method-progress {
  display: flex;
  gap: 8px;
  padding: 12px 20px;
  background: var(--color-bg);
  border-bottom: 1px solid var(--color-border-light);
}
.method-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 0.78rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  color: var(--color-text-muted);
  transition: all 0.2s;
}
.method-pill.active { background: var(--color-primary); color: #fff; border-color: var(--color-primary); }
.method-pill.done { background: var(--color-success); color: #fff; border-color: var(--color-success); }

.ai-chat-area {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-height: 300px;
  max-height: 380px;
}

.ai-message { display: flex; gap: 10px; align-items: flex-start; }
.ai-message.user { flex-direction: row-reverse; }

.ai-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--color-primary-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
}

.ai-bubble {
  max-width: 80%;
  padding: 12px 16px;
  border-radius: 16px;
  font-size: 0.9rem;
  line-height: 1.5;
  background: var(--color-surface);
  border: 1px solid var(--color-border-light);
}
.ai-message.user .ai-bubble { background: var(--color-primary); color: #fff; border-color: var(--color-primary); }
.ai-streaming { opacity: 0.8; }

.typing-dots { animation: typingPulse 1.2s ease-in-out infinite; letter-spacing: 3px; color: var(--color-text-muted); }
@keyframes typingPulse { 0%, 100% { opacity: 0.3; } 50% { opacity: 1; } }

.ai-status-bar { padding: 4px 20px; font-size: 0.78rem; color: var(--color-text-muted); min-height: 22px; background: var(--color-bg); }

.ai-input-area {
  display: flex;
  gap: 10px;
  padding: 14px 20px;
  border-top: 1px solid var(--color-border-light);
  background: var(--color-surface);
}
.ai-input-area textarea {
  flex: 1;
  resize: none;
  border: 1px solid var(--color-border);
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 0.9rem;
  font-family: inherit;
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.4;
}
.ai-input-area textarea:focus { outline: none; border-color: var(--color-primary); }

.ai-mapping-footer {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 20px;
  border-top: 1px solid var(--color-border-light);
  background: var(--color-bg);
}

.entry-count {
  font-size: 0.85rem;
  color: var(--color-text-secondary);
  white-space: nowrap;
  margin-right: auto;
}
.entry-count.hidden { display: none; }
.entry-count strong {
  color: var(--color-primary);
}

.btn-icon { width: 32px; height: 32px; padding: 0; display: flex; align-items: center; justify-content: center; border-radius: 50%; font-size: 1rem; }

/* --- Auth Overlay --- */
.auth-overlay {
  position: fixed;
  inset: 0;
  background: linear-gradient(135deg, #0a3622 0%, #0f6b4b 40%, #1a4a3a 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.auth-card {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  padding: 40px;
  width: 100%;
  max-width: 420px;
  box-shadow: var(--shadow-lg);
}

.auth-brand {
  text-align: center;
  margin-bottom: 28px;
}

.brand-icon {
  font-size: 36px;
  margin-bottom: 8px;
}

.auth-brand h1 {
  font-size: 22px;
  font-weight: 700;
  color: var(--color-text);
}

.brand-tagline {
  font-size: 13px;
  color: var(--color-text-muted);
  margin-top: 4px;
}

.auth-form { display: none; }
.auth-form.active { display: block; }

.auth-form h2 {
  font-size: 18px;
  margin-bottom: 20px;
  color: var(--color-text);
}

.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text-secondary);
  margin-bottom: 6px;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-family: var(--font-sans);
  color: var(--color-text);
  background: var(--color-surface);
  transition: border-color 0.15s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-primary-light);
}

.form-group textarea {
  resize: vertical;
  min-height: 80px;
}

.auth-switch {
  text-align: center;
  font-size: 13px;
  color: var(--color-text-muted);
  margin-top: 16px;
}

.auth-switch a {
  color: var(--color-primary);
  font-weight: 600;
  text-decoration: none;
}

.auth-error {
  background: #fef2f2;
  color: var(--color-danger);
  font-size: 13px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  margin-top: 16px;
  text-align: center;
}

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 18px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  font-family: var(--font-sans);
  cursor: pointer;
  transition: all 0.15s;
  text-decoration: none;
}

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

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

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

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

.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-lg { padding: 14px 24px; font-size: 16px; }
.btn-full { width: 100%; }

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* --- App Shell --- */
.app-shell {
  display: flex;
  min-height: 100vh;
}

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

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px;
  font-weight: 700;
  font-size: 15px;
  color: var(--color-primary);
  border-bottom: 1px solid var(--color-border-light);
}

.nav-menu {
  list-style: none;
  padding: 12px 8px;
  flex: 1;
  overflow-y: auto;
}

.nav-menu li { margin-bottom: 2px; }

.nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  color: var(--color-text-secondary);
  text-decoration: none;
  transition: all 0.15s;
}

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

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

.nav-link i { width: 18px; text-align: center; font-size: 13px; }

.nav-divider {
  padding: 16px 14px 8px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-text-muted);
}

.phase-badge {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  background: var(--color-border);
  color: var(--color-text-secondary);
  flex-shrink: 0;
}

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

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

.user-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  color: var(--color-text-secondary);
}

/* --- Main Content --- */
.main-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  min-height: 100vh;
}

/* --- Topbar --- */
.topbar {
  height: var(--topbar-height);
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 50;
}

.startup-selector {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  color: var(--color-text-secondary);
}

.startup-selector select {
  padding: 6px 12px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-family: var(--font-sans);
  color: var(--color-text);
  background: var(--color-surface);
  min-width: 220px;
}

.phase-progress {
  display: flex;
  align-items: center;
  gap: 4px;
}

/* --- Views --- */
.view {
  display: none;
  padding: 28px 24px;
}

.view.active { display: block; }

.view-header {
  margin-bottom: 28px;
}

.view-header h2 {
  font-size: 24px;
  font-weight: 700;
  color: var(--color-text);
}

.view-header p {
  font-size: 14px;
  color: var(--color-text-secondary);
  margin-top: 4px;
}

/* --- Cards --- */
.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 24px;
  box-shadow: var(--shadow-sm);
}

.card + .card { margin-top: 20px; }

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

.card-header h3 {
  font-size: 16px;
  font-weight: 700;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
}

/* --- Stats --- */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}

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

.stat-value {
  font-size: 28px;
  font-weight: 700;
  color: var(--color-text);
}

.stat-label {
  font-size: 12px;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 4px;
}

/* --- Tables --- */
.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

thead th {
  text-align: left;
  padding: 10px 14px;
  font-weight: 600;
  color: var(--color-text-muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 2px solid var(--color-border);
  background: var(--color-bg);
}

tbody td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--color-border-light);
  color: var(--color-text);
}

tbody tr:hover { background: var(--color-surface-hover); }

/* --- Badges --- */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 100px;
  font-size: 11px;
  font-weight: 600;
}

.badge-green { background: #e6f4ed; color: #0f6b4b; }
.badge-blue { background: #e8f0fe; color: #3b82f6; }
.badge-purple { background: #f0e8fe; color: #8b5cf6; }
.badge-amber { background: #fef3e2; color: #d4891f; }
.badge-red { background: #fef2f2; color: #c53030; }
.badge-gray { background: #f1f5f9; color: #5a6f7e; }

/* --- Phase color accents --- */
.phase-1-accent { border-left: 3px solid var(--color-phase-1); }
.phase-2-accent { border-left: 3px solid var(--color-phase-2); }
.phase-3-accent { border-left: 3px solid var(--color-phase-3); }
.phase-4-accent { border-left: 3px solid var(--color-phase-4); }

/* --- Progress bar --- */
.progress-bar {
  height: 8px;
  background: var(--color-border-light);
  border-radius: 4px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.4s ease;
}

.progress-fill.f1 { background: var(--color-phase-1); }
.progress-fill.f2 { background: var(--color-phase-2); }
.progress-fill.f3 { background: var(--color-phase-3); }
.progress-fill.f4 { background: var(--color-phase-4); }

/* --- Toast --- */
.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  box-shadow: var(--shadow-lg);
  font-size: 14px;
  min-width: 280px;
  animation: slideIn 0.3s ease;
}

.toast-success { border-left: 3px solid var(--color-success); }
.toast-error { border-left: 3px solid var(--color-danger); }

@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* --- Empty state --- */
.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--color-text-muted);
}

.empty-state i {
  font-size: 40px;
  margin-bottom: 12px;
  display: block;
}

.empty-state h3 {
  font-size: 16px;
  color: var(--color-text-secondary);
  margin-bottom: 6px;
}

.empty-state p {
  font-size: 13px;
  max-width: 400px;
  margin: 0 auto 20px;
}

/* --- SROI ratio display --- */
.sroi-ratio {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px;
  background: var(--color-primary-light);
  border-radius: var(--radius-md);
  margin: 16px 0;
}

.sroi-number {
  font-size: 42px;
  font-weight: 800;
  color: var(--color-primary);
  line-height: 1;
}

.sroi-label {
  font-size: 13px;
  color: var(--color-text-secondary);
}

/* --- Modal --- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
}

.modal {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  padding: 32px;
  width: 100%;
  max-width: 560px;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
}

.modal h3 {
  font-size: 18px;
  margin-bottom: 20px;
}

.modal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 24px;
}


/* =============================================
   Process Overview Page
   ============================================= */
.process-overview {
  max-width: 880px;
  margin: 0 auto;
  padding: 24px 0 60px;
}

/* Hero */
.po-hero {
  text-align: center;
  padding: 40px 24px 32px;
  margin-bottom: 8px;
}
.po-hero-badge {
  display: inline-block;
  background: var(--color-primary-light, #e8f5e9);
  color: var(--color-primary-dark, #1b5e20);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  padding: 4px 14px;
  border-radius: 20px;
  margin-bottom: 16px;
}
.po-hero h1 {
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--color-text, #1a1a2e);
  margin: 0 0 12px;
  letter-spacing: -0.02em;
}
.po-hero-sub {
  font-size: 1.05rem;
  color: var(--color-text-secondary, #555);
  line-height: 1.7;
  max-width: 600px;
  margin: 0 auto;
}

/* Sections */
.po-section {
  margin: 36px 0;
}
.po-section h2 {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--color-text, #1a1a2e);
  margin: 0 0 20px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.po-section h2 i {
  color: var(--color-primary, #2e7d32);
  font-size: 1.15rem;
  width: 28px;
  text-align: center;
}

/* Argument grid */
.po-argument-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
.po-argument-card {
  background: var(--color-surface, #fff);
  border: 1px solid var(--color-border-light, #e8e8e8);
  border-radius: 12px;
  padding: 24px;
}
.po-arg-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  margin-bottom: 14px;
  background: var(--color-primary-light, #e8f5e9);
  color: var(--color-primary, #2e7d32);
}
.po-argument-card h3 {
  font-size: 1.05rem;
  font-weight: 700;
  margin: 0 0 10px;
  color: var(--color-text, #1a1a2e);
}
.po-argument-card p {
  font-size: 0.9rem;
  line-height: 1.7;
  color: var(--color-text-secondary, #555);
  margin: 0 0 10px;
}
.po-bullet-list {
  margin: 8px 0 0;
  padding: 0 0 0 18px;
  font-size: 0.9rem;
  line-height: 1.8;
  color: var(--color-text-secondary, #555);
}
.po-bullet-list li { margin-bottom: 4px; }

/* Pipeline diagram */
.po-pipeline {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  flex-wrap: wrap;
  padding: 20px 0;
}
.po-pipe-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 16px 20px;
  background: var(--color-surface, #fff);
  border: 2px solid var(--color-border-light, #e8e8e8);
  border-radius: 12px;
  min-width: 110px;
}
.po-pipe-num {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1rem;
  color: #fff;
}
.po-pipe-1 .po-pipe-num { background: #7b1fa2; }
.po-pipe-2 .po-pipe-num { background: #0277bd; }
.po-pipe-3 .po-pipe-num { background: #f57c00; }
.po-pipe-4 .po-pipe-num { background: #2e7d32; }
.po-pipe-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-text, #1a1a2e);
  white-space: nowrap;
}
.po-pipe-arrow {
  color: var(--color-text-muted, #aaa);
  font-size: 1.2rem;
  margin: 0 4px;
}

/* Phase detail cards */
.po-phase-detail {
  border: 1px solid var(--color-border-light, #e8e8e8);
  border-radius: 14px;
  overflow: hidden;
  background: var(--color-surface, #fff);
}
.po-phase-header {
  padding: 20px 24px;
  display: flex;
  align-items: center;
  gap: 14px;
}
.po-phase-header h2 {
  margin: 0;
  color: #fff;
  font-size: 1.15rem;
}
.po-phase-header h2 i { color: rgba(255,255,255,0.85); }
.po-phase-1 { background: linear-gradient(135deg, #7b1fa2, #9c27b0); }
.po-phase-2 { background: linear-gradient(135deg, #0277bd, #0288d1); }
.po-phase-3 { background: linear-gradient(135deg, #f57c00, #ff9800); }
.po-phase-4 { background: linear-gradient(135deg, #2e7d32, #43a047); }
.po-phase-num {
  display: inline-block;
  background: rgba(255,255,255,0.22);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 3px 10px;
  border-radius: 12px;
  white-space: nowrap;
}
.po-phase-body {
  padding: 24px;
}
.po-phase-rationale h3 {
  font-size: 1.05rem;
  font-weight: 700;
  margin: 0 0 10px;
  color: var(--color-text, #1a1a2e);
}
.po-phase-rationale p {
  font-size: 0.9rem;
  line-height: 1.7;
  color: var(--color-text-secondary, #555);
  margin: 0 0 12px;
}
.po-phase-differentiator {
  margin-top: 16px;
  padding: 14px 18px;
  background: #fef9e7;
  border-left: 4px solid #f9a825;
  border-radius: 0 8px 8px 0;
}
.po-phase-differentiator h4 {
  font-size: 0.85rem;
  font-weight: 700;
  margin: 0 0 6px;
  color: #795548;
}
.po-phase-differentiator p {
  font-size: 0.85rem;
  line-height: 1.65;
  color: #6d4c41;
  margin: 0;
}

/* Method cards (Fas 1 three-method grid) */
.po-method-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-top: 20px;
}
.po-method-card {
  background: var(--color-surface-hover, #f9fafb);
  border: 1px solid var(--color-border-light, #e8e8e8);
  border-radius: 12px;
  padding: 20px;
  position: relative;
}
.po-method-card h4 {
  margin: 0 0 2px;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--color-text, #1a1a2e);
}
.po-method-ref {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-primary, #7b1fa2);
  margin-bottom: 10px;
}
.po-method-card p {
  font-size: 0.82rem;
  line-height: 1.65;
  color: var(--color-text-secondary, #555);
  margin: 0;
}
.po-method-num {
  position: absolute;
  top: 12px;
  right: 14px;
  font-size: 0.7rem;
  font-weight: 800;
  color: var(--color-border, #ddd);
  background: var(--color-surface, #fff);
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 1px solid var(--color-border-light, #e8e8e8);
}
@media (max-width: 768px) {
  .po-method-grid {
    grid-template-columns: 1fr;
  }
}

/* Comparison table */
.po-compare-table-wrap {
  border: 1px solid var(--color-border-light, #e8e8e8);
  border-radius: 12px;
  overflow: hidden;
}
.po-compare-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}
.po-compare-table th {
  background: var(--color-surface-hover, #f9f9f9);
  padding: 14px 16px;
  text-align: left;
  font-weight: 700;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-secondary, #555);
  border-bottom: 2px solid var(--color-border, #ddd);
}
.po-compare-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--color-border-light, #eee);
  color: var(--color-text-secondary, #555);
  line-height: 1.5;
}
.po-compare-table tr:last-child td { border-bottom: none; }
.po-col-sota {
  color: #c62828 !important;
  background: #fff5f5;
}
.po-col-green {
  color: #2e7d32 !important;
  background: #f1f8e9;
  font-weight: 600;
}

/* Closing */
.po-closing {
  text-align: center;
  padding: 48px 24px;
  background: var(--color-surface, #fff);
  border: 1px solid var(--color-border-light, #e8e8e8);
  border-radius: 14px;
  margin-top: 48px;
}
.po-closing-icon {
  font-size: 2.8rem;
  margin-bottom: 12px;
  color: var(--color-primary, #2e7d32);
}
.po-closing h2 {
  justify-content: center;
  margin-bottom: 12px;
}
.po-closing-text {
  font-size: 0.95rem;
  line-height: 1.8;
  color: var(--color-text-secondary, #555);
  max-width: 560px;
  margin: 0 auto 24px;
}
.po-closing .btn {
  font-size: 1rem;
  padding: 14px 32px;
}

/* --- Method Tabs (Fas 1) --- */
.method-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 20px;
  border-bottom: 2px solid var(--color-border-light);
  overflow-x: auto;
}
.method-tab {
  flex: 1;
  min-width: 140px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 16px;
  border: none;
  background: transparent;
  font-size: 14px;
  font-weight: 500;
  font-family: var(--font-sans);
  color: var(--color-text-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all 0.15s;
  white-space: nowrap;
}
.method-tab:hover {
  color: var(--color-text);
  background: var(--color-surface-hover);
}
.method-tab.active {
  color: var(--color-phase-1);
  border-bottom-color: var(--color-phase-1);
  font-weight: 600;
}
.method-tab i { font-size: 16px; }
.method-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  background: var(--color-border-light);
  border-radius: 11px;
  font-size: 11px;
  font-weight: 700;
  color: var(--color-text-secondary);
}
.method-tab.active .method-count {
  background: var(--color-phase-1);
  color: #fff;
}

/* Method info card */
.method-info-card {
  border-left: 4px solid var(--color-phase-1);
}
.method-info-header {
  display: flex;
  gap: 16px;
  align-items: flex-start;
}
.method-info-header i {
  font-size: 28px;
  color: var(--color-phase-1);
  margin-top: 4px;
}
.method-info-header h3 {
  font-size: 16px;
  margin-bottom: 6px;
}
.method-info-header p {
  font-size: 13px;
  color: var(--color-text-secondary);
  line-height: 1.6;
}

/* Neuro pyramid */
.neuro-pyramid {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.neuro-level-row {
  display: flex;
  align-items: center;
  gap: 16px;
}
.neuro-level-label {
  width: 240px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}
.neuro-icon { font-size: 20px; }
.neuro-level-label strong {
  display: block;
  font-size: 13px;
  color: var(--color-text);
}
.neuro-question {
  display: block;
  font-size: 11px;
  color: var(--color-text-muted);
  margin-top: 2px;
}
.neuro-bar-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
}
.neuro-bar {
  height: 8px;
  border-radius: 4px;
  min-width: 4px;
  transition: width 0.3s;
}
.neuro-count {
  font-size: 12px;
  font-weight: 700;
  color: var(--color-text-secondary);
  min-width: 20px;
  text-align: right;
}

/* Psycho chart */
.psycho-chart {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.psycho-bar-row {
  display: flex;
  align-items: center;
  gap: 16px;
}
.psycho-bar-label {
  width: 240px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}
.psycho-icon { font-size: 20px; }
.psycho-bar-label strong {
  display: block;
  font-size: 13px;
  color: var(--color-text);
}
.psycho-desc {
  display: block;
  font-size: 11px;
  color: var(--color-text-muted);
  margin-top: 2px;
}
.psycho-bar-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
}
.psycho-bar {
  height: 8px;
  border-radius: 4px;
  min-width: 4px;
  transition: width 0.3s;
}
.psycho-count {
  font-size: 12px;
  color: var(--color-text-secondary);
  white-space: nowrap;
}

/* 5S chart */
.fems-chart {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.fems-row {
  display: flex;
  align-items: center;
  gap: 16px;
}
.fems-label {
  width: 240px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}
.fems-icon { font-size: 20px; }
.fems-label strong {
  display: block;
  font-size: 13px;
  color: var(--color-text);
}
.fems-desc {
  display: block;
  font-size: 11px;
  color: var(--color-text-muted);
  margin-top: 2px;
}
.fems-bar-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
}
.fems-bar {
  height: 8px;
  border-radius: 4px;
  min-width: 4px;
  transition: width 0.3s;
}
.fems-count {
  font-size: 12px;
  font-weight: 700;
  color: var(--color-text-secondary);
  min-width: 20px;
  text-align: right;
}

/* Tension card */
.tension-card {
  background: var(--color-accent-light);
  border-color: var(--color-accent);
  margin-bottom: 20px;
  font-size: 14px;
}

/* Badge colors for methods */
.badge-neuro { background: #dbeafe; color: #1e40af; }
.badge-psykografiska { background: #ede9fe; color: #6b21a8; }
.badge-fems { background: #fef3c7; color: #92400e; }

/* Persona-analys */
.persona-card .card-header { margin-bottom: 0; }
.persona-entry { transition: box-shadow 0.2s; }
.persona-entry:hover { box-shadow: 0 2px 12px rgba(0,0,0,0.06); }
.persona-section p { font-size: 0.9em; }

/* Response pattern badges */
.badge-response { font-size: 11px; padding: 3px 10px; border-radius: 12px; }
.badge-warming { background: #e8f5e9; color: #2e7d32; }
.badge-consistent { background: #e3f2fd; color: #1565c0; }
.badge-resistant { background: #fbe9e7; color: #bf360c; }
.badge-intellectualizing { background: #f3e5f5; color: #6a1b9a; }
.badge-emotional { background: #fce4ec; color: #880e4f; }

/* --- Responsive --- */
@media (max-width: 768px) {
  .sidebar {
    width: 100%;
    height: auto;
    position: relative;
    flex-direction: row;
    overflow-x: auto;
  }
  .main-content { margin-left: 0; }
  .nav-menu { display: flex; flex-direction: row; }
  .card-grid { grid-template-columns: 1fr; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .po-pipeline { flex-direction: column; align-items: center; gap: 8px; }
  .po-pipe-arrow { transform: rotate(90deg); }
  .po-argument-grid { grid-template-columns: 1fr; }
  .po-compare-table-wrap { overflow-x: auto; }
  .method-tab { font-size: 12px; padding: 10px 12px; }
  .method-tab i { display: none; }
  .neuro-level-label, .psycho-bar-label, .fems-label { width: 160px; }
}
