/* ============================================
   Arbitr Analytics — Design System CSS
   ============================================ */

/* ============================================
   CSS VARIABLES (Dark theme — default)
   ============================================ */
:root {
  --bg-base: #020617;
  --bg-surface: rgba(15, 23, 42, 0.9);
  --bg-card: rgba(30, 41, 59, 0.7);
  --bg-card-hover: rgba(30, 41, 59, 0.95);
  --bg-input: rgba(15, 23, 42, 0.8);
  --bg-elevated: rgba(51, 65, 85, 0.5);

  --border-base: rgba(148, 163, 184, 0.08);
  --border-subtle: rgba(148, 163, 184, 0.12);
  --border-emphasis: rgba(99, 102, 241, 0.3);

  --color-primary: #4f46e5;
  --color-primary-hover: #4338ca;
  --color-primary-light: #818cf8;
  --color-primary-muted: rgba(99, 102, 241, 0.15);
  --color-secondary: #7c3aed;
  --color-accent: #c084fc;

  --color-success: #10b981;
  --color-success-muted: rgba(16, 185, 129, 0.15);
  --color-success-border: rgba(16, 185, 129, 0.2);
  --color-warning: #f59e0b;
  --color-warning-muted: rgba(245, 158, 11, 0.15);
  --color-warning-border: rgba(245, 158, 11, 0.2);
  --color-danger: #ef4444;
  --color-danger-muted: rgba(239, 68, 68, 0.15);
  --color-danger-border: rgba(239, 68, 68, 0.2);
  --color-info: #818cf8;
  --color-info-muted: rgba(129, 140, 248, 0.15);

  --text-primary: #e2e8f0;
  --text-secondary: #94a3b8;
  --text-muted: #475569;
  --text-disabled: #334155;

  --gradient-primary: linear-gradient(135deg, #4f46e5, #7c3aed);
  --gradient-text: linear-gradient(135deg, #818cf8, #c084fc);
  --gradient-btn-hover: linear-gradient(135deg, #4338ca, #6d28d9);

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-full: 9999px;

  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;
  --space-12: 48px;

  --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 8px 25px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 20px 40px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 8px 25px rgba(79, 70, 229, 0.4);

  --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base: 0.25s cubic-bezier(0.4, 0, 0.2, 1);

  --font-body: 'DM Sans', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  --text-xs: 11px;
  --text-sm: 13px;
  --text-base: 15px;
  --text-lg: 17px;
  --text-xl: 20px;
  --text-2xl: 24px;
  --text-3xl: 30px;
}

/* ============================================
   LIGHT THEME
   ============================================ */
[data-theme="light"] {
  --bg-base: #f8fafc;
  --bg-surface: rgba(255, 255, 255, 0.95);
  --bg-card: rgba(255, 255, 255, 0.85);
  --bg-card-hover: rgba(255, 255, 255, 1);
  --bg-input: rgba(241, 245, 249, 0.9);
  --bg-elevated: rgba(226, 232, 240, 0.6);

  --border-base: rgba(148, 163, 184, 0.2);
  --border-subtle: rgba(148, 163, 184, 0.25);
  --border-emphasis: rgba(99, 102, 241, 0.4);

  --color-primary: #4f46e5;
  --color-primary-hover: #4338ca;
  --color-primary-light: #4f46e5;
  --color-primary-muted: rgba(99, 102, 241, 0.1);
  --color-secondary: #7c3aed;
  --color-accent: #9333ea;

  --color-success: #059669;
  --color-success-muted: rgba(5, 150, 105, 0.1);
  --color-success-border: rgba(5, 150, 105, 0.25);
  --color-warning: #d97706;
  --color-warning-muted: rgba(217, 119, 6, 0.1);
  --color-warning-border: rgba(217, 119, 6, 0.25);
  --color-danger: #dc2626;
  --color-danger-muted: rgba(220, 38, 38, 0.08);
  --color-danger-border: rgba(220, 38, 38, 0.2);
  --color-info: #4f46e5;
  --color-info-muted: rgba(79, 70, 229, 0.08);

  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  --text-disabled: #cbd5e1;

  --gradient-text: linear-gradient(135deg, #4f46e5, #7c3aed);

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.06), 0 1px 3px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.08), 0 4px 10px rgba(0, 0, 0, 0.05);
  --shadow-glow: 0 8px 25px rgba(79, 70, 229, 0.2);
}

[data-theme="light"] .glass-card { backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
[data-theme="light"] .card-metric { backdrop-filter: none; }
[data-theme="light"] .glass { backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
[data-theme="light"] .app-sidebar { background: rgba(255, 255, 255, 0.98); border-right-color: var(--border-base); }
[data-theme="light"] .sidebar-item:hover { background: rgba(99, 102, 241, 0.08); }
[data-theme="light"] .sidebar-item.active { background: rgba(99, 102, 241, 0.12); }
[data-theme="light"] .ds-table tr:hover td { background: rgba(99, 102, 241, 0.04); }
[data-theme="light"] .input-field { background: white; border-color: #cbd5e1; }
[data-theme="light"] .input-field:focus { border-color: var(--color-primary); box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.12); }
[data-theme="light"] .input-field::placeholder { color: #94a3b8; }
[data-theme="light"] .btn-secondary { background: white; border-color: #cbd5e1; color: var(--text-primary); }
[data-theme="light"] .btn-secondary:hover { border-color: var(--color-primary); background: rgba(79, 70, 229, 0.04); }
[data-theme="light"] .btn-ghost { border-color: rgba(79, 70, 229, 0.3); }
[data-theme="light"] .btn[disabled], [data-theme="light"] .btn-disabled { background: #f1f5f9; color: #94a3b8; }
[data-theme="light"] .icon-wrap { background: rgba(241, 245, 249, 0.8); }
[data-theme="light"] .sidebar-item.active .icon-wrap { background: rgba(99, 102, 241, 0.15); }
[data-theme="light"] .bottom-nav { background: rgba(255, 255, 255, 0.95); border-top-color: var(--border-base); }
[data-theme="light"] .progress-bar { background: #e2e8f0; }
[data-theme="light"] .mobile-header { background: rgba(255, 255, 255, 0.95); }
[data-theme="light"] .transcript-block { background: rgba(241, 245, 249, 0.8); }

/* ============================================
   RESET & BASE
   ============================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: var(--font-body);
  background: var(--bg-base);
  color: var(--text-primary);
  font-size: var(--text-base);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  background-image:
    radial-gradient(ellipse 80% 50% at 50% -20%, rgba(99, 102, 241, 0.08), transparent),
    radial-gradient(ellipse 60% 40% at 100% 50%, rgba(124, 58, 237, 0.05), transparent);
}
[data-theme="light"] body {
  background-image:
    radial-gradient(ellipse 80% 50% at 50% -20%, rgba(99, 102, 241, 0.06), transparent),
    radial-gradient(ellipse 60% 40% at 100% 50%, rgba(124, 58, 237, 0.03), transparent);
}
a { color: var(--color-primary-light); text-decoration: none; }
a:hover { color: var(--color-primary); }
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: #0f172a; }
::-webkit-scrollbar-thumb { background: #334155; border-radius: 3px; }
[data-theme="light"] ::-webkit-scrollbar-track { background: #f1f5f9; }
[data-theme="light"] ::-webkit-scrollbar-thumb { background: #cbd5e1; }

/* ============================================
   GLASSMORPHISM
   ============================================ */
.glass {
  background: var(--bg-surface);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-base);
}
.glass-card {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-md);
  border-radius: var(--radius-xl);
  transition: all var(--transition-base);
}
.glass-card:hover {
  border-color: var(--border-emphasis);
  box-shadow: var(--shadow-lg), 0 0 0 1px rgba(99, 102, 241, 0.05);
}

/* ============================================
   APP LAYOUT
   ============================================ */
.app-layout { display: flex; min-height: 100vh; }

.app-sidebar {
  width: 240px;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  background: rgba(2, 6, 23, 0.98);
  backdrop-filter: blur(20px);
  border-right: 1px solid var(--border-base);
  padding: var(--space-6) var(--space-3);
  display: flex;
  flex-direction: column;
  z-index: 50;
  overflow-y: auto;
  background-image: radial-gradient(ellipse 100% 60% at 0% 100%, rgba(99, 102, 241, 0.06), transparent);
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  font-size: var(--text-lg);
  font-weight: 700;
  padding: var(--space-2) var(--space-4) var(--space-4);
}
.sidebar-brand .brand-text {
  background: var(--gradient-text);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.sidebar-brand::after {
  content: '';
  position: absolute;
  bottom: 0; left: var(--space-4); right: var(--space-4);
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border-emphasis), transparent);
}
.sidebar-brand {
  position: relative;
  padding-bottom: var(--space-4);
  margin-bottom: var(--space-2);
}

/* Logo Waveform */
.logo-waveform { display: flex; align-items: center; gap: 2px; height: 22px; flex-shrink: 0; }
.logo-waveform .wave-bar {
  width: 3px; border-radius: 2px;
  background: var(--gradient-primary);
  animation: logoWave 1.4s ease-in-out infinite;
}
.logo-waveform--lg { height: 32px; }
.logo-waveform--lg .wave-bar { width: 4px; border-radius: 3px; }
@keyframes logoWave {
  0%, 100% { transform: scaleY(0.3); }
  50% { transform: scaleY(1); }
}
.logo-waveform:hover .wave-bar { animation-duration: 0.7s; }
[data-theme="light"] .logo-waveform .wave-bar { background: var(--color-primary); }

.sidebar-nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }

.sidebar-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: 10px var(--space-4);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-base);
  color: var(--text-secondary);
  font-weight: 500;
  font-size: var(--text-sm);
  text-decoration: none;
  position: relative;
}
.sidebar-item:hover { background: var(--color-primary-muted); color: var(--text-primary); transform: translateX(3px); }
.sidebar-item.active {
  background: rgba(99, 102, 241, 0.2);
  color: var(--color-primary-light);
}
.sidebar-item.active::before {
  content: '';
  position: absolute;
  left: 0; top: 6px; bottom: 6px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--gradient-primary);
}

.icon-wrap {
  width: 34px; height: 34px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(148, 163, 184, 0.06);
  font-size: 20px;
  flex-shrink: 0;
  transition: transform var(--transition-fast);
}
.sidebar-item:hover .icon-wrap { transform: scale(1.1); }
.sidebar-item.active .icon-wrap { background: rgba(99, 102, 241, 0.15); }

.sidebar-item-sub {
  font-size: var(--text-xs);
  padding: 6px var(--space-3);
  color: var(--text-muted);
}

.sidebar-footer {
  margin-top: auto;
  padding-top: var(--space-4);
  border-top: 1px solid var(--border-base);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.app-main {
  flex: 1;
  margin-left: 240px;
  padding: var(--space-8);
  max-width: 1200px;
}

/* Mobile header */
.mobile-header {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 56px;
  background: rgba(2, 6, 23, 0.95);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-base);
  padding: 0 var(--space-4);
  align-items: center;
  justify-content: space-between;
  z-index: 40;
}
.mobile-brand {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-weight: 700;
  font-size: var(--text-base);
}
.mobile-brand .brand-text {
  background: var(--gradient-text);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.hamburger-btn {
  width: 40px; height: 40px;
  border-radius: var(--radius-sm);
  background: transparent;
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  font-size: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 45;
}

/* Bottom nav (mobile) */
.bottom-nav {
  display: none;
  position: fixed;
  bottom: 0; left: 0; right: 0;
  justify-content: space-around;
  background: rgba(2, 6, 23, 0.95);
  backdrop-filter: blur(20px);
  border-top: 1px solid var(--border-base);
  padding: var(--space-2) 0 var(--space-4);
  z-index: 40;
}
.bottom-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-2);
  color: var(--text-muted);
  font-size: var(--text-xs);
  font-weight: 500;
  cursor: pointer;
  transition: color var(--transition-fast);
  text-decoration: none;
}
.bottom-nav-item.active { color: var(--color-primary-light); }
.bottom-nav-item .bn-icon { font-size: 20px; }

