/* ===========================
   BACKNOVA DASHBOARD - PREMIUM REDESIGN v4.0
   A sophisticated dark interface with depth and polish
   =========================== */

/* Import fonts - Satoshi for display, DM Sans for body, Berkeley Mono for code */
@import url('https://api.fontshare.com/v2/css?f[]=satoshi@700,900,500,400&display=swap');
@import url('https://fonts.googleapis.com/css2?family=DM+Sans:opsz,wght@9..40,400;9..40,500;9..40,600;9..40,700&family=JetBrains+Mono:wght@400;500;600&display=swap');

/* CSS Variables - Preserved color scheme with enhanced depth */
:root {
  /* Core colors - keeping original palette */
  --bg-primary: #050508;
  --bg-secondary: #0c0c12;
  --bg-tertiary: #111118;
  --bg-card: #0e0e15;
  --bg-card-hover: #141420;
  --bg-elevated: #18181f;
  
  /* Borders & surfaces */
  --border-color: rgba(255, 255, 255, 0.06);
  --border-subtle: rgba(255, 255, 255, 0.03);
  --border-glow: rgba(0, 255, 136, 0.4);
  --surface-glass: rgba(255, 255, 255, 0.02);
  
  /* Accent colors - preserved from original */
  --accent-primary: #00ff88;
  --accent-secondary: #00cc6a;
  --accent-glow: rgba(0, 255, 136, 0.15);
  --accent-tertiary: #3b82f6;
  --accent-purple: #8b5cf6;
  
  /* Gradients */
  --gradient-primary: linear-gradient(135deg, #00ff88 0%, #00cc6a 50%, #00aa55 100%);
  --gradient-card: linear-gradient(165deg, rgba(14, 14, 21, 0.98) 0%, rgba(8, 8, 12, 0.99) 100%);
  --gradient-glass: linear-gradient(135deg, rgba(255, 255, 255, 0.03) 0%, rgba(255, 255, 255, 0.01) 100%);
  --gradient-mesh: 
    radial-gradient(ellipse 80% 50% at 20% -20%, rgba(0, 255, 136, 0.08) 0%, transparent 50%),
    radial-gradient(ellipse 60% 40% at 80% 120%, rgba(59, 130, 246, 0.06) 0%, transparent 50%),
    radial-gradient(ellipse 100% 80% at 50% 50%, rgba(139, 92, 246, 0.04) 0%, transparent 60%);
  
  /* Status colors - preserved */
  --success: #10b981;
  --success-soft: rgba(16, 185, 129, 0.12);
  --success-glow: rgba(16, 185, 129, 0.5);
  --warning: #fbbf24;
  --warning-soft: rgba(251, 191, 36, 0.12);
  --warning-glow: rgba(251, 191, 36, 0.5);
  --error: #f43f5e;
  --error-soft: rgba(244, 63, 94, 0.12);
  --error-glow: rgba(244, 63, 94, 0.5);
  --info: #3b82f6;
  --info-soft: rgba(59, 130, 246, 0.12);
  --info-glow: rgba(59, 130, 246, 0.5);
  
  /* Text */
  --text-primary: #ffffff;
  --text-secondary: rgba(255, 255, 255, 0.65);
  --text-muted: rgba(255, 255, 255, 0.35);
  --text-accent: var(--accent-primary);
  
  /* Fonts */
  --font-display: 'Satoshi', system-ui, -apple-system, sans-serif;
  --font-sans: 'DM Sans', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', 'SF Mono', monospace;
  
  /* Shadows - enhanced depth */
  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.4), 0 0 1px rgba(0, 0, 0, 0.5);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.5), 0 0 1px rgba(0, 0, 0, 0.6);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.6), 0 0 1px rgba(0, 0, 0, 0.7);
  --shadow-xl: 0 16px 48px rgba(0, 0, 0, 0.7), 0 0 1px rgba(0, 0, 0, 0.8);
  --shadow-glow: 0 0 40px var(--accent-glow), 0 0 80px rgba(0, 255, 136, 0.05);
  --shadow-glow-sm: 0 0 20px var(--accent-glow);
  
  /* Radii */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-2xl: 32px;
  
  /* Transitions */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --duration-fast: 150ms;
  --duration-normal: 250ms;
  --duration-slow: 400ms;
}

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

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

body {
  font-family: var(--font-sans);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  font-size: 0.9375rem;
  position: relative;
  overflow-x: hidden;
}

/* Ambient Background */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--gradient-mesh);
  pointer-events: none;
  z-index: 0;
}

