/* ============================================
   AUDIOMIND — STYLE SYSTEM
   Colors: White · Graphite · Blue
   Font: Inter (200 / 500)
   ============================================ */

/* --- LOADING OVERLAY --- */
.loading-overlay {
  position: fixed;
  top: 0; left: 0;
  width: 100vw; height: 100vh;
  background: rgba(255,255,255,0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.3s ease;
}
.loading-overlay.hidden {
  opacity: 0;
  pointer-events: none;
}
.loading-spinner-container {
  text-align: center;
}
.loading-spinner {
  width: 48px;
  height: 48px;
  border: 4px solid #f1f5f9;
  border-top: 4px solid #0f172a;
  border-radius: 50%;
  margin: 0 auto 16px;
  animation: spin 1s linear infinite;
}
.loading-message {
  font-family: 'Inter', sans-serif;
  font-weight: 500;
  color: #0f172a;
  font-size: 15px;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* --- TAG FILTERS --- */
.tag-filter {
  padding: 6px 14px;
  border-radius: 99px;
  border: 1px solid #e2e8f0;
  background: #fff;
  color: #64748b;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.tag-filter:hover {
  border-color: #cbd5e1;
  background: #f8fafc;
  color: #0f172a;
}

.tag-filter.active {
  background: #0f172a;
  color: #fff;
  border-color: #0f172a;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}


/* --- ONBOARDING TUTORIAL --- */
.onboarding-popover {
  background: #226A68; /* Closer green */
  background: var(--accent-primary);
  color: white;
  padding: 24px;
  border-radius: 20px;
  max-width: 320px;
  box-shadow: 0 20px 50px rgba(0,0,0,0.3);
  animation: popIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  font-family: var(--font-raleway), sans-serif;
  border: 1px solid rgba(255,255,255,0.1);
}

.onboarding-highlight {
  transition: all 0.3s ease;
  box-shadow: 0 0 0 4px var(--accent-primary), 0 0 20px rgba(99, 102, 241, 0.4) !important;
  z-index: 10000 !important;
  position: relative;
}

.popover-arrow {
  position: absolute;
  width: 12px;
  height: 12px;
  background: var(--accent-primary);
  transform: rotate(45deg);
  top: -6px;
  left: 30px;
}

@keyframes popIn {
  from { opacity: 0; transform: scale(0.8) translateY(20px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

/* ---------- TOKENS ---------- */
:root {
  --white:        #FFFFFF;
  --bg:           #FAFBFC;
  --bg-card:      #FFFFFF;
  --border:       #E5E7EB;
  --border-hover: #D1D5DB;

  --graphite-50:  #F9FAFB;
  --graphite-100: #F3F4F6;
  --graphite-200: #E5E7EB;
  --graphite-300: #D1D5DB;
  --graphite-400: #6B7280;
  --graphite-500: #4B5563;
  --graphite-600: #4B5563;
  --graphite-600: #374151;
  --graphite-800: #1F2937;
  --graphite-900: #111827;
  --graphite-950: #030712;

  --accent-primary: #226A68;
  --accent-light: #F1F5F9;
  --accent-main:  #0F172A; /* Almost black */
  --accent-hover: #000000;
  
  --red:   #EF4444;
  --green: #10B981;

  --fw-light:  250;
  --fw-normal: 300;
  --fw-medium: 500;
  --fw-bold:   600;

  --radius-sm:  8px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-xl: 32px;
  --radius-pill: 9999px;

  --shadow-sm:  0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md:  0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  --shadow-lg:  0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -4px rgba(0, 0, 0, 0.05);
  --shadow-xl:  0 20px 25px -5px rgba(0, 0, 0, 0.05), 0 8px 10px -6px rgba(0, 0, 0, 0.05);
  --shadow-btn: 0 4px 14px 0 rgba(0, 0, 0, 0.15);

  --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
  --font-raleway: 'Raleway', sans-serif;

  --transition: 200ms cubic-bezier(.4,0,.2,1);
}

/* ---------- DARK MODE PALETTE ---------- */
[data-theme="dark"] {
  --bg:           #0a0c10; 
  --bg-card:      #12161e; 
  --white:        #12161e; 
  --border:       #24292f;
  --border-hover: #3b424b;

  --graphite-50:  #161b22;
  --graphite-100: #1c2128;
  --graphite-200: #2d333b;
  --graphite-300: #444c56;
  --graphite-400: #768390;
  --graphite-500: #adbac7;
  --graphite-600: #cdd9e1;
  --graphite-800: #f0f6fc;
  --graphite-900: #ffffff;

  --accent-light: #1c2128;
  --accent-main:  #3b82f6; 
}

/* Hard Force Dark Overrides for Inline Styles and dynamic components */
[data-theme="dark"] body { 
  background-color: var(--bg) !important; 
  background-image: none !important;
  color: var(--graphite-600) !important; 
}

[data-theme="dark"] .header,
[data-theme="dark"] .nav-pill,
[data-theme="dark"] .chart-card, 
[data-theme="dark"] .history-item, 
[data-theme="dark"] .recorder-card,
[data-theme="dark"] .drop-zone,
[data-theme="dark"] .audio-preview,
[data-theme="dark"] .consent-card,
[data-theme="dark"] .modal-content-wide,
[data-theme="dark"] section.view,
[data-theme="dark"] div[style*="background: #fff"], 
[data-theme="dark"] div[style*="background: white"],
[data-theme="dark"] div[style*="background:#fff"],
[data-theme="dark"] div[style*="background:white"],
[data-theme="dark"] div[style*="background-color: #fff"],
[data-theme="dark"] div[style*="background-color: white"],
[data-theme="dark"] button[style*="background: #fff"],
[data-theme="dark"] button[style*="background:#fff"],
[data-theme="dark"] button[style*="background: white"] { 
  background-color: var(--bg-card) !important; 
  border-color: var(--border) !important; 
  color: var(--graphite-600) !important;
  box-shadow: 0 4px 20px rgba(0,0,0,0.4) !important;
}

/* Fix for light background badges in dark mode */
[data-theme="dark"] div[style*="background: #f1f5f9"],
[data-theme="dark"] span[style*="background: #f1f5f9"],
[data-theme="dark"] div[style*="background:#f1f5f9"],
[data-theme="dark"] span[style*="background:#f1f5f9"] {
  background-color: var(--graphite-100) !important;
  color: var(--graphite-500) !important;
}

[data-theme="dark"] h1, [data-theme="dark"] h2, [data-theme="dark"] h3, [data-theme="dark"] h4, [data-theme="dark"] h5,
[data-theme="dark"] div[style*="color: #0f172a"],
[data-theme="dark"] div[style*="color:#0f172a"],
[data-theme="dark"] div[style*="color: #111"],
[data-theme="dark"] div[style*="color: #111111"],
[data-theme="dark"] h1[style*="color: #0f172a"],
[data-theme="dark"] h1[style*="color: #111"],
[data-theme="dark"] h3[style*="color: #111111"],
[data-theme="dark"] td[style*="color: #0f172a"],
[data-theme="dark"] strong[style*="color: #0f172a"] {
  color: var(--graphite-900) !important;
}

[data-theme="dark"] .app-subtitle,
[data-theme="dark"] p[style*="color: #475569"],
[data-theme="dark"] p[style*="color: #4b5563"],
[data-theme="dark"] p[style*="color: #64748b"],
[data-theme="dark"] p[style*="color: #94a3b8"],
[data-theme="dark"] div[style*="color: #64748b"],
[data-theme="dark"] div[style*="color:#64748b"],
[data-theme="dark"] div[style*="color: #94a3b8"],
[data-theme="dark"] span[style*="color: #64748b"],
[data-theme="dark"] span[style*="color: #94a3b8"] {
  color: var(--graphite-400) !important;
}

[data-theme="dark"] .header-divider {
  background: var(--border) !important;
}

[data-theme="dark"] table tr {
  border-bottom-color: var(--border) !important;
}

[data-theme="dark"] input, [data-theme="dark"] select, [data-theme="dark"] textarea {
  background-color: var(--graphite-100) !important;
  border-color: var(--border) !important;
  color: var(--graphite-900) !important;
}

[data-theme="dark"] .btn-outline,
[data-theme="dark"] .header-icon-btn {
  background: var(--graphite-100) !important;
  border-color: var(--border) !important;
  color: var(--graphite-500) !important;
}

[data-theme="dark"] .btn-outline:hover,
[data-theme="dark"] .header-icon-btn:hover {
  background: var(--graphite-200) !important;
  color: var(--graphite-900) !important;
}

/* Special fix for the executive report export button which is hardcoded black */
[data-theme="dark"] button[onclick*="exportExecutiveReport"] {
  background: var(--accent-main) !important;
  color: white !important;
}

/* Ensure background transitions smoothly */
body {
  transition: background-color 0.3s ease, color 0.3s ease;
}

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

html {
  -webkit-font-smoothing: antialiased;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  font-weight: var(--fw-light);
  font-size: 15px;
  line-height: 1.65;
  color: var(--graphite-600);
  background: var(--bg);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

h1 {
  font-family: var(--font-raleway);
  font-weight: 600;
}

h2, h3, h4, h5, h6 {
  font-family: var(--font-raleway);
  font-weight: 450;
}

strong, b, .font-600 {
  font-family: var(--font-raleway);
  font-weight: 600;
}

/* ---------- UTILITIES ---------- */
.hidden { display: none !important; }
.w-full { width: 100%; }
.accent { color: var(--accent-main); }

.app-subtitle {
  font-family: var(--font-raleway);
  font-weight: var(--fw-medium);
}

/* ---------- HEADER ---------- */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--white);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px;
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
}

.nav-primary {
  display: flex;
  gap: 8px;
  margin-left: 8px;
}

.header-right-zone {
  display: flex;
  align-items: center;
  gap: 16px;
  flex: 1;
  justify-content: flex-end;
}

.nav-secondary {
  display: flex;
  gap: 6px;
}

.header-divider {
  width: 1px;
  height: 24px;
  background: var(--border);
  margin: 0 4px;
  opacity: 0.6;
}

.header-user-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.sync-indicator {
  font-size: 11px;
  color: #94a3b8;
  font-family: var(--font-raleway);
  font-weight: 500;
}

.header-icon-btn {
  width: 36px;
  height: 36px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 16px;
}

.header-icon-btn:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
  transform: translateY(-1px);
}

.user-avatar-pill {
  width: 36px;
  height: 36px;
  background: #0f172a;
  color: white;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  font-size: 14px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  flex-shrink: 0;
}

.user-avatar-pill:hover {
  transform: scale(1.08);
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.logo {
  display: flex;
  align-items: center;
  gap: 16px;
}
.logo-mark { line-height: 0; }
.logo-mark img {
  height: 60px;
  width: auto;
}
.logo-text {
  font-family: var(--font-raleway);
  font-size: 32px;
  font-weight: 600;
  color: #1a6f66; /* Match Closer green/teal */
  letter-spacing: -0.5px;
}

.nav {
  display: flex;
  gap: 8px;
}
.nav-btn {
  font-family: var(--font-raleway);
  font-weight: 300;
  font-size: 14px;
  color: var(--graphite-600);
  background: none;
  border: 1px solid var(--border);
  cursor: pointer;
  padding: 8px 20px;
  border-radius: var(--radius-pill);
  transition: all var(--transition);
  background: var(--white);
  box-shadow: var(--shadow-sm);
}
.nav-btn:hover {
  border-color: var(--graphite-300);
  color: var(--accent-main);
  background: var(--graphite-50);
}
.nav-btn.active {
  background: var(--accent-main);
  color: var(--white);
  border-color: var(--accent-main);
  box-shadow: var(--shadow-md);
}

/* QUICK FILTERS DASHBOARD */
.quick-filters {
  display: flex;
  gap: 8px;
  margin-right: 12px;
}
.quick-filter-btn {
  padding: 7px 14px;
  border: 1px solid var(--border);
  background: white;
  color: #64748b;
  border-radius: 10px;
  cursor: pointer;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  transition: all 0.2s ease;
  box-shadow: var(--shadow-sm);
  font-family: var(--font-raleway);
}
.quick-filter-btn:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
  color: #0f172a;
  transform: translateY(-1px);
}
.quick-filter-btn:active {
  transform: translateY(0);
}

.main {
  flex: 1;
  max-width: 1104px;
  margin: 0 auto;
  padding: 40px 24px 100px;
  width: 100%;
}

/* ---------- HERO PREMIUM ---------- */
.hero-premium {
  background: var(--accent-main);
  background: linear-gradient(135deg, var(--accent-main) 0%, var(--bg-card) 100%);
  border-radius: var(--radius-xl);
  padding: 80px 60px;
  text-align: left;
  margin-bottom: 48px;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-xl);
  color: #FFFFFF; /* High contrast white for hero text */
}

.hero-premium::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(circle at top right, rgba(255,255,255,0.05) 0%, transparent 70%);
  pointer-events: none;
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 800px;
}

.hero-premium .hero-title {
  color: var(--white);
  font-size: clamp(32px, 5vw, 48px);
  margin-bottom: 16px;
  font-family: var(--font-raleway);
  font-weight: 500;
}

.hero-premium .hero-title .accent {
  color: #475569;
}

.hero-premium .hero-sub {
  color: #cbd5e1;
  font-size: 18px;
  margin-bottom: 40px;
  font-weight: 300;
}

.btn-hero {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 16px 36px;
  font-size: 16px;
  font-family: var(--font-raleway);
  font-weight: 300;
  background: var(--white);
  color: var(--accent-main);
  border: none;
  border-radius: var(--radius-pill);
  box-shadow: 0 10px 25px -5px rgba(0,0,0,0.3);
  transition: all 0.3s ease;
  cursor: pointer;
}

.btn-hero:hover {
  transform: translateY(-4px);
  box-shadow: 0 15px 30px -5px rgba(0,0,0,0.4);
  background: var(--graphite-50);
}

.btn-hero-icon {
  font-size: 20px;
}

/* ---------- BUTTONS ---------- */
button, .btn {
  font-family: var(--font-raleway);
  font-weight: 300;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  border-radius: 99px;
  padding: 8px 20px;
  cursor: pointer;
  transition: all 0.2s ease;
  border: 1px solid #f1f5f9;
  background: white;
  color: #334155;
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
  text-decoration: none;
  white-space: nowrap;
}
.btn-primary {
  background: #000;
  color: #fff;
  border: 1px solid #000;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.2);
}
.btn-primary:hover {
  background: #222;
  border-color: #222;
  transform: translateY(-2px);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.3);
}
.btn-primary:active { transform: translateY(0); }

.btn-outline {
  background: white;
  color: #334155;
  border: 1px solid #f1f5f9;
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}
.btn-outline:hover {
  background: #f8fafc;
  border-color: #e2e8f0;
  color: #0f172a;
}
.btn-ghost {
  background: none;
  color: #475569;
  border-color: transparent;
  padding: 6px 12px;
}
.btn-ghost:hover { background: #f1f5f9; color: #0f172a; }
.btn-sm { font-size: 13px; padding: 8px 16px; border-radius: var(--radius-pill); }
.btn-icon { font-size: 16px; }

/* ---------- API NOTICE ---------- */
.api-notice {
  background: var(--white);
  border: 1px solid var(--border);
  border-left: 3px solid var(--blue-400);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px 14px;
  align-items: start;
  margin-bottom: 24px;
  animation: fadeSlideIn .4s ease;
}
.api-notice-icon { font-size: 22px; line-height: 1; }
.api-notice-title {
  font-family: var(--font-raleway);
  font-weight: 600;
  color: var(--graphite-600);
  font-size: 14px;
  margin-bottom: 3px;
}
.api-notice-desc {
  font-size: 13px;
  color: var(--graphite-400);
  font-weight: var(--fw-normal);
}
.api-key-row {
  grid-column: 1 / -1;
  display: flex;
  gap: 8px;
  align-items: center;
}
.api-key-field {
  width: 100%;
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: var(--fw-normal);
  padding: 12px 16px;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  background: #f8fafc;
  color: var(--graphite-800);
  outline: none;
  transition: all var(--transition);
  display: block;
}
.api-key-field:focus { border-color: var(--accent-main); background: var(--white); box-shadow: 0 0 0 3px rgba(15, 23, 42, 0.05); }

.form-group {
  margin-bottom: 20px;
  width: 100%;
}
.form-label {
  display: block;
  font-family: var(--font-raleway);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--graphite-400);
  margin-bottom: 8px;
}

/* ---------- DROP ZONE ---------- */
.drop-zone {
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  background: var(--white);
  transition: all var(--transition);
  cursor: pointer;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.drop-zone:hover, .drop-zone.drag-over {
  border-color: var(--graphite-300);
  box-shadow: var(--shadow-md);
}
.drop-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 72px 24px;
  text-align: center;
}
.drop-icon {
  width: 80px;
  height: 80px;
  background: var(--blue-50);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1.5px solid var(--blue-100);
  transition: all var(--transition);
}
.drop-zone:hover .drop-icon {
  background: var(--blue-100);
  transform: scale(1.06);
}
.drop-title {
  font-family: var(--font-raleway);
  font-size: 24px;
  color: var(--graphite-900);
  margin-bottom: -4px;
}
.drop-sub {
  font-size: 14px;
  font-weight: 300;
  color: var(--graphite-500);
}

/* ---------- AUDIO PREVIEW ---------- */
.audio-preview {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-top: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  box-shadow: var(--shadow-sm);
  animation: fadeSlideIn .35s ease;
}
.audio-preview-info {
  display: flex;
  align-items: center;
  gap: 12px;
}
.audio-icon {
  width: 48px; height: 48px;
  background: var(--graphite-50);
  border: 1px solid var(--border);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.file-name {
  font-weight: var(--fw-medium);
  color: var(--graphite-600);
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 300px;
}
.file-size {
  font-size: 12px;
  color: var(--graphite-300);
  font-weight: var(--fw-normal);
}
audio {
  width: 100%;
  height: 40px;
  border-radius: var(--radius-sm);
  accent-color: var(--blue-500);
}

/* ---------- RECORDER ---------- */
.recorder-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 32px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  box-shadow: var(--shadow-md);
}
.recorder-visual {
  width: 100%;
  background: var(--graphite-50);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  position: relative;
  height: 120px;
}
#visualizer-canvas {
  width: 100%;
  height: 100%;
  display: block;
}
.recorder-status {
  position: absolute;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 7px;
  background: rgba(255,255,255,.9);
  border-radius: 20px;
  padding: 4px 12px;
  font-size: 12px;
  font-weight: var(--fw-medium);
  color: var(--graphite-500);
  backdrop-filter: blur(8px);
}
.status-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--graphite-300);
}
.status-dot.recording {
  background: var(--red);
  animation: blink 1s ease-in-out infinite;
}
.status-dot.paused { background: #F59E0B; }
.status-dot.done { background: var(--green); }

.recorder-timer {
  font-size: 42px;
  font-weight: var(--fw-medium);
  color: var(--graphite-800);
  letter-spacing: -1px;
  font-variant-numeric: tabular-nums;
}

.recorder-controls {
  display: flex;
  gap: 16px;
  align-items: center;
}
.rec-btn {
  width: 60px; height: 60px;
  border-radius: 50%;
  border: 1.5px solid var(--border);
  background: var(--white);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: all var(--transition);
  box-shadow: var(--shadow-sm);
}
.rec-btn:hover {
  border-color: var(--graphite-300);
  transform: scale(1.06);
  box-shadow: var(--shadow-md);
}
.rec-btn:active { transform: scale(.97); }

.recorder-options {
  width: 100%;
  border-top: 1px solid var(--border);
  padding-top: 18px;
}
.toggle-label {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-size: 13.5px;
  font-weight: var(--fw-normal);
  color: var(--graphite-500);
  user-select: none;
}
.toggle-input { display: none; }
.toggle-track {
  width: 38px; height: 22px;
  background: var(--graphite-200);
  border-radius: 11px;
  position: relative;
  transition: background var(--transition);
  flex-shrink: 0;
}
.toggle-track::after {
  content: '';
  position: absolute;
  width: 17px; height: 17px;
  background: var(--white);
  border-radius: 50%;
  top: 2.5px; left: 2.5px;
  transition: transform var(--transition);
  box-shadow: 0 1px 4px rgba(0,0,0,.18);
}
.toggle-input:checked + .toggle-track {
  background: var(--blue-500);
}
.toggle-input:checked + .toggle-track::after {
  transform: translateX(16px);
}

.live-transcript {
  width: 100%;
  background: var(--graphite-50);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px;
}
.live-label {
  font-size: 11px;
  font-weight: var(--fw-medium);
  text-transform: uppercase;
  letter-spacing: .8px;
  color: var(--blue-500);
  margin-bottom: 8px;
}
.live-text {
  font-size: 14px;
  font-weight: var(--fw-normal);
  color: var(--graphite-600);
  line-height: 1.7;
  min-height: 48px;
}
.live-text .interim { color: var(--graphite-300); font-style: italic; }

/* ---------- PROGRESS ---------- */
.progress-section {
  margin-top: 36px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
  box-shadow: var(--shadow-sm);
  animation: fadeSlideIn .4s ease;
}
.progress-steps {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 28px;
}
.step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  opacity: .35;
  transition: opacity .4s, transform .4s;
  font-size: 12px;
  font-weight: var(--fw-normal);
  color: var(--graphite-500);
}
.step.active { opacity: 1; }
.step.done { opacity: 1; }
.step-icon {
  width: 40px; height: 40px;
  background: var(--graphite-100);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
  transition: all .4s;
}
.step.active .step-icon {
  background: var(--blue-50);
  box-shadow: 0 0 0 4px rgba(59,130,246,.12);
}
.step.done .step-icon {
  background: #ECFDF5;
  box-shadow: 0 0 0 4px rgba(16,185,129,.1);
}
.step-line {
  width: 60px; height: 1.5px;
  background: var(--graphite-200);
  flex-shrink: 0;
}
.progress-bar-wrap {
  height: 6px;
  background: var(--graphite-100);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 12px;
}
.progress-bar {
  height: 100%;
  background: var(--accent-main);
  border-radius: 3px;
  width: 0%;
  transition: width .4s cubic-bezier(.4,0,.2,1);
}
.progress-label {
  text-align: center;
  font-size: 13px;
  color: var(--graphite-400);
  font-weight: var(--fw-normal);
}
.progress-chunk {
  text-align: center;
  font-size: 12px;
  color: var(--graphite-500);
  font-weight: var(--fw-normal);
  margin-top: 4px;
  min-height: 18px;
  letter-spacing: .2px;
}

