/* ═══════════════════════════════════════════════════════
   OS Scheduler Visualizer — "Slate Forge" Theme
   Professional Casual Dark-First Design System
   ═══════════════════════════════════════════════════════ */

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

/* ─── CSS CUSTOM PROPERTIES ─── */
:root {
  /* Backgrounds */
  --bg-base:       #0e1117;
  --bg-surface:    #161b22;
  --bg-elevated:   #1c2333;
  --bg-input:      #212936;
  --bg-hover:      #253047;

  /* Accent Colors */
  --accent-primary:   #3b82f6;
  --accent-primary-h: #2563eb;
  --accent-cyan:      #06b6d4;
  --accent-cyan-h:    #0891b2;
  --accent-success:   #10b981;
  --accent-warning:   #f59e0b;
  --accent-danger:    #ef4444;
  --accent-purple:    #8b5cf6;
  --accent-amber:     #f59e0b;
  --accent-green:     #10b981;
  --accent-pink:      #ec4899;

  /* Text */
  --text-primary:   #f0f6fc;
  --text-secondary: #8b949e;
  --text-muted:     #484f58;
  --text-link:      #58a6ff;

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

  /* Glows */
  --glow-blue:    rgba(59, 130, 246, 0.3);
  --glow-cyan:    rgba(6, 182, 212, 0.3);
  --glow-success: rgba(16, 185, 129, 0.3);
  --glow-danger:  rgba(239, 68, 68, 0.3);

  /* Shadows */
  --shadow-sm:  0 1px 3px rgba(0, 0, 0, 0.4);
  --shadow-md:  0 4px 16px rgba(0, 0, 0, 0.5);
  --shadow-lg:  0 8px 32px rgba(0, 0, 0, 0.6);
  --shadow-xl:  0 20px 60px rgba(0, 0, 0, 0.7);

  /* Radii */
  --radius-sm:  6px;
  --radius-md:  10px;
  --radius-lg:  14px;
  --radius-xl:  18px;
  --radius-2xl: 24px;

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

  /* Fonts */
  --font-heading: 'Space Grotesk', system-ui, sans-serif;
  --font-body:    'Inter', system-ui, sans-serif;
  --font-mono:    'JetBrains Mono', 'Fira Code', monospace;
}

/* ─── LIGHT THEME OVERRIDES ─── */
[data-theme="light"] {
  --bg-base:       #f0f4f8;
  --bg-surface:    #ffffff;
  --bg-elevated:   #f8fafc;
  --bg-input:      #f1f5f9;
  --bg-hover:      #e2e8f0;

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

  --border-subtle:  rgba(0, 0, 0, 0.05);
  --border-default: rgba(0, 0, 0, 0.1);
  --border-strong:  rgba(0, 0, 0, 0.2);

  --shadow-sm:  0 1px 3px rgba(0, 0, 0, 0.08);
  --shadow-md:  0 4px 16px rgba(0, 0, 0, 0.1);
  --shadow-lg:  0 8px 32px rgba(0, 0, 0, 0.12);
  --shadow-xl:  0 20px 60px rgba(0, 0, 0, 0.15);
}

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

html {
  scroll-behavior: smooth;
}

/* ─── BODY & BACKGROUND ─── */
body {
  font-family: var(--font-body);
  background-color: var(--bg-base);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.6;
  transition: background-color var(--transition-slow), color var(--transition-slow);
  position: relative;
  overflow-x: hidden;
}

/* Dot-grid background */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: radial-gradient(circle, rgba(255,255,255,0.04) 1px, transparent 1px);
  background-size: 28px 28px;
  pointer-events: none;
  z-index: 0;
}

[data-theme="light"] body::before {
  background-image: radial-gradient(circle, rgba(0,0,0,0.07) 1px, transparent 1px);
}

/* ─── THEME TOGGLE ─── */
.theme-toggle {
  position: fixed;
  top: 20px;
  right: 20px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  transition: all var(--transition-base);
  z-index: 1000;
  box-shadow: var(--shadow-md);
  color: var(--text-primary);
}

.theme-toggle:hover {
  transform: scale(1.1) rotate(20deg);
  border-color: var(--accent-primary);
  box-shadow: 0 0 16px var(--glow-blue);
}

/* ─── SITE HEADER ─── */
.site-header {
  position: relative;
  z-index: 1;
  padding: 48px 24px 32px;
  max-width: 1280px;
  margin: 0 auto;
}