/* Subtle grid pattern */
body::after {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: 
    linear-gradient(rgba(255, 255, 255, 0.012) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.012) 1px, transparent 1px);
  background-size: 100px 100px;
  mask-image: radial-gradient(ellipse 100% 80% at 50% 0%, black 20%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

/* Container */
.container {
  max-width: 1520px;
  margin: 0 auto;
  padding: 1.5rem 2rem;
  position: relative;
  z-index: 1;
}

/* ============================================
   HEADER - Refined Navigation
   ============================================ */
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  padding: 1rem 1.5rem;
  background: var(--gradient-glass);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  position: relative;
  gap: 1.5rem;
}

.header::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.02));
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask-composite: xor;
  -webkit-mask-composite: xor;
  pointer-events: none;
}

.logo-section {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.logo-img {
  height: 36px;
  width: auto;
  transition: all var(--duration-normal) var(--ease-out);
  filter: drop-shadow(0 0 20px var(--accent-glow));
}

.logo-img:hover {
  transform: scale(1.05);
  filter: drop-shadow(0 0 30px var(--accent-glow));
}

.version-badge {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 600;
  padding: 0.35rem 0.65rem;
  background: linear-gradient(135deg, var(--accent-glow), rgba(0, 255, 136, 0.05));
  border: 1px solid rgba(0, 255, 136, 0.25);
  border-radius: 20px;
  color: var(--accent-primary);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

/* Navigation */
.header-nav {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(255, 255, 255, 0.03);
  padding: 0.5rem;
  border-radius: var(--radius-xl);
  border: 1px solid var(--border-color);
  backdrop-filter: blur(10px);
}

.nav-link {
  padding: 0.75rem 1.5rem;
  background: transparent;
  border: none;
  border-radius: var(--radius-lg);
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--duration-normal) var(--ease-out);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  position: relative;
  white-space: nowrap;
}

.nav-link:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.06);
}

.nav-link.active {
  background: var(--gradient-primary);
  color: var(--bg-primary);
  font-weight: 600;
  box-shadow: var(--shadow-glow-sm), 0 4px 12px rgba(0, 255, 136, 0.2);
}

/* User Menu */
.user-menu {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.plan-badge {
  padding: 0.4rem 0.875rem;
  border-radius: 20px;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  position: relative;
}

.plan-badge.solo {
  background: linear-gradient(135deg, rgba(0, 255, 136, 0.15), rgba(0, 204, 106, 0.08));
  color: var(--accent-primary);
  border: 1px solid rgba(0, 255, 136, 0.3);
  box-shadow: 0 0 20px rgba(0, 255, 136, 0.1);
}

.plan-badge.team {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.15), rgba(139, 92, 246, 0.08));
  color: var(--info);
  border: 1px solid rgba(59, 130, 246, 0.3);
  box-shadow: 0 0 20px rgba(59, 130, 246, 0.1);
}

.user-email {
  font-size: 0.8125rem;
  color: var(--text-muted);
  font-weight: 400;
}

/* ============================================
   BUTTONS - Polished & Interactive
   ============================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-md);
  font-family: var(--font-sans);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-out);
  border: none;
  text-decoration: none;
  position: relative;
  overflow: hidden;
  white-space: nowrap;
}

.btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.15), transparent);
  opacity: 0;
  transition: opacity var(--duration-fast);
}

.btn:hover::before {
  opacity: 1;
}

.btn-primary {
  background: var(--gradient-primary);
  color: var(--bg-primary);
  box-shadow: var(--shadow-glow-sm), var(--shadow-sm);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-glow), var(--shadow-md);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-secondary {
  background: var(--bg-card);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}

.btn-secondary:hover {
  border-color: rgba(255, 255, 255, 0.15);
  background: var(--bg-elevated);
}

.btn-sm {
  padding: 0.5rem 1rem;
  font-size: 0.8125rem;
  border-radius: var(--radius-sm);
}

.btn-logout {
  padding: 0.625rem 1rem;
  background: transparent;
  border: 1px solid rgba(244, 63, 94, 0.3);
  border-radius: var(--radius-md);
  color: var(--error);
  font-family: var(--font-sans);
  font-size: 0.8125rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--duration-normal) var(--ease-out);
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
}

.btn-logout:hover {
  background: var(--error-soft);
  border-color: rgba(244, 63, 94, 0.5);
  box-shadow: 0 0 16px rgba(244, 63, 94, 0.15);
}

/* ============================================
   CARDS & WIDGETS - Glass Morphism
   ============================================ */