@media (max-width: 768px) {
  .app-sidebar { transform: translateX(-100%); transition: transform var(--transition-base); }
  .app-sidebar.open { transform: translateX(0); }
  .sidebar-overlay.open { display: block; }
  .mobile-header { display: flex; }
  .bottom-nav { display: flex; }
  .app-main { margin-left: 0; padding: var(--space-4); padding-top: 72px; padding-bottom: 80px; }
}

/* ============================================
   TYPOGRAPHY
   ============================================ */
.page-title {
  font-size: var(--text-2xl);
  font-weight: 700;
  margin-bottom: var(--space-6);
  background: var(--gradient-text);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.section-title {
  font-size: var(--text-xl);
  font-weight: 600;
  margin-bottom: var(--space-4);
}
.text-secondary { color: var(--text-secondary); }
.text-muted { color: var(--text-muted); }
.text-sm { font-size: var(--text-sm); }
.text-xs { font-size: var(--text-xs); }
.text-mono { font-family: var(--font-mono); font-size: var(--text-sm); color: var(--color-primary-light); }
.text-danger { color: var(--color-danger); }
.text-success { color: var(--color-success); }
.text-warning { color: var(--color-warning); }
.gradient-text {
  background: var(--gradient-text);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.fw-bold { font-weight: 700; }
.fw-semibold { font-weight: 600; }

/* ============================================
   BUTTONS
   ============================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  border: none;
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
  text-decoration: none;
  padding: 10px 20px;
  font-size: var(--text-sm);
}
.btn-sm { padding: 6px 14px; font-size: var(--text-xs); border-radius: var(--radius-sm); }
.btn-lg { padding: 14px 28px; font-size: var(--text-base); border-radius: var(--radius-lg); }
.btn-primary {
  background: var(--gradient-primary);
  color: white;
  box-shadow: 0 8px 18px -6px rgba(46, 16, 101, 0.5);
  position: relative;
  overflow: hidden;
}
.btn-primary::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.15), transparent 60%);
  pointer-events: none;
}
.btn-primary:hover { background: var(--gradient-btn-hover); transform: translateY(-2px); box-shadow: var(--shadow-glow); }
.btn-secondary {
  background: var(--bg-elevated);
  color: var(--text-primary);
  border: 1px solid var(--border-subtle);
}
.btn-secondary:hover { background: rgba(71, 85, 105, 0.6); border-color: var(--border-emphasis); }
.btn-accent {
  background: linear-gradient(135deg, var(--color-accent), #a855f7);
  color: white;
}
.btn-accent:hover { transform: translateY(-1px); box-shadow: 0 8px 20px rgba(168, 85, 247, 0.3); }
.btn-ghost {
  background: transparent;
  color: var(--color-primary-light);
  border: 1px solid var(--border-emphasis);
}
.btn-ghost:hover { background: var(--color-primary-muted); }
.btn-danger {
  background: var(--color-danger);
  color: white;
}
.btn-danger:hover { background: #dc2626; transform: translateY(-1px); }
.btn-warning {
  background: var(--color-warning);
  color: #0f172a;
  font-weight: 600;
}
.btn-warning:hover { transform: translateY(-1px); }
.btn[disabled], .btn-disabled {
  background: var(--bg-elevated);
  color: var(--text-disabled);
  cursor: not-allowed;
  box-shadow: none;
}
.btn-block { width: 100%; }

/* ============================================
   CARDS
   ============================================ */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  overflow: hidden;
}
.card-header {
  padding: var(--space-4) var(--space-6);
  border-bottom: 1px solid var(--border-base);
  font-weight: 600;
}
.card-body { padding: var(--space-6); }
.card-footer {
  padding: var(--space-4) var(--space-6);
  border-top: 1px solid var(--border-base);
}

.card-metric {
  border-radius: var(--radius-xl);
  padding: var(--space-6);
  position: relative;
  overflow: hidden;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  transition: all var(--transition-base);
}
.card-metric::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.03), transparent);
  pointer-events: none;
}
.card-metric:hover {
  transform: scale(1.02) translateY(-2px);
  box-shadow: var(--shadow-lg), 0 0 30px rgba(99, 102, 241, 0.1);
  border-color: var(--border-emphasis);
}
.card-metric-label { font-size: var(--text-sm); font-weight: 500; color: var(--text-secondary); }
.card-metric-value {
  font-size: var(--text-3xl);
  font-weight: 700;
  margin-top: var(--space-2);
  background: var(--gradient-text);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
[data-theme="light"] .card-metric-value {
  background: var(--gradient-text);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.card-metric-sub { font-size: var(--text-xs); color: var(--text-muted); margin-top: var(--space-1); }

/* ============================================
   BADGES
   ============================================ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: 600;
}
.badge-success { background: var(--color-success-muted); color: #34d399; border: 1px solid var(--color-success-border); }
.badge-warning { background: var(--color-warning-muted); color: #fbbf24; border: 1px solid var(--color-warning-border); }
.badge-danger { background: var(--color-danger-muted); color: #f87171; border: 1px solid var(--color-danger-border); }
.badge-info { background: var(--color-info-muted); color: var(--color-info); border: 1px solid rgba(99,102,241,0.2); }
.badge-neutral { background: rgba(148,163,184,0.1); color: var(--text-secondary); border: 1px solid rgba(148,163,184,0.15); }
[data-theme="light"] .badge-success { color: var(--color-success); }
[data-theme="light"] .badge-warning { color: var(--color-warning); }
[data-theme="light"] .badge-danger { color: var(--color-danger); }

/* ============================================
   FORMS
   ============================================ */
.input-field {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  outline: none;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}
.input-field:focus { border-color: var(--border-emphasis); box-shadow: 0 0 0 3px var(--color-primary-muted), 0 0 12px rgba(99, 102, 241, 0.08); }
.input-field::placeholder { color: var(--text-muted); }
textarea.input-field { min-height: 100px; resize: vertical; }
select.input-field {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2394a3b8' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
}
.input-label {
  display: block;
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: var(--space-1);
}
.form-group { margin-bottom: var(--space-4); }
.form-hint { font-size: var(--text-xs); color: var(--text-muted); margin-top: var(--space-1); }

/* Tabs */
.tabs {
  display: flex;
  gap: var(--space-1);
  border-bottom: 2px solid var(--border-subtle);
}
.tab-btn {
  padding: var(--space-2) var(--space-4);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  color: var(--text-muted);
  font-size: var(--text-sm);
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
}
.tab-btn:hover { color: var(--text-primary); background: var(--color-primary-muted); border-radius: var(--radius-sm) var(--radius-sm) 0 0; }
.tab-btn.active {
  color: var(--color-primary);
  border-bottom: 2px solid transparent;
  border-image: var(--gradient-primary) 1;
}
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* File dropzone */
.file-dropzone {
  border: 2px dashed var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: var(--space-6) var(--space-4);
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
  background: var(--bg-input);
}
.file-dropzone:hover,
.file-dropzone.dragover {
  border-color: var(--color-primary);
  background: rgba(99, 102, 241, 0.05);
}
.file-dropzone-icon {
  font-size: 2rem;
  margin-bottom: var(--space-2);
  opacity: 0.6;
}
.file-dropzone-text {
  font-size: var(--text-sm);
  color: var(--text-secondary);
}
.file-dropzone-link {
  color: var(--color-primary);
  text-decoration: underline;
  cursor: pointer;
}
.file-dropzone-hint {
  font-size: var(--text-xs);
  color: var(--text-muted);
  margin-top: var(--space-1);
}
.file-dropzone-selected {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-4);
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
}
.file-dropzone-selected span:first-child {
  font-weight: 500;
  color: var(--text-primary);
}
.file-dropzone-remove {
  margin-left: auto;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: var(--text-lg);
  cursor: pointer;
  padding: 0 var(--space-1);
  line-height: 1;
}
.file-dropzone-remove:hover {
  color: var(--color-danger);
}

/* ============================================
   TABLE
   ============================================ */
.ds-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: var(--text-sm);
}
.ds-table th {
  text-align: left;
  padding: var(--space-3) var(--space-4);
  color: var(--text-muted);
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
  border-bottom: 1px solid var(--border-subtle);
}
.ds-table td {
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--border-base);
}
.ds-table tr { transition: background var(--transition-fast); }
.ds-table tr:hover td { background: rgba(99, 102, 241, 0.05); }
.ds-table tr.deal-row-new td { border-left: none; }
.ds-table tr.deal-row-new td:first-child { border-left: 3px solid var(--primary); }
.ds-table tr.deal-row-new td { background: rgba(99, 102, 241, 0.06); }
.ds-table tr.deal-row-new:hover td { background: rgba(99, 102, 241, 0.10); }