/* ---------- HISTORY VIEW ---------- */
.history-header {
  margin-bottom: 24px;
}
.history-header h2 {
  font-family: var(--font-raleway);
  font-size: 28px;
  font-weight: 400;
  color: var(--graphite-900);
}
.history-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.history-item {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: all var(--transition);
  cursor: pointer;
  box-shadow: var(--shadow-sm);
}
.history-item:hover {
  border-color: var(--graphite-300);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}
.history-item-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.history-item-title {
  font-weight: 500;
  color: var(--graphite-900);
  font-size: 16px;
}
.history-item-meta {
  font-size: 13px;
  color: var(--graphite-500);
}
.history-item-actions {
  display: flex;
  gap: 8px;
}
.empty-history {
  text-align: center;
  padding: 40px;
  color: var(--graphite-500);
  font-size: 15px;
  border: 1px dashed var(--border);
  border-radius: var(--radius-xl);
}

/* ---------- RESULTS ---------- */
.results {
  margin-top: 36px;
  animation: fadeSlideIn .5s ease;
}
.results-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 12px;
}
.results-title {
  font-family: var(--font-raleway);
  font-size: 32px;
  font-weight: 400;
  color: var(--graphite-900);
  letter-spacing: -0.5px;
}
.results-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.tabs {
  display: flex;
  border-bottom: 2px solid var(--border);
  margin-bottom: 0;
  gap: 0;
}
.tab {
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: var(--fw-normal);
  color: var(--graphite-400);
  background: none;
  border: none;
  cursor: pointer;
  padding: 12px 22px;
  position: relative;
  transition: color var(--transition);
}
.tab::after {
  content: '';
  position: absolute;
  bottom: -2px; left: 0; right: 0;
  height: 2px;
  background: var(--accent-main);
  transform: scaleX(0);
  transition: transform var(--transition);
  border-radius: 2px 2px 0 0;
}
.tab.active { color: var(--graphite-900); font-weight: 500; }
.tab.active::after { transform: scaleX(1); }
.tab:hover:not(.active) { color: var(--graphite-600); }