.card {
  background: var(--gradient-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  position: relative;
}

.card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(165deg, rgba(255, 255, 255, 0.08), transparent 50%);
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask-composite: xor;
  -webkit-mask-composite: xor;
  pointer-events: none;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border-subtle);
  background: rgba(255, 255, 255, 0.01);
}

.card-title {
  font-family: var(--font-display);
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.625rem;
  letter-spacing: -0.01em;
}

.card-actions {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.widget {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.5rem;
  transition: all var(--duration-normal) var(--ease-out);
  position: relative;
  overflow: hidden;
}

.widget::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent-primary), transparent);
  opacity: 0;
  transition: opacity var(--duration-normal);
}

.widget:hover {
  border-color: rgba(0, 255, 136, 0.2);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg), 0 0 30px rgba(0, 255, 136, 0.05);
}

.widget:hover::before {
  opacity: 0.6;
}

.widget-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1rem;
}

.widget-title {
  font-family: var(--font-sans);
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.widget-icon {
  font-size: 1rem;
}

.widget-value {
  font-family: var(--font-display);
  font-size: 2.25rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.1;
  letter-spacing: -0.03em;
}

.widget-badge {
  font-family: var(--font-mono);
  font-size: 0.625rem;
  padding: 0.25rem 0.5rem;
  border-radius: 6px;
  font-weight: 600;
  letter-spacing: 0.03em;
}

.badge-success {
  background: var(--success-soft);
  color: var(--success);
}

.badge-warning {
  background: var(--warning-soft);
  color: var(--warning);
}

.badge-danger, .badge-error {
  background: var(--error-soft);
  color: var(--error);
}

.badge-info {
  background: var(--info-soft);
  color: var(--info);
}

/* ============================================
   LAYOUT GRIDS
   ============================================ */
.section-gap {
  margin-bottom: 2rem;
}

.three-column-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
}

.two-column-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.25rem;
}

@media (max-width: 1024px) {
  .three-column-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .three-column-grid,
  .two-column-grid {
    grid-template-columns: 1fr;
  }
}

/* ============================================
   FORMS - Refined Inputs
   ============================================ */
.form-group {
  margin-bottom: 1.25rem;
}

.form-group label, .form-label {
  display: block;
  color: var(--text-secondary);
  font-size: 0.8125rem;
  font-weight: 500;
  margin-bottom: 0.5rem;
}

.form-group input, .form-input, .link-input {
  width: 100%;
  padding: 0.75rem 1rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 0.875rem;
  transition: all var(--duration-fast) var(--ease-out);
}

.form-group input:focus, .form-input:focus, .link-input:focus {
  outline: none;
  border-color: var(--accent-primary);
  background: var(--bg-tertiary);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.form-group input::placeholder, .form-input::placeholder, .link-input::placeholder {
  color: var(--text-muted);
}

.form-help {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.375rem;
}

/* Select */
.source-select {
  width: 100%;
  padding: 0.75rem 1rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 0.875rem;
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-out);
  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='%236b7280' d='M3 4.5L6 7.5L9 4.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  padding-right: 2.5rem;
}

.source-select:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

/* ============================================
   TABLES - Clean & Scannable
   ============================================ */
.sources-table, .members-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

.sources-table th, .sources-table td,
.members-table th, .members-table td {
  padding: 1rem 1.25rem;
  text-align: left;
}

.sources-table th, .members-table th {
  font-family: var(--font-sans);
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 10;
}

.sources-table td, .members-table td {
  font-size: 0.875rem;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border-subtle);
  transition: background var(--duration-fast);
}

.sources-table tbody tr, .members-table tbody tr {
  transition: background var(--duration-fast);
}

.sources-table tbody tr:hover, .members-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.02);
}

.sources-table tbody tr:hover td, .members-table tbody tr:hover td {
  color: var(--text-primary);
}

/* Source Name Cell */
.source-name {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 500;
  color: var(--text-primary);
}

.source-icon {
  font-size: 1.25rem;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-tertiary);
  border-radius: var(--radius-sm);
}

/* ============================================
   MODALS - Premium Overlays
   ============================================ */
.modal, .modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(5, 5, 8, 0.9);
  backdrop-filter: blur(12px);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}

.modal.active, .modal-overlay {
  display: flex;
}

.modal-content {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: 2rem;
  max-width: 600px;
  width: 92%;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  box-shadow: var(--shadow-xl);
  animation: modalSlideUp 0.3s var(--ease-out);
}

@keyframes modalSlideUp {
  from { 
    opacity: 0; 
    transform: translateY(24px) scale(0.98); 
  }
  to { 
    opacity: 1; 
    transform: translateY(0) scale(1); 
  }
}