.header-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 20px;
}

.logo-group {
  display: flex;
  align-items: center;
  gap: 16px;
}

.logo-icon {
  flex-shrink: 0;
  filter: drop-shadow(0 0 12px var(--glow-blue));
}

h1 {
  font-family: var(--font-heading);
  font-size: clamp(1.5rem, 4vw, 2.25rem);
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.header-subtitle {
  font-size: 0.85rem;
  color: var(--text-secondary);
  font-weight: 400;
  margin-top: 2px;
  letter-spacing: 0.02em;
}

.header-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.badge {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
  letter-spacing: 0.03em;
  border: 1px solid transparent;
}

.badge-blue   { background: rgba(59,130,246,0.15); color: #60a5fa; border-color: rgba(59,130,246,0.3); }
.badge-cyan   { background: rgba(6,182,212,0.15);  color: #22d3ee; border-color: rgba(6,182,212,0.3);  }
.badge-purple { background: rgba(139,92,246,0.15); color: #a78bfa; border-color: rgba(139,92,246,0.3); }
.badge-amber  { background: rgba(245,158,11,0.15); color: #fbbf24; border-color: rgba(245,158,11,0.3); }
.badge-green  { background: rgba(16,185,129,0.15); color: #34d399; border-color: rgba(16,185,129,0.3); }

/* ─── MAIN CONTENT ─── */
.main-content {
  position: relative;
  z-index: 1;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px 64px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* ─── PANELS ─── */
.panel {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  transition: border-color var(--transition-base), box-shadow var(--transition-base);
  animation: panelFadeIn 0.4s ease-out both;
}

.panel:hover {
  border-color: var(--border-default);
}

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

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px;
  border-bottom: 1px solid var(--border-subtle);
  background: var(--bg-elevated);
  flex-wrap: wrap;
  gap: 12px;
}

.panel-title {
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

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

.panel-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.panel-body {
  padding: 24px;
}

/* ─── CONFIG PANEL ─── */
.config-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

.add-process-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 20px;
}

.add-process-title {
  font-family: var(--font-heading);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 6px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.process-inputs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}

.add-btn-row {
  display: flex;
  justify-content: flex-end;
}

/* ─── INPUTS & SELECTS ─── */
.input-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

label {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-secondary);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 4px;
}

.info-icon {
  color: var(--accent-primary);
  font-size: 0.75rem;
  opacity: 0.7;
}

input[type="text"],
input[type="number"],
select {
  width: 100%;
  padding: 10px 14px;
  font-size: 0.9rem;
  font-family: var(--font-body);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-default);
  background: var(--bg-input);
  color: var(--text-primary);
  transition: all var(--transition-fast);
  outline: none;
  appearance: none;
  -webkit-appearance: none;
}

input[type="number"] {
  font-family: var(--font-mono);
}

input[type="text"]:focus,
input[type="number"]:focus,
select:focus {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px var(--glow-blue);
  background: var(--bg-elevated);
}

input:hover,
select:hover {
  border-color: var(--border-strong);
}

select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%238b949e' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
  cursor: pointer;
}

/* ─── TOOLTIP ─── */
.tooltip-label {
  position: relative;
  cursor: help;
}

.tooltip-label::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  background: var(--bg-hover);
  color: var(--text-primary);
  border: 1px solid var(--border-default);
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 400;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-fast);
  z-index: 100;
  pointer-events: none;
  text-transform: none;
  letter-spacing: 0;
  box-shadow: var(--shadow-md);
}

.tooltip-label:hover::after {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

/* ─── BUTTONS ─── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 20px;
  font-family: var(--font-body);
  font-size: 0.875rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all var(--transition-base);
  position: relative;
  overflow: hidden;
  text-decoration: none;
  white-space: nowrap;
}

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

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

.btn:active { transform: scale(0.97); }

.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
}

.btn-primary {
  background: var(--accent-primary);
  color: #fff;
  border-color: var(--accent-primary);
  box-shadow: 0 2px 8px rgba(59,130,246,0.3);
}
.btn-primary:hover {
  background: var(--accent-primary-h);
  box-shadow: 0 4px 16px rgba(59,130,246,0.5);
  transform: translateY(-1px);
}

.btn-success {
  background: var(--accent-success);
  color: #fff;
  border-color: var(--accent-success);
  box-shadow: 0 2px 8px var(--glow-success);
}
.btn-success:hover {
  background: #059669;
  box-shadow: 0 4px 16px var(--glow-success);
  transform: translateY(-1px);
}

.btn-outline {
  background: transparent;
  color: var(--text-primary);
  border-color: var(--border-default);
}
.btn-outline:hover {
  background: var(--bg-elevated);
  border-color: var(--accent-primary);
  color: var(--accent-primary);
}

.btn-danger-outline {
  background: transparent;
  color: var(--accent-danger);
  border-color: rgba(239,68,68,0.4);
}
.btn-danger-outline:hover {
  background: rgba(239,68,68,0.1);
  border-color: var(--accent-danger);
  transform: translateY(-1px);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border-color: transparent;
  padding: 6px 12px;
}
.btn-ghost:hover {
  background: var(--bg-elevated);
  color: var(--text-primary);
  border-color: var(--border-default);
}

.btn-sm {
  font-size: 0.78rem;
  padding: 6px 12px;
}

/* ─── CONTROLS PANEL ─── */
.controls-panel .panel-header {
  flex-wrap: wrap;
  gap: 16px;
}

.controls-body {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px;
  justify-content: space-between;
}

.sim-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

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

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.status-dot.idle    { background: var(--text-muted); }
.status-dot.running { background: var(--accent-success); box-shadow: 0 0 8px var(--glow-success); animation: pulse 1.5s infinite; }
.status-dot.paused  { background: var(--accent-warning); box-shadow: 0 0 8px rgba(245,158,11,0.4); }
.status-dot.done    { background: var(--accent-purple); }

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: 0.6; transform: scale(1.3); }
}

