/* ============================================================
   TELECOM NETWORK LAB — Global Stylesheet
   Ultra-modern, premium SaaS design system
   ============================================================ */

:root {
  /* Brand palette */
  --brand-950: #020617;
  --brand-900: #0a0f1e;
  --brand-800: #0d1530;
  --brand-700: #111d45;
  --brand-600: #1a2d6e;
  --brand-500: #2563eb;
  --brand-400: #3b82f6;
  --brand-300: #60a5fa;
  --brand-200: #93c5fd;
  --brand-100: #dbeafe;

  /* Accent — electric cyan */
  --accent-500: #06b6d4;
  --accent-400: #22d3ee;
  --accent-300: #67e8f9;

  /* Accent 2 — violet */
  --violet-500: #8b5cf6;
  --violet-400: #a78bfa;
  --violet-300: #c4b5fd;

  /* Semantic */
  --success: #10b981;
  --success-light: #d1fae5;
  --warning: #f59e0b;
  --warning-light: #fef3c7;
  --danger: #ef4444;
  --danger-light: #fee2e2;
  --info: #3b82f6;

  /* Neutrals */
  --gray-950: #030712;
  --gray-900: #111827;
  --gray-800: #1f2937;
  --gray-750: #273244;
  --gray-700: #374151;
  --gray-600: #4b5563;
  --gray-500: #6b7280;
  --gray-400: #9ca3af;
  --gray-300: #d1d5db;
  --gray-200: #e5e7eb;
  --gray-100: #f3f4f6;
  --gray-50:  #f9fafb;

  /* Surfaces */
  --surface-base:    #0a0f1e;
  --surface-card:    #111827;
  --surface-elevated:#1a2233;
  --surface-modal:   #1e2a3d;
  --surface-border:  rgba(255,255,255,0.07);
  --surface-hover:   rgba(255,255,255,0.04);

  /* Text */
  --text-primary:   #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted:     #64748b;
  --text-inverse:   #0a0f1e;

  /* Spacing */
  --sidebar-width: 260px;
  --topbar-height: 64px;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;

  /* Transitions */
  --transition-fast: 0.15s ease;
  --transition-med:  0.25s ease;
  --transition-slow: 0.4s cubic-bezier(0.4,0,0.2,1);

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.4), 0 1px 2px rgba(0,0,0,0.3);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.5), 0 2px 6px rgba(0,0,0,0.3);
  --shadow-lg: 0 10px 40px rgba(0,0,0,0.6), 0 4px 12px rgba(0,0,0,0.4);
  --shadow-glow-brand: 0 0 20px rgba(37,99,235,0.35);
  --shadow-glow-accent: 0 0 20px rgba(6,182,212,0.35);

  /* Gradients */
  --grad-brand: linear-gradient(135deg, #2563eb 0%, #06b6d4 100%);
  --grad-violet: linear-gradient(135deg, #8b5cf6 0%, #06b6d4 100%);
  --grad-dark: linear-gradient(180deg, #0d1530 0%, #020617 100%);
  --grad-card: linear-gradient(145deg, rgba(26,34,56,0.8) 0%, rgba(17,24,39,0.9) 100%);
}

/* ── Reset & Base ──────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 14px; scroll-behavior: smooth; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--surface-base);
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
button { cursor: pointer; font-family: inherit; }
input, select, textarea { font-family: inherit; }
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--gray-700); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--gray-600); }

/* ── Utility Classes ────────────────────────────────────────── */
.hidden { display: none !important; }
.flex { display: flex; }
.flex-col { display: flex; flex-direction: column; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: 4px; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.gap-6 { gap: 24px; }
.gap-8 { gap: 32px; }
.w-full { width: 100%; }
.h-full { height: 100%; }
.text-sm { font-size: 0.875rem; }
.text-xs { font-size: 0.75rem; }
.text-lg { font-size: 1.125rem; }
.text-xl { font-size: 1.25rem; }
.text-2xl { font-size: 1.5rem; }
.text-3xl { font-size: 1.875rem; }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }
.text-muted { color: var(--text-muted); }
.text-secondary { color: var(--text-secondary); }
.text-accent { color: var(--accent-400); }
.text-brand { color: var(--brand-400); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.relative { position: relative; }
.absolute { position: absolute; }
.overflow-hidden { overflow: hidden; }
.rounded { border-radius: var(--radius-md); }
.rounded-full { border-radius: 9999px; }
.opacity-0 { opacity: 0; }
.opacity-50 { opacity: 0.5; }
.pointer-events-none { pointer-events: none; }
.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.mt-4 { margin-top: 16px; }
.mt-6 { margin-top: 24px; }
.mb-2 { margin-bottom: 8px; }
.mb-4 { margin-bottom: 16px; }
.mb-6 { margin-bottom: 24px; }
.p-2 { padding: 8px; }
.p-3 { padding: 12px; }
.p-4 { padding: 16px; }
.p-6 { padding: 24px; }
.px-2 { padding-left: 8px; padding-right: 8px; }
.px-3 { padding-left: 12px; padding-right: 12px; }
.px-4 { padding-left: 16px; padding-right: 16px; }
.py-1 { padding-top: 4px; padding-bottom: 4px; }
.py-2 { padding-top: 8px; padding-bottom: 8px; }
.py-3 { padding-top: 12px; padding-bottom: 12px; }
.grid { display: grid; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

/* ── Animations ─────────────────────────────────────────────── */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes slideInLeft {
  from { opacity: 0; transform: translateX(-20px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes slideInRight {
  from { opacity: 0; transform: translateX(20px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.95); }
  to   { opacity: 1; transform: scale(1); }
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}
@keyframes spin {
  to { transform: rotate(360deg); }
}
@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}
@keyframes gradientShift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}
@keyframes glow {
  0%, 100% { box-shadow: 0 0 10px rgba(37,99,235,0.3); }
  50% { box-shadow: 0 0 30px rgba(37,99,235,0.7); }
}
@keyframes networkPulse {
  0% { r: 4; opacity: 1; }
  100% { r: 12; opacity: 0; }
}

.animate-fade-in { animation: fadeIn 0.35s ease forwards; }
.animate-fade-in-up { animation: fadeInUp 0.4s ease forwards; }
.animate-slide-left { animation: slideInLeft 0.35s ease forwards; }
.animate-scale-in { animation: scaleIn 0.3s ease forwards; }
.animate-pulse { animation: pulse 2s ease infinite; }
.animate-spin { animation: spin 0.8s linear infinite; }
.animate-float { animation: float 3s ease-in-out infinite; }

/* ================================================================
   LANDING PAGE
   ================================================================ */

#landing-page {
  min-height: 100vh;
  background: var(--brand-950);
  position: relative;
  overflow: hidden;
}

.landing-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 50% -10%, rgba(37,99,235,0.25) 0%, transparent 70%),
    radial-gradient(ellipse 40% 40% at 80% 80%, rgba(6,182,212,0.12) 0%, transparent 60%),
    radial-gradient(ellipse 30% 30% at 20% 60%, rgba(139,92,246,0.1) 0%, transparent 60%);
  pointer-events: none;
}

.landing-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px);
  background-size: 40px 40px;
  pointer-events: none;
}