/* ============================================
   ALERTS / FLASH
   ============================================ */
.alert {
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  margin-bottom: var(--space-4);
  display: flex;
  align-items: center;
  justify-content: space-between;
  animation: fadeInUp 0.3s ease both;
}
.alert-success {
  background: var(--color-success-muted);
  color: #34d399;
  border: 1px solid var(--color-success-border);
}
.alert-danger {
  background: var(--color-danger-muted);
  color: #f87171;
  border: 1px solid var(--color-danger-border);
}
.alert-warning {
  background: var(--color-warning-muted);
  color: #fbbf24;
  border: 1px solid var(--color-warning-border);
}
.alert-info {
  background: var(--color-info-muted);
  color: var(--color-info);
  border: 1px solid rgba(99,102,241,0.2);
}
[data-theme="light"] .alert-success { color: var(--color-success); }
[data-theme="light"] .alert-danger { color: var(--color-danger); }
[data-theme="light"] .alert-warning { color: var(--color-warning); }
[data-theme="light"] .alert-info { color: var(--color-info); }
.alert-close {
  background: none;
  border: none;
  color: inherit;
  opacity: 0.6;
  cursor: pointer;
  font-size: 18px;
  padding: 0 var(--space-2);
}
.alert-close:hover { opacity: 1; }

