/* =====================================================================
   SCM 4K COMMAND CENTER - HIGH-TECH HUD THEME
   Palette: Deep Slate (#0b0f19), Translucent Obsidian, Neon Accents
   Global Font: Times New Roman (As requested)
===================================================================== */

:root {
  --bg-primary: #0b0f19;
  --bg-surface: rgba(17, 24, 39, 0.75);
  --bg-surface-elevated: rgba(30, 41, 59, 0.65);
  --glass-border: rgba(255, 255, 255, 0.08);
  --glass-border-glow: rgba(0, 243, 255, 0.25);
  
  --accent-cyan: #00f3ff;
  --accent-cyan-glow: rgba(0, 243, 255, 0.4);
  --accent-emerald: #10b981;
  --accent-emerald-glow: rgba(16, 185, 129, 0.4);
  --accent-amber: #f59e0b;
  --accent-amber-glow: rgba(245, 158, 11, 0.4);
  --accent-crimson: #ef4444;
  --accent-crimson-glow: rgba(239, 68, 68, 0.4);

  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;

  --font-global: "Times New Roman", Times, serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: var(--font-global) !important;
}

body {
  background-color: var(--bg-primary);
  background-image: 
    radial-gradient(circle at 10% 20%, rgba(0, 243, 255, 0.04) 0%, transparent 40%),
    radial-gradient(circle at 90% 80%, rgba(16, 185, 129, 0.03) 0%, transparent 40%),
    linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
  background-size: 100% 100%, 100% 100%, 40px 40px, 40px 40px;
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* View Sections (For Multi-Dashboard Switching) */
.view-section {
  display: none;
  opacity: 0;
  transition: opacity 0.5s ease;
  width: 100%;
  height: 100vh;
}
.view-section.active {
  display: block;
  opacity: 1;
}

.dash-section {
  display: none;
  animation: slideIn 0.4s ease-out;
  padding: 20px;
}
.dash-section.active {
  display: block;
}

/* Glassmorphism Card Style */
.glass-panel {
  background: var(--bg-surface);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.45);
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}
.glass-panel:hover {
  border-color: var(--glass-border-glow);
}

/* Home / Matrix Screen */
#matrix-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  opacity: 0.3;
}
.home-overlay {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  height: 100%;
  text-align: center;
  background: radial-gradient(circle, rgba(11,15,25,0.2) 0%, rgba(11,15,25,0.9) 100%);
}
.glitch {
  font-size: 4rem;
  font-weight: bold;
  color: #fff;
  text-shadow: 0 0 20px var(--accent-cyan);
  margin-bottom: 10px;
  position: relative;
  letter-spacing: 5px;
}
.home-subtitle {
  font-size: 1.5rem;
  color: var(--accent-emerald);
  margin-bottom: 40px;
  letter-spacing: 3px;
}
.btn-jumbo {
  font-size: 1.5rem;
  padding: 15px 40px;
  border-radius: 8px;
  border: 2px solid var(--accent-cyan);
  background: rgba(0, 243, 255, 0.1);
  color: var(--accent-cyan);
  cursor: pointer;
  transition: all 0.3s;
  box-shadow: 0 0 15px rgba(0, 243, 255, 0.2);
}
.btn-jumbo:hover {
  background: var(--accent-cyan);
  color: #000;
  box-shadow: 0 0 30px var(--accent-cyan-glow);
  transform: scale(1.05);
}

/* Login Screen */
.login-container {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100%;
  background: radial-gradient(circle, rgba(11,15,25,0.4) 0%, rgba(11,15,25,1) 100%);
}
.login-box {
  padding: 40px;
  width: 100%;
  max-width: 400px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  text-align: center;
}
.login-box h2 {
  color: var(--accent-cyan);
  letter-spacing: 2px;
  border-bottom: 1px solid var(--glass-border);
  padding-bottom: 15px;
}
.login-box input {
  padding: 12px;
  background: rgba(0,0,0,0.5);
  border: 1px solid var(--glass-border);
  color: #fff;
  border-radius: 4px;
  font-size: 1.1rem;
}
.login-box input:focus {
  outline: none;
  border-color: var(--accent-cyan);
  box-shadow: 0 0 10px var(--accent-cyan-glow);
}