.modal-content::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(165deg, rgba(255, 255, 255, 0.1), transparent 50%);
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask-composite: xor;
  -webkit-mask-composite: xor;
  pointer-events: none;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1.5rem;
}

.modal-header h3 {
  font-family: var(--font-display);
  font-size: 1.375rem;
  font-weight: 700;
  margin-bottom: 0.375rem;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.modal-header p {
  color: var(--text-muted);
  font-size: 0.875rem;
}

.modal-title {
  font-family: var(--font-display);
  font-size: 1.375rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.modal-close {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  font-size: 1.125rem;
  cursor: pointer;
  padding: 0;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  transition: all var(--duration-fast);
}

.modal-close:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  border-color: rgba(255, 255, 255, 0.1);
}

.modal-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
  margin-top: 1.5rem;
}

.btn-modal {
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-md);
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 0.875rem;
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-out);
}

.btn-modal.secondary {
  background: var(--bg-secondary);
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
}

.btn-modal.secondary:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  border-color: rgba(255, 255, 255, 0.1);
}

.btn-modal.primary {
  background: var(--gradient-primary);
  color: var(--bg-primary);
  border: none;
  box-shadow: var(--shadow-glow-sm);
}

.btn-modal.primary:hover {
  box-shadow: var(--shadow-glow);
}

/* ============================================
   TOAST NOTIFICATIONS
   ============================================ */
.toast {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
  min-width: 280px;
  font-size: 0.875rem;
  box-shadow: var(--shadow-xl);
  transform: translateY(100px);
  opacity: 0;
  transition: all 0.3s var(--ease-out);
  z-index: 10000;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

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

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

.toast-warning {
  border-left: 3px solid var(--warning);
}

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

.toast-info {
  border-left: 3px solid var(--info);
}

/* ============================================
   DATE RANGE SELECTOR
   ============================================ */
.date-range-selector {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 2rem;
  padding: 1rem 1.5rem;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  flex-wrap: wrap;
  backdrop-filter: blur(10px);
}

.quick-ranges {
  display: flex;
  gap: 0.5rem;
  background: rgba(255, 255, 255, 0.03);
  padding: 0.5rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-subtle);
}

.date-btn {
  padding: 0.625rem 1.25rem;
  background: transparent;
  border: none;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-size: 0.8125rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--duration-normal) var(--ease-out);
  white-space: nowrap;
}

.date-btn:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.06);
}

.date-btn.active {
  background: var(--gradient-primary);
  color: var(--bg-primary);
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(0, 255, 136, 0.2);
}

.filter-buttons {
  display: flex;
  gap: 0.375rem;
  background: var(--bg-secondary);
  padding: 0.25rem;
  border-radius: var(--radius-sm);
}

.filter-btn {
  padding: 0.375rem 0.75rem;
  background: transparent;
  border: none;
  border-radius: 6px;
  color: var(--text-muted);
  font-family: var(--font-sans);
  font-size: 0.75rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--duration-fast);
}

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

.filter-btn.active {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
}

/* ============================================
   LIVE DECISIONS FEED
   ============================================ */
.live-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border-subtle);
}

.live-indicator {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.live-dot {
  width: 8px;
  height: 8px;
  background: var(--success);
  border-radius: 50%;
  animation: livePulse 2s ease-in-out infinite;
  box-shadow: 0 0 8px var(--success-glow);
}

@keyframes livePulse {
  0%, 100% { 
    opacity: 1; 
    transform: scale(1);
  }
  50% { 
    opacity: 0.5; 
    transform: scale(0.9);
  }
}

.decisions-feed {
  max-height: 480px;
  overflow-y: auto;
  padding: 1rem;
}

.decisions-feed::-webkit-scrollbar {
  width: 6px;
}

.decisions-feed::-webkit-scrollbar-track {
  background: transparent;
}

.decisions-feed::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 3px;
}

.decisions-feed::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.15);
}

.decision-item {
  padding: 1rem;
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  margin-bottom: 0.625rem;
  border-left: 3px solid var(--text-muted);
  transition: all var(--duration-fast);
}

.decision-item:hover {
  background: var(--bg-tertiary);
}

.decision-item.high {
  border-left-color: var(--success);
  background: linear-gradient(90deg, var(--success-soft) 0%, var(--bg-secondary) 30%);
}

.decision-item.medium {
  border-left-color: var(--warning);
  background: linear-gradient(90deg, var(--warning-soft) 0%, var(--bg-secondary) 30%);
}