/* ============================================
   THEME TOGGLE
   ============================================ */
.theme-toggle {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  width: 100%;
  padding: 10px var(--space-4);
  border-radius: var(--radius-md);
  background: var(--color-primary-muted);
  border: 1px solid var(--border-emphasis);
  color: var(--color-primary-light);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
}
.theme-toggle:hover { background: rgba(99, 102, 241, 0.25); transform: translateY(-1px); }

/* ============================================
   ANIMATIONS
   ============================================ */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}
.anim-fade-up { animation: fadeInUp 0.5s ease both; }
.anim-delay-1 { animation-delay: 0.1s; }
.anim-delay-2 { animation-delay: 0.2s; }
.anim-delay-3 { animation-delay: 0.3s; }

@keyframes pulseRing {
  0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4); }
  70% { box-shadow: 0 0 0 8px rgba(16, 185, 129, 0); }
  100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}
.live-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--color-success);
  display: inline-block;
  animation: pulseRing 2s infinite;
}

/* Shimmer effect for loading states */
@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}
.shimmer {
  background: linear-gradient(90deg, var(--bg-elevated) 25%, rgba(99, 102, 241, 0.08) 50%, var(--bg-elevated) 75%);
  background-size: 200% 100%;
  animation: shimmer 2s ease-in-out infinite;
}

