@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
  /* Core Palette - Clean dark with a subtle warm tint */
  --bg-base:       #0d0f14;
  --bg-surface:    #13161e;
  --bg-elevated:   #1a1e2a;
  --bg-hover:      rgba(255,255,255,0.04);
  --bg-active:     rgba(99,102,241,0.12);

  /* Accent - Indigo / Violet */
  --accent:        #6366f1;
  --accent-light:  #818cf8;
  --accent-glow:   rgba(99,102,241,0.25);

  /* Text */
  --text-primary:   #ffffff;
  --text-secondary: #cbd5e1;
  --text-muted:     #64748b;

  /* Borders */
  --border:         rgba(255,255,255,0.06);
  --border-strong:  rgba(255,255,255,0.12);

  /* Status */
  --green:  #22c55e;
  --yellow: #eab308;
  --red:    #ef4444;
  --blue:   #38bdf8;
  --status-success: var(--green);
  --status-warning: var(--yellow);
  
  --bg-success-subtle: rgba(34,197,94,0.1);
  --bg-warning-subtle: rgba(234,179,8,0.1);
  --bg-success-subtle-hover: rgba(34,197,94,0.2);
  --bg-warning-subtle-hover: rgba(234,179,8,0.2);
  
  --badge-bg: rgba(255,255,255,0.05);
  --badge-bg-hover: rgba(255,255,255,0.1);

  /* OSI/TCP Layers */
  --layer-app-border: #a78bfa;
  --layer-trans-border: #60a5fa;
  --layer-net-border: #34d399;
  --layer-link-border: #fbbf24;
  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 16px;
  --r-xl: 24px;

/* Animations */
@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

  /* Font */
  --font: 'Inter', system-ui, sans-serif;
}

html.light {
  --bg-base:       #f8fafc;
  --bg-surface:    #ffffff;
  --bg-elevated:   #f1f5f9;
  --bg-hover:      rgba(0,0,0,0.04);
  --bg-active:     rgba(99,102,241,0.12);

  --accent:        #4f46e5;
  --accent-light:  #6366f1;
  --accent-glow:   rgba(99,102,241,0.2);

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

  --border:         rgba(0,0,0,0.08);
  --border-strong:  rgba(0,0,0,0.15);

  --green:  #16a34a;
  --yellow: #b45309;
  --red:    #dc2626;
  --blue:   #0284c7;
  --status-success: var(--green);
  --status-warning: var(--yellow);
  
  --bg-success-subtle: rgba(22,163,74,0.15);
  --bg-warning-subtle: rgba(180,83,9,0.15);
  --bg-success-subtle-hover: rgba(22,163,74,0.25);
  --bg-warning-subtle-hover: rgba(180,83,9,0.25);
  
  --badge-bg: rgba(0,0,0,0.04);
  --badge-bg-hover: rgba(0,0,0,0.08);

  --layer-app-border: #6d28d9;
  --layer-trans-border: #1d4ed8;
  --layer-net-border: #047857;
  --layer-link-border: #b45309;
}

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

html { font-size: 15px; }

body {
  font-family: var(--font);
  background: var(--bg-base);
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
  line-height: 1.6;
  min-height: 100vh;
}

/* Scrollbar */

::-webkit-scrollbar { width: 5px; height: 5px; }

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

::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 99px; }

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

/* Animations */

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

.animate-fade-in { animation: fadeUp 0.3s ease forwards; }

.delay-100 { animation-delay: 60ms;  opacity: 0; }

.delay-200 { animation-delay: 120ms; opacity: 0; }

.delay-300 { animation-delay: 180ms; opacity: 0; }

/* Text gradient */

.text-gradient {
  background: linear-gradient(135deg, #818cf8 0%, #a78bfa 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Buttons */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 18px;
  border-radius: var(--r-lg);
  font-family: var(--font);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  border: none;
  transition: all 0.2s;
}

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

.btn-primary:hover {
  background: var(--accent-light);
  transform: translateY(-1px);
}

/* Glass panel → replaced with flat surface */

.glass-panel {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
}

/* Section */

.config-section { padding: 1.75rem; }

.section-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 1.25rem;
}