.landing-nav {
  position: relative;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 48px;
  border-bottom: 1px solid var(--surface-border);
}

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

.landing-logo-icon {
  width: 36px;
  height: 36px;
  background: var(--grad-brand);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  animation: glow 3s ease infinite;
}

.landing-logo-text {
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.landing-logo-text span { color: var(--accent-400); }

.landing-nav-links {
  display: flex;
  align-items: center;
  gap: 8px;
}

.landing-hero {
  position: relative;
  z-index: 5;
  text-align: center;
  padding: 100px 48px 80px;
  max-width: 900px;
  margin: 0 auto;
}

.landing-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(37,99,235,0.15);
  border: 1px solid rgba(37,99,235,0.3);
  color: var(--brand-300);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 6px 14px;
  border-radius: 100px;
  margin-bottom: 28px;
  animation: fadeIn 0.5s ease forwards;
}

.landing-title {
  font-size: clamp(2.4rem, 6vw, 4rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.03em;
  margin-bottom: 24px;
  animation: fadeInUp 0.5s ease 0.1s both;
}

.landing-title .gradient-text {
  background: var(--grad-brand);
  background-size: 200% 200%;
  animation: gradientShift 4s ease infinite, fadeInUp 0.5s ease 0.1s both;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.landing-subtitle {
  font-size: 1.1rem;
  color: var(--text-secondary);
  max-width: 640px;
  margin: 0 auto 40px;
  line-height: 1.7;
  animation: fadeInUp 0.5s ease 0.2s both;
}

.landing-cta-group {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  animation: fadeInUp 0.5s ease 0.3s both;
}

.landing-stats {
  position: relative;
  z-index: 5;
  display: flex;
  justify-content: center;
  gap: 48px;
  padding: 32px 48px;
  border-top: 1px solid var(--surface-border);
  border-bottom: 1px solid var(--surface-border);
  background: rgba(255,255,255,0.02);
  flex-wrap: wrap;
}

.landing-stat {
  text-align: center;
  animation: fadeIn 0.5s ease forwards;
}

.landing-stat-value {
  font-size: 1.8rem;
  font-weight: 800;
  background: var(--grad-brand);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

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

.landing-features {
  position: relative;
  z-index: 5;
  padding: 80px 48px;
  max-width: 1200px;
  margin: 0 auto;
}

.landing-features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  margin-top: 48px;
}

.feature-card {
  background: var(--surface-card);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-lg);
  padding: 28px;
  transition: all var(--transition-med);
  position: relative;
  overflow: hidden;
}

.feature-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: var(--grad-brand);
  opacity: 0;
  transition: opacity var(--transition-med);
}

.feature-card:hover {
  border-color: rgba(37,99,235,0.3);
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
}

.feature-card:hover::before { opacity: 1; }

.feature-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  margin-bottom: 16px;
}

/* ================================================================
   AUTH MODAL
   ================================================================ */

#auth-overlay {
  position: fixed;
  inset: 0;
  background: rgba(2,6,23,0.85);
  backdrop-filter: blur(12px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.25s ease;
}

.auth-modal {
  background: var(--surface-elevated);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-xl);
  padding: 40px;
  width: 100%;
  max-width: 420px;
  box-shadow: var(--shadow-lg), 0 0 60px rgba(37,99,235,0.1);
  animation: scaleIn 0.3s ease;
}

.auth-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 32px;
  justify-content: center;
}

.auth-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 6px;
  text-align: center;
}

.auth-sub {
  color: var(--text-secondary);
  font-size: 0.875rem;
  text-align: center;
  margin-bottom: 28px;
}

.auth-oauth-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 11px 20px;
  border-radius: var(--radius-md);
  border: 1px solid var(--surface-border);
  background: var(--surface-card);
  color: var(--text-primary);
  font-size: 0.875rem;
  font-weight: 500;
  transition: all var(--transition-fast);
  margin-bottom: 10px;
}

.auth-oauth-btn:hover {
  background: var(--surface-hover);
  border-color: rgba(255,255,255,0.15);
  transform: translateY(-1px);
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 20px 0;
  color: var(--text-muted);
  font-size: 0.75rem;
}

.auth-divider::before, .auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--surface-border);
}

.auth-2fa {
  background: rgba(37,99,235,0.08);
  border: 1px solid rgba(37,99,235,0.2);
  border-radius: var(--radius-md);
  padding: 20px;
  margin-top: 20px;
  text-align: center;
}

.auth-2fa-digits {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-top: 16px;
}