/* Gradient border glow */
@keyframes borderGlow {
  0%, 100% { border-color: var(--border-subtle); }
  50% { border-color: var(--border-emphasis); }
}

/* Stagger children animation */
.stagger-children > * {
  animation: fadeInUp 0.4s ease both;
}
.stagger-children > *:nth-child(1) { animation-delay: 0.05s; }
.stagger-children > *:nth-child(2) { animation-delay: 0.1s; }
.stagger-children > *:nth-child(3) { animation-delay: 0.15s; }
.stagger-children > *:nth-child(4) { animation-delay: 0.2s; }
.stagger-children > *:nth-child(5) { animation-delay: 0.25s; }
.stagger-children > *:nth-child(6) { animation-delay: 0.3s; }
.stagger-children > *:nth-child(n+7) { animation-delay: 0.35s; }

/* ============================================
   PROGRESS BAR
   ============================================ */
.progress-bar {
  height: 6px;
  border-radius: var(--radius-full);
  background: #1e293b;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  border-radius: var(--radius-full);
  background: var(--gradient-primary);
  transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}
.progress-fill::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  animation: shimmer 2s ease-in-out infinite;
  background-size: 200% 100%;
}

/* ============================================
   UTILITIES
   ============================================ */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.gap-1 { gap: var(--space-1); }
.gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); }
.gap-4 { gap: var(--space-4); }
.gap-6 { gap: var(--space-6); }
.mt-1 { margin-top: var(--space-1); }
.mt-2 { margin-top: var(--space-2); }
.mt-3 { margin-top: var(--space-3); }
.mt-4 { margin-top: var(--space-4); }
.mt-6 { margin-top: var(--space-6); }
.mb-2 { margin-bottom: var(--space-2); }
.mb-3 { margin-bottom: var(--space-3); }
.mb-4 { margin-bottom: var(--space-4); }
.mb-6 { margin-bottom: var(--space-6); }
.ms-2 { margin-left: var(--space-2); }
.p-4 { padding: var(--space-4); }
.p-6 { padding: var(--space-6); }
.py-2 { padding-top: var(--space-2); padding-bottom: var(--space-2); }
.py-4 { padding-top: var(--space-4); padding-bottom: var(--space-4); }
.w-full { width: 100%; }
.text-center { text-align: center; }
.text-end { text-align: right; }
.hidden { display: none; }
.block { display: block; }

/* Grid */
.grid { display: grid; gap: var(--space-4); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-5 { grid-template-columns: repeat(5, 1fr); }
@media (max-width: 768px) {
  .grid-2, .grid-3, .grid-4, .grid-5 { grid-template-columns: 1fr; }
}
@media (min-width: 769px) and (max-width: 1024px) {
  .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-5 { grid-template-columns: repeat(3, 1fr); }
}

/* Responsive grid for settings page */
.grid-sidebar { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-6); }
@media (max-width: 1024px) { .grid-sidebar { grid-template-columns: 1fr; } }

/* Collapsible call details */
.call-details summary { list-style: none; }
.call-details summary::-webkit-details-marker { display: none; }
.call-details summary::marker { display: none; content: ""; }
.call-toggle-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px; height: 24px;
  font-size: 10px;
  color: var(--text-muted);
  background: var(--bg-elevated);
  border-radius: var(--radius-sm);
  transition: transform var(--transition-fast), color var(--transition-fast);
  flex-shrink: 0;
}
.call-details[open] .call-toggle-icon { transform: rotate(90deg); color: var(--color-primary-light); }
.call-details .card-body { animation: fadeInUp 0.2s ease both; }

/* Analysis version tabs */
.analysis-tabs-nav {
  display: flex;
  gap: var(--space-1);
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: var(--space-1);
  margin-bottom: var(--space-4);
  overflow-x: auto;
}
.analysis-tab-btn {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  background: transparent;
  border: 1px solid transparent;
  border-bottom: 2px solid transparent;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  color: var(--text-muted);
  cursor: pointer;
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: 500;
  transition: all var(--transition-fast);
  white-space: nowrap;
  margin-bottom: -1px;
}
.analysis-tab-btn:hover {
  color: var(--text-primary);
  background: var(--color-primary-muted);
}
.analysis-tab-btn.active {
  color: var(--color-primary-light);
  border-color: var(--border-subtle);
  border-bottom-color: var(--bg-base);
  background: var(--bg-card);
}
.analysis-tab-version {
  font-family: var(--font-mono);
  font-weight: 600;
  color: var(--color-primary-light);
}
.analysis-tab-name {
  color: var(--text-secondary);
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.analysis-tab-btn.active .analysis-tab-name { color: var(--text-primary); }
.analysis-tab-score {
  font-family: var(--font-mono);
  font-weight: 700;
}
.analysis-tab-panel { display: none; }
.analysis-tab-panel.active { display: block; animation: fadeInUp 0.2s ease both; }

/* Transcript block */
.transcript-block {
  font-size: var(--text-sm);
  background: var(--bg-input);
  border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-4);
  max-height: 200px;
  overflow-y: auto;
  white-space: pre-wrap;
  font-family: var(--font-body);
  color: var(--text-secondary);
  border: 1px solid var(--border-base);
}

