/* ==========================================================================
   Hermes Mission Control — Tactical Aerospace / Sci-Fi Operations Center
   Design Language: Deep Void, Monospace Precision, High-Contrast Telemetry
   ========================================================================== */

:root {
  --bg-space: #060913;
  --bg-card: rgba(11, 17, 32, 0.85);
  --bg-card-hover: rgba(16, 24, 44, 0.95);
  --bg-sidebar: #090e1a;
  --border-hud: rgba(56, 189, 248, 0.2);
  --border-hud-bright: rgba(56, 189, 248, 0.5);
  --accent-cyan: #00f5d4;
  --accent-blue: #38bdf8;
  --accent-emerald: #10b981;
  --accent-amber: #f59e0b;
  --accent-crimson: #ef4444;
  --text-bright: #f8fafc;
  --text-main: #cbd5e1;
  --text-dim: #64748b;
  --font-mono: "SF Mono", Monaco, "Cascadia Code", "Roboto Mono", Consolas, monospace;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --sidebar-width: 260px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  background-color: var(--bg-space);
  background-image: 
    radial-gradient(rgba(56, 189, 248, 0.07) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(6, 9, 19, 0.8), rgba(6, 9, 19, 0.98));
  background-size: 24px 24px, 100% 100%;
  color: var(--text-main);
  font-family: var(--font-sans);
  line-height: 1.5;
  font-size: 14px;
  min-height: 100vh;
  overflow-x: hidden;
}

/* Monospace Utilities */
.mono {
  font-family: var(--font-mono);
  letter-spacing: -0.3px;
}

/* App Container */
.app-container {
  display: flex;
  min-height: 100vh;
}

/* Sidebar (Tactical Nav) */
.sidebar {
  width: var(--sidebar-width);
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border-hud);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 100;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 4px 0 24px rgba(0, 0, 0, 0.6);
}

.sidebar-header {
  padding: 1.25rem;
  border-bottom: 1px solid var(--border-hud);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: linear-gradient(180deg, rgba(56, 189, 248, 0.08) 0%, transparent 100%);
}

.brand-radar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--accent-cyan);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  box-shadow: 0 0 12px rgba(0, 245, 212, 0.3);
}

.brand-radar::after {
  content: "";
  width: 8px;
  height: 8px;
  background: var(--accent-cyan);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--accent-cyan);
}

.brand-title {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text-bright);
  letter-spacing: 0.8px;
  text-transform: uppercase;
}

.brand-sub {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--accent-blue);
  letter-spacing: 0.5px;
}

.sidebar-nav {
  padding: 1rem 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  flex: 1;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 0.85rem;
  border-radius: 4px;
  color: var(--text-main);
  text-decoration: none;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border: 1px solid transparent;
  transition: all 0.15s ease;
}

.nav-item:hover, .nav-item.active {
  background: rgba(56, 189, 248, 0.1);
  color: var(--accent-cyan);
  border-color: var(--border-hud);
  box-shadow: inset 0 0 12px rgba(0, 245, 212, 0.05);
}

.nav-badge {
  margin-left: auto;
  font-family: var(--font-mono);
  background: rgba(245, 158, 11, 0.2);
  color: var(--accent-amber);
  border: 1px solid rgba(245, 158, 11, 0.4);
  font-size: 0.7rem;
  padding: 0.1rem 0.4rem;
  border-radius: 3px;
  font-weight: 700;
}

/* Main Content Area */
.main-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  padding: 1.25rem 1.75rem;
  max-width: 1440px;
}

/* Tactical Top HUD Bar */
.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  gap: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-hud);
}

.mobile-menu-btn {
  display: none;
  background: rgba(56, 189, 248, 0.1);
  border: 1px solid var(--border-hud);
  color: var(--accent-cyan);
  font-size: 1.4rem;
  border-radius: 4px;
  cursor: pointer;
  padding: 0.35rem 0.6rem;
  line-height: 1;
}