.auth-2fa-digit {
  width: 44px;
  height: 52px;
  border-radius: var(--radius-md);
  border: 2px solid var(--surface-border);
  background: var(--surface-card);
  color: var(--text-primary);
  font-size: 1.4rem;
  font-weight: 700;
  text-align: center;
  outline: none;
  transition: border-color var(--transition-fast);
}

.auth-2fa-digit:focus { border-color: var(--brand-400); }

/* ================================================================
   APP SHELL
   ================================================================ */

#app-shell {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* ── Sidebar ──────────────────────────────────────────────── */
#sidebar {
  width: var(--sidebar-width);
  background: var(--surface-card);
  border-right: 1px solid var(--surface-border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  height: 100vh;
  overflow: hidden;
  transition: width var(--transition-slow);
  position: relative;
  z-index: 100;
}

#sidebar.collapsed { width: 64px; }

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 18px 16px;
  border-bottom: 1px solid var(--surface-border);
  flex-shrink: 0;
}

.sidebar-logo-icon {
  width: 32px;
  height: 32px;
  background: var(--grad-brand);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  flex-shrink: 0;
}

.sidebar-logo-text {
  font-size: 0.95rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  transition: opacity var(--transition-med), width var(--transition-med);
}
.sidebar-logo-text span { color: var(--accent-400); }
#sidebar.collapsed .sidebar-logo-text { opacity: 0; width: 0; }

.sidebar-scroll {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 12px 8px;
}

.sidebar-section-label {
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  padding: 8px 8px 4px;
  white-space: nowrap;
  overflow: hidden;
  transition: opacity var(--transition-med);
}
#sidebar.collapsed .sidebar-section-label { opacity: 0; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
  position: relative;
  white-space: nowrap;
  overflow: hidden;
  margin-bottom: 1px;
}

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

.nav-item.active {
  background: rgba(37,99,235,0.15);
  color: var(--brand-300);
}

.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0; top: 4px; bottom: 4px;
  width: 3px;
  background: var(--brand-400);
  border-radius: 0 2px 2px 0;
}

.nav-item-icon {
  width: 20px;
  text-align: center;
  font-size: 0.9rem;
  flex-shrink: 0;
  transition: color var(--transition-fast);
}

.nav-item.active .nav-item-icon { color: var(--brand-400); }
.nav-item-badge {
  margin-left: auto;
  background: var(--brand-600);
  color: var(--brand-200);
  font-size: 0.65rem;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 100px;
  flex-shrink: 0;
}

#sidebar.collapsed .nav-item-text,
#sidebar.collapsed .nav-item-badge { display: none; }

.sidebar-bottom {
  padding: 12px 8px;
  border-top: 1px solid var(--surface-border);
  flex-shrink: 0;
}

/* Tooltip for collapsed sidebar */
.nav-item[data-tooltip] { overflow: visible; }
#sidebar.collapsed .nav-item[data-tooltip]:hover::after {
  content: attr(data-tooltip);
  position: absolute;
  left: 56px;
  top: 50%;
  transform: translateY(-50%);
  background: var(--gray-800);
  color: var(--text-primary);
  font-size: 0.78rem;
  padding: 5px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--surface-border);
  white-space: nowrap;
  z-index: 1000;
  box-shadow: var(--shadow-md);
}

/* ── Topbar ──────────────────────────────────────────────── */
#topbar {
  height: var(--topbar-height);
  border-bottom: 1px solid var(--surface-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  background: var(--surface-card);
  flex-shrink: 0;
  gap: 16px;
}

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

.topbar-page-title {
  font-size: 1rem;
  font-weight: 600;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.topbar-scenario-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(37,99,235,0.1);
  border: 1px solid rgba(37,99,235,0.25);
  border-radius: 100px;
  padding: 5px 14px;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--brand-300);
  cursor: pointer;
  transition: all var(--transition-fast);
}
.topbar-scenario-pill:hover { background: rgba(37,99,235,0.2); }

.topbar-icon-btn {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
  position: relative;
}
.topbar-icon-btn:hover { background: var(--surface-hover); color: var(--text-primary); }
.topbar-icon-btn .badge {
  position: absolute;
  top: 4px; right: 4px;
  width: 8px; height: 8px;
  background: var(--danger);
  border-radius: 50%;
  border: 2px solid var(--surface-card);
}

.topbar-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--grad-brand);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  border: 2px solid transparent;
  transition: border-color var(--transition-fast);
}
.topbar-avatar:hover { border-color: var(--brand-400); }

/* ── Main Content ────────────────────────────────────────── */
#main-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

#main-content {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
  position: relative;
}

/* ── Page Header ─────────────────────────────────────────── */
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 16px;
}

.page-header-left h1 {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 4px;
}

.page-header-left p {
  color: var(--text-secondary);
  font-size: 0.875rem;
}

/* ================================================================
   BUTTON SYSTEM
   ================================================================ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: var(--radius-md);
  font-size: 0.82rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
  position: relative;
  overflow: hidden;
}

.btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0);
  transition: background var(--transition-fast);
}
.btn:hover::after { background: rgba(255,255,255,0.05); }
.btn:active { transform: scale(0.97); }

.btn-primary {
  background: var(--brand-500);
  color: #fff;
  box-shadow: 0 2px 8px rgba(37,99,235,0.35);
}
.btn-primary:hover { background: var(--brand-400); box-shadow: 0 4px 16px rgba(37,99,235,0.45); }

.btn-accent {
  background: var(--accent-500);
  color: #fff;
  box-shadow: 0 2px 8px rgba(6,182,212,0.35);
}
.btn-accent:hover { background: var(--accent-400); }

.btn-secondary {
  background: var(--surface-elevated);
  color: var(--text-primary);
  border: 1px solid var(--surface-border);
}
.btn-secondary:hover { background: var(--gray-750); border-color: rgba(255,255,255,0.15); }

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

.btn-danger {
  background: var(--danger);
  color: #fff;
}
.btn-danger:hover { filter: brightness(1.1); }

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

.btn-gradient {
  background: var(--grad-brand);
  background-size: 200% 200%;
  color: #fff;
  animation: gradientShift 4s ease infinite;
  box-shadow: 0 4px 20px rgba(37,99,235,0.4);
}

.btn-sm { padding: 5px 10px; font-size: 0.78rem; }
.btn-lg { padding: 12px 24px; font-size: 0.9rem; border-radius: var(--radius-md); }
.btn-xl { padding: 14px 32px; font-size: 1rem; border-radius: var(--radius-lg); }
.btn[disabled] { opacity: 0.5; pointer-events: none; }

/* ================================================================
   CARD SYSTEM
   ================================================================ */