.section-title {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text-primary);
}

.summary-card-icon { color: var(--accent-light); }

/* Tables */

.data-table-container { overflow-x: auto; }

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.875rem;
}

.data-table th {
  padding: 10px 14px;
  color: var(--text-muted);
  font-weight: 500;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  border-bottom: 1px solid var(--border);
}

.data-table td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  color: var(--text-secondary);
}

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

.data-table tbody tr { transition: background 0.15s; }

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

/* Badges */

.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 99px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.badge-success { background: var(--bg-success-subtle); color: var(--green); }

.badge-warning { background: var(--bg-warning-subtle); color: var(--yellow); }

.badge-error   { background: rgba(239,68,68,0.1);  color: var(--red); }

.badge-info    { background: rgba(56,189,248,0.1); color: var(--blue); }

.badge-neutral { background: rgba(75,85,99,0.25);  color: var(--text-secondary); }

/* Guide Section Styling */

.guide-container {
  max-width: 1000px;
  margin: 4rem auto;
  padding: 0 2rem;
}

.guide-header {
  text-align: center;
  margin-bottom: 3rem;
}

.guide-title {
  font-size: 2.25rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
  background: linear-gradient(135deg, var(--text-primary) 0%, var(--text-muted) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.guide-meta {
  font-size: 0.875rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
}

.guide-grid {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 2.5rem;
  align-items: start;
}

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

.guide-nav {
  position: sticky;
  top: 2rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 0.5rem;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
}

.guide-nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  border-radius: var(--r-md);
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  border: none;
  background: transparent;
  text-align: left;
}

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

.guide-nav-item.active {
  background: var(--bg-active);
  color: var(--accent-light);
}

.guide-content-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: 2.5rem;
  min-height: 500px;
}

.guide-content-header {
  margin-bottom: 2rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 1.5rem;
}

.guide-content-title {
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 12px;
}

.guide-content-description {
  color: var(--text-secondary);
  line-height: 1.7;
}

.info-box-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.5rem;
  margin: 2rem 0;
}

.info-box {
  padding: 1.5rem;
  border-radius: var(--r-lg);
  background: var(--bg-base);
  border: 1px solid var(--border);
}

.info-box h5 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 8px;
}

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

.info-box li {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.info-box li::before {
  content: '•';
  color: var(--accent);
  font-weight: bold;
}

.tip-box {
  margin: 1.5rem 0;
  padding: 1.25rem;
  border-radius: var(--r-md);
  background: var(--bg-success-subtle);
  border: 1px solid rgba(34, 197, 94, 0.2);
  display: flex;
  gap: 12px;
  font-size: 0.9rem;
  line-height: 1.5;
}

.tip-box.warning {
  background: var(--bg-warning-subtle);
  border: 1px solid rgba(234, 179, 8, 0.2);
}

.tip-box-icon {
  flex-shrink: 0;
  margin-top: 2px;
}

.step-card {
  margin-bottom: 1.5rem;
  padding: 1.5rem;
  border-radius: var(--r-lg);
  background: var(--bg-base);
  border: 1px solid var(--border);
}

.step-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 1rem;
}

.step-badge {
  background: var(--accent);
  color: white;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 700;
}

.step-card h5 {
  font-size: 1.1rem;
  font-weight: 600;
}

.code-block-wrapper {
  margin: 1.25rem 0;
  border-radius: var(--r-md);
  overflow: hidden;
  background: #000;
  border: 1px solid var(--border-strong);
}