.tab-panel {
  display: none;
  background: var(--white);
  border: 1px solid var(--border);
  border-top: none;
  border-radius: 0 0 var(--radius-xl) var(--radius-xl);
  padding: 36px;
  box-shadow: var(--shadow-sm);
}
.tab-panel.active { display: block; animation: fadeIn .3s ease; }

.panel-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.word-count {
  font-size: 12px;
  font-weight: var(--fw-normal);
  color: var(--graphite-300);
  letter-spacing: .3px;
}

.transcription-text {
  font-size: 15px;
  font-weight: var(--fw-normal);
  color: var(--graphite-600);
  line-height: 1.85;
  white-space: pre-wrap;
  max-height: 480px;
  overflow-y: auto;
  padding-right: 4px;
}
.transcription-text::-webkit-scrollbar { width: 4px; }
.transcription-text::-webkit-scrollbar-track { background: transparent; }
.transcription-text::-webkit-scrollbar-thumb { background: var(--graphite-200); border-radius: 2px; }

/* SUMMARY */
.summary-content {
  font-size: 15px;
  font-weight: var(--fw-normal);
  color: var(--graphite-600);
  line-height: 1.85;
}
.summary-section {
  margin-bottom: 24px;
}
.summary-section-title {
  font-size: 12px;
  font-weight: var(--fw-medium);
  text-transform: uppercase;
  letter-spacing: .8px;
  color: var(--blue-500);
  margin-bottom: 8px;
}
.summary-block {
  background: var(--graphite-50);
  border-radius: var(--radius-md);
  padding: 16px;
  font-size: 14.5px;
  color: var(--graphite-600);
  border: 1px solid var(--border);
}

/* INSIGHTS */
.insights-list { display: flex; flex-direction: column; gap: 12px; }
.insight-card {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 16px 18px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  transition: all var(--transition);
  animation: fadeSlideIn .4s ease both;
}
.insight-card:hover {
  border-color: var(--blue-200);
  box-shadow: 0 2px 12px rgba(59,130,246,.08);
  transform: translateY(-1px);
}
.insight-number {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--graphite-100);
  color: var(--graphite-800);
  font-size: 13px;
  font-weight: 500;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.insight-text {
  font-size: 14.5px;
  font-weight: var(--fw-normal);
  color: var(--graphite-600);
  line-height: 1.65;
}

/* ---------- FOOTER ---------- */
.footer {
  text-align: center;
  padding: 24px;
  font-size: 12px;
  font-weight: var(--fw-normal);
  color: var(--graphite-300);
  border-top: 1px solid var(--border);
  background: var(--white);
}

/* ---------- VIEWS ---------- */
.view { display: none; }
.view.active { display: block; animation: fadeSlideIn .3s ease; }

/* ---------- ANIMATIONS ---------- */
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes fadeSlideIn {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: .3; }
}
@keyframes pulse-ring {
  0%   { transform: scale(1); opacity: .6; }
  100% { transform: scale(1.9); opacity: 0; }
}