.card {
  background: var(--surface-card);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.card-hover {
  transition: all var(--transition-med);
}
.card-hover:hover {
  border-color: rgba(37,99,235,0.3);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

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

.card-title {
  font-size: 0.875rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}

.card-body { padding: 20px; }
.card-body-sm { padding: 14px 16px; }
.card-footer {
  padding: 14px 20px;
  border-top: 1px solid var(--surface-border);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

/* KPI card */
.kpi-card {
  background: var(--surface-card);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-lg);
  padding: 20px;
  position: relative;
  overflow: hidden;
  transition: all var(--transition-med);
}

.kpi-card::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: var(--grad-brand);
  opacity: 0;
  transition: opacity var(--transition-med);
}

.kpi-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.kpi-card:hover::after { opacity: 1; }

.kpi-label {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.kpi-value {
  font-size: 1.8rem;
  font-weight: 800;
  line-height: 1;
  margin-bottom: 6px;
  letter-spacing: -0.02em;
}

.kpi-delta {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 100px;
}

.kpi-delta.up { color: var(--success); background: var(--success-light); }
.kpi-delta.down { color: var(--danger); background: var(--danger-light); }
.kpi-delta.neutral { color: var(--text-secondary); background: rgba(255,255,255,0.05); }

.kpi-icon {
  position: absolute;
  right: 16px;
  top: 16px;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  opacity: 0.8;
}

/* ================================================================
   FORM ELEMENTS
   ================================================================ */

.form-group { margin-bottom: 16px; }
.form-label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
  letter-spacing: 0.02em;
}

.form-input, .form-select, .form-textarea {
  width: 100%;
  background: var(--surface-card);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 0.85rem;
  padding: 9px 12px;
  outline: none;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
  appearance: none;
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--brand-400);
  box-shadow: 0 0 0 3px rgba(37,99,235,0.15);
}

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

.form-select {
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24'%3E%3Cpath fill='%2364748b' d='M7 10l5 5 5-5H7z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 30px;
}

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

.form-checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.form-checkbox input[type="checkbox"] {
  width: 16px; height: 16px;
  border-radius: 4px;
  accent-color: var(--brand-400);
  cursor: pointer;
}

.form-range {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 4px;
  background: var(--gray-700);
  border-radius: 2px;
  outline: none;
  cursor: pointer;
}
.form-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: var(--brand-400);
  cursor: pointer;
  box-shadow: 0 0 6px rgba(37,99,235,0.5);
}

.input-group {
  display: flex;
  gap: 8px;
  align-items: center;
}

.input-addon {
  background: var(--surface-elevated);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-md);
  padding: 9px 12px;
  font-size: 0.8rem;
  color: var(--text-muted);
  white-space: nowrap;
  flex-shrink: 0;
}

/* Toggle switch */
.toggle {
  position: relative;
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  gap: 8px;
}

.toggle input { display: none; }

.toggle-track {
  width: 36px; height: 20px;
  background: var(--gray-700);
  border-radius: 100px;
  position: relative;
  transition: background var(--transition-fast);
}

.toggle-track::after {
  content: '';
  position: absolute;
  top: 2px; left: 2px;
  width: 16px; height: 16px;
  background: #fff;
  border-radius: 50%;
  transition: transform var(--transition-fast);
  box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

.toggle input:checked + .toggle-track { background: var(--brand-400); }
.toggle input:checked + .toggle-track::after { transform: translateX(16px); }

.toggle-label { font-size: 0.82rem; color: var(--text-secondary); }

/* ================================================================
   BADGE SYSTEM
   ================================================================ */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 100px;
  font-size: 0.7rem;
  font-weight: 600;
}

.badge-blue   { background: rgba(37,99,235,0.15);  color: var(--brand-300); }
.badge-cyan   { background: rgba(6,182,212,0.15);  color: var(--accent-400); }
.badge-green  { background: rgba(16,185,129,0.15); color: #34d399; }
.badge-yellow { background: rgba(245,158,11,0.15); color: #fbbf24; }
.badge-red    { background: rgba(239,68,68,0.15);  color: #f87171; }
.badge-purple { background: rgba(139,92,246,0.15); color: var(--violet-400); }
.badge-gray   { background: rgba(255,255,255,0.07); color: var(--text-secondary); }

/* ================================================================
   TABLE SYSTEM
   ================================================================ */

.table-wrapper {
  overflow-x: auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--surface-border);
}

table.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}

.data-table thead tr {
  background: var(--surface-elevated);
  border-bottom: 1px solid var(--surface-border);
}

.data-table th {
  padding: 10px 14px;
  text-align: left;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  white-space: nowrap;
}

.data-table th.sortable { cursor: pointer; }
.data-table th.sortable:hover { color: var(--text-primary); }

.data-table td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--surface-border);
  vertical-align: middle;
}

.data-table tbody tr {
  transition: background var(--transition-fast);
}
.data-table tbody tr:hover { background: var(--surface-hover); }
.data-table tbody tr:last-child td { border-bottom: none; }

/* ================================================================
   TABS
   ================================================================ */

.tabs {
  display: flex;
  gap: 2px;
  border-bottom: 1px solid var(--surface-border);
  margin-bottom: 20px;
  overflow-x: auto;
  scrollbar-width: none;
}

.tab-btn {
  padding: 9px 16px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
  transition: all var(--transition-fast);
  position: relative;
  top: 1px;
}

