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

:root {
  --bg-primary: #0a0e17;
  --bg-secondary: #111827;
  --bg-card: #1a1f2e;
  --border: #1e293b;
  --border-light: #2a3045;
  --accent-blue: #00aaff;
  --accent-red: #ef4444;
  --accent-amber: #f59e0b;
  --accent-green: #22c55e;
  --text-primary: #e2e8f0;
  --text-secondary: #94a3b8;
  --text-dim: #64748b;
  --glow-blue: 0 0 10px rgba(0,170,255,0.3);
  --glow-red: 0 0 10px rgba(239,68,68,0.3);
  --glow-green: 0 0 10px rgba(34,197,94,0.3);
  --glow-amber: 0 0 10px rgba(245,158,11,0.3);
}

body {
  background: var(--bg-primary);
  color: var(--text-primary);
  font-family: 'IBM Plex Sans', system-ui, sans-serif;
  overflow-x: hidden;
  min-height: 100vh;
}

/* Scan-line overlay */
body::after {
  content: '';
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  pointer-events: none;
  z-index: 9999;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0, 170, 255, 0.015) 2px,
    rgba(0, 170, 255, 0.015) 4px
  );
}

/* Grid pattern background */
#root {
  background-image: 
    linear-gradient(rgba(0,170,255,0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,170,255,0.03) 1px, transparent 1px);
  background-size: 40px 40px;
  min-height: 100vh;
}

/* Scrollbar styling */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: var(--bg-primary);
}
::-webkit-scrollbar-thumb {
  background: var(--border-light);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--accent-blue);
}

/* Pulsing animation */
@keyframes pulse-glow {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

@keyframes pulse-border {
  0%, 100% { border-color: var(--accent-blue); box-shadow: 0 0 10px rgba(0,170,255,0.3); }
  50% { border-color: rgba(0,170,255,0.5); box-shadow: 0 0 20px rgba(0,170,255,0.5); }
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

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

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

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

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

.animate-slide-in {
  animation: slideIn 0.3s ease-out;
}

.animate-fade-in {
  animation: fadeIn 0.5s ease-out;
}

.pulse-dot {
  animation: pulse-glow 2s ease-in-out infinite;
}

.blink-cursor {
  animation: blink 1s step-end infinite;
}

.pulse-border-anim {
  animation: pulse-border 2s ease-in-out infinite;
}

/* HUD bracket decorators */
.hud-bracket::before,
.hud-bracket::after {
  content: '';
  position: absolute;
  width: 8px;
  height: 8px;
  border-color: var(--accent-blue);
}
.hud-bracket::before {
  top: -1px; left: -1px;
  border-top: 2px solid;
  border-left: 2px solid;
}
.hud-bracket::after {
  bottom: -1px; right: -1px;
  border-bottom: 2px solid;
  border-right: 2px solid;
}

/* Military stencil text */
.stencil-text {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 800;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.mono {
  font-family: 'JetBrains Mono', monospace;
}

/* Card styling */
.cmd-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: 4px;
  position: relative;
}

.cmd-card-glow {
  box-shadow: inset 0 1px 0 rgba(0,170,255,0.1), 0 0 20px rgba(0,0,0,0.5);
}

/* Input styling */
.cmd-input {
  background: rgba(10, 14, 23, 0.8);
  border: 1px solid var(--border-light);
  color: var(--text-primary);
  font-family: 'IBM Plex Sans', system-ui;
  padding: 8px 12px;
  border-radius: 3px;
  width: 100%;
  transition: border-color 0.2s, box-shadow 0.2s;
  font-size: 14px;
}

.cmd-input:focus {
  outline: none;
  border-color: var(--accent-blue);
  box-shadow: 0 0 8px rgba(0,170,255,0.2);
}

.cmd-input::placeholder {
  color: var(--text-dim);
  font-style: italic;
}

.cmd-textarea {
  background: rgba(10, 14, 23, 0.8);
  border: 1px solid var(--border-light);
  color: var(--text-primary);
  font-family: 'IBM Plex Sans', system-ui;
  padding: 10px 12px;
  border-radius: 3px;
  width: 100%;
  min-height: 80px;
  resize: vertical;
  transition: border-color 0.2s, box-shadow 0.2s;
  font-size: 14px;
  line-height: 1.5;
}

.cmd-textarea:focus {
  outline: none;
  border-color: var(--accent-blue);
  box-shadow: 0 0 8px rgba(0,170,255,0.2);
}

.cmd-textarea::placeholder {
  color: var(--text-dim);
  font-style: italic;
}

/* Terminal feed */
.terminal-feed {
  background: rgba(0,0,0,0.5);
  border: 1px solid var(--border);
  border-radius: 3px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  line-height: 1.6;
  padding: 12px;
  max-height: 500px;
  overflow-y: auto;
}

/* Chip/badge */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 3px;
  font-size: 12px;
  font-weight: 500;
  border: 1px solid;
  cursor: pointer;
  transition: all 0.2s;
}

.chip-blue {
  background: rgba(0,170,255,0.1);
  border-color: rgba(0,170,255,0.3);
  color: var(--accent-blue);
}

.chip-red {
  background: rgba(239,68,68,0.1);
  border-color: rgba(239,68,68,0.3);
  color: var(--accent-red);
}

.chip-gray {
  background: rgba(148,163,184,0.1);
  border-color: rgba(148,163,184,0.3);
  color: var(--text-secondary);
}

.chip-green {
  background: rgba(34,197,94,0.1);
  border-color: rgba(34,197,94,0.3);
  color: var(--accent-green);
}

.chip-amber {
  background: rgba(245,158,11,0.1);
  border-color: rgba(245,158,11,0.3);
  color: var(--accent-amber);
}

/* Generate button */
.btn-generate {
  background: linear-gradient(135deg, rgba(0,170,255,0.2), rgba(0,170,255,0.1));
  border: 2px solid var(--accent-blue);
  color: var(--accent-blue);
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700;
  font-size: 16px;
  letter-spacing: 0.1em;
  padding: 14px 40px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.3s;
  text-transform: uppercase;
  position: relative;
  overflow: hidden;
}

.btn-generate:hover {
  background: linear-gradient(135deg, rgba(0,170,255,0.3), rgba(0,170,255,0.2));
  box-shadow: 0 0 30px rgba(0,170,255,0.4);
  transform: translateY(-1px);
}

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

.btn-generate.loading {
  pointer-events: none;
  opacity: 0.8;
}

.btn-generate.loading::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: linear-gradient(90deg, transparent, rgba(0,170,255,0.3), transparent);
  animation: progress-scan 1.5s ease-in-out infinite;
}