/* ---------- CLOSER 360 ANALYSIS ---------- */
.analysis-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
}
.analysis-title {
  font-family: var(--font-raleway);
  font-size: 20px;
  font-weight: 500;
  color: var(--graphite-900);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.analysis-grid {
  display: grid;
  gap: 24px;
}
.analysis-grid.two-cols { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.metric-row { display: flex; flex-wrap: wrap; gap: 12px; }
.metric-badge {
  background: var(--graphite-50);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  display: flex; flex-direction: column; gap: 4px;
}
.metric-badge .metric-label { font-size: 11px; text-transform: uppercase; color: var(--graphite-500); letter-spacing: 0.5px; font-weight: 500;}
.metric-badge .metric-value { font-size: 16px; font-weight: 600; color: var(--accent-main); }
.analysis-list {
  list-style: none;
  padding: 0; margin: 0;
  display: flex; flex-direction: column; gap: 8px;
  font-size: 14px;
}
.analysis-list li {
  position: relative;
  padding-left: 20px;
}
.analysis-list li::before {
  content: "•";
  position: absolute;
  left: 0; color: var(--accent-main);
  font-weight: 600; font-size: 18px; line-height: 1.2;
}

.success-zone { border-top: 4px solid var(--green); }
.danger-zone { border-top: 4px solid var(--red); }
.warning-zone { border-top: 4px solid #F59E0B; }

.badge {
  font-size: 12px; padding: 4px 8px; border-radius: 12px; font-weight: 500;
}
.badge-gray { background: var(--graphite-100); color: var(--graphite-600); }
.badge-brand { background: var(--blue-50); color: var(--accent-main); }
.badge-dark { background: var(--graphite-800); color: var(--white); }

.traffic-light { display: flex; flex-direction: column; gap: 8px; }
.tl-item { padding: 12px; border-radius: var(--radius-md); font-size: 14px; }
.tl-item.green { background: rgba(16,185,129,0.1); border-left: 3px solid var(--green); }
.tl-item.amber { background: rgba(245,158,11,0.1); border-left: 3px solid #F59E0B; }
.tl-item.red { background: rgba(239,68,68,0.1); border-left: 3px solid var(--red); }

.script-box {
  background: var(--graphite-50);
  border-left: 3px solid var(--blue-400);
  border-radius: var(--radius-sm);
  padding: 16px;
}

.step-plan-item {
  border-bottom: 1px solid var(--border);
  padding: 16px 0;
}
.step-plan-item:last-child { border-bottom: none; padding-bottom: 0; }

.text-sm { font-size: 14px; }
.text-lg { font-size: 18px; line-height: 1.5; }
.mt-sm { margin-top: 8px; }
.mt-md { margin-top: 16px; }
.mt-lg { margin-top: 24px; }
.mb-sm { margin-bottom: 8px; }
.mb-md { margin-bottom: 16px; }

.competency-list { display: flex; flex-direction: column; gap: 12px; }
.cm-item { display: flex; justify-content: space-between; font-size: 15px; border-bottom: 1px dotted var(--border); padding-bottom: 4px; }
.cm-item b { color: var(--accent-main); }

/* ---------- HOME DASHBOARD & USER ---------- */
.user-profile {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 16px;
  border-radius: var(--radius-md);
  background: var(--white);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: all var(--transition);
  user-select: none;
  flex-shrink: 0;
}
.user-profile:hover { border-color: var(--graphite-300); background: var(--graphite-50); }
.user-avatar { width: 32px; height: 32px; background: var(--accent-main); color: white; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 14px; }
.user-info-brief { display: flex; flex-direction: column; line-height: 1.2; }
#user-name { font-family: var(--font-raleway); font-size: 13px; font-weight: 600; color: var(--graphite-900); white-space: nowrap; }
#user-role { font-size: 11px; color: var(--graphite-400); text-transform: uppercase; letter-spacing: 0.5px; }

.user-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 220px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-xl);
  z-index: 1000;
  padding: 8px;
  animation: fadeSlideIn 0.2s ease;
}
.dropdown-header { font-family: var(--font-raleway); font-size: 11px; text-transform: uppercase; color: var(--graphite-400); padding: 8px 12px; font-weight: 600; }
.drop-item {
  width: 100%; text-align: left; padding: 10px 12px; border: none; background: none; font-family: var(--font-raleway); font-size: 14px; color: var(--graphite-600); cursor: pointer; border-radius: var(--radius-sm); transition: background 0.2s; font-weight: 300;
}
.drop-item:hover { background: var(--graphite-50); color: var(--accent-main); }
.drop-item#logout-btn { color: var(--red); }
.drop-item#logout-btn:hover { background: #FEF2F2; }
hr { border: none; border-top: 1px solid var(--border); margin: 8px 0; }

.quick-actions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 16px;
  margin-top: 16px;
}
.qa-btn {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: 24px 16px; background: var(--graphite-50); border: 1px solid var(--border); border-radius: var(--radius-lg); cursor: pointer; transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.qa-btn:hover { background: var(--white); border-color: var(--accent-main); transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.qa-icon { font-size: 28px; }
.qa-text { font-family: var(--font-raleway); font-size: 13px; font-weight: 300; color: var(--graphite-800); }

.analysis-grid.four-cols { 
  display: grid;
  grid-template-columns: repeat(4, 1fr); 
  gap: 20px; 
}
.analysis-grid.three-cols { 
  display: grid;
  grid-template-columns: repeat(3, 1fr); 
  gap: 16px; 
}

.kpi-card {
  padding: 24px 20px; text-align: center; background: var(--white); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); position: relative; overflow: hidden;
}
.kpi-card::before { content: ""; position: absolute; top: 0; left: 0; width: 4px; height: 100%; background: var(--accent-main); opacity: 0.1; }
.kpi-value { font-family: var(--font-raleway); font-size: 32px; font-weight: 600; color: var(--graphite-900); margin: 8px 0; }
.kpi-label { font-family: var(--font-raleway); font-size: 11px; color: var(--graphite-500); text-transform: uppercase; letter-spacing: 0.8px; font-weight: 600; }

.mini-item { display: flex; align-items: center; justify-content: space-between; padding: 14px 0; border-bottom: 1px solid var(--graphite-100); }
.mini-item:last-child { border-bottom: none; }
.mini-title { font-family: var(--font-raleway); font-size: 14px; font-weight: 600; color: var(--graphite-800); }
.mini-date { font-size: 12px; color: var(--graphite-400); }

/* ---------- RESPONSIVE ---------- */
@media (max-width: 1024px) {
  .analysis-grid.four-cols { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .header-inner { height: auto; flex-direction: column; padding: 16px; gap: 16px; }
  .logo { order: 1; }
  .user-profile { order: 2; width: 100%; }
  .nav { order: 3; width: 100%; overflow-x: auto; padding-bottom: 8px; justify-content: flex-start; }
  .analysis-grid.two-cols { grid-template-columns: 1fr; }
  .analysis-grid.three-cols { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .analysis-grid.four-cols { grid-template-columns: 1fr; }
  .quick-actions-grid { grid-template-columns: 1fr; }
}
/* ---------- SETTINGS PANELS ---------- */
.settings-panel { display: none; }
.settings-panel.active { display: block; animation: fadeSlideIn 0.3s ease; }

.tab.s-tab { color: var(--graphite-400); padding-bottom: 20px; }
.tab.s-tab.active { color: var(--accent-main); }

/* ---------- MODALS ---------- */
.modal {
  position: fixed; top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(15, 23, 42, 0.4);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: center;
  z-index: 2000;
  animation: fadeIn 0.3s ease;
}
.modal-content-wide {
  background: var(--white);
  padding: 40px;
  border-radius: var(--radius-xl);
  width: 95%;
  max-width: 1100px;
  box-shadow: var(--shadow-xl);
  border: 1px solid var(--border);
}

.modal-content {
  background: var(--white);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  border: 1px solid var(--border);
}

/* Step Nav Profile */
.step-p-btn {
  background: var(--graphite-50);
  border: 1px solid var(--border);
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  font-size: 11px;
  font-family: var(--font-raleway);
  font-weight: 600;
  color: var(--graphite-500);
  cursor: pointer;
  transition: all 0.2s;
}
.step-p-btn.active { background: var(--accent-main); color: white; border-color: var(--accent-main); }

.form-section { display: none; }
.form-section.active { display: block; animation: fadeSlideIn 0.3s ease; }

.space-y-sm > * + * { margin-top: 8px; }
.space-y-md > * + * { margin-top: 16px; }

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

.card-label {
  font-family: var(--font-raleway);
  font-size: 11px; font-weight: 600; text-transform: uppercase; color: var(--graphite-400); margin-bottom: 12px; display: block;
}

/* ---------- DASHBOARD & C-LEVEL ---------- */
#view-clevel {
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 24px;
}

.dashboard-header {
  margin-bottom: 48px;
}

.system-health-label {
  display: flex;
  justify-content: space-between;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  font-size: 10px;
  color: var(--graphite-400);
  margin-bottom: 8px;
}

.health-bar-bg {
  height: 6px;
  background: var(--graphite-100);
  border-radius: 3px;
  overflow: hidden;
  display: flex;
  align-items: center;
}

.health-bar-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 1s ease-out;
}

/* Intelligence Panel Grid */
.intel-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-bottom: 40px;
}

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

.intel-radar-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
  display: flex;
  flex-direction: column;
}

.intel-side-cards {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.intel-mini-stats {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.intel-evo-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  flex: 1;
}

/* AI insight engine */
.insight-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 16px;
  margin-bottom: 40px;
}

.insight-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 24px;
  transition: transform 0.2s, box-shadow 0.2s;
}

.insight-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.impact-badge {
  font-size: 9px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 99px;
  display: inline-block;
  margin-bottom: 12px;
}

.impact-alto { color: #DC2626; background: #FEF2F2; border: 1px solid #FEE2E2; }
.impact-medio { color: #D97706; background: #FFFBEB; border: 1px solid #FEF3C7; }
.impact-bajo { color: #059669; background: #ECFDF5; border: 1px solid #D1FAE5; }

/* Performance Board */
.perf-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 40px;
}

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

.perf-table th {
  text-align: left;
  padding: 16px 24px;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--graphite-400);
  border-bottom: 1px solid var(--graphite-50);
}

.perf-table td {
  padding: 20px 24px;
  border-bottom: 1px solid var(--graphite-50);
  font-size: 14px;
}

.perf-table tr:hover {
  background: var(--graphite-50);
}

/* Conversation Stream */
.stream-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
}

.stream-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 24px;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
}

.stream-card:hover {
  border-color: var(--graphite-500);
  box-shadow: var(--shadow-md);
}

.stream-status {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
  margin-right: 8px;
}

