/* ============================================
   Zoekwoord Onderzoek — Design System
   ============================================ */

:root {
  --primary: #4f46e5;
  --primary-hover: #4338ca;
  --primary-light: #eef2ff;
  --success: #059669;
  --success-light: #ecfdf5;
  --warning: #d97706;
  --warning-light: #fffbeb;
  --danger: #dc2626;
  --danger-light: #fef2f2;
  --info: #2563eb;
  --info-light: #eff6ff;

  --bg: #f8fafc;
  --bg-card: #ffffff;
  --bg-sidebar: #1e293b;
  --bg-sidebar-hover: #334155;
  --bg-sidebar-active: #4f46e5;

  --text: #1e293b;
  --text-secondary: #64748b;
  --text-muted: #94a3b8;
  --text-sidebar: #cbd5e1;
  --text-sidebar-active: #ffffff;

  --border: #e2e8f0;
  --border-light: #f1f5f9;
  --bg-hover: #f1f5f9;

  --radius: 8px;
  --radius-lg: 12px;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
  --shadow: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);
  --shadow-lg: 0 4px 6px rgba(0,0,0,0.07), 0 2px 4px rgba(0,0,0,0.06);

  --sidebar-width: 240px;
  --topbar-height: 60px;
  --transition: 150ms ease;
}

/* ============================================
   Reset & Base
   ============================================ */

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 14px;
  color: var(--text);
  background: var(--bg);
  display: flex;
  min-height: 100vh;
  overflow-x: hidden;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ============================================
   Sidebar
   ============================================ */

.sidebar {
  width: var(--sidebar-width);
  background: var(--bg-sidebar);
  color: var(--text-sidebar);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 100;
  transition: transform var(--transition);
}

.sidebar-header {
  padding: 20px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-icon {
  font-size: 28px;
}

.logo-text {
  font-weight: 700;
  font-size: 15px;
  line-height: 1.3;
  color: #fff;
}

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

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-sidebar);
  transition: all var(--transition);
  margin-bottom: 2px;
}

.nav-item:hover {
  background: var(--bg-sidebar-hover);
  color: #fff;
}

.nav-item.active {
  background: var(--bg-sidebar-active);
  color: var(--text-sidebar-active);
}

.nav-icon {
  font-size: 18px;
  width: 24px;
  text-align: center;
}

.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid rgba(255,255,255,0.08);
}

.status-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
}

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

.status-dot.online { background: var(--success); }
.status-dot.offline { background: var(--danger); }

/* ============================================
   Main Content
   ============================================ */

.main-content {
  margin-left: var(--sidebar-width);
  flex: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.topbar {
  height: var(--topbar-height);
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 50;
}

.menu-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 22px;
  cursor: pointer;
  color: var(--text);
}

.page-title {
  font-size: 18px;
  font-weight: 600;
  flex: 1;
}

.topbar-actions {
  display: flex;
  gap: 8px;
}

.page-container {
  padding: 24px;
  flex: 1;
}

.page {
  display: none;
}

.page.active {
  display: block;
}

/* ============================================
   Cards
   ============================================ */

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

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

.card-header h3 {
  font-size: 15px;
  font-weight: 600;
}

.card-body {
  padding: 20px;
}

.card-body.no-padding {
  padding: 0;
}

/* ============================================
   Stats Grid
   ============================================ */

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

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: var(--shadow-sm);
}

.stat-icon {
  font-size: 32px;
  width: 52px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--primary-light);
  border-radius: var(--radius);
}

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

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

/* ============================================
   Buttons
   ============================================ */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all var(--transition);
  white-space: nowrap;
}

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

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

.btn-active {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--primary);
}
.btn-active:hover:not(:disabled) { background: var(--primary-hover); }