/* Details/summary */
details summary {
  cursor: pointer;
  color: var(--text-secondary);
  font-size: var(--text-sm);
  font-weight: 500;
}
details summary:hover { color: var(--text-primary); }

/* Audio player */
audio {
  width: 100%;
  height: 36px;
  border-radius: var(--radius-md);
  margin-bottom: var(--space-3);
}

/* List reset */
.list-clean { list-style: none; padding: 0; }
.list-clean li { padding: var(--space-1) 0; }

/* Desktop only / Mobile only */
@media (max-width: 768px) {
  .desktop-only { display: none !important; }
}
@media (min-width: 769px) {
  .mobile-only { display: none !important; }
}

/* Prompt list item */
.prompt-item {
  padding: var(--space-4) var(--space-6);
  border-bottom: 1px solid var(--border-base);
  transition: background var(--transition-fast);
}
.prompt-item:hover { background: rgba(99, 102, 241, 0.03); }
.prompt-item:last-child { border-bottom: none; }

/* Score colors — override gradient-text on card-metric-value */
.score-high { background: none; -webkit-text-fill-color: var(--color-success); color: var(--color-success); }
.score-mid { background: none; -webkit-text-fill-color: var(--color-warning); color: var(--color-warning); }
.score-low { background: none; -webkit-text-fill-color: var(--color-danger); color: var(--color-danger); }

/* Red flag */
.red-flag { color: var(--color-danger); }

/* ============================================
   PIPELINE STATS & LOGS
   ============================================ */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--space-3);
}
.stat-card {
  padding: var(--space-4);
  text-align: center;
  position: relative;
  transition: all var(--transition-base);
}
.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 20%; right: 20%;
  height: 2px;
  border-radius: 0 0 2px 2px;
  background: var(--gradient-primary);
  opacity: 0;
  transition: opacity var(--transition-base);
}
.stat-card:hover::before { opacity: 1; }
.stat-label {
  font-size: var(--text-sm);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: var(--space-1);
}
.stat-value {
  font-size: var(--text-2xl);
  font-weight: 700;
  font-family: 'JetBrains Mono', monospace;
  background: var(--gradient-text);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.stat-detail {
  font-size: var(--text-sm);
  color: var(--text-muted);
  margin-top: var(--space-1);
  display: flex;
  gap: var(--space-2);
  justify-content: center;
  flex-wrap: wrap;
}
.text-success { color: var(--color-success); }
.text-danger { color: var(--color-danger); }
.text-warning { color: var(--color-warning); }
.text-muted { color: var(--text-muted); }
.text-sm { font-size: var(--text-sm); }
.font-mono { font-family: 'JetBrains Mono', monospace; }

.page-header {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-wrap: wrap;
  position: relative;
  margin-bottom: var(--space-4);
}
.page-header h1 {
  margin: 0;
}

.section-header {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-top: var(--space-6);
  margin-bottom: var(--space-3);
}
.section-header h2 {
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
}
.info-tooltip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--bg-elevated);
  color: var(--text-muted);
  font-size: var(--text-sm);
  cursor: help;
  position: relative;
  flex-shrink: 0;
  border: 1px solid var(--border-subtle);
  transition: all 0.15s ease;
}
.info-tooltip:hover {
  background: var(--color-primary);
  color: white;
  border-color: var(--color-primary);
}
.info-tooltip::after {
  content: attr(data-tip);
  position: absolute;
  left: calc(100% + 8px);
  top: 50%;
  transform: translateY(-50%);
  background: var(--bg-card);
  color: var(--text-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: var(--space-2) var(--space-3);
  font-size: var(--text-sm);
  line-height: 1.4;
  width: 280px;
  white-space: normal;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.15s ease, visibility 0.15s ease;
  z-index: 100;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(12px);
}
.info-tooltip:hover::after {
  opacity: 1;
  visibility: visible;
}
@media (max-width: 768px) {
  .info-tooltip::after {
    left: auto;
    right: 0;
    top: calc(100% + 8px);
    transform: none;
    width: 240px;
  }
}

/* Page help (collapsible hints block) */
.page-help {
  margin-left: auto;
}
.page-help summary {
  cursor: pointer;
  user-select: none;
}
.page-help summary::-webkit-details-marker { display: none; }
.page-help summary::marker { display: none; content: ""; }
.page-help-content {
  position: absolute;
  right: 0;
  top: calc(100% + var(--space-2));
  z-index: 50;
  padding: var(--space-4) var(--space-5);
  max-width: 560px;
  width: calc(100vw - var(--space-8));
  max-height: 70vh;
  overflow-y: auto;
  font-size: var(--text-sm);
  line-height: 1.6;
  color: var(--text-secondary);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}
.page-help-content h3 {
  font-size: var(--text-base);
  color: var(--text-primary);
  margin: 0 0 var(--space-3) 0;
}
.page-help-content h4 {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-primary);
  margin: var(--space-3) 0 var(--space-1) 0;
}
.page-help-content p {
  margin: 0 0 var(--space-2) 0;
}
.page-help-content ul {
  margin: 0 0 var(--space-2) 0;
  padding-left: var(--space-4);
}
.page-help-content li {
  margin-bottom: var(--space-1);
}