.status-green { background: #10B981; }
.status-red { background: #EF4444; }
.status-amber { background: #F59E0B; }

.stream-prob {
  font-family: var(--font-raleway);
  font-size: 24px;
  position: absolute;
  top: 20px;
  right: 24px;
}


/* ---------- NEW NAVIGATION PILLS ---------- */
.nav-pill {
  border: 1px solid var(--border);
  background: var(--white);
  padding: 6px 14px;
  border-radius: 99px;
  font-size: 13px;
  font-weight: 500;
  display: flex;
  align-items: center;
  font-family: var(--font-raleway);
  color: var(--graphite-500);
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.nav-pill:hover {
  background: var(--graphite-50);
  border-color: var(--border-hover);
  color: var(--graphite-900);
}

.nav-pill.active {
  background: var(--white);
  border-color: var(--border);
  color: var(--graphite-900);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

/* Removed duplicate .nav-pill.active */

.user-profile-simple {
  margin-left: 12px;
  position: relative;
  display: flex;
  align-items: center;
}

/* ---------- CONSENTIMIENTOS VIEW ---------- */
#view-consent {
  max-width: 900px;
  margin: 0 auto;
  padding: 60px 24px;
}

.consent-container {
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.consent-card {
  background: white;
  border: 1px solid #f1f5f9;
  border-radius: 24px;
  padding: 32px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.02);
}

.consent-card-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
}

.consent-icon-circle {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: #000;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
}

.consent-title {
  font-family: var(--font-raleway);
  font-size: 24px;
  color: #111;
  margin-bottom: 2px;
}

.consent-subtitle {
  font-family: var(--font-raleway);
  font-size: 10px;
  letter-spacing: 0.2em;
  color: #475569;
  text-transform: uppercase;
  font-weight: var(--fw-bold);
}

.consent-script-box {
  background: #f8fafc;
  border-radius: 16px;
  padding: 24px;
  margin-bottom: 24px;
  font-weight: 300;
  font-size: 14px;
  line-height: 1.6;
  color: #1e293b;
}

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

.consent-accept-box, .consent-reject-box {
  border-left: 4px solid #e2e8f0;
  padding-left: 16px;
}

.consent-accept-box { border-color: #10b981; }

.box-label {
  font-family: var(--font-raleway);
  font-size: 10px;
  letter-spacing: 0.15em;
  margin-bottom: 4px;
  font-weight: var(--fw-bold);
}

.box-label.accept { color: #059669; }
.box-label.reject { color: #334155; }

.box-text {
  font-size: 13px;
  color: #475569;
  font-weight: var(--fw-light);
}

.consent-info-box {
  background: #fffbeb;
  border: 1px solid #fef3c7;
  border-radius: 16px;
  padding: 16px;
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.consent-info-box svg { color: #d97706; margin-top: 2px; }

.info-label {
  font-size: 10px;
  letter-spacing: 0.15em;
  color: #92400e;
  font-weight: 600;
  margin-bottom: 4px;
}

.info-text {
  font-size: 13px;
  color: #92400e;
  font-weight: 300;
  line-height: 1.5;
}

.consent-detailed-text {
  font-size: 14px;
  line-height: 1.6;
  color: #334155;
  font-weight: 300;
}

.consent-bullet-list {
  padding-left: 20px;
  margin-bottom: 24px;
}

.consent-bullet-list li {
  margin-bottom: 12px;
  position: relative;
}

.consent-bullet-list li::before {
  content: "";
  position: absolute;
  left: -20px;
  top: 8px;
  width: 6px;
  height: 6px;
  background: #000;
  border-radius: 50%;
}

.consent-sub-box {
  background: #f8fafc;
  padding: 24px;
  border-radius: 16px;
  margin-bottom: 16px;
}

.box-title {
  font-weight: 600;
  color: #0f172a;
  margin-bottom: 8px;
}

.consent-signature-area {
  border-top: 1px solid #e2e8f0;
  margin-top: 40px;
  padding-top: 32px;
}

.sig-title {
  font-family: var(--font-raleway);
  font-size: 20px;
  color: #000;
  margin-bottom: 24px;
}

.sig-line {
  margin-bottom: 24px;
}

.sig-line label {
  font-size: 10px;
  letter-spacing: 0.1em;
  color: #475569;
  display: block;
  margin-bottom: 8px;
}

.sig-line .line {
  height: 1px;
  background: #cbd5e1;
  width: 100%;
}

.sig-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}


/* ---------- METRICS & DASHBOARD PREMIUM ---------- */
.metrics-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 24px;
}

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

.kpi-card-premium {
  background: white;
  border: 1px solid #f1f5f9;
  border-radius: 24px;
  padding: 24px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.02);
}

.kpi-card-premium .label {
  font-size: 11px;
  letter-spacing: 0.15em;
  color: #475569;
  text-transform: uppercase;
  font-weight: 600;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.kpi-card-premium .value {
  font-family: var(--font-raleway);
  font-size: 36px;
  color: #111;
  margin-bottom: 4px;
}

.kpi-card-premium .suffix {
  font-size: 18px;
  color: #cbd5e1;
}

.kpi-card-premium .sub {
  font-size: 12px;
  color: #475569;
  font-weight: 300;
}

.chart-card {
  background: white;
  border: 1px solid #f1f5f9;
  border-radius: 32px;
  padding: 32px;
  margin-bottom: 32px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.02);
}

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

.chart-title {
  font-family: var(--font-raleway);
  font-size: 20px;
  color: #111;
}

.chart-subtitle {
  font-size: 13px;
  color: #475569;
  font-weight: 300;
  margin-top: 4px;
}

/* ---------- PROFILES & CLOSERS LISTS ---------- */
.entities-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 24px;
}

.entity-card {
  background: white;
  border: 1px solid #f1f5f9;
  border-radius: 24px;
  padding: 24px;
  transition: all 0.2s ease;
}

.entity-card:hover {
  box-shadow: 0 12px 24px -10px rgba(0,0,0,0.08);
  border-color: #e2e8f0;
}

.entity-card .title {
  font-family: var(--font-raleway);
  font-size: 18px;
  margin-bottom: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.badge-v {
  font-size: 10px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  padding: 2px 8px;
  border-radius: 99px;
  color: #334155;
}

.entity-actions {
  display: flex;
  gap: 8px;
  margin-top: 20px;
}

.btn-icon {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 1px solid #f1f5f9;
  background: white;
  color: #334155;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-icon:hover {
  background: #f8fafc;
  color: #111;
  border-color: #cbd5e1;
}

.btn-icon.danger:hover {
  color: #ef4444;
  background: #fef2f2;
}

.empty-state {
  text-align: center;
  padding: 80px 24px;
  background: white;
  border: 1px dashed #cbd5e1;
  border-radius: 32px;
}

.empty-icon {
  font-size: 40px;
  margin-bottom: 16px;
  opacity: 0.5;
}

/* ---------- FILTERS ---------- */
.filters-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 32px;
}

.filter-item {
  background: white;
  border: 1px solid #f1f5f9;
  padding: 8px 16px;
  border-radius: 12px;
  font-size: 12px;
  color: #1e293b;
  outline: none;
}

/* ════════════════════════════════════════════════════════════════
   NAVBAR PROFESSIONAL - Estilo Moderno Pill Buttons
   ════════════════════════════════════════════════════════════════ */

.navbar-professional {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 16px 0 18px 0;
  margin-bottom: 32px;
  border-bottom: 1px solid var(--border);
}

/* PILL BUTTONS NAVIGATION */
.navbar-pills {
  display: flex;
  gap: 8px;
}

.pill {
  padding: 8px 16px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: 13px;
  font-weight: 500;
  color: var(--graphite-600);
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.pill:hover {
  border-color: var(--accent-primary);
  color: var(--accent-primary);
  background: var(--accent-light);
}

.pill.active {
  background: var(--accent-primary);
  color: white;
  border-color: var(--accent-primary);
}

/* DROPDOWNS SECTION */
.navbar-dropdowns {
  display: flex;
  gap: 12px;
  flex: 1;
}

.dropdown-wrapper {
  position: relative;
}

.dropdown-trigger {
  padding: 8px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 12px;
  font-weight: 500;
  color: var(--graphite-600);
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.dropdown-trigger:hover {
  border-color: var(--accent-primary);
  color: var(--accent-primary);
}

.dropdown-trigger.active {
  border-color: var(--accent-primary);
  color: var(--accent-primary);
  background: var(--accent-light);
}

.caret {
  font-size: 10px;
  display: inline-block;
}

.dropdown-panel {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  z-index: 1000;
  min-width: 240px;
  padding: 16px;
  display: none;
  animation: fadeInDown 0.15s ease-out;
}

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

@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.dropdown-quick {
  display: flex;
  gap: 6px;
  margin-bottom: 12px;
}

.quick-btn {
  flex: 1;
  padding: 6px 8px;
  background: var(--accent-light);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 11px;
  font-weight: 500;
  color: var(--accent-primary);
  cursor: pointer;
  transition: all 0.15s ease;
}

.quick-btn:hover {
  background: var(--accent-primary);
  color: white;
  border-color: var(--accent-primary);
}

.dropdown-label {
  display: block;
  font-size: 10px;
  font-weight: 700;
  color: var(--graphite-500);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}

.dropdown-divider {
  height: 1px;
  background: var(--border);
  margin: 12px 0;
}

.dropdown-field {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 12px;
  color: var(--graphite-700);
  background: var(--bg);
  cursor: pointer;
  margin-bottom: 8px;
}

.dropdown-field:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 2px var(--accent-light);
}

.date-range {
  display: flex;
  gap: 8px;
}

.date-range input {
  flex: 1;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 12px;
  background: var(--bg);
  color: var(--graphite-700);
}

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

.dropdown-action {
  width: 100%;
  padding: 10px 12px;
  background: transparent;
  border: none;
  border-radius: 6px;
  font-size: 12px;
  color: var(--graphite-700);
  cursor: pointer;
  text-align: left;
  transition: all 0.15s ease;
  margin-bottom: 4px;
}

.dropdown-action:last-child {
  margin-bottom: 0;
}

.dropdown-action:hover {
  background: var(--accent-light);
  color: var(--accent-primary);
}

/* SETTINGS BUTTON */
.settings-btn {
  padding: 8px 10px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  color: var(--graphite-500);
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-left: auto;
}

.settings-btn:hover {
  border-color: var(--accent-primary);
  color: var(--accent-primary);
  background: var(--accent-light);
}

/* RESPONSIVE */
@media (max-width: 1024px) {
  .navbar-professional {
    gap: 12px;
  }

  .dropdown-panel {
    min-width: 200px;
  }
}

@media (max-width: 768px) {
  .navbar-professional {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }

  .navbar-pills {
    width: 100%;
  }

  .navbar-dropdowns {
    width: 100%;
    flex-wrap: wrap;
  }

  .settings-btn {
    margin-left: 0;
    width: fit-content;
    align-self: flex-end;
  }

  .dropdown-panel {
    min-width: 250px;
  }
}

/* ---------- HOME DASHBOARD PREMIUM (IMAGE CLONE) ---------- */
.home-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 24px;
}

.home-title {
  font-family: var(--font-raleway);
  font-size: 42px;
  color: #111;
  margin-bottom: 8px;
}

.home-subtitle {
  font-family: var(--font-raleway);
  color: #334155;
  font-weight: var(--fw-medium);
  font-size: 18px;
  margin-bottom: 32px;
}

.health-index-section {
  margin-bottom: 48px;
  max-width: 400px;
}

.health-label-row {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  letter-spacing: 0.1em;
  color: #475569;
  text-transform: uppercase;
  font-weight: 600;
  margin-bottom: 8px;
}

.health-bar-container {
  height: 4px;
  background: #f1f5f9;
  border-radius: 2px;
  overflow: hidden;
}

.health-bar-inner {
  height: 100%;
  background: #ef4444;
  transition: width 0.8s ease-out;
}

.dashboard-main-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-bottom: 48px;
}

.radar-card-premium {
  background: white;
  border: 1px solid #f1f5f9;
  border-radius: 32px;
  padding: 32px;
}

.radar-card-premium .title {
  font-size: 11px;
  letter-spacing: 0.15em;
  color: #475569;
  text-transform: uppercase;
  margin-bottom: 4px;
}

.radar-card-premium h3 {
  font-family: var(--font-raleway);
  font-size: 24px;
  color: #111;
  margin-bottom: 24px;
}

.improvement-alert {
  background: #fffbef;
  border: 1px solid #fef3c7;
  border-radius: 12px;
  padding: 16px;
  margin-top: 24px;
  font-size: 13px;
  color: #92400e;
}

.stats-panel-right {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.stat-card-horizontal {
  background: white;
  border: 1px solid #f1f5f9;
  border-radius: 24px;
  padding: 24px;
  display: flex;
  justify-content: space-between;
}

.stat-group {
  text-align: left;
}

.stat-group .val {
  font-family: var(--font-raleway);
  font-size: 28px;
  color: #111;
}

.stat-group .lbl {
  font-size: 10px;
  color: #475569;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 4px;
}

.intel-section-title {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 32px;
}

.intel-icon-circle {
  width: 32px;
  height: 32px;
  background: #000;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
}

.intel-cards-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 64px;
}

.intel-card-premium {
  background: white;
  border: 1px solid #f1f5f9;
  border-radius: 24px;
  padding: 24px;
  position: relative;
}

.intel-card-premium .impact-tag {
  font-size: 10px;
  letter-spacing: 0.1em;
  background: #fef3c7;
  color: #92400e;
  padding: 2px 8px;
  border-radius: 4px;
  text-transform: uppercase;
  font-weight: 600;
}

.intel-card-premium .category {
  position: absolute;
  top: 24px;
  right: 24px;
  font-size: 10px;
  color: #cbd5e1;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.intel-card-premium h4 {
  font-family: var(--font-raleway);
  font-size: 16px;
  margin: 16px 0 8px;
  color: #111;
  line-height: 1.4;
}

.intel-card-premium p {
  font-size: 13px;
  color: #334155;
  line-height: 1.6;
  margin-bottom: 16px;
}

.intel-card-premium .action-link {
  font-size: 12px;
  color: #334155;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 4px;
}

.perf-board-container {
  margin-bottom: 64px;
}

.perf-table-premium {
  width: 100%;
  background: white;
  border: 1px solid #f1f5f9;
  border-radius: 24px;
  overflow: hidden;
  border-collapse: collapse;
}

.perf-table-premium th {
  text-align: left;
  font-size: 10px;
  letter-spacing: 0.15em;
  color: #475569;
  text-transform: uppercase;
  padding: 20px 24px;
  border-bottom: 1px solid #f8fafc;
}

.perf-table-premium td {
  padding: 16px 24px;
  border-bottom: 1px solid #f8fafc;
  font-size: 14px;
}

.rank-circle {
  width: 24px;
  height: 24px;
  background: #000;
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
}

.member-avatar-mini {
  width: 24px;
  height: 24px;
  background: #f1f5f9;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  color: #334155;
}


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

.stream-card-premium {
  background: white;
  border: 1px solid #f1f5f9;
  border-radius: 24px;
  padding: 24px;
  position: relative;
  transition: all 0.2s;
  cursor: pointer;
}

.stream-card-premium:hover {
  border-color: #cbd5e1;
  transform: translateY(-2px);
}

.stream-card-premium .status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  position: absolute;
  top: 24px;
  left: 24px;
}

.stream-card-premium .title {
  padding-left: 20px;
  font-size: 15px;
  color: #111;
  margin-bottom: 12px;
}

.stream-card-premium .prob-value {
  position: absolute;
  top: 20px;
  right: 24px;
  font-family: var(--font-raleway);
  font-size: 28px;
  color: #111;
}

.badge-tag {
  font-family: var(--font-raleway);
  font-size: 10px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 4px;
  text-transform: uppercase;
}

.badge-encurso { background: #fef9c3; color: #854d0e; }
.badge-cerrada { background: #dcfce7; color: #166534; }


.hero-premium {
  display: none; /* Hide old hero in new dashboard */
}


/* ---------- FLOATING ACTION BUTTON (FAB) ---------- */
.fab-container {
  position: fixed;
  bottom: 30px;
  right: 30px;
  z-index: 2000;
}

.fab-btn {
  background: black;
  color: white;
  border: none;
  padding: 14px 24px;
  border-radius: 99px;
  font-size: 14px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.4), 0 4px 6px -2px rgba(0, 0, 0, 0.1);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.fab-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.4), 0 10px 10px -5px rgba(0, 0, 0, 0.1);
  background: #111;
}

.fab-btn:active {
  transform: scale(0.95);
}

.fab-icon {
  font-size: 20px;
  line-height: 1;
}

.fab-menu {
  position: absolute;
  bottom: calc(100% + 15px);
  right: 0;
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  width: 240px;
  overflow: hidden;
  display: none;
  flex-direction: column;
  animation: fabMenuIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  transform-origin: bottom right;
}

.fab-menu.active {
  display: flex;
}

@keyframes fabMenuIn {
  from { opacity: 0; transform: scale(0.9) translateY(10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.fab-menu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  border: none;
  background: none;
  text-align: left;
  font-family: inherit;
  font-size: 14px;
  color: var(--graphite-600);
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.fab-menu-item:hover {
  background: #f8fafc;
  color: black;
}

.fab-menu-item .m-icon {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f1f5f9;
  border-radius: 8px;
  font-size: 16px;
  transition: all 0.2s;
}

.fab-menu-item:hover .m-icon {
  background: black;
  color: white;
}

.fab-menu-title {
  padding: 12px 20px 8px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--graphite-400);
  font-weight: 600;
  border-bottom: 1px solid #f1f5f9;
  margin-bottom: 4px;
}


/* FAB Styles moved to inline for better fixed-position reliability */

/* ---------- LOGIN SCREEN ---------- */
#view-login {
  background: radial-gradient(circle at top right, #f8fafc, #eff6ff);
  display: none;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: fixed;
  inset: 0;
  z-index: 99999;
}

#view-login.active {
  display: flex !important;
}

.login-container {
  width: 100%;
  max-width: 480px;
  padding: 24px;
}

.login-card {
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 32px;
  padding: 48px;
  box-shadow: 0 40px 80px -20px rgba(0, 0, 0, 0.1);
  text-align: center;
}

.login-logo {
  margin-bottom: 40px;
}

.login-logo img {
  height: 84px;
  width: auto;
}

.login-header {
  margin-bottom: 48px;
}

.login-options {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.login-btn {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 24px;
  border-radius: 24px;
  border: 1px solid #eef2f6;
  background: white;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  text-align: left;
}

.login-btn:hover {
  transform: translateY(-4px);
  border-color: #cbd5e1;
  box-shadow: 0 20px 40px -12px rgba(0, 0, 0, 0.08);
}

.login-btn-icon {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  background: #f8fafc;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
}

.login-btn-text strong {
  display: block;
  font-family: var(--font-raleway);
  font-size: 18px;
  color: #0f172a;
  margin-bottom: 4px;
}

.login-btn-text span {
  font-size: 13px;
  color: #64748b;
}

.login-btn.admin:hover {
  background: #0f172a;
}
.login-btn.admin:hover .login-btn-text strong,
.login-btn.admin:hover .login-btn-text span {
  color: white;
}

.login-btn.member:hover {
  background: #3b82f6;
}
.login-btn.member:hover .login-btn-text strong,
.login-btn.member:hover .login-btn-text span {
  color: white;
}
.login-btn.member:hover .login-btn-icon {
  background: rgba(255,255,255,0.1);
}


.login-footer {
  margin-top: 48px;
  font-size: 12px;
  color: #94a3b8;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

/* Role-based Visibility */
body.role-member #nav-metrics,
body.role-member #nav-settings-profiles,
body.role-member #nav-settings-members {
  display: none !important;
}


/* ============================================
   RESPONSIVE OPTIMIZATIONS (MOBILE FIRST)
   ============================================ */

@media (max-width: 768px) {
  /* --- RESET ESTRUCTURAL MÓVIL --- */
  body {
    overflow-x: hidden; /* Evita cualquier scroll horizontal accidental */
    width: 100%;
  }

  .main {
    padding: 20px 20px 100px !important; /* Más margen lateral para que el texto no toque el borde */
    max-width: 100% !important;
    overflow-x: hidden;
  }

  /* --- HEADER: SIMPLICIDAD ABSOLUTA --- */
  .header {
    width: 100%;
  }
  
  .header-inner {
    padding: 12px 16px !important;
    display: flex !important;
    flex-direction: column !important; /* Logo arriba, nav abajo */
    height: auto !important;
    gap: 16px !important;
  }

  /* Fila superior del header: Logo y Acciones */
  .header-inner > .logo, 
  .header-right-zone {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
  }
  
  /* Ajuste específico para que el logo no se corte */
  .logo {
    justify-content: flex-start !important;
    margin-left: 0 !important;
  }
  
  .logo img {
    height: 30px !important;
    width: auto !important;
    object-fit: contain;
  }

  /* Acciones (Luna, Avatar, Sync) */
  .header-right-zone {
    position: absolute;
    right: 16px;
    top: 12px;
    width: auto;
    gap: 8px;
  }

  /* Ocultar texto de sync en móvil para ganar espacio */
  .sync-indicator { 
    font-size: 10px;
    max-width: 80px;
    text-align: right;
    line-height: 1.1;
  }
  
  .header-divider { display: none !important; }
  .nav-secondary { display: none !important; }

  /* --- NAVEGACIÓN --- */
  .nav-primary {
    width: calc(100% + 32px); /* Sobresale un poco para que el scroll se vea bien */
    margin-left: -16px; 
    padding: 0 16px 5px;
    display: flex;
    overflow-x: auto;
    gap: 8px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  
  .nav-primary::-webkit-scrollbar { display: none; }

  .nav-pill {
    padding: 6px 14px !important;
    font-size: 13px !important;
    border-radius: 12px !important;
    box-shadow: none !important; /* Menos peso visual */
    background: #f8fafc !important;
    border: 1px solid #e2e8f0 !important;
  }

  /* --- DASHBOARD GRIDS --- */
  #home-dashboard-content, 
  .dashboard-grid, 
  .metrics-grid, 
  div[style*="grid-template-columns"] {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
    gap: 16px !important;
  }

  /* Tarjetas siempre al 100% */
  .chart-card, .metric-card, .history-item {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 0 16px 0 !important;
  }

  /* Títulos */
  h1 { 
    font-size: 26px !important; 
    margin-left: 0 !important;
    padding-left: 0 !important;
  }
  
  .app-subtitle, .hero-sub {
    font-size: 14px !important;
  }
}

/* --- SPINNER --- */
.spinner-sm {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(0,0,0,0.1);
  border-top-color: var(--accent-main);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ============================================================
   MOBILE IMPROVEMENTS — v1.5.5
   Solo afectan viewports ≤ 768px. Desktop intacto.
   ============================================================ */

/* -- Botón hamburger: oculto en desktop, visible en móvil -- */
.mobile-only { display: none !important; }

/* -- Drawer: oculto en desktop -- */
.mobile-nav-drawer { display: none; }

/* ============================================================
   TODOS LOS FIXES: SOLO EN ≤ 768px
   ============================================================ */
@media (max-width: 768px) {

  /* 1. MOSTRAR BOTÓN HAMBURGER */
  .mobile-only {
    display: flex !important;
  }

  /* 2. DRAWER DE NAVEGACIÓN MÓVIL */
  .mobile-nav-drawer {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 10000;
    pointer-events: none;
    visibility: hidden;
  }
  .mobile-nav-drawer.open {
    pointer-events: auto;
    visibility: visible;
  }

  .mobile-nav-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    opacity: 0;
    transition: opacity 0.3s ease;
  }
  .mobile-nav-drawer.open .mobile-nav-backdrop {
    opacity: 1;
  }

  .mobile-nav-panel {
    position: absolute;
    top: 0; right: 0;
    width: min(85vw, 320px);
    height: 100%;
    background: var(--white);
    box-shadow: -8px 0 32px rgba(0,0,0,0.15);
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
  .mobile-nav-drawer.open .mobile-nav-panel {
    transform: translateX(0);
  }

  .mobile-nav-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    background: var(--white);
    z-index: 1;
  }

  .mobile-nav-panel-items {
    padding: 12px 12px 32px;
    display: flex;
    flex-direction: column;
    gap: 2px;
  }

  .mobile-nav-item {
    display: flex;
    align-items: center;
    gap: 14px;
    width: 100%;
    padding: 14px 12px;
    background: transparent;
    border: none;
    border-radius: 14px;
    cursor: pointer;
    text-align: left;
    transition: background 0.15s ease;
    font-family: var(--font-sans);
  }
  .mobile-nav-item:hover, .mobile-nav-item:active {
    background: var(--graphite-50);
  }

  .mobile-nav-item-icon {
    width: 40px; height: 40px;
    background: var(--graphite-50);
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
    color: var(--graphite-500);
    font-size: 18px;
  }

  .mobile-nav-item-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
  }
  .mobile-nav-item-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--graphite-900);
    font-family: var(--font-raleway);
  }
  .mobile-nav-item-desc {
    font-size: 12px;
    color: var(--graphite-400);
  }

  .mobile-nav-divider {
    height: 1px;
    background: var(--border);
    margin: 8px 0;
  }

  /* Dark mode drawer */
  [data-theme="dark"] .mobile-nav-panel {
    background: var(--bg-card) !important;
  }
  [data-theme="dark"] .mobile-nav-panel-header {
    background: var(--bg-card) !important;
    border-color: var(--border) !important;
  }
  [data-theme="dark"] .mobile-nav-item-icon {
    background: var(--graphite-100) !important;
  }

  /* 3. MAIN — espacio bottom para el FAB */
  .main {
    padding-bottom: 120px !important;
  }

  /* 4. LOGO — orden correcto y altura ajustada
     El CSS original tiene .logo { order: 1 } que lo manda DEBAJO de nav-primary (order:0).
     Lo revertimos: logo primero, nav-pills debajo, right-zone absolute alineada al logo. */
  .logo {
    order: 0 !important;
  }
  .nav-primary {
    order: 1 !important;
  }
  .logo img {
    height: 32px !important;
  }

  /* 4b. SYNC INDICATOR — ocultar en móvil para no solapar nav pills */
  .sync-indicator {
    display: none !important;
  }

  /* 5. TÍTULOS DE DASHBOARD — evitar que se corten fuera del viewport */
  #home-dashboard-content h1,
  #home-dashboard-content h2,
  #home-dashboard-content h3,
  #metrics-content-area h1,
  #metrics-content-area h2,
  .dashboard-header h1,
  .dashboard-header h2 {
    overflow-wrap: break-word !important;
    word-break: break-word !important;
    white-space: normal !important;
    max-width: 100% !important;
  }

  /* 5b. GRÁFICOS APEXCHARTS — contener desbordamiento del radar y otros charts */
  .intel-radar-card,
  .chart-card,
  .intel-evo-card,
  .intel-mini-stats {
    overflow: hidden !important;
  }
  /* El SVG de ApexCharts se contiene dentro del card */
  .apexcharts-canvas {
    max-width: 100% !important;
    overflow: hidden !important;
  }
  /* Etiquetas del radar que sobresalen — darles más espacio con padding simétrico */
  .intel-radar-card {
    padding: 20px 28px !important;
  }

  /* 5c. CONTENEDORES GENERALES — nada debe salirse del viewport */
  #home-dashboard-content,
  #metrics-content-area,
  #superadmin-content-area,
  #profiles-content-area,
  #members-content-area {
    overflow-x: hidden !important;
    max-width: 100% !important;
  }

  /* 5. HERO PREMIUM — padding brutal → compacto */
  .hero-premium {
    padding: 36px 24px !important;
    border-radius: var(--radius-lg) !important;
    margin-bottom: 24px !important;
  }
  .hero-premium h1 {
    font-size: 26px !important;
  }

  /* 6. GRIDS → COLUMNA ÚNICA EN MÓVIL
     A) CSS class: stream-grid-premium (3 cols en desktop → 1 col en móvil) */
  .stream-grid-premium {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
  }
  /* B) Inline styles: CUALQUIER div con grid-template-columns en su style attribute.
     Selector amplio para capturar todas las variantes de dashboard.js */
  div[style*="grid-template-columns"] {
    display: flex !important;
    flex-direction: column !important;
    gap: 12px !important;
    width: 100% !important;
  }
  /* C) Cards del stream: ancho completo y contenido sin cortes */
  .stream-card-premium {
    width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
  }
  /* D) Títulos dentro de las cards: no se corten */
  .stream-card-premium .title {
    font-size: 15px !important;
    word-break: break-word !important;
    white-space: normal !important;
    padding-right: 40px !important; /* espacio para el número de score */
  }

  /* 7. RECORDER CARD — padding reducido */
  .recorder-card {
    padding: 16px !important;
  }

  /* 8. DROP ZONE — menos padding muerto */
  .drop-inner {
    padding: 40px 20px !important;
    gap: 12px !important;
  }
  .drop-icon {
    width: 60px !important;
    height: 60px !important;
  }

  /* 9. ANALYSIS VIEW — padding superior reducido */
  #view-analysis > div {
    padding: 20px 16px !important;
  }

  /* 10. RESULTS HEADER — apilado en vertical */
  .results-header {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 16px !important;
    margin-bottom: 24px !important;
  }
  .results-header h1 {
    font-size: 24px !important;
    line-height: 1.2 !important;
  }
  .results-actions {
    width: 100% !important;
    flex-direction: column !important;
    gap: 8px !important;
  }
  .results-actions .btn {
    width: 100% !important;
    justify-content: center !important;
  }

  /* 11. TABS DE ANÁLISIS — scroll horizontal fluido */
  .tabs {
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    scrollbar-width: none !important;
    gap: 4px !important;
    padding-bottom: 4px !important;
    margin-left: -16px !important;
    padding-left: 16px !important;
    margin-right: -16px !important;
    padding-right: 16px !important;
  }
  .tabs::-webkit-scrollbar { display: none; }
  .tab {
    flex-shrink: 0 !important;
    white-space: nowrap !important;
    font-size: 12px !important;
    padding: 7px 12px !important;
  }

  /* 12. MODAL — padding reducido y altura controlada */
  .modal-content-wide {
    padding: 24px 20px !important;
    border-radius: var(--radius-lg) !important;
    max-height: 88vh !important;
    width: calc(100% - 16px) !important;
    margin: 8px !important;
  }
  .modal-content {
    border-radius: var(--radius-lg) !important;
    max-height: 88vh !important;
    overflow-y: auto !important;
    margin: 8px !important;
    width: calc(100% - 16px) !important;
  }

  /* 13. STEP-NAV PROFILE (modal) — scroll horizontal */
  .step-nav-p {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    scrollbar-width: none !important;
    flex-wrap: nowrap !important;
    padding-bottom: 4px !important;
  }
  .step-nav-p::-webkit-scrollbar { display: none; }

  /* 14. CONSENT VIEW — h1 40px → 26px */
  .consent-container h1 {
    font-size: 26px !important;
  }
  .consent-container .app-subtitle {
    font-size: 15px !important;
  }
  .consent-card {
    padding: 20px !important;
  }

  /* 15. HISTORY HEADER — apilado */
  .history-header {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 12px !important;
  }
  .history-header h2 {
    font-size: 22px !important;
  }

  /* 16. MI CUENTA VIEW */
  #view-myaccount {
    padding: 28px 16px 80px !important;
  }

  /* 17. FAB — compacto y bien posicionado */
  .member-fab-container {
    bottom: 16px !important;
    right: 16px !important;
  }
  .member-fab-trigger {
    height: 52px !important;
    padding: 0 20px !important;
    font-size: 14px !important;
  }
  .member-fab-menu {
    width: calc(100vw - 32px) !important;
    right: 0 !important;
  }

  /* 18. SETTINGS HEADER — apilado */
  #view-settings .history-header {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 12px !important;
  }

  /* 19. PROGRESS SECTION */
  .progress-section {
    padding: 0 4px !important;
  }

  /* 20. PROGRESS STEPS — compactos en móvil */
  .progress-steps {
    gap: 4px !important;
  }
  .step-icon { font-size: 18px !important; }
  .progress-steps .step span {
    font-size: 11px !important;
  }

}