.btn-success {
  background: var(--success);
  color: #fff;
}
.btn-success:hover:not(:disabled) { background: #047857; }

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

.btn-danger {
  background: var(--danger);
  color: #fff;
}
.btn-danger:hover:not(:disabled) { background: #b91c1c; }

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border-color: var(--border);
}
.btn-ghost:hover:not(:disabled) {
  background: var(--bg);
  color: var(--text);
}

.btn-sm {
  padding: 5px 10px;
  font-size: 12px;
}

.btn-lg {
  padding: 12px 24px;
  font-size: 16px;
}

.btn-icon {
  width: 36px;
  height: 36px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius);
  font-size: 16px;
}

/* ============================================
   Tables
   ============================================ */

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

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

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

.data-table tbody tr:hover {
  background: var(--primary-light);
}

.data-table tbody tr:last-child td {
  border-bottom: none;
}

/* ============================================
   Badges
   ============================================ */

.badge {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.badge-success { background: var(--success-light); color: var(--success); }
.badge-warning { background: var(--warning-light); color: var(--warning); }
.badge-danger { background: var(--danger-light); color: var(--danger); }
.badge-info { background: var(--info-light); color: var(--info); }
.badge-default { background: var(--border-light); color: var(--text-secondary); }

/* ============================================
   Forms
   ============================================ */

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

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

.form-input, .form-select, .form-textarea {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 14px;
  font-family: inherit;
  color: var(--text);
  background: var(--bg-card);
  transition: border-color var(--transition);
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79,70,229,0.1);
}

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

.form-hint {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
}

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

/* ============================================
   File Upload
   ============================================ */

.file-upload {
  border: 2px dashed var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition);
  position: relative;
}

.file-upload:hover, .file-upload.dragover {
  border-color: var(--primary);
  background: var(--primary-light);
}

.file-upload input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

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

.file-upload-text {
  font-size: 14px;
  color: var(--text-secondary);
}

.file-upload-text strong {
  color: var(--primary);
}

.file-upload-hint {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* ============================================
   Modal
   ============================================ */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  backdrop-filter: blur(2px);
}

.modal {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 90%;
  max-width: 520px;
  max-height: 85vh;
  overflow-y: auto;
}

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

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

.modal-close {
  background: none;
  border: none;
  font-size: 22px;
  cursor: pointer;
  color: var(--text-muted);
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius);
}

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

.modal-body {
  padding: 20px;
}

.modal-footer {
  padding: 12px 20px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

/* ============================================
   Toast
   ============================================ */

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

.toast {
  padding: 12px 16px;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  font-size: 14px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 8px;
  animation: toastIn 0.3s ease;
  min-width: 280px;
  max-width: 420px;
}

.toast-success { background: var(--success); color: #fff; }
.toast-error { background: var(--danger); color: #fff; }
.toast-warning { background: var(--warning); color: #fff; }
.toast-info { background: var(--info); color: #fff; }

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

/* ============================================
   Progress
   ============================================ */

.progress-bar {
  width: 100%;
  height: 8px;
  background: var(--border-light);
  border-radius: 4px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--primary);
  border-radius: 4px;
  transition: width 0.5s ease;
}

.progress-fill.success { background: var(--success); }

/* ============================================
   Pipeline Steps
   ============================================ */

.pipeline {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.pipeline-step {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-card);
}

.pipeline-step.active {
  border-color: var(--primary);
  background: var(--primary-light);
}

.pipeline-step.completed {
  border-color: var(--success);
  background: var(--success-light);
}

.pipeline-step.partial {
  border-color: var(--warning);
  background: var(--warning-light);
}

.pipeline-step.error {
  border-color: var(--danger);
  background: var(--danger-light);
}

.step-number {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--border-light);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  flex-shrink: 0;
}

.pipeline-step.completed .step-number {
  background: var(--success);
  color: #fff;
}

.pipeline-step.partial .step-number {
  background: var(--warning);
  color: #fff;
}

.pipeline-step.active .step-number {
  background: var(--primary);
  color: #fff;
}

.step-info {
  flex: 1;
}

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

.step-desc {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 2px;
}

.step-result {
  font-size: 12px;
  color: var(--success);
  font-weight: 600;
  margin-top: 3px;
}

.pipeline-step.completed .step-result {
  color: var(--success);
}

.step-result-warning {
  color: var(--warning) !important;
}

.step-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.step-help {
  margin-top: 8px;
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.45;
}

.step-progress {
  font-size: 12px;
  color: var(--primary);
  font-weight: 600;
  margin-top: 4px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.spinner-sm {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid var(--primary);
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  flex-shrink: 0;
}

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

.step-action {
  flex-shrink: 0;
}

/* ============================================
   Layout Helpers
   ============================================ */

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

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

.hidden { display: none !important; }

.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }

.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }

.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: 8px; }
.gap-2 { gap: 16px; }

.page-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}