.decision-item.low {
  border-left-color: var(--error);
  background: linear-gradient(90deg, var(--error-soft) 0%, var(--bg-secondary) 30%);
}

/* ============================================
   HEALTH SCORES & STATUS INDICATORS
   ============================================ */
.health-score {
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 0.875rem;
}

.health-excellent { color: var(--success); }
.health-good { color: var(--info); }
.health-poor { color: var(--warning); }

.health-badge {
  font-family: var(--font-mono);
  font-size: 0.625rem;
  padding: 0.25rem 0.5rem;
  border-radius: 6px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.health-badge.excellent {
  background: var(--success-soft);
  color: var(--success);
}

.health-badge.good {
  background: var(--info-soft);
  color: var(--info);
}

.health-badge.poor {
  background: var(--warning-soft);
  color: var(--warning);
}

/* Quality Tier Badges */
.tier-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 0.625rem;
  font-weight: 700;
  padding: 0.25rem 0.625rem;
  border-radius: 6px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.tier-badge.high {
  background: var(--success-soft);
  color: var(--success);
  box-shadow: 0 0 12px var(--success-glow);
}

.tier-badge.medium {
  background: var(--warning-soft);
  color: var(--warning);
  box-shadow: 0 0 12px var(--warning-glow);
}

.tier-badge.low {
  background: var(--error-soft);
  color: var(--error);
  box-shadow: 0 0 12px var(--error-glow);
}

/* ============================================
   LINK BUILDER & UTM STYLES
   ============================================ */
.link-builder-container {
  padding: 1.5rem 0;
}

.link-builder-header {
  margin-bottom: 2rem;
}

.link-builder-header h2 {
  font-family: var(--font-display);
  font-size: 1.625rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  letter-spacing: -0.02em;
}

.link-builder-header p {
  color: var(--text-muted);
  font-size: 0.9375rem;
}

.link-builder-step {
  margin-bottom: 1.75rem;
}

.link-builder-step h3 {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--text-primary);
}

.step-number {
  width: 28px;
  height: 28px;
  background: var(--gradient-primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--bg-primary);
  flex-shrink: 0;
}

.link-input-help {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.5rem;
}

/* Traffic Type Grid */
.traffic-type-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.625rem;
}

@media (max-width: 640px) {
  .traffic-type-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.traffic-type-option {
  padding: 0.875rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--duration-fast);
  text-align: center;
}

.traffic-type-option:hover {
  border-color: rgba(255, 255, 255, 0.15);
  background: var(--bg-tertiary);
}

.traffic-type-option.selected {
  border-color: var(--accent-primary);
  background: rgba(0, 255, 136, 0.08);
  box-shadow: 0 0 20px var(--accent-glow);
}

.traffic-type-option input {
  display: none;
}

.traffic-type-option label {
  cursor: pointer;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.traffic-type-option.selected label {
  color: var(--text-primary);
}

/* Generated URL Section */
.generated-url-section {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin-top: 2rem;
  position: relative;
}

.generated-url-section::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(165deg, rgba(255, 255, 255, 0.06), transparent 50%);
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask-composite: xor;
  -webkit-mask-composite: xor;
  pointer-events: none;
}

.generated-url-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 0.625rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.generated-url-box {
  padding: 1rem 1.25rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  color: var(--accent-primary);
  word-break: break-all;
  margin-bottom: 1.25rem;
  line-height: 1.5;
}

.link-actions {
  display: flex;
  gap: 0.625rem;
  flex-wrap: wrap;
}

/* ============================================
   PRO TIP BOX
   ============================================ */
.pro-tip {
  background: linear-gradient(135deg, var(--info-soft), rgba(139, 92, 246, 0.05));
  border: 1px solid rgba(59, 130, 246, 0.2);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.5rem;
  margin: 1.5rem 0;
  position: relative;
}

.pro-tip::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--info);
  border-radius: 3px 0 0 3px;
}

.pro-tip-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.875rem;
  color: var(--info);
  margin-bottom: 0.5rem;
}

.pro-tip-text {
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.7;
}

/* ============================================
   INFO BOX
   ============================================ */
.info-box {
  background: linear-gradient(135deg, var(--accent-glow), rgba(0, 255, 136, 0.03));
  border: 1px solid rgba(0, 255, 136, 0.2);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.5rem;
  position: relative;
}

.info-box::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--accent-primary);
  border-radius: 3px 0 0 3px;
}

.info-box ul {
  list-style: none;
  padding: 0;
}

.info-box li {
  font-size: 0.875rem;
  color: var(--text-secondary);
  padding: 0.25rem 0;
  padding-left: 1.25rem;
  position: relative;
}