/* Para pantallas muy pequeñas (≤ 380px): FAB aún más compacto */
@media (max-width: 380px) {
  .member-fab-trigger {
    padding: 0 14px !important;
    height: 48px !important;
    font-size: 13px !important;
    gap: 8px !important;
  }
  .member-fab-trigger span:first-child {
    font-size: 20px !important;
  }
}

/* ──────────────────────────────────────────────────────────────
   KPI SETTINGS PANEL
   ────────────────────────────────────────────────────────────── */

.kpi-settings-panel {
  padding: 0;
}

.kpi-settings-panel h3 {
  font-size: 18px;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 8px;
}

.settings-desc {
  font-size: 14px;
  color: #64748b;
  margin-bottom: 24px;
}

.kpi-settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin-bottom: 28px;
}

.kpi-setting-item {
  display: flex;
  flex-direction: column;
}

.kpi-setting-item label {
  font-size: 13px;
  font-weight: 600;
  color: #0f172a;
  margin-bottom: 8px;
}

.input-group {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0 12px;
  background: #fff;
}

.kpi-input {
  flex: 1;
  border: none;
  padding: 12px 0;
  font-size: 14px;
  font-weight: 600;
  outline: none;
  background: transparent;
}

.input-group .symbol {
  font-size: 14px;
  color: #64748b;
  font-weight: 500;
}