.breadcrumb {
  font-size: 14px;
  color: var(--text-secondary);
  font-weight: 500;
}

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

.empty-state-icon {
  font-size: 48px;
  margin-bottom: 12px;
}

.empty-state-text {
  font-size: 15px;
  margin-bottom: 16px;
}

.spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

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

/* ============================================
   Linkplan Specific
   ============================================ */

.month-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 16px;
  border-bottom: 2px solid var(--border);
  padding-bottom: 0;
}

.month-tab {
  padding: 8px 20px;
  cursor: pointer;
  font-weight: 500;
  font-size: 14px;
  color: var(--text-secondary);
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all var(--transition);
  background: none;
  border-top: none;
  border-left: none;
  border-right: none;
  font-family: inherit;
}

.month-tab:hover {
  color: var(--text);
}

.month-tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

.anchor-type {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
}

.anchor-type-exact { background: #fee2e2; color: #991b1b; }
.anchor-type-near { background: #fef3c7; color: #92400e; }
.anchor-type-partial { background: #dbeafe; color: #1e40af; }
.anchor-type-brand { background: #f3e8ff; color: #6b21a8; }
.anchor-type-url { background: #e0e7ff; color: #3730a3; }
.anchor-type-generic { background: #f1f5f9; color: #475569; }
.anchor-type-city { background: #d1fae5; color: #065f46; }

/* ============================================
   Keyword List
   ============================================ */

.keyword-tag {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 12px;
  background: var(--primary-light);
  color: var(--primary);
  margin: 2px;
  font-weight: 500;
}

.keyword-volume {
  font-size: 11px;
  color: var(--text-muted);
  margin-left: 4px;
}

/* ============================================
   Responsive
   ============================================ */

/* ============================================
   Tabs
   ============================================ */

.tab-bar {
  display: flex;
  border-bottom: 2px solid var(--border);
  gap: 0;
}

.tab-btn {
  padding: 10px 20px;
  border: none;
  background: none;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all 0.2s;
}

.tab-btn:hover {
  color: var(--text);
  background: var(--bg-hover);
}

.tab-btn.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

/* ============================================
   Pipeline Status Banner
   ============================================ */

.pipeline-status-banner {
  padding: 12px 16px;
  border-radius: var(--radius);
  margin-bottom: 16px;
  font-size: 14px;
}

.pipeline-status-banner.hidden {
  display: none;
}

.pipeline-status-banner.running {
  background: var(--primary-light);
  border: 1px solid var(--primary);
  color: var(--primary);
}

.pipeline-status-banner.completed {
  background: var(--success-light);
  border: 1px solid var(--success);
  color: var(--success);
}

.pipeline-status-banner.error {
  background: var(--danger-light);
  border: 1px solid var(--danger);
  color: var(--danger);
}

.spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* ============================================
   Step Status Text
   ============================================ */

.step-status-text {
  font-size: 12px;
  color: var(--primary);
  margin-top: 3px;
  font-weight: 500;
}

/* ============================================
   Mini Stats (in panels)
   ============================================ */

.mini-stats {
  display: flex;
  gap: 20px;
}

.mini-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.mini-val {
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
}

.mini-label {
  font-size: 11px;
  color: var(--text-secondary);
  margin-top: 2px;
}

/* ============================================
   Priority Score Bar
   ============================================ */

.score-bar {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(90deg, var(--primary), var(--success));
  min-width: 32px;
  text-align: center;
}

/* ============================================
   Badges
   ============================================ */

.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.4;
}

.badge-success { background: var(--success-light); color: var(--success); }
.badge-warning { background: #fef3c7; color: #92400e; }
.badge-danger  { background: var(--danger-light); color: var(--danger); }
.badge-info    { background: #dbeafe; color: #1d4ed8; }
.badge-default { background: var(--bg-hover); color: var(--text-secondary); }

/* ============================================
   Cluster Cards
   ============================================ */

.cluster-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 10px;
  background: var(--bg-card);
}

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

.cluster-keywords {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.keyword-chip {
  display: inline-block;
  padding: 3px 10px;
  background: var(--bg-hover);
  border-radius: 12px;
  font-size: 12px;
  color: var(--text-secondary);
}

.keyword-chip.parent {
  background: var(--primary-light);
  color: var(--primary);
  font-weight: 600;
}

.keyword-chip.more {
  font-style: italic;
  opacity: 0.7;
}

/* ============================================
   Opportunity Items
   ============================================ */

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

.opportunity-item {
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-card);
}

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

.opp-details {
  font-size: 12px;
}

/* ============================================
   Grid-2 Layout
   ============================================ */

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

/* ============================================
   Table Tweaks
   ============================================ */

.no-padding {
  padding: 0 !important;
}

.data-table td,
.data-table th {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 280px;
}

/* ============================================
   Utility: mt-3
   ============================================ */

.mt-3 { margin-top: 20px; }
.gap-1 { gap: 6px; }

@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .main-content {
    margin-left: 0;
  }

  .menu-toggle {
    display: block;
  }

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

  .form-row {
    grid-template-columns: 1fr;
  }

  .page-container {
    padding: 16px;
  }

  .stats-grid {
    grid-template-columns: 1fr;
  }

  .tab-bar {
    flex-wrap: wrap;
  }

  .tab-btn {
    padding: 8px 12px;
    font-size: 13px;
  }

  .mini-stats {
    flex-wrap: wrap;
    gap: 12px;
  }

  .cluster-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }

  .opp-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }
}

/* ============================================
   Cost Tracking
   ============================================ */

.cost-total-banner {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  background: var(--primary-light);
  border-radius: 8px;
  margin-bottom: 16px;
}

.cost-total-label {
  font-size: 14px;
  color: var(--text-muted);
  font-weight: 500;
}

.cost-total-value {
  font-size: 28px;
  font-weight: 700;
  color: var(--primary);
}

.cost-total-requests {
  font-size: 13px;
  color: var(--text-muted);
  margin-left: auto;
}

.cost-provider-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
}

.cost-provider-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  transition: border-color 0.15s;
}

.cost-provider-card:hover {
  border-color: var(--primary);
}

.cost-provider-icon {
  font-size: 24px;
  flex-shrink: 0;
}

.cost-provider-info {
  min-width: 0;
}

.cost-provider-name {
  font-weight: 600;
  font-size: 13px;
  color: var(--text);
  margin-bottom: 2px;
}

.cost-value {
  font-weight: 700;
  font-size: 16px;
  color: var(--primary);
}

.cost-value.cost-free {
  color: var(--success);
  font-size: 13px;
}

.cost-provider-requests {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

.cost-period-total {
  text-align: right;
  font-size: 14px;
}

@media (max-width: 768px) {
  .cost-provider-grid {
    grid-template-columns: 1fr 1fr;
  }
  .cost-total-banner {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }
  .cost-total-requests {
    margin-left: 0;
  }
}