.info-box li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.625rem;
  width: 6px;
  height: 6px;
  background: var(--accent-primary);
  border-radius: 50%;
}

/* ============================================
   TEMPLATES SECTION
   ============================================ */
.templates-section {
  margin-top: 2rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border-color);
}

.templates-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.templates-title {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
}

.templates-list {
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
}

/* ============================================
   API & INTEGRATION SECTION
   ============================================ */
.integration-container {
  padding: 1.5rem 0;
}

.integration-section {
  margin-bottom: 2.5rem;
}

.integration-header h2 {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  letter-spacing: -0.01em;
}

.integration-header p {
  color: var(--text-muted);
  font-size: 0.9375rem;
  line-height: 1.6;
}

.api-key-section {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  position: relative;
}

.api-key-section::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(165deg, rgba(255, 255, 255, 0.06), transparent 50%);
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask-composite: xor;
  -webkit-mask-composite: xor;
  pointer-events: none;
}

.api-key-section h4 {
  font-family: var(--font-display);
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.api-key-display {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  margin-bottom: 1rem;
}

.api-key-value {
  font-family: var(--font-mono);
  font-size: 0.875rem;
  flex: 1;
  color: var(--text-secondary);
}

.api-key-actions {
  display: flex;
  gap: 0.5rem;
}

.api-key-warning {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  font-size: 0.8125rem;
  color: var(--warning);
  margin-bottom: 1rem;
  padding: 0.75rem;
  background: var(--warning-soft);
  border-radius: var(--radius-sm);
}

.postback-url-display {
  padding: 1rem 1.25rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  color: var(--accent-primary);
  word-break: break-all;
  margin: 1rem 0;
  line-height: 1.5;
}

.postback-actions {
  display: flex;
  gap: 0.625rem;
  margin-bottom: 1.5rem;
}

.param-reference {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin: 1.5rem 0;
}

.param-reference h4 {
  font-family: var(--font-display);
  margin-bottom: 1rem;
  font-size: 0.9375rem;
  font-weight: 600;
}

.param-list {
  list-style: none;
  padding: 0;
}

.param-list li {
  display: flex;
  gap: 1rem;
  padding: 0.625rem 0;
  border-bottom: 1px solid var(--border-subtle);
  align-items: baseline;
}

.param-list li:last-child {
  border-bottom: none;
}

.param-name {
  font-family: var(--font-mono);
  color: var(--accent-primary);
  min-width: 100px;
  font-weight: 600;
  font-size: 0.8125rem;
}

.param-desc {
  color: var(--text-secondary);
  font-size: 0.875rem;
}

.example-section {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
}

.example-section h4 {
  font-family: var(--font-display);
  margin-bottom: 1rem;
  font-size: 0.9375rem;
  font-weight: 600;
}

.result-item {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  font-size: 0.875rem;
  color: var(--text-secondary);
  padding: 0.375rem 0;
}

.result-item .check {
  color: var(--success);
  font-size: 1rem;
}

/* ============================================
   TEAM SECTION
   ============================================ */
.team-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border-subtle);
}

.team-title {
  font-family: var(--font-display);
  font-size: 0.9375rem;
  font-weight: 700;
}

/* ============================================
   EMPTY STATES
   ============================================ */
.empty-state-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem 1rem;
  text-align: center;
}

.empty-icon {
  font-size: 2.5rem;
  margin-bottom: 1rem;
  opacity: 0.6;
}

.empty-title {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 0.375rem;
}

.empty-subtitle {
  font-size: 0.875rem;
  color: var(--text-muted);
}

/* ============================================
   TOOLTIPS
   ============================================ */
.tooltip {
  position: fixed;
  background: var(--bg-elevated);
  color: var(--text-primary);
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  pointer-events: none;
  transform: translate(-50%, -100%);
  opacity: 0;
  transition: opacity var(--duration-fast);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-lg);
  z-index: 9999;
  max-width: 200px;
}

.tooltip.visible {
  opacity: 1;
}

/* ============================================
   QUOTA CARD STYLES
   ============================================ */
.quota-card {
  position: relative;
}

.quota-card .progress-fill {
  background: var(--gradient-primary);
}