.kpi-settings-actions {
  display: flex;
  gap: 12px;
  margin-bottom: 24px;
}

.btn-secondary {
  flex: 1;
  background: #f1f5f9;
  color: #64748b;
  padding: 14px;
  border: none;
  border-radius: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-secondary:hover {
  background: #e2e8f0;
}

.kpi-settings-info {
  background: #f0fdf4;
  border-left: 3px solid #10B981;
  padding: 16px;
  border-radius: 8px;
  font-size: 13px;
  color: #3f6f35;
}

.kpi-settings-info p {
  margin: 0;
}

.toast-success {
  animation: slideIn 0.3s ease;
}

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



/* ═══════════════════════════════════════════════════
   MEMBERSHIP SYSTEM STYLES
   ═══════════════════════════════════════════════════ */

/* ── Sidebar plan badge ── */
.sidebar-plan-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.03em;
  cursor: pointer;
  border: none;
  transition: all 0.2s;
  white-space: nowrap;
}
.sidebar-plan-badge:hover { opacity: 0.85; transform: translateY(-1px); }

.sidebar-plan-badge.plan-free {
  background: #374151;
  color: #9CA3AF;
}
.sidebar-plan-badge.plan-team {
  background: #1E3A8A;
  color: #93C5FD;
}
.sidebar-plan-badge.plan-enterprise {
  background: #4C1D95;
  color: #C4B5FD;
}