/* Sidebar & App Layout */
.app-layout {
  display: flex;
  height: calc(100vh - 65px); /* Minus header */
}
.sidebar {
  width: 250px;
  background: rgba(11, 15, 25, 0.9);
  border-right: 1px solid var(--glass-border);
  padding: 20px 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.nav-item {
  padding: 15px;
  font-size: 1.1rem;
  color: var(--text-secondary);
  border: 1px solid transparent;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 10px;
}
.nav-item:hover {
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
}
.nav-item.active {
  background: rgba(0, 243, 255, 0.15);
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
  box-shadow: 0 0 10px var(--accent-cyan-glow);
}
.main-content {
  flex-grow: 1;
  overflow-y: auto;
}

/* Header */
.hud-header {
  height: 65px;
  background: rgba(11, 15, 25, 0.85);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--glass-border);
  padding: 0 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.hud-brand {
  display: flex;
  align-items: center;
  gap: 14px;
}
.hud-logo-icon {
  width: 32px;
  height: 32px;
  border: 2px solid var(--accent-cyan);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 15px var(--accent-cyan-glow);
}
.hud-logo-icon::after {
  content: '';
  width: 8px;
  height: 8px;
  background: var(--accent-cyan);
  border-radius: 50%;
  animation: pulse-beacon 1.8s infinite;
}
.hud-title {
  font-size: 1.15rem;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: #fff;
  font-weight: 700;
}
.hud-badge {
  background: rgba(0, 243, 255, 0.12);
  border: 1px solid var(--accent-cyan);
  color: var(--accent-cyan);
  font-size: 0.75rem;
  padding: 2px 8px;
  border-radius: 4px;
  letter-spacing: 1px;
}

/* Radar */
.hud-telemetry-cluster { display: flex; align-items: center; gap: 24px; }
.telemetry-item { display: flex; flex-direction: column; align-items: flex-end; }
.telemetry-label { font-size: 0.75rem; color: var(--text-muted); letter-spacing: 1px; }
.telemetry-value { font-size: 0.95rem; color: var(--text-primary); font-weight: 600; }
.radar-indicator {
  display: flex; align-items: center; gap: 8px;
  background: rgba(16, 185, 129, 0.1); border: 1px solid rgba(16, 185, 129, 0.3);
  padding: 4px 12px; border-radius: 20px;
}
.pulse-dot {
  width: 10px; height: 10px; background-color: var(--accent-emerald);
  border-radius: 50%; box-shadow: 0 0 10px var(--accent-emerald);
  animation: pulse-ring 1.5s infinite;
}
.pulse-dot.disconnected { background-color: var(--accent-crimson); box-shadow: 0 0 10px var(--accent-crimson); }

/* Common Panels */
.panel-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--glass-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.panel-title { font-size: 1.1rem; letter-spacing: 1.5px; font-weight: 600; color: #fff; }

/* Buttons */
.hud-btn {
  background: rgba(0, 243, 255, 0.1); border: 1px solid var(--accent-cyan);
  color: var(--accent-cyan); padding: 8px 16px; border-radius: 6px;
  cursor: pointer; letter-spacing: 1px; font-size: 0.9rem;
  transition: all 0.2s ease;
}
.hud-btn:hover { background: var(--accent-cyan); color: #000; box-shadow: 0 0 16px var(--accent-cyan-glow); }
.hud-btn-danger { background: rgba(239, 68, 68, 0.1); border-color: var(--accent-crimson); color: var(--accent-crimson); }
.hud-btn-danger:hover { background: var(--accent-crimson); color: #fff; box-shadow: 0 0 16px var(--accent-crimson-glow); }

/* Dashboard 1: GIS */
#gis-map { height: calc(100vh - 250px); width: 100%; background: #090d16; border-radius: 0 0 12px 12px; }
.stats-strip { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; padding: 16px 20px; }
.stat-box { background: rgba(15, 23, 42, 0.6); border: 1px solid var(--glass-border); padding: 12px 14px; border-radius: 8px; }
.stat-label { font-size: 0.8rem; color: var(--text-muted); }
.stat-number { font-size: 1.6rem; font-weight: bold; color: #fff; margin-top: 4px; }

/* Dashboard 2: Inventory */
.inventory-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 20px; margin-bottom: 20px; }
.hud-table { width: 100%; border-collapse: collapse; text-align: left; }
.hud-table th { background: rgba(15, 23, 42, 0.8); padding: 12px; color: var(--text-secondary); border-bottom: 1px solid var(--glass-border); }
.hud-table td { padding: 12px; border-bottom: 1px solid rgba(255, 255, 255, 0.04); }
.hud-table tr:hover { background: rgba(0, 243, 255, 0.03); }
.badge { padding: 4px 10px; border-radius: 4px; font-size: 0.85rem; font-weight: bold; }
.badge-optimal { background: rgba(16, 185, 129, 0.15); color: var(--accent-emerald); border: 1px solid var(--accent-emerald); }
.badge-low { background: rgba(245, 158, 11, 0.15); color: var(--accent-amber); border: 1px solid var(--accent-amber); }
.badge-critical { background: rgba(239, 68, 68, 0.2); color: var(--accent-crimson); border: 1px solid var(--accent-crimson); animation: glow-pulse 1.5s infinite; }

/* Dashboard 3: Kanban */
.kanban-board { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; padding: 16px 20px; min-height: 500px; }
.kanban-column { background: rgba(15, 23, 42, 0.5); border: 1px solid var(--glass-border); border-radius: 8px; display: flex; flex-direction: column; }
.kanban-col-header { padding: 12px; border-bottom: 1px solid var(--glass-border); display: flex; justify-content: space-between; font-weight: bold; }
.kanban-cards-wrapper { padding: 12px; display: flex; flex-direction: column; gap: 12px; overflow-y: auto; }
.kanban-card { background: rgba(30, 41, 59, 0.7); border: 1px solid var(--glass-border); border-radius: 6px; padding: 12px; cursor: pointer; transition: 0.2s; }
.kanban-card:hover { transform: translateY(-2px); border-color: var(--accent-cyan); box-shadow: 0 4px 16px rgba(0, 243, 255, 0.15); }
.po-number-title { font-weight: bold; color: var(--accent-cyan); }

/* Dashboard 4: Telemetry */
.hud-event-feed { padding: 14px 20px; height: calc(100vh - 200px); overflow-y: auto; display: flex; flex-direction: column; gap: 8px; }
.event-entry { padding: 10px; background: rgba(15, 23, 42, 0.4); border-left: 3px solid var(--accent-cyan); font-size: 0.95rem; animation: slide-in 0.3s ease-out; }
.event-entry.alert-danger { border-left-color: var(--accent-crimson); background: rgba(239, 68, 68, 0.1); }
.event-time { color: var(--text-muted); margin-right: 10px; }

/* Map Markers */
.leaflet-container { font-family: "Times New Roman", Times, serif !important; background-color: #0b0f19 !important; }
.marker-inner { width: 32px; height: 32px; background: rgba(11, 15, 25, 0.85); border: 2px solid var(--accent-cyan); border-radius: 50%; display: flex; align-items: center; justify-content: center; box-shadow: 0 0 12px var(--accent-cyan-glow); }
.marker-inner.delayed { border-color: var(--accent-crimson); box-shadow: 0 0 14px var(--accent-crimson-glow); animation: hazard-alert 1.2s infinite; }
.custom-hub-marker { width: 14px; height: 14px; background: var(--accent-emerald); border: 2px solid #fff; border-radius: 50%; box-shadow: 0 0 12px var(--accent-emerald-glow); }

/* Animations */
@keyframes pulse-ring { 0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); } 70% { transform: scale(1.1); box-shadow: 0 0 0 8px rgba(16, 185, 129, 0); } 100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); } }
@keyframes pulse-beacon { 0%, 100% { transform: scale(0.8); opacity: 0.6; } 50% { transform: scale(1.3); opacity: 1; } }
@keyframes hazard-alert { 0%, 100% { transform: scale(1); filter: drop-shadow(0 0 4px var(--accent-crimson)); } 50% { transform: scale(1.15); filter: drop-shadow(0 0 12px var(--accent-crimson)); } }
@keyframes glow-pulse { 0%, 100% { box-shadow: 0 0 4px var(--accent-crimson-glow); } 50% { box-shadow: 0 0 14px var(--accent-crimson); } }
@keyframes slide-in { from { opacity: 0; transform: translateX(-12px); } to { opacity: 1; transform: translateX(0); } }
@keyframes slideIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* Leaflet Dark Mode Filter (Free OSM Tiles) */
.leaflet-layer,
.leaflet-control-zoom-in,
.leaflet-control-zoom-out,
.leaflet-control-attribution {
  filter: invert(100%) hue-rotate(180deg) brightness(95%) contrast(90%);
}

/* Modals */
.modal-overlay {
  display: none; position: fixed; top: 0; left: 0; width: 100vw; height: 100vh;
  background: rgba(0,0,0,0.8); z-index: 9999; justify-content: center; align-items: center;
}
.modal-overlay.active { display: flex; }
.modal-content { padding: 30px; width: 400px; border-color: var(--accent-cyan); box-shadow: 0 0 25px var(--accent-cyan-glow); }
.hud-input {
  width: 100%; padding: 10px; background: rgba(0,0,0,0.5); border: 1px solid var(--glass-border);
  color: #fff; border-radius: 4px; margin-top: 5px; margin-bottom: 15px; font-size: 1rem;
}
.hud-input:focus { border-color: var(--accent-cyan); outline: none; box-shadow: 0 0 10px var(--accent-cyan-glow); }