/* Cyber Command Input */
.dispatch-hud {
  flex: 1;
  max-width: 650px;
  display: flex;
  align-items: center;
  background: rgba(11, 17, 32, 0.9);
  border: 1px solid var(--border-hud);
  border-radius: 4px;
  padding: 0.25rem 0.5rem;
  box-shadow: 0 0 15px rgba(0, 0, 0, 0.4);
}

.dispatch-prompt-tag {
  font-family: var(--font-mono);
  color: var(--accent-cyan);
  font-size: 0.8rem;
  font-weight: 700;
  padding: 0 0.5rem;
  white-space: nowrap;
}

.dispatch-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-bright);
  font-family: var(--font-mono);
  font-size: 0.9rem;
  padding: 0.45rem 0.5rem;
}

.dispatch-input::placeholder {
  color: var(--text-dim);
}

.btn-transmit {
  background: linear-gradient(135deg, rgba(0, 245, 212, 0.2) 0%, rgba(56, 189, 248, 0.2) 100%);
  border: 1px solid var(--accent-cyan);
  color: var(--accent-cyan);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  padding: 0.45rem 0.85rem;
  border-radius: 3px;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 0 8px rgba(0, 245, 212, 0.2);
}

.btn-transmit:hover {
  background: var(--accent-cyan);
  color: #000;
  box-shadow: 0 0 15px rgba(0, 245, 212, 0.6);
}

/* Telemetry Status Widget */
.telemetry-time-box {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-family: var(--font-mono);
  font-size: 0.85rem;
}

.utc-clock {
  color: var(--accent-blue);
  background: rgba(56, 189, 248, 0.08);
  border: 1px solid var(--border-hud);
  padding: 0.35rem 0.65rem;
  border-radius: 4px;
}