.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  font-size: var(--text-xs);
  font-weight: 500;
  background: var(--bg-elevated);
  color: var(--text-secondary);
}
.badge-error { background: rgba(239, 68, 68, 0.15); color: var(--color-danger); }
.badge-warn { background: rgba(245, 158, 11, 0.15); color: var(--color-warning); }
.badge-info { background: rgba(99, 102, 241, 0.15); color: var(--color-primary); }

.row-error { background: rgba(239, 68, 68, 0.05); }
.row-warn { background: rgba(245, 158, 11, 0.05); }

.log-meta {
  margin-top: var(--space-1);
}
.log-meta summary {
  cursor: pointer;
  user-select: none;
}
.log-meta pre {
  background: var(--bg-input);
  padding: var(--space-2);
  border-radius: var(--radius-sm);
  margin-top: var(--space-1);
  overflow-x: auto;
  max-height: 200px;
  font-size: var(--text-xs);
}

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

/* ============================================
   PROMPT BUILDER
   ============================================ */
.prompt-builder-tabs {
  display: flex;
  gap: var(--space-2);
  margin-bottom: var(--space-6);
  border-bottom: 1px solid var(--border-base);
  padding-bottom: var(--space-2);
}

.pb-tab {
  padding: var(--space-2) var(--space-4);
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  color: var(--text-secondary);
  cursor: pointer;
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 500;
  transition: var(--transition-fast);
}

.pb-tab:hover {
  color: var(--text-primary);
  background: var(--bg-elevated);
}

.pb-tab.active {
  color: var(--color-primary-light);
  border-color: var(--border-subtle);
  border-bottom-color: var(--bg-base);
  background: var(--bg-card);
}

.pb-panel {
  display: none;
}

.pb-panel.active {
  display: block;
}

.pb-field-row,
.pb-criterion-row {
  padding: var(--space-3);
  margin-bottom: var(--space-3);
  background: var(--bg-elevated);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-base);
}

.pb-field-grid {
  display: grid;
  grid-template-columns: 150px 140px 1fr 40px;
  gap: var(--space-2);
  align-items: center;
}

.pb-criterion-grid {
  display: grid;
  grid-template-columns: 200px 1fr 40px;
  gap: var(--space-2);
  align-items: center;
}

.input-sm {
  padding: var(--space-2) var(--space-3) !important;
  font-size: var(--text-sm) !important;
  min-height: unset !important;
}

.btn-danger-text {
  color: var(--color-danger) !important;
  font-size: 18px;
  line-height: 1;
}

.btn-danger-text:hover {
  background: var(--color-danger-muted) !important;
}

.font-mono {
  font-family: var(--font-mono) !important;
}

.mt-2 { margin-top: var(--space-2); }

/* Hint tooltip button */
.hint-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: var(--radius-full);
  background: var(--color-primary-muted);
  color: var(--color-primary-light);
  border: 1px solid var(--border-emphasis);
  font-size: 11px;
  font-weight: 700;
  font-family: var(--font-body);
  cursor: pointer;
  margin-left: var(--space-2);
  position: relative;
  vertical-align: middle;
  transition: var(--transition-fast);
  flex-shrink: 0;
}
.hint-btn:hover {
  background: var(--color-primary);
  color: #fff;
}

.hint-popup {
  display: none;
  position: fixed;
  z-index: 10000;
  width: 380px;
  max-width: 90vw;
  padding: var(--space-4);
  background: var(--bg-base);
  border: 1px solid var(--border-emphasis);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  font-size: var(--text-sm);
  color: var(--text-primary);
  font-weight: 400;
  line-height: 1.6;
  white-space: normal;
}
[data-theme="light"] .hint-popup {
  background: #fff;
  border-color: rgba(99, 102, 241, 0.3);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
}
.hint-popup.open { display: block; }
.hint-popup strong { color: var(--color-primary-light); }
.hint-popup p { margin: 0 0 var(--space-2) 0; }
.hint-popup p:last-child { margin-bottom: 0; }
.hint-popup ul {
  margin: var(--space-1) 0 var(--space-2) 0;
  padding-left: var(--space-4);
}
.hint-popup li { margin-bottom: 2px; }
.hint-popup code {
  background: var(--bg-elevated);
  padding: 1px 5px;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
}

@media (max-width: 768px) {
  .pb-field-grid {
    grid-template-columns: 1fr 1fr;
  }
  .pb-field-grid > .pb-field-desc-col {
    grid-column: 1 / -1;
  }
  .pb-criterion-grid {
    grid-template-columns: 1fr 40px;
  }
  .pb-criterion-grid > :first-child {
    grid-column: 1 / -1;
  }
}