.quota-card .progress-fill.warning {
  background: linear-gradient(90deg, #fbbf24, #f59e0b);
}

.quota-card .progress-fill.danger {
  background: linear-gradient(90deg, #f43f5e, #dc2626);
}

.custom-range-picker {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* ============================================
   USAGE WARNING BANNER
   ============================================ */
.usage-warning-banner {
  background: linear-gradient(135deg, var(--warning-soft), rgba(251, 191, 36, 0.05));
  border: 1px solid rgba(251, 191, 36, 0.25);
  border-radius: var(--radius-lg);
  padding: 0.875rem 1.25rem;
  margin-bottom: 1.5rem;
  position: relative;
  overflow: hidden;
}

.usage-warning-banner::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--warning);
}

.warning-content {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.warning-icon {
  font-size: 1.125rem;
}

.warning-text {
  flex: 1;
  color: var(--warning);
  font-size: 0.875rem;
  font-weight: 500;
}

.btn-upgrade-small {
  background: linear-gradient(135deg, #fbbf24, #f59e0b);
  color: #000;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-sm);
  font-family: var(--font-sans);
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--duration-fast);
}

.btn-upgrade-small:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(251, 191, 36, 0.3);
}

.btn-dismiss {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.125rem;
  cursor: pointer;
  padding: 0.25rem;
  line-height: 1;
  transition: color var(--duration-fast);
}

.btn-dismiss:hover {
  color: var(--text-secondary);
}

/* ============================================
   UPGRADE MODAL
   ============================================ */
.modal-content.upgrade-modal {
  max-width: 720px;
}

.modal-subtitle {
  color: var(--text-muted);
  margin-bottom: 1.5rem;
  font-size: 0.9375rem;
}

.plan-comparison {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}

@media (max-width: 640px) {
  .plan-comparison {
    grid-template-columns: 1fr;
  }
}

.plan-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  position: relative;
  transition: all var(--duration-fast);
}

.plan-card.current {
  opacity: 0.6;
}

.plan-card.recommended {
  border-color: var(--accent-primary);
  box-shadow: 0 0 30px var(--accent-glow);
}

.plan-badge-current {
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-card);
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.625rem;
  font-weight: 600;
  padding: 0.25rem 0.75rem;
  border-radius: 12px;
  border: 1px solid var(--border-color);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.plan-badge-recommended {
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--accent-primary);
  color: var(--bg-primary);
  font-family: var(--font-mono);
  font-size: 0.625rem;
  font-weight: 700;
  padding: 0.25rem 0.75rem;
  border-radius: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.plan-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-subtle);
}

.plan-name {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
}

.plan-price {
  font-family: var(--font-mono);
  font-size: 1rem;
  color: var(--accent-primary);
  font-weight: 600;
}

.plan-features {
  list-style: none;
  margin-bottom: 1.5rem;
}

.plan-features li {
  padding: 0.5rem 0;
  color: var(--text-secondary);
  font-size: 0.875rem;
  display: flex;
  align-items: center;
  gap: 0.625rem;
}

.plan-features li::before {
  content: '✓';
  color: var(--accent-primary);
  font-weight: 700;
  font-size: 0.875rem;
}

.btn-upgrade {
  width: 100%;
  justify-content: center;
}

.modal-footer-text {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.8125rem;
}

.modal-footer-text a {
  color: var(--accent-primary);
  text-decoration: none;
  font-weight: 500;
}

.modal-footer-text a:hover {
  text-decoration: underline;
}

/* ============================================
   USAGE BAR
   ============================================ */
.usage-bar-container {
  background: var(--bg-tertiary);
  border-radius: var(--radius-sm);
  padding: 0.625rem 1rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.usage-bar-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.usage-bar {
  flex: 1;
  height: 6px;
  background: var(--bg-primary);
  border-radius: 3px;
  overflow: hidden;
  min-width: 100px;
}

.usage-bar-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.5s var(--ease-out);
}

.usage-bar-fill.low {
  background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary));
}

.usage-bar-fill.medium {
  background: linear-gradient(90deg, #fbbf24, #f59e0b);
}

.usage-bar-fill.high {
  background: linear-gradient(90deg, #f43f5e, #dc2626);
}

.usage-bar-text {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  color: var(--text-muted);
  white-space: nowrap;
}

/* ============================================
   LOADING STATES
   ============================================ */
#globalProgressBar {
  position: fixed;
  top: 0;
  left: 0;
  height: 2px;
  background: var(--gradient-primary);
  width: 0%;
  z-index: 99999;
  transition: width 0.2s var(--ease-out);
  box-shadow: 0 0 10px var(--accent-primary), 0 0 20px var(--accent-glow);
}

#globalProgressBar.active {
  opacity: 1;
}

#globalProgressBar.complete {
  opacity: 0;
  transition: width 0.2s var(--ease-out), opacity 0.3s 0.2s;
}