.tab-btn:hover { color: var(--text-primary); }
.tab-btn.active { color: var(--brand-300); border-bottom-color: var(--brand-400); }

.tab-panel { display: none; animation: fadeIn 0.2s ease; }
.tab-panel.active { display: block; }

/* ================================================================
   PROGRESS & STATUS INDICATORS
   ================================================================ */

.progress-bar {
  height: 4px;
  background: var(--gray-800);
  border-radius: 2px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  border-radius: 2px;
  background: var(--grad-brand);
  transition: width 0.6s cubic-bezier(0.4,0,0.2,1);
}

.status-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}
.status-dot.active { background: var(--success); box-shadow: 0 0 6px var(--success); }
.status-dot.warning { background: var(--warning); box-shadow: 0 0 6px var(--warning); }
.status-dot.error { background: var(--danger); box-shadow: 0 0 6px var(--danger); }
.status-dot.inactive { background: var(--gray-600); }

/* Maturity score circle */
.maturity-ring {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.maturity-ring svg { transform: rotate(-90deg); }

.maturity-ring-text {
  position: absolute;
  text-align: center;
}

/* ================================================================
   SCENARIO CARDS
   ================================================================ */

.scenario-card {
  background: var(--surface-card);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-lg);
  padding: 20px;
  cursor: pointer;
  transition: all var(--transition-med);
  position: relative;
  overflow: hidden;
}

.scenario-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; bottom: 0;
  width: 3px;
  background: var(--grad-brand);
  border-radius: 0 0 0 var(--radius-lg);
  opacity: 0;
  transition: opacity var(--transition-med);
}

.scenario-card:hover {
  border-color: rgba(37,99,235,0.3);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.scenario-card:hover::before,
.scenario-card.active-scenario::before { opacity: 1; }
.scenario-card.active-scenario {
  border-color: rgba(37,99,235,0.4);
  background: rgba(37,99,235,0.06);
}

.scenario-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 12px;
}

.scenario-status {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.72rem;
  color: var(--text-muted);
}

.scenario-metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--surface-border);
}

.scenario-metric {
  text-align: center;
}

.scenario-metric-value {
  font-size: 0.95rem;
  font-weight: 700;
}

.scenario-metric-label {
  font-size: 0.65rem;
  color: var(--text-muted);
  margin-top: 1px;
}

/* ================================================================
   ARCHITECTURE DIAGRAM
   ================================================================ */

.arch-canvas {
  background: var(--brand-950);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-lg);
  position: relative;
  overflow: hidden;
  min-height: 480px;
}

.arch-node {
  position: absolute;
  background: var(--surface-elevated);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  font-size: 0.72rem;
  font-weight: 500;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition-fast);
  min-width: 80px;
}

.arch-node:hover {
  border-color: var(--brand-400);
  box-shadow: 0 0 12px rgba(37,99,235,0.3);
  z-index: 10;
}

.arch-node-icon {
  width: 32px; height: 32px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
}

.arch-layer {
  position: absolute;
  border-radius: var(--radius-md);
  border: 1px dashed;
  padding: 8px 12px;
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.arch-svg-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

/* ================================================================
   CALCULATION ENGINE
   ================================================================ */

.formula-card {
  background: var(--surface-card);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 10px;
  transition: all var(--transition-fast);
}

.formula-card:hover { border-color: rgba(37,99,235,0.25); }

.formula-name {
  font-size: 0.82rem;
  font-weight: 600;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.formula-expr {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.78rem;
  color: var(--accent-400);
  background: rgba(6,182,212,0.06);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(6,182,212,0.15);
  word-break: break-all;
  line-height: 1.8;
}

.formula-params {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.formula-param {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72rem;
  color: var(--violet-400);
  background: rgba(139,92,246,0.08);
  padding: 2px 8px;
  border-radius: 4px;
  border: 1px solid rgba(139,92,246,0.2);
}

/* ================================================================
   RADAR / SPIDER CHART CONTAINER
   ================================================================ */

.chart-container {
  position: relative;
  width: 100%;
}

.chart-container canvas { max-width: 100%; }

/* ================================================================
   COMPARISON TABLE
   ================================================================ */

.comparison-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.82rem;
}

.comparison-table th {
  background: var(--surface-elevated);
  padding: 12px 16px;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--surface-border);
  font-weight: 600;
}

.comparison-table th:first-child { width: 200px; }
.comparison-table th.highlight { background: rgba(37,99,235,0.12); color: var(--brand-300); }

.comparison-table td {
  padding: 11px 16px;
  border-bottom: 1px solid var(--surface-border);
  vertical-align: middle;
}

.comparison-table td.row-label {
  color: var(--text-secondary);
  font-weight: 500;
  font-size: 0.78rem;
}

.comparison-table td.highlight { background: rgba(37,99,235,0.05); }
.comparison-table tr:hover td { background: var(--surface-hover); }
.comparison-table tr:hover td.highlight { background: rgba(37,99,235,0.1); }

.score-bar {
  display: flex;
  align-items: center;
  gap: 8px;
}

.score-bar-track {
  flex: 1;
  height: 6px;
  background: var(--gray-800);
  border-radius: 3px;
  overflow: hidden;
}

.score-bar-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.5s ease;
}

/* ================================================================
   SECURITY MODULE
   ================================================================ */

.security-domain-card {
  background: var(--surface-card);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-lg);
  padding: 20px;
  transition: all var(--transition-med);
}

.security-domain-card:hover { border-color: rgba(139,92,246,0.3); }

.domain-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.domain-icon {
  width: 40px; height: 40px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
}

.maturity-levels {
  display: flex;
  gap: 4px;
  margin-top: 12px;
}

.maturity-level {
  flex: 1;
  height: 6px;
  border-radius: 3px;
  background: var(--gray-800);
  transition: background var(--transition-med);
}

.maturity-level.filled { background: var(--grad-brand); }
.maturity-level.target { background: rgba(37,99,235,0.3); border: 1px dashed var(--brand-400); }