/* Speed Slider */
.speed-control {
  display: flex;
  align-items: center;
  gap: 8px;
}

.speed-label {
  font-size: 0.8rem;
  color: var(--text-secondary);
  font-weight: 500;
  text-transform: none;
  letter-spacing: 0;
  white-space: nowrap;
}

.speed-hint {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-muted);
}

.speed-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100px;
  height: 4px;
  border-radius: 2px;
  background: var(--bg-hover);
  outline: none;
  cursor: pointer;
}

.speed-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--accent-primary);
  cursor: pointer;
  box-shadow: 0 0 8px var(--glow-blue);
  transition: transform var(--transition-fast);
}

.speed-slider::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}

.speed-slider::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--accent-primary);
  cursor: pointer;
  border: none;
  box-shadow: 0 0 8px var(--glow-blue);
}

/* ─── PROCESS QUEUE ─── */
.count-badge {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
  padding: 3px 8px;
  background: var(--bg-elevated);
  border-radius: 999px;
  border: 1px solid var(--border-subtle);
}

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

.empty-icon {
  font-size: 2.5rem;
  margin-bottom: 12px;
  opacity: 0.4;
}

.empty-state p {
  font-size: 0.875rem;
  line-height: 1.7;
  color: var(--text-muted);
}

/* Process Cards */
.process-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 16px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  margin-bottom: 10px;
  transition: all var(--transition-fast);
  position: relative;
  overflow: hidden;
  animation: slideInCard 0.35s ease-out both;
  border-left: 3px solid transparent;
}

@keyframes slideInCard {
  from { opacity: 0; transform: translateX(-20px); }
  to   { opacity: 1; transform: translateX(0); }
}

.process-card:hover {
  border-color: var(--border-default);
  background: var(--bg-hover);
  transform: translateX(4px);
}

.process-color-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.process-info {
  flex: 1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 16px;
  min-width: 0;
}

.process-pid {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
  min-width: 32px;
}

.process-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.meta-chip {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  padding: 2px 8px;
  border-radius: 4px;
  background: var(--bg-input);
  color: var(--text-secondary);
  border: 1px solid var(--border-subtle);
}

.process-status {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 999px;
  border: 1px solid transparent;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
}