.recent-job-row:hover {
  background: var(--bg-elevated) !important;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* ============================================
   ANALYSIS DASHBOARD CARD
   ============================================ */
.analysis-dashboard {
  background: #161b22;
  border: 1px solid #30363d;
  border-radius: 8px;
  overflow: hidden;
}
[data-theme="light"] .analysis-dashboard {
  background: #fff;
  border-color: #d0d7de;
}

/* Top strip: score + metrics */
.analysis-top-strip {
  display: flex;
  align-items: stretch;
  border-bottom: 1px solid #30363d;
}
[data-theme="light"] .analysis-top-strip { border-color: #d0d7de; }

.analysis-score-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 16px 20px;
  border-right: 1px solid #30363d;
  min-width: 80px;
}
[data-theme="light"] .analysis-score-panel { border-color: #d0d7de; }

.analysis-score-big { font-size: 28px; font-weight: 700; line-height: 1; }
.analysis-score-label { font-size: 10px; font-weight: 600; letter-spacing: 0.5px; color: #484f58; margin-top: 2px; }

.analysis-score-good { background: rgba(63,185,80,0.08); }
.analysis-score-good .analysis-score-big { color: #3fb950; }
.analysis-score-mid { background: rgba(210,153,34,0.08); }
.analysis-score-mid .analysis-score-big { color: #d29922; }
.analysis-score-bad { background: rgba(248,81,73,0.08); }
.analysis-score-bad .analysis-score-big { color: #f85149; }

[data-theme="light"] .analysis-score-good .analysis-score-big { color: #1a7f37; }
[data-theme="light"] .analysis-score-mid .analysis-score-big { color: #9a6700; }
[data-theme="light"] .analysis-score-bad .analysis-score-big { color: #cf222e; }

.analysis-metrics-panel {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
}
.analysis-metric-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 12px 8px;
  border-right: 1px solid #21262d;
}
[data-theme="light"] .analysis-metric-cell { border-color: #e1e4e8; }
.analysis-metric-cell:last-child { border-right: none; }
.analysis-metric-val { font-size: 18px; font-weight: 700; line-height: 1; }
.analysis-metric-name { font-size: 10px; color: #484f58; text-align: center; margin-top: 2px; }

/* Script compliance bar */
.analysis-script-section {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  border-bottom: 1px solid #30363d;
}
[data-theme="light"] .analysis-script-section { border-color: #d0d7de; }
.analysis-script-label { font-size: 12px; color: #8b949e; white-space: nowrap; }
.analysis-script-bar {
  flex: 1;
  height: 8px;
  background: #0d1117;
  border-radius: 4px;
  overflow: hidden;
}
[data-theme="light"] .analysis-script-bar { background: #eaeef2; }
.analysis-script-fill { height: 100%; border-radius: 4px; }
.analysis-script-val { font-size: 14px; font-weight: 700; min-width: 40px; text-align: right; }

/* Info rows */
.analysis-info-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-bottom: 1px solid #30363d;
}
[data-theme="light"] .analysis-info-row { border-color: #d0d7de; }
.analysis-info-cell {
  padding: 10px 16px;
  font-size: 13px;
  border-right: 1px solid #21262d;
}
[data-theme="light"] .analysis-info-cell { border-color: #e1e4e8; }
.analysis-info-cell:last-child { border-right: none; }
.analysis-info-full { grid-column: 1 / -1; border-right: none; }
.analysis-info-label {
  font-size: 10px;
  font-weight: 600;
  color: #484f58;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  margin-bottom: 4px;
}

/* Criteria grid */
.analysis-criteria-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-bottom: 1px solid #30363d;
}
[data-theme="light"] .analysis-criteria-grid { border-color: #d0d7de; }
.analysis-criterion {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  padding: 5px 12px;
  border-bottom: 1px solid #21262d;
}
[data-theme="light"] .analysis-criterion { border-color: #e1e4e8; }
.analysis-criterion:nth-child(odd) { border-right: 1px solid #21262d; }
[data-theme="light"] .analysis-criterion:nth-child(odd) { border-color: #e1e4e8; }
.analysis-criterion:nth-last-child(-n+2) { border-bottom: none; }
.analysis-crit-icon { flex-shrink: 0; font-size: 11px; }
.analysis-crit-text { color: #8b949e; }
.analysis-crit-text.met { color: #e6edf3; }
.analysis-crit-text.key { font-weight: 600; }
[data-theme="light"] .analysis-crit-text { color: #656d76; }
[data-theme="light"] .analysis-crit-text.met { color: #1f2328; }

/* Summary details */
.analysis-summary-details { border-bottom: none; }
.analysis-summary-toggle {
  padding: 8px 16px;
  font-size: 12px;
  font-weight: 600;
  color: #8b949e;
  cursor: pointer;
  list-style: none;
}
.analysis-summary-toggle::-webkit-details-marker { display: none; }
.analysis-summary-toggle::before { content: "▸ "; }
details[open] > .analysis-summary-toggle::before { content: "▾ "; }
.analysis-summary-body { padding: 0 16px 10px; }
.analysis-summary-line { font-size: 12px; color: #8b949e; padding: 2px 0; }

/* Responsive */
@media (max-width: 600px) {
  .analysis-metrics-panel { grid-template-columns: repeat(3, 1fr); }
  .analysis-info-row { grid-template-columns: 1fr; }
  .analysis-info-cell { border-right: none !important; border-bottom: 1px solid #21262d; }
  .analysis-criteria-grid { grid-template-columns: 1fr; }
  .analysis-criterion:nth-child(odd) { border-right: none !important; }
}

/* Call filter active button */
.call-filter-btn.active {
  background: var(--color-primary);
  color: #fff;
  border-color: var(--color-primary);
}

/* Copy phone tooltip */
.copy-phone:hover { opacity: 0.75; }
.copy-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text-primary);
  padding: 8px 18px;
  border-radius: var(--radius-md);
  font-size: 13px;
  z-index: 9999;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s;
}
.copy-toast.show { opacity: 1; }

/* Manager review markdown rendering */
.manager-review-body { line-height: 1.7; }
.manager-review-body h1,
.manager-review-body h2,
.manager-review-body h3,
.manager-review-body h4 {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 14px 0 4px;
  padding-bottom: 3px;
  border-bottom: 1px solid var(--border);
}
.manager-review-body h1:first-child,
.manager-review-body h2:first-child,
.manager-review-body h3:first-child,
.manager-review-body h4:first-child { margin-top: 0; }
.manager-review-body p { margin: 4px 0; }
.manager-review-body ul, .manager-review-body ol { padding-left: 18px; margin: 4px 0; }
.manager-review-body li { margin: 2px 0; }
.manager-review-body strong { color: var(--text-primary); }
.manager-review-body hr { border: none; border-top: 1px solid var(--border); margin: 10px 0; }