.code-block-header {
  background: #1a1a1a;
  padding: 8px 16px;
  font-size: 0.75rem;
  color: var(--text-muted);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.code-block-content {
  padding: 16px;
  overflow-x: auto;
}

.code-block-content code {
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  font-size: 0.85rem;
  color: #e2e8f0;
  white-space: pre;
}

.visual-connection {
  padding: 1.5rem;
  background: var(--bg-surface);
  border-radius: var(--r-md);
  text-align: center;
  font-family: monospace;
  font-size: 0.9rem;
  color: var(--text-secondary);
  border: 1px dashed var(--border-strong);
}

.highlight {
  color: var(--accent-light);
  font-weight: 600;
}

/* ─── React Flow Controls ────────────────────────────────────── */

.react-flow__controls {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  border-radius: var(--r-md);
  overflow: hidden;
}

.react-flow__controls-button {
  background: var(--bg-surface) !important;
  border-bottom: 1px solid var(--border) !important;
  color: var(--text-primary) !important;
  fill: var(--text-primary) !important;
  transition: background 0.2s, fill 0.2s !important;
}

.react-flow__controls-button:last-child {
  border-bottom: none !important;
}

.react-flow__controls-button:hover {
  background: var(--bg-hover) !important;
}

.react-flow__controls-button svg {
  fill: currentColor !important;
}

/* Light mode overrides for React Flow Controls */

html.light .react-flow__controls-button {
  background: var(--bg-surface) !important;
  color: var(--text-primary) !important;
  fill: var(--text-primary) !important;
}
/* ─── App Shell ─────────────────────────────────────────────── */
.app-container {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ─── Top header bar ─────────────────────────────────────────── */
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 28px;
  height: 56px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-surface);
  position: sticky;
  top: 0;
  z-index: 20;
  flex-shrink: 0;
}

.header-title {
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.header-subtitle {
  display: none; /* hidden on dashboard view, shown in uploader */
}

.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
}

/* ─── Uploader page ──────────────────────────────────────────── */
.uploader-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1;
  padding: 4rem 2rem;
  text-align: center;
  border: 1.5px dashed var(--border-strong);
  border-radius: var(--r-xl);
  cursor: pointer;
  transition: all 0.2s;
  background: var(--bg-surface);
  margin: 2rem;
}
.uploader-container:hover,
.uploader-container.drag-active {
  border-color: var(--accent);
  background: rgba(99,102,241,0.04);
}
.uploader-icon { color: var(--accent); margin-bottom: 1.25rem; }
.uploader-title { font-size: 1.35rem; font-weight: 600; margin-bottom: 0.4rem; }
.uploader-sub  { color: var(--text-secondary); font-size: 0.9rem; }
.file-input    { display: none; }
.uploader-error { margin-top: 1rem; color: var(--status-error); font-size: 0.9rem; font-weight: 600; }

/* ─── Landing Page ───────────────────────────────────────────── */
.landing-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 4rem 2rem;
  display: flex;
  flex-direction: column;
  gap: 6rem;
}

/* Hero Section */
.hero-section {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  align-items: center;
  gap: 4rem;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-active);
  color: var(--accent-light);
  padding: 6px 14px;
  border-radius: 99px;
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 2rem;
  border: 1px solid var(--accent-glow);
}

.hero-title {
  font-size: 3.5rem;
  font-weight: 800;
  line-height: 1.1;
  margin-bottom: 1.5rem;
  letter-spacing: -0.04em;
}

.hero-description {
  font-size: 1.2rem;
  color: var(--text-secondary);
  margin-bottom: 2.5rem;
  line-height: 1.6;
  max-width: 540px;
}

.hero-actions {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.btn-lg {
  padding: 14px 32px;
  font-size: 1rem;
  width: fit-content;
}

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

.demo-label {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 500;
}

.demo-buttons {
  display: flex;
  gap: 12px;
}

.demo-btn {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  color: var(--text-primary);
  padding: 8px 16px;
  border-radius: var(--r-md);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  transition: all 0.2s;
}

.demo-btn:hover {
  border-color: var(--accent);
  background: var(--bg-hover);
}

/* Hero Visual */
.hero-visual {
  position: relative;
}

.hero-image-container {
  position: relative;
  z-index: 1;
}

.hero-image {
  width: 100%;
  height: auto;
  filter: drop-shadow(0 20px 50px rgba(0,0,0,0.3));
  animation: float 6s ease-in-out infinite;
}

.hero-glow {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 140%;
  height: 140%;
  background: radial-gradient(circle, var(--accent-glow) 0%, transparent 70%);
  z-index: -1;
  filter: blur(40px);
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-20px); }
}