.gap-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px;
  background: rgba(239,68,68,0.06);
  border: 1px solid rgba(239,68,68,0.15);
  border-radius: var(--radius-md);
  margin-bottom: 8px;
  font-size: 0.82rem;
}

.recommendation-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px;
  background: rgba(16,185,129,0.06);
  border: 1px solid rgba(16,185,129,0.15);
  border-radius: var(--radius-md);
  margin-bottom: 8px;
  font-size: 0.82rem;
}

/* ================================================================
   CARBON MODULE
   ================================================================ */

.carbon-meter {
  position: relative;
  text-align: center;
  padding: 20px;
}

.carbon-donut {
  position: relative;
  display: inline-block;
}

.carbon-value-overlay {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
}

.carbon-domain-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--surface-border);
}

.carbon-domain-bar-track {
  flex: 1;
  height: 6px;
  background: var(--gray-800);
  border-radius: 3px;
  overflow: hidden;
}

.carbon-domain-bar-fill {
  height: 100%;
  border-radius: 3px;
  background: linear-gradient(90deg, #10b981, #34d399);
  transition: width 0.8s ease;
}

/* ================================================================
   PROJECT MODULE (Gantt-like Timeline)
   ================================================================ */

.timeline-wrapper {
  overflow-x: auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--surface-border);
}

.timeline-header {
  display: flex;
  background: var(--surface-elevated);
  border-bottom: 1px solid var(--surface-border);
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 600;
}

.timeline-label-col {
  width: 200px;
  min-width: 200px;
  padding: 10px 14px;
  border-right: 1px solid var(--surface-border);
}

.timeline-months {
  flex: 1;
  display: flex;
}

.timeline-month {
  flex: 1;
  min-width: 60px;
  padding: 10px 6px;
  text-align: center;
  border-right: 1px solid var(--surface-border);
}

.timeline-row {
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--surface-border);
  min-height: 42px;
}

.timeline-row-label {
  width: 200px;
  min-width: 200px;
  padding: 8px 14px;
  border-right: 1px solid var(--surface-border);
  font-size: 0.78rem;
  font-weight: 500;
}

.timeline-bars {
  flex: 1;
  position: relative;
  height: 42px;
  display: flex;
  align-items: center;
}

.timeline-bar {
  position: absolute;
  height: 22px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  padding: 0 8px;
  font-size: 0.68rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  transition: all var(--transition-med);
  cursor: pointer;
}

.timeline-bar:hover { filter: brightness(1.2); transform: scaleY(1.1); }

/* ================================================================
   CATALOG MODULE
   ================================================================ */

.catalog-card {
  background: var(--surface-card);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-lg);
  padding: 16px;
  transition: all var(--transition-med);
  cursor: pointer;
}

.catalog-card:hover {
  border-color: rgba(37,99,235,0.3);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.catalog-vendor-logo {
  width: 40px; height: 40px;
  border-radius: var(--radius-sm);
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}

.catalog-vendor-logo img {
  max-width: 36px;
  max-height: 36px;
  object-fit: contain;
}

.catalog-specs {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
  margin-top: 12px;
}

.catalog-spec {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.catalog-spec-label {
  font-size: 0.65rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.catalog-spec-value {
  font-size: 0.8rem;
  font-weight: 600;
}

.eol-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 0.65rem;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(239,68,68,0.12);
  color: #f87171;
  border: 1px solid rgba(239,68,68,0.2);
}

/* ================================================================
   MODAL
   ================================================================ */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(2,6,23,0.75);
  backdrop-filter: blur(8px);
  z-index: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.2s ease;
}

.modal {
  background: var(--surface-modal);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 640px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  animation: scaleIn 0.25s ease;
}

.modal-lg { max-width: 860px; }
.modal-xl { max-width: 1100px; }

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

.modal-title { font-size: 1rem; font-weight: 700; }

.modal-close {
  width: 30px; height: 30px;
  border-radius: var(--radius-sm);
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}
.modal-close:hover { background: var(--surface-hover); color: var(--text-primary); }

.modal-body { padding: 24px; }
.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--surface-border);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  position: sticky;
  bottom: 0;
  background: var(--surface-modal);
}

/* ================================================================
   NOTIFICATION / TOAST
   ================================================================ */

#toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  background: var(--surface-elevated);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.82rem;
  box-shadow: var(--shadow-md);
  animation: slideInRight 0.3s ease;
  pointer-events: auto;
  max-width: 320px;
  min-width: 260px;
}

.toast.success { border-left: 3px solid var(--success); }
.toast.error { border-left: 3px solid var(--danger); }
.toast.warning { border-left: 3px solid var(--warning); }
.toast.info { border-left: 3px solid var(--brand-400); }

.toast-icon { font-size: 0.9rem; flex-shrink: 0; }
.toast-dismiss {
  margin-left: auto;
  cursor: pointer;
  color: var(--text-muted);
  padding: 2px;
}

/* ================================================================
   EXPLAIN PANEL (Calculation transparency)
   ================================================================ */

.explain-panel {
  background: var(--brand-900);
  border: 1px solid rgba(37,99,235,0.2);
  border-radius: var(--radius-lg);
  padding: 16px;
  animation: fadeIn 0.2s ease;
}

.explain-title {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--brand-300);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.explain-step {
  display: flex;
  gap: 10px;
  padding: 6px 0;
  font-size: 0.78rem;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}
.explain-step:last-child { border-bottom: none; }

.explain-step-num {
  width: 20px; height: 20px;
  background: rgba(37,99,235,0.2);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--brand-300);
  flex-shrink: 0;
}

.explain-code {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  color: var(--accent-300);
  background: rgba(6,182,212,0.05);
  padding: 6px 10px;
  border-radius: 4px;
  margin-top: 6px;
  word-break: break-all;
}

/* ================================================================
   IMPORT DROPZONE
   ================================================================ */