.status-waiting  { background: rgba(245,158,11,0.12); color: #fbbf24; border-color: rgba(245,158,11,0.3); }
.status-running  { background: rgba(16,185,129,0.12); color: #34d399; border-color: rgba(16,185,129,0.3); }
.status-finished { background: rgba(139,92,246,0.12); color: #a78bfa; border-color: rgba(139,92,246,0.3); }

/* Progress bar */
.process-progress-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.progress-track {
  width: 90px;
  height: 5px;
  background: var(--bg-input);
  border-radius: 999px;
  overflow: hidden;
  flex-shrink: 0;
}

.progress-fill {
  height: 100%;
  border-radius: 999px;
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.progress-fill::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.25), transparent);
  animation: shimmer 2s infinite;
}

@keyframes shimmer {
  0%   { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

.progress-pct {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-muted);
  min-width: 28px;
}

.delete-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px 6px;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
  font-size: 1rem;
  line-height: 1;
  flex-shrink: 0;
}

.delete-btn:hover {
  background: rgba(239,68,68,0.15);
  color: var(--accent-danger);
}

/* ─── MEMORY VISUALIZATION ─── */
.memory-meta {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-secondary);
}

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

.memory-bar-wrapper {
  margin-bottom: 16px;
}

.memory-visual {
  display: flex;
  align-items: stretch;
  min-height: 56px;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border-subtle);
}

.mem-block {
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  color: #fff;
  padding: 6px 4px;
  min-width: 40px;
  transition: all var(--transition-base);
  cursor: default;
  position: relative;
  overflow: hidden;
  text-shadow: 0 1px 3px rgba(0,0,0,0.4);
}

.mem-block::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255,255,255,0.1) 0%, transparent 100%);
  pointer-events: none;
}

.mem-block:hover {
  z-index: 2;
  filter: brightness(1.15);
  transform: scaleY(1.04);
}

.mem-block.free {
  background: var(--bg-elevated) !important;
  color: var(--text-muted) !important;
  border-right: 1px solid var(--border-subtle);
  text-shadow: none;
}

.memory-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 12px;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  color: var(--text-secondary);
}

.legend-swatch {
  width: 12px;
  height: 12px;
  border-radius: 3px;
  flex-shrink: 0;
}

.legend-swatch.free {
  background: var(--bg-elevated);
  border: 1px solid var(--border-default);
}

/* ─── GANTT CHART ─── */
#gantt-scroll {
  overflow-x: auto;
  padding-bottom: 8px;
  scrollbar-width: thin;
  scrollbar-color: var(--border-default) transparent;
}

#gantt-scroll::-webkit-scrollbar { height: 5px; }
#gantt-scroll::-webkit-scrollbar-track { background: transparent; }
#gantt-scroll::-webkit-scrollbar-thumb { background: var(--border-default); border-radius: 999px; }

#gantt-chart {
  display: flex;
  align-items: flex-end;
  min-height: 64px;
  gap: 0;
  padding-bottom: 4px;
}

.gantt-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  color: #fff;
  height: 56px;
  min-width: 40px;
  border-radius: 6px;
  margin: 0 2px;
  position: relative;
  overflow: hidden;
  transition: transform var(--transition-fast), filter var(--transition-fast);
  cursor: default;
  text-shadow: 0 1px 3px rgba(0,0,0,0.5);
  border: 1px solid rgba(255,255,255,0.1);
  animation: ganttBlockIn 0.3s ease-out both;
}

@keyframes ganttBlockIn {
  from { opacity: 0; transform: scaleX(0); transform-origin: left; }
  to   { opacity: 1; transform: scaleX(1); }
}

.gantt-block::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255,255,255,0.12) 0%, transparent 60%);
  pointer-events: none;
}

.gantt-block:hover {
  transform: scaleY(1.06);
  filter: brightness(1.15);
  z-index: 2;
}

.gantt-block.idle {
  background: var(--bg-elevated) !important;
  color: var(--text-muted) !important;
  border: 1px dashed var(--border-default);
  text-shadow: none;
}

.gantt-axis {
  display: flex;
  min-height: 24px;
  padding: 0 2px;
  position: relative;
  margin-top: 2px;
}

.gantt-tick {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--text-muted);
  position: absolute;
  transform: translateX(-50%);
  top: 4px;
  white-space: nowrap;
}

/* ─── STATISTICS TABLE ─── */
.stats-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 16px;
  text-align: center;
  transition: all var(--transition-base);
  animation: statCardIn 0.4s ease-out both;
}

@keyframes statCardIn {
  from { opacity: 0; transform: scale(0.95); }
  to   { opacity: 1; transform: scale(1); }
}

.stat-card:hover {
  border-color: var(--border-default);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.stat-value {
  font-family: var(--font-mono);
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--accent-primary);
  line-height: 1;
  margin-bottom: 6px;
}