/* Info Section */
.info-section {
  display: flex;
  flex-direction: column;
  gap: 4rem;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
}

.feature-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  padding: 2rem;
  border-radius: var(--r-lg);
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.feature-icon { margin-bottom: 0.5rem; }
.feature-icon.success { color: var(--status-success); }
.feature-icon.accent { color: var(--accent); }
.feature-icon.blue { color: var(--blue); }

.feature-card h4 { font-size: 1.1rem; font-weight: 600; }
.feature-card p { font-size: 0.9rem; color: var(--text-secondary); line-height: 1.5; }

/* Tutorial Section */
.tutorial-section {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
}

.tutorial-toggle {
  width: 100%;
  padding: 1.5rem 2rem;
  background: none;
  border: none;
  display: flex;
  align-items: center;
  gap: 1rem;
  color: var(--text-primary);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
}

.tutorial-toggle:hover { background: var(--bg-hover); }

.tutorial-content {
  padding: 0 2rem 2rem;
  border-top: 1px solid var(--border);
}

.steps-container {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  margin-top: 1.5rem;
}

.step-item {
  display: flex;
  gap: 1rem;
}

.step-number {
  width: 28px;
  height: 28px;
  background: var(--accent);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 700;
  flex-shrink: 0;
}

.code-snippet {
  margin-top: 0.75rem;
  background: var(--bg-base);
  padding: 0.75rem;
  border-radius: var(--r-sm);
  font-family: monospace;
  font-size: 0.9rem;
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 8px;
}

.landing-footer {
  text-align: center;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.85rem;
}

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}
.animate-slide-down { animation: slideDown 0.3s ease-out forwards; }

@media (max-width: 968px) {
  .hero-section { grid-template-columns: 1fr; text-align: center; }
  .hero-description { margin-left: auto; margin-right: auto; }
  .hero-actions { align-items: center; }
  .features-grid { grid-template-columns: 1fr; }
}

/* ─── Dashboard layout (sidebar + main) ──────────────────────── */
.dashboard-layout {
  display: flex;
  flex: 1;
  min-height: calc(100vh - 56px);
}