/* ── Upgrade banner in analysis views ── */
.upgrade-banner-analysis {
  margin-bottom: 20px;
}
.upgrade-banner-analysis-inner {
  display: flex;
  align-items: center;
  gap: 16px;
  background: linear-gradient(135deg, rgba(99,102,241,0.08) 0%, rgba(139,92,246,0.08) 100%);
  border: 1px solid rgba(99,102,241,0.25);
  border-left: 4px solid #6366F1;
  border-radius: 14px;
  padding: 16px 20px;
  flex-wrap: wrap;
}
.upgrade-banner-icon {
  font-size: 24px;
  flex-shrink: 0;
}
.upgrade-banner-text {
  flex: 1;
  min-width: 200px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.upgrade-banner-text strong {
  font-size: 14px;
  font-weight: 700;
  color: #4F46E5;
}
.upgrade-banner-text span {
  font-size: 13px;
  color: #6B7280;
}
.btn-upgrade-cta {
  flex-shrink: 0;
  background: linear-gradient(135deg, #6366F1 0%, #8B5CF6 100%);
  color: white;
  border: none;
  border-radius: 10px;
  padding: 9px 18px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 2px 8px rgba(99,102,241,0.35);
}
.btn-upgrade-cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(99,102,241,0.45);
}

/* ── Myaccount plan card ── */
.myaccount-plan-card {
  background: linear-gradient(135deg, #0f172a 0%, #1e1b4b 100%);
  border: 1px solid rgba(99,102,241,0.3);
  border-radius: 20px;
  padding: 24px;
  margin-bottom: 24px;
  color: white;
}
.myaccount-plan-header { margin-bottom: 20px; }
.myaccount-plan-title-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.myaccount-plan-label {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(255,255,255,0.4);
}
.myaccount-plan-name {
  font-size: 20px;
  font-weight: 800;
  color: white;
}
.plan-status-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
}
.plan-status-badge.status-free     { background: rgba(107,114,128,0.3); color: #9CA3AF; }
.plan-status-badge.status-active   { background: rgba(16,185,129,0.2);  color: #6EE7B7; }
.plan-status-badge.status-past_due { background: rgba(245,158,11,0.2);  color: #FCD34D; }
.plan-status-badge.status-cancelled{ background: rgba(239,68,68,0.2);   color: #FCA5A5; }

.myaccount-plan-usage { margin-bottom: 16px; }
.myaccount-plan-usage-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  color: rgba(255,255,255,0.6);
  margin-bottom: 8px;
}
.myaccount-plan-usage-row strong { color: white; font-size: 16px; }

.plan-usage-bar {
  height: 6px;
  background: rgba(255,255,255,0.1);
  border-radius: 10px;
  overflow: hidden;
}
.plan-usage-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #6366F1, #8B5CF6);
  border-radius: 10px;
  transition: width 0.6s ease;
}
.plan-usage-bar-fill.near-limit {
  background: linear-gradient(90deg, #F59E0B, #EF4444);
}

.myaccount-plan-renewal {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: rgba(255,255,255,0.5);
  margin-bottom: 16px;
}
.myaccount-plan-renewal strong { color: rgba(255,255,255,0.8); }

.myaccount-plan-actions { display: flex; gap: 10px; flex-wrap: wrap; }

.btn-upgrade-primary {
  flex: 1;
  min-width: 160px;
  background: linear-gradient(135deg, #6366F1 0%, #8B5CF6 100%);
  color: white;
  border: none;
  border-radius: 12px;
  padding: 12px 20px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 4px 14px rgba(99,102,241,0.4);
  text-align: center;
}
.btn-upgrade-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(99,102,241,0.55);
}
.btn-manage-plan {
  background: rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.8);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 12px;
  padding: 12px 20px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}
.btn-manage-plan:hover { background: rgba(255,255,255,0.18); }

/* ── Upgrade modal overlay ── */
.upgrade-modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(6px);
  z-index: 99999;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.upgrade-modal-overlay.active {
  display: flex;
}

.upgrade-modal {
  background: #0f172a;
  border: 1px solid rgba(99,102,241,0.25);
  border-radius: 24px;
  padding: 40px;
  max-width: 760px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  box-shadow: 0 25px 60px rgba(0,0,0,0.6);
}

.upgrade-modal-close {
  position: absolute;
  top: 20px;
  right: 20px;
  background: rgba(255,255,255,0.08);
  border: none;
  border-radius: 10px;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: rgba(255,255,255,0.5);
  transition: all 0.2s;
}
.upgrade-modal-close:hover {
  background: rgba(255,255,255,0.15);
  color: white;
}

.upgrade-modal-header { text-align: center; margin-bottom: 36px; }
.upgrade-modal-eyebrow {
  display: inline-block;
  background: linear-gradient(135deg, #6366F1, #8B5CF6);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-bottom: 12px;
}
.upgrade-modal-title {
  font-size: 32px;
  font-weight: 800;
  color: white;
  margin: 0 0 12px;
  font-family: var(--font-raleway, 'Raleway', sans-serif);
}
.upgrade-modal-subtitle {
  font-size: 15px;
  color: rgba(255,255,255,0.5);
  max-width: 480px;
  margin: 0 auto;
  line-height: 1.6;
}

.upgrade-plans-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 28px;
}
@media (max-width: 600px) {
  .upgrade-plans-grid { grid-template-columns: 1fr; }
  .upgrade-modal { padding: 28px 20px; }
  .upgrade-modal-title { font-size: 24px; }
}

.upgrade-plan-card {
  border-radius: 18px;
  padding: 28px 24px;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.plan-card-team {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.1);
}
.plan-card-enterprise {
  background: linear-gradient(135deg, rgba(91,33,182,0.25) 0%, rgba(79,70,229,0.25) 100%);
  border: 1px solid rgba(139,92,246,0.4);
  box-shadow: 0 0 40px rgba(99,102,241,0.1);
}

.plan-card-popular {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(135deg, #6366F1, #8B5CF6);
  color: white;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.1em;
  padding: 4px 14px;
  border-radius: 20px;
}

.plan-card-badge {
  font-size: 16px;
  font-weight: 800;
  color: white;
}

.plan-card-price {
  display: flex;
  align-items: baseline;
  gap: 4px;
}
.plan-price-amount {
  font-size: 36px;
  font-weight: 900;
  color: white;
  line-height: 1;
}
.plan-price-period {
  font-size: 14px;
  color: rgba(255,255,255,0.4);
}

.plan-card-analyses {
  display: flex;
  align-items: baseline;
  gap: 6px;
  background: rgba(255,255,255,0.06);
  border-radius: 10px;
  padding: 10px 14px;
}
.plan-analyses-number {
  font-size: 28px;
  font-weight: 900;
  color: #A5B4FC;
}
.plan-analyses-label {
  font-size: 13px;
  color: rgba(255,255,255,0.5);
}

.plan-card-features {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 9px;
  flex: 1;
}
.plan-card-features li {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: rgba(255,255,255,0.7);
}
.plan-card-features li svg { color: #6EE7B7; flex-shrink: 0; }

.btn-plan-cta {
  width: 100%;
  padding: 13px;
  border-radius: 12px;
  border: none;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.btn-plan-team {
  background: rgba(255,255,255,0.1);
  color: white;
  border: 1px solid rgba(255,255,255,0.2);
}
.btn-plan-team:hover { background: rgba(255,255,255,0.18); transform: translateY(-2px); }
.btn-plan-enterprise {
  background: linear-gradient(135deg, #6366F1, #8B5CF6);
  color: white;
  box-shadow: 0 4px 16px rgba(99,102,241,0.45);
}
.btn-plan-enterprise:hover { transform: translateY(-2px); box-shadow: 0 6px 24px rgba(99,102,241,0.6); }

.btn-spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.upgrade-modal-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 12px;
  color: rgba(255,255,255,0.3);
}
.upgrade-modal-skip {
  background: none;
  border: none;
  color: rgba(255,255,255,0.3);
  font-size: 12px;
  cursor: pointer;
  text-decoration: underline;
  padding: 0;
  margin-left: 8px;
}
.upgrade-modal-skip:hover { color: rgba(255,255,255,0.6); }

/* ── Checkout success toast ── */
.checkout-toast {
  position: fixed;
  bottom: 28px;
  right: 28px;
  background: #0f172a;
  border: 1px solid rgba(16,185,129,0.4);
  border-radius: 16px;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 14px;
  box-shadow: 0 8px 30px rgba(0,0,0,0.4);
  z-index: 999999;
  max-width: 360px;
  transform: translateY(120px);
  opacity: 0;
  transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.checkout-toast.visible {
  transform: translateY(0);
  opacity: 1;
}
.checkout-toast-icon { font-size: 28px; }
.checkout-toast-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.checkout-toast-text strong {
  font-size: 14px;
  font-weight: 700;
  color: white;
}
.checkout-toast-text span {
  font-size: 12px;
  color: rgba(255,255,255,0.5);
}