.dropzone {
  border: 2px dashed var(--surface-border);
  border-radius: var(--radius-lg);
  padding: 40px;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition-med);
  background: var(--surface-card);
}

.dropzone:hover, .dropzone.drag-over {
  border-color: var(--brand-400);
  background: rgba(37,99,235,0.04);
}

.dropzone-icon {
  font-size: 2rem;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.dropzone.drag-over .dropzone-icon { color: var(--brand-400); animation: float 1s ease infinite; }

/* ================================================================
   DASHBOARD — Network topology SVG animation
   ================================================================ */

.network-animation {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-lg);
  background: var(--brand-950);
  border: 1px solid var(--surface-border);
}

.network-animation svg circle.pulse-ring {
  animation: networkPulse 2s ease-out infinite;
  transform-origin: center;
}

/* ================================================================
   EMPTY STATE
   ================================================================ */

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

.empty-state-icon {
  font-size: 3rem;
  color: var(--text-muted);
  margin-bottom: 16px;
  opacity: 0.5;
}

.empty-state h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text-primary);
}

.empty-state p { font-size: 0.82rem; max-width: 320px; margin: 0 auto 20px; }

/* ================================================================
   METHODOLOGY PAGE
   ================================================================ */

.source-item {
  display: flex;
  gap: 12px;
  padding: 14px;
  background: var(--surface-card);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-md);
  margin-bottom: 8px;
  transition: all var(--transition-fast);
}

.source-item:hover { border-color: rgba(37,99,235,0.25); }

.source-num {
  width: 24px; height: 24px;
  background: rgba(37,99,235,0.15);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--brand-300);
  flex-shrink: 0;
}

/* ================================================================
   RESPONSIVE
   ================================================================ */

@media (max-width: 768px) {
  :root { --sidebar-width: 240px; }

  #sidebar {
    position: fixed;
    top: 0; left: 0; bottom: 0;
    z-index: 200;
    transform: translateX(-100%);
    transition: transform var(--transition-slow);
  }

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

  #main-wrapper { width: 100%; }
  #main-content { padding: 16px; }

  .landing-nav { padding: 16px 20px; }
  .landing-hero { padding: 60px 20px 40px; }
  .landing-stats { gap: 24px; padding: 20px; }
  .landing-features { padding: 40px 20px; }

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

  .page-header { flex-direction: column; }
  .page-header .flex { flex-wrap: wrap; }

  .scenario-metrics { grid-template-columns: repeat(3, 1fr); gap: 4px; }

  .auth-modal { margin: 16px; }

  .modal { margin: 0; max-height: 100vh; border-radius: 0; }
}

@media (max-width: 480px) {
  .grid-4, .grid-3, .grid-2 { grid-template-columns: 1fr; }
  .kpi-value { font-size: 1.4rem; }
}

/* ================================================================
   MISC / EXTRA
   ================================================================ */

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

.code-block {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.78rem;
  background: var(--brand-900);
  border: 1px solid rgba(37,99,235,0.15);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  color: var(--accent-300);
  overflow-x: auto;
  line-height: 1.8;
}

.section-title {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-title::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--surface-border);
}

.glassmorphism {
  background: rgba(17,24,39,0.7);
  backdrop-filter: blur(16px);
  border: 1px solid var(--surface-border);
}

/* Loading skeleton */
.skeleton {
  background: linear-gradient(
    90deg,
    var(--surface-elevated) 25%,
    var(--surface-hover) 50%,
    var(--surface-elevated) 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-sm);
}

/* ----------------------------------------------------------------
   Scrollable horizontal chip row
   ---------------------------------------------------------------- */
.chip-row {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
  padding-bottom: 2px;
}
.chip-row::-webkit-scrollbar { display: none; }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 100px;
  font-size: 0.72rem;
  font-weight: 500;
  background: var(--surface-elevated);
  border: 1px solid var(--surface-border);
  white-space: nowrap;
  cursor: pointer;
  transition: all var(--transition-fast);
  flex-shrink: 0;
}
.chip:hover, .chip.active {
  background: rgba(37,99,235,0.15);
  border-color: rgba(37,99,235,0.3);
  color: var(--brand-300);
}

/* ----------------------------------------------------------------
   Vendor / operator logo pill
   ---------------------------------------------------------------- */
.vendor-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--surface-elevated);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-sm);
  padding: 4px 10px;
  font-size: 0.75rem;
  font-weight: 500;
}

.vendor-pill img {
  width: 18px; height: 18px;
  object-fit: contain;
  border-radius: 2px;
}

.vendor-placeholder {
  width: 18px; height: 18px;
  background: var(--grad-brand);
  border-radius: 3px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.55rem;
  font-weight: 800;
  color: #fff;
}

/* ----------------------------------------------------------------
   Sidebar mobile overlay
   ---------------------------------------------------------------- */
#sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 150;
}

@media (max-width: 768px) {
  #sidebar-overlay.visible { display: block; }
}

/* ----------------------------------------------------------------
   BOM table extra
   ---------------------------------------------------------------- */
.bom-row-total td {
  font-weight: 700;
  background: rgba(37,99,235,0.06);
  border-top: 2px solid rgba(37,99,235,0.2);
}

/* Pulse animated dot for "live" indicators */
.live-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--success);
  animation: pulse 1.5s ease infinite;
}

/* ----------------------------------------------------------------
   WORLD MAP placeholder
   ---------------------------------------------------------------- */
.world-map-placeholder {
  width: 100%;
  height: 220px;
  background: var(--brand-950);
  border-radius: var(--radius-lg);
  border: 1px solid var(--surface-border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 0.82rem;
  position: relative;
  overflow: hidden;
}

.world-map-placeholder::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 50% 60%, rgba(37,99,235,0.08) 0%, transparent 70%);
}

/* ----------------------------------------------------------------
   Weighted score bar
   ---------------------------------------------------------------- */
.weighted-score-bar {
  height: 24px;
  border-radius: 4px;
  overflow: hidden;
  display: flex;
  background: var(--gray-800);
}