/* ─── Sidebar ────────────────────────────────────────────────── */
.sidebar {
  width: 220px;
  flex-shrink: 0;
  background: var(--bg-surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  padding: 12px 8px 24px;
  position: sticky;
  top: 56px; /* Offset for header */
  height: calc(100vh - 56px);
  align-self: flex-start;
  transition: width 0.3s ease;
}

.sidebar-collapsed {
  width: 60px;
}

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

.sidebar-toggle {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  border-radius: var(--r-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.sidebar-toggle:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.sidebar-logo {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
  transition: all 0.3s ease;
}

.sidebar-collapsed .sidebar-logo {
  text-align: center;
  font-size: 0.7rem;
}

.sidebar-section-label {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 14px 12px 4px;
}

.sidebar-menu {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

/* Parent item */
.sidebar-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 12px;
  border-radius: var(--r-md);
  color: var(--text-secondary);
  font-size: 0.875rem;
  font-weight: 450;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  user-select: none;
  position: relative;
}

.sidebar-collapsed .sidebar-item {
  justify-content: center;
  padding: 7px 8px;
}

.sidebar-item-content {
  display: flex;
  align-items: center;
  gap: 9px;
  transition: all 0.3s ease;
}

.sidebar-collapsed .sidebar-item-content span {
  display: none;
}

.sidebar-item:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.sidebar-collapsed .sidebar-item:hover {
  background: var(--bg-hover);
}

.sidebar-collapsed .sidebar-item:hover::after {
  content: attr(title);
  position: absolute;
  left: 100%;
  top: 50%;
  transform: translateY(-50%);
  background: var(--bg-elevated);
  color: var(--text-primary);
  padding: 6px 12px;
  border-radius: var(--r-sm);
  font-size: 0.8rem;
  white-space: nowrap;
  z-index: 1000;
  border: 1px solid var(--border);
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  margin-left: 8px;
}

.sidebar-item.active,
.sidebar-item.parent-active {
  background: var(--bg-active);
  color: var(--accent-light);
}

.sidebar-item.active .sidebar-item-content svg,
.sidebar-item.parent-active .sidebar-item-content svg {
  color: var(--accent-light);
}

/* Chevron */
.sidebar-chevron {
  color: var(--text-muted);
  transition: transform 0.2s;
}
.sidebar-chevron.open { transform: rotate(90deg); }

/* Sub items */
.sidebar-submenus {
  display: flex;
  flex-direction: column;
  gap: 1px;
  margin: 2px 0 4px 28px;
  padding-left: 10px;
  border-left: 1px solid var(--border);
  transition: all 0.3s ease;
}

.sidebar-collapsed .sidebar-submenus {
  display: none;
}

.sidebar-subitem {
  padding: 5px 10px;
  font-size: 0.82rem;
  color: var(--text-secondary);
  cursor: pointer;
  border-radius: var(--r-sm);
  transition: background 0.15s, color 0.15s;
  user-select: none;
}
.sidebar-subitem:hover {
  color: var(--text-primary);
  background: var(--bg-hover);
}
.sidebar-subitem.active {
  color: var(--accent-light);
  font-weight: 600;
  background: var(--bg-active);
}

/* ─── Main content area ───────────────────────────────────────── */
.main-view {
  flex: 1;
  min-width: 0;
  overflow-y: auto;
  padding: 24px 28px;
  background: var(--bg-base);
}

/* ─── Overview grid ───────────────────────────────────────────── */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

.summary-card {
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.summary-card-header {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
}
.summary-card-value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1;
}

.card-hover { transition: border-color 0.2s; }
.card-hover:hover { border-color: var(--border-strong); }
/* this gets exported as style.css and can be used for the default theming */
/* these are the necessary styles for React Flow, they get used by base.css and style.css */
.react-flow {
  direction: ltr;
}
.react-flow__container {
  position: absolute;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
}
.react-flow__pane {
  z-index: 1;
  cursor: -webkit-grab;
  cursor: grab;
}
.react-flow__pane.selection {
    cursor: pointer;
  }
.react-flow__pane.dragging {
    cursor: -webkit-grabbing;
    cursor: grabbing;
  }
.react-flow__viewport {
  transform-origin: 0 0;
  z-index: 2;
  pointer-events: none;
}
.react-flow__renderer {
  z-index: 4;
}
.react-flow__selection {
  z-index: 6;
}
.react-flow__nodesselection-rect:focus,
.react-flow__nodesselection-rect:focus-visible {
  outline: none;
}
.react-flow .react-flow__edges {
  pointer-events: none;
  overflow: visible;
}
.react-flow__edge-path,
.react-flow__connection-path {
  stroke: #b1b1b7;
  stroke-width: 1;
  fill: none;
}
.react-flow__edge {
  pointer-events: visibleStroke;
  cursor: pointer;
}
.react-flow__edge.animated path {
    stroke-dasharray: 5;
    -webkit-animation: dashdraw 0.5s linear infinite;
            animation: dashdraw 0.5s linear infinite;
  }
.react-flow__edge.animated path.react-flow__edge-interaction {
    stroke-dasharray: none;
    -webkit-animation: none;
            animation: none;
  }
.react-flow__edge.inactive {
    pointer-events: none;
  }
.react-flow__edge.selected,
  .react-flow__edge:focus,
  .react-flow__edge:focus-visible {
    outline: none;
  }
.react-flow__edge.selected .react-flow__edge-path,
  .react-flow__edge:focus .react-flow__edge-path,
  .react-flow__edge:focus-visible .react-flow__edge-path {
    stroke: #555;
  }
.react-flow__edge-textwrapper {
    pointer-events: all;
  }
.react-flow__edge-textbg {
    fill: white;
  }
.react-flow__edge .react-flow__edge-text {
    pointer-events: none;
    -webkit-user-select: none;
       -moz-user-select: none;
            user-select: none;
  }
.react-flow__connection {
  pointer-events: none;
}
.react-flow__connection .animated {
    stroke-dasharray: 5;
    -webkit-animation: dashdraw 0.5s linear infinite;
            animation: dashdraw 0.5s linear infinite;
  }
.react-flow__connectionline {
  z-index: 1001;
}
.react-flow__nodes {
  pointer-events: none;
  transform-origin: 0 0;
}
.react-flow__node {
  position: absolute;
  -webkit-user-select: none;
     -moz-user-select: none;
          user-select: none;
  pointer-events: all;
  transform-origin: 0 0;
  box-sizing: border-box;
  cursor: -webkit-grab;
  cursor: grab;
}
.react-flow__node.dragging {
    cursor: -webkit-grabbing;
    cursor: grabbing;
  }
.react-flow__nodesselection {
  z-index: 3;
  transform-origin: left top;
  pointer-events: none;
}
.react-flow__nodesselection-rect {
    position: absolute;
    pointer-events: all;
    cursor: -webkit-grab;
    cursor: grab;
  }
.react-flow__handle {
  position: absolute;
  pointer-events: none;
  min-width: 5px;
  min-height: 5px;
  width: 6px;
  height: 6px;
  background: #1a192b;
  border: 1px solid white;
  border-radius: 100%;
}
.react-flow__handle.connectionindicator {
    pointer-events: all;
    cursor: crosshair;
  }
.react-flow__handle-bottom {
    top: auto;
    left: 50%;
    bottom: -4px;
    transform: translate(-50%, 0);
  }
.react-flow__handle-top {
    left: 50%;
    top: -4px;
    transform: translate(-50%, 0);
  }
.react-flow__handle-left {
    top: 50%;
    left: -4px;
    transform: translate(0, -50%);
  }
.react-flow__handle-right {
    right: -4px;
    top: 50%;
    transform: translate(0, -50%);
  }
.react-flow__edgeupdater {
  cursor: move;
  pointer-events: all;
}
.react-flow__panel {
  position: absolute;
  z-index: 5;
  margin: 15px;
}
.react-flow__panel.top {
    top: 0;
  }
.react-flow__panel.bottom {
    bottom: 0;
  }
.react-flow__panel.left {
    left: 0;
  }
.react-flow__panel.right {
    right: 0;
  }
.react-flow__panel.center {
    left: 50%;
    transform: translateX(-50%);
  }
.react-flow__attribution {
  font-size: 10px;
  background: rgba(255, 255, 255, 0.5);
  padding: 2px 3px;
  margin: 0;
}
.react-flow__attribution a {
    text-decoration: none;
    color: #999;
  }
@-webkit-keyframes dashdraw {
  from {
    stroke-dashoffset: 10;
  }
}
@keyframes dashdraw {
  from {
    stroke-dashoffset: 10;
  }
}
.react-flow__edgelabel-renderer {
  position: absolute;
  width: 100%;
  height: 100%;
  pointer-events: none;
  -webkit-user-select: none;
     -moz-user-select: none;
          user-select: none;
}
.react-flow__edge.updating .react-flow__edge-path {
      stroke: #777;
    }
.react-flow__edge-text {
    font-size: 10px;
  }
.react-flow__node.selectable:focus,
  .react-flow__node.selectable:focus-visible {
    outline: none;
  }
.react-flow__node-default,
.react-flow__node-input,
.react-flow__node-output,
.react-flow__node-group {
  padding: 10px;
  border-radius: 3px;
  width: 150px;
  font-size: 12px;
  color: #222;
  text-align: center;
  border-width: 1px;
  border-style: solid;
  border-color: #1a192b;
  background-color: white;
}
.react-flow__node-default.selectable:hover, .react-flow__node-input.selectable:hover, .react-flow__node-output.selectable:hover, .react-flow__node-group.selectable:hover {
      box-shadow: 0 1px 4px 1px rgba(0, 0, 0, 0.08);
    }
.react-flow__node-default.selectable.selected,
    .react-flow__node-default.selectable:focus,
    .react-flow__node-default.selectable:focus-visible,
    .react-flow__node-input.selectable.selected,
    .react-flow__node-input.selectable:focus,
    .react-flow__node-input.selectable:focus-visible,
    .react-flow__node-output.selectable.selected,
    .react-flow__node-output.selectable:focus,
    .react-flow__node-output.selectable:focus-visible,
    .react-flow__node-group.selectable.selected,
    .react-flow__node-group.selectable:focus,
    .react-flow__node-group.selectable:focus-visible {
      box-shadow: 0 0 0 0.5px #1a192b;
    }
.react-flow__node-group {
  background-color: rgba(240, 240, 240, 0.25);
}
.react-flow__nodesselection-rect,
.react-flow__selection {
  background: rgba(0, 89, 220, 0.08);
  border: 1px dotted rgba(0, 89, 220, 0.8);
}
.react-flow__nodesselection-rect:focus,
  .react-flow__nodesselection-rect:focus-visible,
  .react-flow__selection:focus,
  .react-flow__selection:focus-visible {
    outline: none;
  }
.react-flow__controls {
  box-shadow: 0 0 2px 1px rgba(0, 0, 0, 0.08);
}
.react-flow__controls-button {
    border: none;
    background: #fefefe;
    border-bottom: 1px solid #eee;
    box-sizing: content-box;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 16px;
    height: 16px;
    cursor: pointer;
    -webkit-user-select: none;
       -moz-user-select: none;
            user-select: none;
    padding: 5px;
  }
.react-flow__controls-button:hover {
      background: #f4f4f4;
    }
.react-flow__controls-button svg {
      width: 100%;
      max-width: 12px;
      max-height: 12px;
    }
.react-flow__controls-button:disabled {
      pointer-events: none;
    }
.react-flow__controls-button:disabled svg {
        fill-opacity: 0.4;
      }
.react-flow__minimap {
  background-color: #fff;
}
.react-flow__minimap svg {
  display: block;
}
.react-flow__resize-control {
  position: absolute;
}
.react-flow__resize-control.left,
.react-flow__resize-control.right {
  cursor: ew-resize;
}
.react-flow__resize-control.top,
.react-flow__resize-control.bottom {
  cursor: ns-resize;
}
.react-flow__resize-control.top.left,
.react-flow__resize-control.bottom.right {
  cursor: nwse-resize;
}
.react-flow__resize-control.bottom.left,
.react-flow__resize-control.top.right {
  cursor: nesw-resize;
}
/* handle styles */
.react-flow__resize-control.handle {
  width: 4px;
  height: 4px;
  border: 1px solid #fff;
  border-radius: 1px;
  background-color: #3367d9;
  transform: translate(-50%, -50%);
}
.react-flow__resize-control.handle.left {
  left: 0;
  top: 50%;
}
.react-flow__resize-control.handle.right {
  left: 100%;
  top: 50%;
}
.react-flow__resize-control.handle.top {
  left: 50%;
  top: 0;
}
.react-flow__resize-control.handle.bottom {
  left: 50%;
  top: 100%;
}
.react-flow__resize-control.handle.top.left {
  left: 0;
}
.react-flow__resize-control.handle.bottom.left {
  left: 0;
}
.react-flow__resize-control.handle.top.right {
  left: 100%;
}
.react-flow__resize-control.handle.bottom.right {
  left: 100%;
}
/* line styles */
.react-flow__resize-control.line {
  border-color: #3367d9;
  border-width: 0;
  border-style: solid;
}
.react-flow__resize-control.line.left,
.react-flow__resize-control.line.right {
  width: 1px;
  transform: translate(-50%, 0);
  top: 0;
  height: 100%;
}
.react-flow__resize-control.line.left {
  left: 0;
  border-left-width: 1px;
}
.react-flow__resize-control.line.right {
  left: 100%;
  border-right-width: 1px;
}
.react-flow__resize-control.line.top,
.react-flow__resize-control.line.bottom {
  height: 1px;
  transform: translate(0, -50%);
  left: 0;
  width: 100%;
}
.react-flow__resize-control.line.top {
  top: 0;
  border-top-width: 1px;
}
.react-flow__resize-control.line.bottom {
  border-bottom-width: 1px;
  top: 100%;
}