.stat-label {
  font-size: 0.75rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 500;
}

.stats-table-wrapper {
  overflow-x: auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-subtle);
  scrollbar-width: thin;
  scrollbar-color: var(--border-default) transparent;
}

.stats-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.stats-table thead th {
  padding: 12px 16px;
  background: var(--bg-elevated);
  color: var(--text-secondary);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  text-align: left;
  border-bottom: 1px solid var(--border-subtle);
  white-space: nowrap;
}

.stats-table tbody td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 0.82rem;
  transition: background var(--transition-fast);
}

.stats-table tbody td:first-child {
  font-weight: 600;
  color: var(--accent-primary);
}

.stats-table tbody tr:hover td {
  background: var(--bg-elevated);
}

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

/* ─── TOAST NOTIFICATIONS ─── */
#toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-primary);
  min-width: 260px;
  max-width: 360px;
  pointer-events: all;
  animation: toastSlideIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) both;
  border-left: 3px solid transparent;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

@keyframes toastSlideIn {
  from { opacity: 0; transform: translateX(100%) scale(0.9); }
  to   { opacity: 1; transform: translateX(0) scale(1); }
}

.toast-out {
  animation: toastSlideOut 0.25s ease-in forwards;
}

@keyframes toastSlideOut {
  to { opacity: 0; transform: translateX(110%) scale(0.95); }
}

.toast.success { border-left-color: var(--accent-success); }
.toast.error   { border-left-color: var(--accent-danger); }
.toast.info    { border-left-color: var(--accent-primary); }
.toast.warning { border-left-color: var(--accent-warning); }

.toast-icon { font-size: 1rem; flex-shrink: 0; }
.toast-msg  { flex: 1; line-height: 1.4; }

.toast-close {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 2px 4px;
  font-size: 1rem;
  line-height: 1;
  border-radius: var(--radius-sm);
  transition: color var(--transition-fast);
  pointer-events: all;
}

.toast-close:hover { color: var(--text-primary); }

/* Progress bar under toast */
.toast-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 2px;
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  animation: toastProgress 3s linear forwards;
}

.toast { position: relative; overflow: hidden; }
.toast.success .toast-progress { background: var(--accent-success); }
.toast.error   .toast-progress { background: var(--accent-danger); }
.toast.info    .toast-progress { background: var(--accent-primary); }
.toast.warning .toast-progress { background: var(--accent-warning); }

@keyframes toastProgress {
  from { width: 100%; }
  to   { width: 0%; }
}

/* ─── FOOTER ─── */
.site-footer {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 24px;
  color: var(--text-muted);
  font-size: 0.8rem;
  border-top: 1px solid var(--border-subtle);
  max-width: 1280px;
  margin: 0 auto;
}

.site-footer a {
  color: var(--text-link);
  text-decoration: none;
  transition: color var(--transition-fast);
}

.site-footer a:hover {
  color: var(--accent-primary);
  text-decoration: underline;
}

/* ─── RESPONSIVE ─── */
@media (max-width: 768px) {
  .site-header { padding: 32px 16px 20px; }
  .main-content { padding: 0 16px 48px; gap: 14px; }
  .header-content { flex-direction: column; align-items: flex-start; }
  .header-badges { display: none; }

  .panel-header { flex-direction: column; align-items: flex-start; }
  .panel-body { padding: 16px; }

  .config-row { grid-template-columns: 1fr; }
  .process-inputs-grid { grid-template-columns: repeat(2, 1fr); }

  .controls-body { flex-direction: column; align-items: flex-start; }
  .sim-buttons { width: 100%; }
  .sim-buttons .btn { flex: 1; justify-content: center; }

  .stats-summary { grid-template-columns: repeat(2, 1fr); }

  #toast-container { bottom: 16px; right: 16px; left: 16px; }
  .toast { min-width: auto; max-width: 100%; }
}

@media (max-width: 480px) {
  h1 { font-size: 1.3rem; }
  .process-inputs-grid { grid-template-columns: 1fr; }
  .stats-summary { grid-template-columns: 1fr 1fr; }
}

/* ─── UTILITIES ─── */
.hidden { display: none !important; }

/* Scrollbar global */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-default); border-radius: 999px; }
::-webkit-scrollbar-thumb:hover { background: var(--border-strong); }