.weighted-score-segment {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  font-weight: 700;
  color: rgba(255,255,255,0.9);
  white-space: nowrap;
  overflow: hidden;
  transition: flex 0.6s ease;
}

/* ----------------------------------------------------------------
   Sidebar collapse toggle
   ---------------------------------------------------------------- */
.sidebar-toggle {
  width: 100%;
  padding: 8px 10px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.75rem;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
}
.sidebar-toggle:hover { background: var(--surface-hover); color: var(--text-primary); }

/* ================================================================
   ADDITIONAL UTILITIES (missing classes)
   ================================================================ */

.font-mono { font-family: 'JetBrains Mono', monospace; }
.text-xs   { font-size: 0.72rem; }
.text-sm   { font-size: 0.82rem; }
.text-base { font-size: 0.9rem; }
.mb-1 { margin-bottom: 4px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 12px; }
.flex-wrap { flex-wrap: wrap; }
.items-start { align-items: flex-start; }
.flex-1 { flex: 1; }
.min-w-0 { min-width: 0; }
.overflow-x-auto { overflow-x: auto; }
.gap-1 { gap: 4px; }
.gap-3 { gap: 12px; }
.font-semibold { font-weight: 600; }
.font-bold  { font-weight: 700; }
.font-extrabold { font-weight: 800; }
.text-right { text-align: right; }
.text-center { text-align: center; }
.italic { font-style: italic; }
.uppercase { text-transform: uppercase; }
.tracking-wide { letter-spacing: 0.05em; }
.inline-flex { display: inline-flex; }
.cursor-pointer { cursor: pointer; }
.select-none { user-select: none; }
.pointer-none { pointer-events: none; }
.break-all { word-break: break-all; }
.whitespace-nowrap { white-space: nowrap; }

/* SVG arch overlay correction */
.arch-svg-overlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
}
.arch-node { z-index: 2; }

/* Sidebar toggle icon */
#sidebar-toggle-icon { transition: transform var(--transition-med); }
#sidebar.collapsed #sidebar-toggle-icon { transform: rotate(180deg); }

/* Section header right-aligned  */
.section-header-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 8px;
}

/* Gradient text utility */
.gradient-text {
  background: var(--grad-brand);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Sidebar collapse — hide active scenario block */
#sidebar.collapsed .sidebar-scroll > div:first-child { display: none; }

/* Comparison table highlighted header */
.comparison-table th.highlight { background: rgba(37,99,235,0.15); color: var(--brand-300); }
.comparison-table td.highlight { background: rgba(37,99,235,0.06); }

/* ================================================================
   SCENARIO DEEP DIVE (arch diagram improvement)
   ================================================================ */

.arch-canvas {
  min-height: 420px;
  background: linear-gradient(180deg, rgba(2,6,23,0.95) 0%, rgba(10,15,30,0.98) 100%);
}

.arch-node {
  min-width: 90px;
  max-width: 110px;
  font-size: 0.68rem;
  line-height: 1.3;
  text-align: center;
}

/* ================================================================
   SIDEBAR-BOTTOM user menu
   ================================================================ */

.sidebar-bottom .nav-item { margin-bottom: 0; }
.sidebar-bottom .nav-item:hover { background: var(--surface-hover); }

/* ================================================================
   Topbar sidebar-toggle button (mobile)
   ================================================================ */

#menu-btn { display: none; }

@media (max-width: 900px) {
  #menu-btn { display: flex; }
}

/* ================================================================
   Enhanced table: row total
   ================================================================ */

tr.bom-row-total td {
  font-weight: 700;
  background: rgba(37,99,235,0.07);
  border-top: 2px solid rgba(37,99,235,0.2);
  padding-top: 12px;
  padding-bottom: 12px;
}

/* ================================================================
   Carbon domain bar width fix
   ================================================================ */

.carbon-domain-row .carbon-domain-bar-track {
  flex: 1;
  min-width: 60px;
}

/* ================================================================
   Formula card list grid
   ================================================================ */

#formula-list .formula-card {
  margin-bottom: 0;
}

/* ================================================================
   Security architecture control grid
   ================================================================ */

.security-arch-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px,1fr));
  gap: 12px;
}

/* ================================================================
   Live badge pulse improvement
   ================================================================ */

.live-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 0 rgba(16,185,129,0.5);
  animation: livePulse 1.8s ease infinite;
  flex-shrink: 0;
}

@keyframes livePulse {
  0%   { box-shadow: 0 0 0 0 rgba(16,185,129,0.5); }
  70%  { box-shadow: 0 0 0 8px rgba(16,185,129,0); }
  100% { box-shadow: 0 0 0 0 rgba(16,185,129,0); }
}

/* ================================================================
   Chip item active state
   ================================================================ */

.chip.active {
  background: rgba(37,99,235,0.18);
  border-color: rgba(37,99,235,0.35);
  color: var(--brand-300);
  font-weight: 600;
}

/* ================================================================
   Chart canvas default height
   ================================================================ */

canvas { display: block; }

/* ================================================================
   Utility: flex gap row
   ================================================================ */

.flex-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

/* ================================================================
   Landing page section-title light override
   ================================================================ */

#landing-page .section-title {
  color: var(--text-muted);
}

/* ================================================================
   BOM table wrapper fix for overflow
   ================================================================ */

.table-wrapper {
  border-radius: var(--radius-md);
}

/* ================================================================
   Sidebar section label padding fix
   ================================================================ */

.sidebar-section-label {
  margin-top: 8px;
}

/* ================================================================
   Animate fade-in delay variants
   ================================================================ */

.animate-fade-in-up.delay-1 { animation-delay: 0.1s; }
.animate-fade-in-up.delay-2 { animation-delay: 0.2s; }
.animate-fade-in-up.delay-3 { animation-delay: 0.3s; }

/* ================================================================
   End of stylesheet
   ================================================================ */