.skeleton {
  background: linear-gradient(90deg, 
    var(--bg-tertiary) 25%, 
    rgba(255, 255, 255, 0.03) 50%, 
    var(--bg-tertiary) 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-sm);
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Loading Overlay (legacy support) */
#loadingOverlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(5, 5, 8, 0.9);
  backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 99998;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s, visibility 0.3s;
}

#loadingOverlay.active {
  opacity: 1;
  visibility: visible;
}

.loading-content {
  text-align: center;
  animation: fadeInUp 0.4s var(--ease-out);
}

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

.loading-spinner {
  width: 48px;
  height: 48px;
  border: 2px solid rgba(0, 255, 136, 0.1);
  border-top-color: var(--accent-primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 1.25rem;
  box-shadow: 0 0 20px var(--accent-glow);
}

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

.loading-text {
  color: var(--accent-primary);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1rem;
  margin-bottom: 0.375rem;
}

.loading-subtext {
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.8125rem;
}

/* Page Transition */
.page-loading {
  opacity: 0.5;
  pointer-events: none;
  transition: opacity 0.2s;
}

/* ============================================
   GEO ROUTING SPECIFIC STYLES
   ============================================ */
.quality-badge {
  padding: 0.5rem 1rem;
  border-radius: var(--radius-md);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--duration-fast);
  border: 2px solid transparent;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.quality-badge.high {
  background: var(--success-soft);
  color: var(--success);
  border-color: transparent;
}

.quality-badge.high:hover, .quality-badge.high.active {
  border-color: var(--success);
  box-shadow: 0 0 16px var(--success-glow);
}

.quality-badge.medium {
  background: var(--warning-soft);
  color: var(--warning);
  border-color: transparent;
}

.quality-badge.medium:hover, .quality-badge.medium.active {
  border-color: var(--warning);
  box-shadow: 0 0 16px var(--warning-glow);
}

.quality-badge.low {
  background: var(--error-soft);
  color: var(--error);
  border-color: transparent;
}

.quality-badge.low:hover, .quality-badge.low.active {
  border-color: var(--error);
  box-shadow: 0 0 16px var(--error-glow);
}

/* Country Buttons */
.quick-country {
  padding: 0.5rem 0.875rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  cursor: pointer;
  transition: all var(--duration-fast);
}

.quick-country:hover {
  border-color: rgba(255, 255, 255, 0.15);
  color: var(--text-primary);
  background: var(--bg-tertiary);
}

/* GEO Routes Grid */
.geo-routes-grid {
  display: grid;
  gap: 0.75rem;
}

.geo-route-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.25rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  transition: all var(--duration-fast);
}

.geo-route-card:hover {
  border-color: rgba(255, 255, 255, 0.1);
  background: var(--bg-tertiary);
}

/* ============================================
   RESPONSIVE ADJUSTMENTS
   ============================================ */
@media (max-width: 1200px) {
  .container {
    padding: 1.25rem 1.5rem;
  }
  
  .header {
    flex-wrap: wrap;
  }
  
  .header-nav {
    order: 3;
    width: 100%;
    justify-content: center;
    margin-top: 0.5rem;
  }
}

@media (max-width: 768px) {
  .container {
    padding: 1rem;
  }
  
  .header {
    padding: 1rem;
    border-radius: var(--radius-lg);
    gap: 1rem;
  }
  
  .header-nav {
    overflow-x: auto;
    padding: 0.25rem;
    gap: 0.25rem;
  }
  
  .nav-link {
    padding: 0.5rem 0.875rem;
    font-size: 0.8125rem;
  }
  
  .user-menu {
    gap: 0.75rem;
  }
  
  .user-email {
    display: none;
  }
  
  .date-range-selector {
    flex-direction: column;
    align-items: stretch;
  }
  
  .quick-ranges {
    overflow-x: auto;
    width: 100%;
  }
  
  .widget-value {
    font-size: 1.75rem;
  }
  
  .modal-content {
    padding: 1.5rem;
    border-radius: var(--radius-lg);
  }
}

/* ============================================
   SCROLLBAR STYLING
   ============================================ */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.15);
}

/* Firefox */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--border-color) transparent;
}

/* ============================================
   SELECTION STYLING
   ============================================ */
::selection {
  background: var(--accent-glow);
  color: var(--text-primary);
}

::-moz-selection {
  background: var(--accent-glow);
  color: var(--text-primary);
}

/* ============================================
   FOCUS VISIBLE STYLING
   ============================================ */
:focus-visible {
  outline: 2px solid var(--accent-primary);
  outline-offset: 2px;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 2px solid var(--accent-primary);
  outline-offset: 2px;
}