/* Nav sidebar */
.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  cursor: pointer;
  transition: all 0.2s;
  border-left: 3px solid transparent;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
}

.nav-item:hover {
  background: rgba(0,170,255,0.05);
  color: var(--text-primary);
}

.nav-item.active {
  border-left-color: var(--accent-blue);
  background: rgba(0,170,255,0.08);
  color: var(--accent-blue);
  box-shadow: inset 3px 0 10px rgba(0,170,255,0.1);
}

/* Gauge / meter */
.gauge-bar {
  height: 6px;
  background: rgba(255,255,255,0.1);
  border-radius: 3px;
  overflow: hidden;
  position: relative;
}

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

/* Stat card */
.stat-card {
  background: rgba(10,14,23,0.6);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 12px;
}

/* Grade badge */
.grade-badge {
  width: 60px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  font-family: 'JetBrains Mono', monospace;
  font-weight: 800;
  font-size: 24px;
  border: 2px solid;
}

/* Progress loading */
.loading-bar {
  height: 3px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
}

.loading-bar-fill {
  height: 100%;
  background: var(--accent-blue);
  border-radius: 2px;
  animation: progress-scan 2s ease-in-out infinite;
  width: 40%;
}

/* Camera feed overlay */
.camera-feed {
  position: relative;
  background: #000;
  border: 1px solid var(--border);
  border-radius: 2px;
  overflow: hidden;
  aspect-ratio: 16/10;
}

.camera-feed::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 1px,
    rgba(0,255,0,0.03) 1px,
    rgba(0,255,0,0.03) 2px
  );
  pointer-events: none;
  z-index: 2;
}

.camera-hud {
  position: absolute;
  top: 6px; left: 8px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 9px;
  color: rgba(0,255,0,0.8);
  z-index: 3;
  text-shadow: 0 0 4px rgba(0,255,0,0.5);
}

.camera-crosshair {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 40px; height: 40px;
  z-index: 3;
}

.camera-crosshair::before,
.camera-crosshair::after {
  content: '';
  position: absolute;
  background: rgba(0,255,0,0.4);
}

.camera-crosshair::before {
  top: 0; left: 50%;
  width: 1px; height: 100%;
  transform: translateX(-50%);
}

.camera-crosshair::after {
  top: 50%; left: 0;
  width: 100%; height: 1px;
  transform: translateY(-50%);
}

/* Section header */
.section-header {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent-blue);
  padding-bottom: 8px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-header::before {
  content: '//';
  color: var(--text-dim);
}

/* Responsive */
@media (max-width: 768px) {
  .sidebar-expanded {
    width: 60px !important;
  }
  .sidebar-label {
    display: none !important;
  }
}

/* Tooltip */
.tooltip-container {
  position: relative;
}

.tooltip {
  position: absolute;
  left: 100%;
  top: 50%;
  transform: translateY(-50%);
  margin-left: 8px;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  color: var(--text-primary);
  font-size: 12px;
  padding: 4px 8px;
  border-radius: 3px;
  white-space: nowrap;
  z-index: 100;
  pointer-events: none;
  box-shadow: 0 4px 12px rgba(0,0,0,0.5);
}

/* Calendar cell */
.cal-cell {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 8px;
  cursor: pointer;
  transition: all 0.2s;
  min-height: 70px;
}

.cal-cell:hover {
  border-color: var(--accent-blue);
  background: rgba(0,170,255,0.05);
}

.cal-cell.current {
  border-color: var(--accent-blue);
  box-shadow: 0 0 12px rgba(0,170,255,0.2);
  animation: pulse-border 3s ease-in-out infinite;
}

.cal-cell.completed {
  border-color: var(--accent-green);
}

/* Map styles */
.map-container {
  background: linear-gradient(180deg, #0a1628, #0d1a2d);
  border: 1px solid var(--border);
  border-radius: 4px;
  position: relative;
  overflow: hidden;
}

.map-grid {
  background-image:
    linear-gradient(rgba(0,170,255,0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,170,255,0.06) 1px, transparent 1px);
  background-size: 30px 30px;
}