.status-defcon {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid var(--accent-emerald);
  color: var(--accent-emerald);
  padding: 0.35rem 0.65rem;
  border-radius: 4px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Sci-Fi HUD Cards with Corner Accents */
.card-grid {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.hud-panel {
  background: var(--bg-card);
  border: 1px solid var(--border-hud);
  border-radius: 4px;
  padding: 1.25rem 1.5rem;
  position: relative;
  backdrop-filter: blur(12px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

/* Tactical Corner Brackets */
.hud-panel::before, .hud-panel::after {
  content: "";
  position: absolute;
  width: 8px;
  height: 8px;
  border-color: var(--accent-blue);
  pointer-events: none;
}
.hud-panel::before {
  top: -1px;
  left: -1px;
  border-top: 2px solid var(--accent-cyan);
  border-left: 2px solid var(--accent-cyan);
}
.hud-panel::after {
  bottom: -1px;
  right: -1px;
  border-bottom: 2px solid var(--accent-cyan);
  border-right: 2px solid var(--accent-cyan);
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  padding-bottom: 0.6rem;
  border-bottom: 1px solid rgba(56, 189, 248, 0.15);
}

.panel-title {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-bright);
  text-transform: uppercase;
  letter-spacing: 1px;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.panel-title span.tag {
  color: var(--accent-cyan);
}

/* Tactical Map Canvas / SVG */
.map-viewport {
  background: #040711;
  border: 1px solid var(--border-hud);
  border-radius: 4px;
  position: relative;
  overflow: hidden;
  height: 320px;
  box-shadow: inset 0 0 40px rgba(0, 0, 0, 0.8);
}

.map-svg {
  width: 100%;
  height: 100%;
  display: block;
}

.map-hud-overlay {
  position: absolute;
  bottom: 12px;
  left: 12px;
  background: rgba(6, 10, 22, 0.85);
  border: 1px solid var(--border-hud);
  padding: 0.6rem 0.85rem;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  line-height: 1.4;
  backdrop-filter: blur(8px);
}

.map-hud-title {
  color: var(--accent-cyan);
  font-weight: 700;
  text-transform: uppercase;
}

/* Beacon Animations */
@keyframes pulse-cyan {
  0% { r: 4; opacity: 1; }
  100% { r: 14; opacity: 0; }
}

@keyframes pulse-emerald {
  0% { r: 4; opacity: 1; }
  100% { r: 16; opacity: 0; }
}

.beacon-pulse {
  animation: pulse-cyan 2s infinite ease-out;
  stroke: var(--accent-cyan);
  fill: none;
  stroke-width: 1.5;
}

.beacon-pulse-emerald {
  animation: pulse-emerald 2.2s infinite ease-out;
  stroke: var(--accent-emerald);
  fill: none;
  stroke-width: 1.5;
}

/* DEFCON Approval Gateway */
.approval-box {
  background: rgba(245, 158, 11, 0.05);
  border: 1px solid rgba(245, 158, 11, 0.4);
  border-left: 4px solid var(--accent-amber);
  border-radius: 4px;
  padding: 1rem 1.25rem;
  margin-bottom: 0.75rem;
  box-shadow: 0 0 15px rgba(245, 158, 11, 0.08);
}

.approval-meta {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.8rem;
}

.btn-authorize {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid var(--accent-emerald);
  color: var(--accent-emerald);
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.8rem;
  text-transform: uppercase;
  padding: 0.45rem 1rem;
  border-radius: 3px;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.2);
}

.btn-authorize:hover {
  background: var(--accent-emerald);
  color: #000;
  box-shadow: 0 0 18px rgba(16, 185, 129, 0.6);
}

.btn-abort {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid var(--accent-crimson);
  color: var(--accent-crimson);
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.8rem;
  text-transform: uppercase;
  padding: 0.45rem 1rem;
  border-radius: 3px;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-abort:hover {
  background: var(--accent-crimson);
  color: #fff;
}

/* Telemetry Grid & Sparklines */
.telemetry-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}

.telemetry-cell {
  background: rgba(6, 10, 22, 0.7);
  border: 1px solid var(--border-hud);
  padding: 0.85rem 1rem;
  border-radius: 4px;
}

.telemetry-label {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.telemetry-val {
  font-family: var(--font-mono);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-bright);
  margin-top: 0.25rem;
}

/* Upcoming Jobs Horizon Timeline */
.timeline-horizon {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  padding-bottom: 0.5rem;
}

.horizon-node {
  min-width: 170px;
  background: rgba(6, 10, 22, 0.8);
  border: 1px solid var(--border-hud);
  padding: 0.75rem;
  border-radius: 4px;
  position: relative;
  flex-shrink: 0;
}

.horizon-node.imminent {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 12px rgba(0, 245, 212, 0.15);
}

.horizon-time {
  font-family: var(--font-mono);
  color: var(--accent-cyan);
  font-size: 0.75rem;
  font-weight: 700;
}

.horizon-job {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text-bright);
  font-weight: 600;
  margin: 0.25rem 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 24h Hourly Histogram */
.histogram-svg {
  width: 100%;
  height: 90px;
  display: block;
}

/* Tables */
.hud-table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--font-mono);
  font-size: 0.85rem;
}

.hud-table th {
  text-align: left;
  padding: 0.5rem 0.75rem;
  color: var(--accent-blue);
  border-bottom: 1px solid var(--border-hud);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.hud-table td {
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid rgba(56, 189, 248, 0.1);
  color: var(--text-main);
}

/* Backdrop for Mobile */
.backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  z-index: 90;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .backdrop.open {
    display: block;
  }
  .main-content {
    margin-left: 0;
    padding: 0.85rem;
  }
  .mobile-menu-btn {
    display: block;
  }
  .top-bar {
    flex-wrap: wrap;
  }
  .dispatch-hud {
    order: 3;
    width: 100%;
    max-width: none;
  }
  .telemetry-time-box {
    font-size: 0.75rem;
  }
}
