/* ==========================================================================
   XHOPEDEV NEXT-GEN EDGE FIREWALL & ANTI-DDOS CONTROL PLANE
   Modern High-Tech Cybersecurity & SOC Theme System (Dark / Light)
   ========================================================================== */

:root {
  color-scheme: dark;

  /* Cyber Dark Palette */
  --bg: #070a10;
  --bg-gradient: radial-gradient(circle at 50% 0%, #0d1527 0%, #070a10 70%);
  --surface: #0e1420;
  --surface-2: #131b2b;
  --surface-3: #182236;
  --surface-hover: #1e2b44;
  --line: #1c273a;
  --line-strong: #2a3a54;
  --line-glow: rgba(16, 185, 129, 0.22);
  --text: #e6edf7;
  --text-bright: #ffffff;
  --muted: #798ba5;

  /* Semantic Cyber Defense Colors */
  --green: #10b981;
  --green-glow: 0 0 16px rgba(16, 185, 129, 0.35);
  --green-soft: #08261e;
  --green-border: #145942;

  --cyan: #00f0ff;
  --cyan-soft: #072a38;
  --cyan-border: #0e5b74;

  --blue: #3b82f6;
  --blue-soft: #0c2345;
  --blue-border: #1d467c;

  --amber: #f59e0b;
  --amber-soft: #2d1d06;
  --amber-border: #6d4409;

  --red: #ef4444;
  --red-glow: 0 0 16px rgba(239, 68, 68, 0.35);
  --red-soft: #301016;
  --red-border: #6f222d;

  --sidebar: 256px;
  --card-bg: var(--surface);
  --header-bg: rgba(9, 13, 21, 0.88);
  --sub-panel-bg: #0a0f18;
  --table-head-bg: #0b1019;
  --table-hover-bg: #121a28;
  --dialog-bg: #0e1522;
  --dialog-border: #2c3c56;
  --dialog-backdrop: rgba(3, 6, 11, 0.82);
  --input-bg: #090e17;
  --input-border: #233148;

  --public-bg: #070a10;
  --public-overlay: linear-gradient(90deg, rgba(7, 10, 16, 0.98) 0%, rgba(7, 10, 16, 0.88) 42%, rgba(7, 10, 16, 0.25) 75%, rgba(7, 10, 16, 0.45) 100%);
  --public-header-bg: rgba(7, 10, 16, 0.65);
  --public-telemetry-bg: rgba(10, 15, 24, 0.84);
  --public-footline-bg: rgba(7, 10, 16, 0.75);
  --public-endpoint-bg: rgba(11, 17, 28, 0.88);

  --shadow-panel: 0 4px 20px rgba(0, 0, 0, 0.45);
  --shadow-card: 0 2px 10px rgba(0, 0, 0, 0.32);
  --shadow-dialog: 0 24px 80px rgba(0, 0, 0, 0.75), 0 0 0 1px rgba(255, 255, 255, 0.05);
  --shadow-tooltip: 0 12px 32px rgba(0, 0, 0, 0.55);

  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: ui-monospace, "JetBrains Mono", "Fira Code", SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  letter-spacing: -0.01em;
}

/* Light Theme: Clean Enterprise Cyber SOC Dashboard */
:root[data-theme="light"],
html[data-theme="light"],
body[data-theme="light"] {
  color-scheme: light;

  --bg: #f4f6fa;
  --bg-gradient: radial-gradient(circle at 50% 0%, #e8edf6 0%, #f4f6fa 70%);
  --surface: #ffffff;
  --surface-2: #edf2f8;
  --surface-3: #e2e9f3;
  --surface-hover: #eaf0f9;
  --line: #d8e2ee;
  --line-strong: #c2d2e4;
  --line-glow: rgba(5, 150, 105, 0.2);
  --text: #111a28;
  --text-bright: #070c14;
  --muted: #5e728d;

  --green: #059669;
  --green-glow: 0 0 14px rgba(5, 150, 105, 0.25);
  --green-soft: #ecfdf5;
  --green-border: #a7f3d0;

  --cyan: #0284c7;
  --cyan-soft: #f0f9ff;
  --cyan-border: #bae6fd;

  --blue: #1d4ed8;
  --blue-soft: #eff6ff;
  --blue-border: #bfdbfe;

  --amber: #b45309;
  --amber-soft: #fffbeb;
  --amber-border: #fde68a;

  --red: #dc2626;
  --red-glow: 0 0 14px rgba(220, 38, 38, 0.25);
  --red-soft: #fef2f2;
  --red-border: #fecaca;

  --card-bg: #ffffff;
  --header-bg: rgba(255, 255, 255, 0.92);
  --sub-panel-bg: #f8fafc;
  --table-head-bg: #f1f5f9;
  --table-hover-bg: #f8fafc;
  --dialog-bg: #ffffff;
  --dialog-border: #cbd5e1;
  --dialog-backdrop: rgba(15, 23, 42, 0.5);
  --input-bg: #ffffff;
  --input-border: #cbd5e1;

  --public-bg: #f1f5f9;
  --public-overlay: linear-gradient(90deg, rgba(241, 245, 249, 0.98) 0%, rgba(241, 245, 249, 0.92) 42%, rgba(241, 245, 249, 0.3) 75%, rgba(241, 245, 249, 0.6) 100%);
  --public-header-bg: rgba(255, 255, 255, 0.88);
  --public-telemetry-bg: rgba(255, 255, 255, 0.95);
  --public-footline-bg: rgba(255, 255, 255, 0.92);
  --public-endpoint-bg: rgba(255, 255, 255, 0.96);

  --shadow-panel: 0 4px 14px rgba(20, 35, 55, 0.06), 0 1px 3px rgba(20, 35, 55, 0.04);
  --shadow-card: 0 2px 8px rgba(20, 35, 55, 0.05);
  --shadow-dialog: 0 24px 70px rgba(20, 35, 55, 0.2), 0 0 0 1px rgba(0, 0, 0, 0.05);
  --shadow-tooltip: 0 10px 28px rgba(20, 35, 55, 0.14);
}

/* ==========================================================================
   Base & Resets
   ========================================================================== */
* { box-sizing: border-box; }
html {
  min-width: 320px;
  background: var(--bg);
  transition: background-color 0.25s ease, color 0.25s ease;
}
body {
  min-height: 100vh;
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-size: 13.5px;
  line-height: 1.5;
  transition: background-color 0.25s ease, color 0.25s ease;
  overflow-x: hidden;
}

button, input, select { font: inherit; }
button { color: inherit; }
svg { display: block; width: 18px; height: 18px; flex-shrink: 0; }
.hidden { display: none !important; }

/* Custom Scrollbars */
::-webkit-scrollbar { width: 7px; height: 7px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--surface-3); border-radius: 4px; border: 1px solid var(--line); }
::-webkit-scrollbar-thumb:hover { background: var(--line-strong); }

/* ==========================================================================
   Brand & Shield Emblem
   ========================================================================== */
.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--text);
  text-decoration: none;
}
.brand-shield {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--green-soft) 0%, var(--surface-2) 100%);
  border: 1px solid var(--green-border);
  color: var(--green);
  box-shadow: var(--green-glow);
  transition: transform 0.2s ease;
}
.brand:hover .brand-shield { transform: scale(1.05); }
.brand-shield svg { width: 20px; height: 20px; }
.brand strong, .brand small { display: block; }
.brand strong { font-size: 14px; font-weight: 800; letter-spacing: 0.04em; color: var(--text-bright); }
.brand small {
  margin-top: 2px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.08em;
}

/* ==========================================================================
   Buttons & Interactive Elements
   ========================================================================== */
.button, .icon-button, .nav-item {
  border: 0;
  cursor: pointer;
  transition: all 0.18s ease;
}
.button {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}
.button svg { width: 15px; height: 15px; }
.button:disabled { cursor: wait; opacity: 0.55; }
.button-primary {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #03140d;
  box-shadow: 0 2px 10px rgba(16, 185, 129, 0.25);
}
.button-primary:hover {
  background: linear-gradient(135deg, #34d399 0%, #10b981 100%);
  box-shadow: 0 4px 16px rgba(16, 185, 129, 0.4);
  transform: translateY(-1px);
}
.button-secondary {
  border: 1px solid var(--line-strong);
  background: var(--surface-2);
  color: var(--text);
}
.button-secondary:hover {
  border-color: #4b6182;
  background: var(--surface-3);
  color: var(--text-bright);
}
.button-warning {
  background: var(--amber);
  color: #1a1002;
  box-shadow: 0 2px 10px rgba(245, 158, 11, 0.25);
}
.button-danger {
  border: 1px solid var(--red-border);
  background: var(--red-soft);
  color: #fca5a5;
}
.button-full { width: 100%; }

.icon-button {
  display: inline-grid;
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  place-items: center;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
}
.icon-button:hover { background: var(--surface-3); color: var(--text-bright); }
.icon-button svg { width: 18px; height: 18px; }

/* Status Indicators */
.region-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border: 1px solid var(--blue-border);
  background: var(--blue-soft);
  color: var(--cyan);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  border-radius: 4px;
}
.region-tag svg { width: 12px; height: 12px; }

.live-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 11px;
}
.live-status > i, .panel-status > i, .status-pill > i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 8px var(--green);
  animation: pulse-glow 2s infinite ease-in-out;
}

@keyframes pulse-glow {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.45; transform: scale(0.85); }
}

.threat-level-badge, .defense-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 10px;
  border: 1px solid var(--green-border);
  background: var(--green-soft);
  color: var(--green);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  border-radius: 4px;
}
.threat-level-badge svg, .defense-badge svg { width: 13px; height: 13px; }

.security-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border: 1px solid var(--cyan-border);
  background: var(--cyan-soft);
  color: var(--cyan);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  border-radius: 4px;
}
.security-chip svg { width: 13px; height: 13px; }

/* ==========================================================================
   Public View (Landing Page)
   ========================================================================== */
.public-view {
  position: relative;
  min-height: 100vh;
  overflow: hidden;
  background: var(--public-bg);
  color: var(--text);
}
.public-map {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.cyber-grid-overlay {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(to right, rgba(28, 39, 58, 0.08) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(28, 39, 58, 0.08) 1px, transparent 1px);
  background-size: 40px 40px;
  pointer-events: none;
}
.public-view::before {
  position: absolute;
  z-index: 1;
  inset: 0;
  background: var(--public-overlay);
  content: "";
  pointer-events: none;
}
.public-header {
  position: relative;
  z-index: 4;
  display: flex;
  min-height: 74px;
  align-items: center;
  justify-content: space-between;
  padding: 0 42px;
  border-bottom: 1px solid var(--line);
  background: var(--public-header-bg);
  backdrop-filter: blur(16px);
}
.header-actions, .admin-actions, .toolbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.public-stage {
  position: relative;
  z-index: 2;
  display: flex;
  min-height: calc(100vh - 74px);
  flex-direction: column;
  justify-content: flex-start;
  padding: 48px 36px 90px;
}

/* ==========================================================================
   LANDING PAGE STYLES (MODERN SAAS HERO & ZERO-IMAGE VECTOR SIMULATOR)
   ========================================================================== */

.landing-container {
  max-width: 1240px;
  margin: 0 auto;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 40px;
}

.landing-hero {
  max-width: 900px;
  margin: 0 auto;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 10px;
}

.landing-kicker {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 6px 16px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  margin-bottom: 24px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  backdrop-filter: blur(10px);
}
.kicker-glow-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--green);
}
.kicker-pulse {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 8px var(--green);
  animation: pulse-dot 1.5s infinite;
}
.kicker-divider {
  color: var(--line-strong);
}
.kicker-tag {
  color: var(--text-bright);
}
.kicker-loc {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--muted);
}
.kicker-loc svg { width: 12px; height: 12px; }

.landing-headline {
  margin: 0;
  font-size: 50px;
  font-weight: 900;
  line-height: 1.08;
  letter-spacing: -0.035em;
  color: var(--text-bright);
}

.landing-lead {
  max-width: 740px;
  margin: 18px 0 28px;
  color: var(--muted);
  font-size: 16.5px;
  line-height: 1.65;
}

.landing-cta-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}
.landing-btn-primary {
  padding: 12px 24px;
  font-size: 13.5px;
  font-weight: 700;
}
.landing-btn-secondary {
  padding: 12px 22px;
  font-size: 13.5px;
  font-weight: 700;
}
.landing-btn-sim {
  padding: 12px 22px;
  font-size: 13.5px;
  font-weight: 700;
  border-color: rgba(239, 68, 68, 0.45) !important;
  color: #ef4444 !important;
  background: rgba(239, 68, 68, 0.08) !important;
}
.landing-btn-sim:hover {
  background: rgba(239, 68, 68, 0.18) !important;
  border-color: #ef4444 !important;
}

.landing-trust-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  flex-wrap: wrap;
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--muted);
}
.trust-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.trust-item svg {
  width: 14px;
  height: 14px;
  color: var(--green);
}

/* ==========================================================================
   LANDING SIMULATOR CARD (100% CANVAS VECTOR - ZERO STATIC IMAGES)
   ========================================================================== */

.landing-simulator-card {
  padding: 24px;
  border-radius: 14px;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  backdrop-filter: blur(16px);
  box-shadow: var(--shadow-card), 0 0 50px rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
  gap: 16px;
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}
.landing-simulator-card:hover {
  border-color: rgba(0, 240, 255, 0.45);
  box-shadow: var(--shadow-card), 0 0 50px rgba(0, 240, 255, 0.1);
}

.sim-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}
.sim-eyebrow-line {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}
.sim-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #ef4444;
}
.sim-eyebrow svg { width: 13px; height: 13px; }
.sim-mode-tag {
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 4px;
  background: var(--surface-2);
  color: var(--muted);
  border: 1px solid var(--line);
}
.sim-header-info h2 {
  margin: 0 0 6px;
  font-size: 21px;
  font-weight: 800;
  color: var(--text-bright);
  letter-spacing: -0.02em;
}
.sim-header-info p {
  margin: 0;
  font-size: 13.5px;
  color: var(--muted);
  max-width: 680px;
  line-height: 1.5;
}

.sim-header-status {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.sim-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 6px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
}
.sim-status-badge svg { width: 13px; height: 13px; }
.sim-status-badge.active {
  background: rgba(239, 68, 68, 0.12);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.35);
}
.sim-status-badge.clean {
  background: rgba(16, 185, 129, 0.12);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.35);
}

.sim-canvas-wrap {
  position: relative;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  background: #060a12;
  box-shadow: inset 0 0 50px rgba(0, 0, 0, 0.8);
}
.ddos-simulation-canvas {
  display: block;
  width: 100%;
  height: 330px;
  cursor: crosshair;
}

.sim-canvas-legend {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 14px;
  padding: 10px 16px;
  background: rgba(7, 12, 20, 0.95);
  border-top: 1px solid var(--line);
  flex-wrap: wrap;
}
.legend-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 4px 10px;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--line);
}
.legend-chip.danger { border-color: rgba(239, 68, 68, 0.35); color: #fca5a5; }
.legend-chip.warning { border-color: rgba(245, 158, 11, 0.35); color: #fde68a; }
.legend-chip.success { border-color: rgba(16, 185, 129, 0.35); color: #a7f3d0; }
.chip-color {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.chip-color.red { background: #ef4444; box-shadow: 0 0 6px #ef4444; }
.chip-color.orange { background: #f59e0b; box-shadow: 0 0 6px #f59e0b; }
.chip-color.green { background: #10b981; box-shadow: 0 0 6px #10b981; }

.sim-telemetry-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}
.sim-tel-card {
  padding: 14px 16px;
  border-radius: 8px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  font-family: var(--font-mono);
}
.sim-tel-card .tel-label {
  display: block;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin-bottom: 5px;
  text-transform: uppercase;
}
.sim-tel-card strong {
  display: block;
  font-size: 15px;
  font-weight: 800;
  margin-bottom: 3px;
}
.sim-tel-card small {
  display: block;
  font-size: 10px;
  color: var(--muted);
}
.text-danger { color: #ef4444 !important; }
.text-warning { color: #f59e0b !important; }
.text-success { color: #10b981 !important; }
.text-accent { color: var(--accent) !important; }

/* Public Telemetry Panel */
.public-telemetry {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  padding: 24px;
  border-radius: 10px;
  border: 1px solid var(--line-strong);
  background: var(--public-telemetry-bg);
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow-panel);
}
.telemetry-block {
  padding: 16px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: var(--surface);
}
.telemetry-block span {
  display: block;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
}
.telemetry-block strong {
  display: block;
  margin: 10px 0 4px;
  font-family: var(--font-mono);
  font-size: 32px;
  font-weight: 900;
  color: var(--text-bright);
  line-height: 1;
}
.telemetry-block small {
  display: block;
  color: var(--muted);
  font-size: 10.5px;
}
.state-highlight { color: var(--green) !important; text-shadow: 0 0 14px rgba(16, 185, 129, 0.4); }

/* Public Footline */
.public-footline {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  display: flex;
  min-height: 48px;
  align-items: center;
  gap: 28px;
  padding: 0 42px;
  border-top: 1px solid var(--line);
  background: var(--public-footline-bg);
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
}
.public-footline span { display: inline-flex; align-items: center; gap: 7px; }
.public-footline svg { width: 13px; height: 13px; color: var(--muted); }
.public-footline span:last-child { margin-left: auto; color: var(--text-bright); font-weight: 700; }

/* ==========================================================================
   User View (Security Monitor)
   ========================================================================== */
.user-view { min-height: 100vh; background: var(--bg); color: var(--text); }
.user-header {
  display: flex;
  min-height: 74px;
  align-items: center;
  justify-content: space-between;
  padding: 10px 42px;
  border-bottom: 1px solid var(--line);
  background: var(--header-bg);
  backdrop-filter: blur(14px);
}
.user-header-actions { display: flex; align-items: center; gap: 14px; }
.user-account-label {
  padding: 4px 10px;
  border-radius: 4px;
  border: 1px solid var(--green-border);
  background: var(--green-soft);
  color: var(--green);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
}
.user-workspace { width: min(1520px, 100%); margin: 0 auto; padding: 28px 42px 64px; }

.user-lookup-panel { padding: 22px; border-radius: 8px; }
.user-lookup-form {
  display: grid;
  grid-template-columns: minmax(220px, 1.2fr) minmax(160px, 0.7fr) auto;
  align-items: end;
  gap: 14px;
  margin-top: 14px;
}
.user-lookup-form label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  font-family: var(--font-mono);
}
.user-lookup-form input {
  height: 42px;
  padding: 0 14px;
  border: 1px solid var(--input-border);
  border-radius: 6px;
  background: var(--input-bg);
  color: var(--text-bright);
  font-family: var(--font-mono);
  font-size: 13px;
}
.user-lookup-form input:focus { outline: none; border-color: var(--green); box-shadow: var(--green-glow); }
.user-privacy-note {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 14px;
  color: var(--muted);
  font-size: 11px;
}
.user-privacy-note svg { width: 14px; height: 14px; color: var(--amber); }

.user-monitor-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin: 32px 0 16px;
}
.user-monitor-heading h1 { margin: 0; font-size: 26px; font-weight: 800; color: var(--text-bright); }
.user-route-endpoint {
  margin: 6px 0 0;
  color: var(--green);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
}
.route-ip-endpoint { display: block; color: var(--muted, #8698ac); font-size: 11px; margin-top: 4px; }

.user-charts { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1.45fr); gap: 14px; margin-top: 14px; }
.user-metric-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; margin-top: 14px; }
.user-metric-grid article {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  box-shadow: var(--shadow-card);
}
.user-metric-grid span { display: block; color: var(--muted); font-family: var(--font-mono); font-size: 10px; font-weight: 700; text-transform: uppercase; }
.user-metric-grid strong { display: block; margin-top: 12px; color: var(--text-bright); font-family: var(--font-mono); font-size: 26px; font-weight: 800; }
.user-metric-grid small { display: block; margin-top: 6px; color: var(--muted); font-size: 10px; }

.user-dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(340px, 0.9fr); gap: 14px; margin-top: 14px; }
.user-traffic-panel, .user-infra-panel, .user-events-panel { padding: 20px; border-radius: 8px; }

.user-data-table { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: 6px; background: var(--sub-panel-bg); }
.user-data-table > div { padding: 14px 16px; border-left: 1px solid var(--line); }
.user-data-table > div:first-child { border-left: 0; }
.user-data-table span, .user-health-grid span { display: block; color: var(--muted); font-family: var(--font-mono); font-size: 9px; text-transform: uppercase; font-weight: 700; }
.user-data-table strong { display: block; margin-top: 10px; color: var(--green); font-family: var(--font-mono); font-size: 14px; font-weight: 800; }

.user-health-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: 6px; background: var(--sub-panel-bg); }
.user-health-grid > div { padding: 14px; border-left: 1px solid var(--line); border-top: 1px solid var(--line); }
.user-health-grid > div:nth-child(-n+3) { border-top: 0; }
.user-health-grid > div:nth-child(3n+1) { border-left: 0; }
.user-health-grid strong { display: block; margin-top: 8px; color: var(--text-bright); font-family: var(--font-mono); font-size: 13px; font-weight: 750; }

.user-event-list { max-height: 320px; overflow-y: auto; border: 1px solid var(--line); border-radius: 6px; background: var(--sub-panel-bg); }
.user-event-row {
  display: grid;
  grid-template-columns: 140px 120px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  min-height: 44px;
  padding: 8px 14px;
  border-top: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 10px;
}
.user-event-row:first-child { border-top: 0; }
.user-event-row span { color: var(--muted); }
.user-event-row strong { color: var(--text-bright); font-weight: 700; text-transform: uppercase; }
.user-event-row small { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ==========================================================================
   Admin View (Control Plane)
   ========================================================================== */
.admin-view { min-height: 100vh; background: var(--bg); color: var(--text); }
.sidebar {
  position: fixed;
  z-index: 20;
  inset: 0 auto 0 0;
  display: flex;
  width: var(--sidebar);
  flex-direction: column;
  border-right: 1px solid var(--line);
  background: var(--surface);
}
.sidebar-brand {
  min-height: 74px;
  padding: 0 20px;
  border-bottom: 1px solid var(--line);
}
.edge-identity {
  display: flex;
  min-height: 64px;
  align-items: center;
  gap: 12px;
  margin: 14px 12px 6px;
  padding: 0 14px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: var(--surface-2);
}
.edge-light {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 10px var(--green);
  animation: pulse-glow 2s infinite ease-in-out;
}
.edge-identity strong, .edge-identity small { display: block; }
.edge-identity strong {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 800;
  color: var(--text-bright);
}
.edge-identity small { margin-top: 3px; color: var(--muted); font-size: 9.5px; }

.main-nav { display: flex; flex: 1; flex-direction: column; gap: 4px; padding: 14px 10px; }
.nav-item {
  display: flex;
  min-height: 44px;
  align-items: center;
  gap: 12px;
  padding: 0 14px;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 600;
  text-align: left;
}
.nav-item svg { width: 17px; height: 17px; }
.nav-item:hover { background: var(--surface-2); color: var(--text-bright); }
.nav-item.active {
  background: var(--green-soft);
  color: var(--green);
  border: 1px solid var(--green-border);
  font-weight: 750;
}

.sidebar-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px;
  border-top: 1px solid var(--line);
}
.operator { display: flex; min-width: 0; align-items: center; gap: 10px; }
.operator > span {
  display: grid;
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  place-items: center;
  border: 1px solid var(--green-border);
  border-radius: 6px;
  background: var(--green-soft);
  color: var(--green);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 800;
}
.operator strong, .operator small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.operator strong { font-size: 11.5px; font-weight: 750; color: var(--text-bright); }
.operator small { max-width: 120px; margin-top: 2px; color: var(--muted); font-size: 9px; }

.admin-content { min-height: 100vh; margin-left: var(--sidebar); }
.admin-header {
  position: sticky;
  z-index: 15;
  top: 0;
  display: flex;
  min-height: 74px;
  align-items: center;
  justify-content: space-between;
  padding: 10px 32px;
  border-bottom: 1px solid var(--line);
  background: var(--header-bg);
  backdrop-filter: blur(16px);
}
.eyebrow {
  margin: 0 0 4px;
  color: var(--green);
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 750;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.page-heading h1 { margin: 0; font-size: 20px; font-weight: 800; color: var(--text-bright); }
.utc-clock, .last-updated {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
}
.health-chip {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  border: 1px solid var(--green-border);
  border-radius: 5px;
  background: var(--green-soft);
  color: var(--green);
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 700;
}
.health-chip svg { width: 14px; height: 14px; }
.health-degraded { border-color: var(--amber-border); background: var(--amber-soft); color: var(--amber); }
.health-critical { border-color: var(--red-border); background: var(--red-soft); color: var(--red); }

.workspace { width: min(1680px, 100%); margin: 0 auto; padding: 24px 32px 64px; }
.page { display: none; }
.page.active { display: block; }
.panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow-card);
}
.panel-heading, .section-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.panel-heading { margin-bottom: 18px; }
.panel-heading h2, .section-toolbar h2 { margin: 0; font-size: 16px; font-weight: 750; color: var(--text-bright); }
.section-toolbar { min-height: 52px; margin-bottom: 18px; }
.panel-status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--green);
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 700;
}
.count-badge {
  display: inline-grid;
  min-width: 30px;
  height: 24px;
  padding: 0 8px;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  background: var(--surface-2);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
}

/* Warnings */
.warning-banner {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
  padding: 12px 16px;
  border: 1px solid var(--amber-border);
  border-radius: 7px;
  background: var(--amber-soft);
}
.warning-banner > svg { width: 20px; height: 20px; color: var(--amber); }
.warning-banner strong { display: block; color: var(--amber); font-size: 12px; font-weight: 750; }
.warning-banner span { display: block; margin-top: 3px; color: var(--text); font-size: 11px; }

/* Command Metrics Grid */
.command-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; }
.command-metric {
  position: relative;
  min-height: 124px;
  overflow: hidden;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow-card);
  transition: transform 0.2s ease, border-color 0.2s ease;
}
.command-metric:hover {
  transform: translateY(-2px);
  border-color: var(--line-strong);
}
.command-metric::after {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 2px;
  background: var(--line-strong);
  content: "";
}
.command-metric.metric-health::after { background: var(--green); }
.command-metric.metric-drops::after { background: var(--red); }
.metric-top { display: flex; align-items: center; justify-content: space-between; }
.metric-top span { color: var(--muted); font-family: var(--font-mono); font-size: 9.5px; font-weight: 750; }
.metric-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 7px;
  border-radius: 4px;
  border: 1px solid var(--line-strong);
  background: var(--surface-2);
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 8.5px;
  font-weight: 700;
}
.metric-badge svg { width: 10px; height: 10px; }
.badge-threat { border-color: var(--red-border); background: var(--red-soft); color: var(--red); }

.command-metric strong {
  display: block;
  margin-top: 14px;
  color: var(--text-bright);
  font-family: var(--font-mono);
  font-size: 28px;
  font-weight: 850;
  line-height: 1;
}
.command-metric small {
  display: block;
  margin-top: 8px;
  overflow: hidden;
  color: var(--muted);
  font-size: 10.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Overview Layouts */
.overview-primary { display: grid; grid-template-columns: minmax(0, 1.85fr) minmax(320px, 0.75fr); gap: 14px; margin-top: 14px; }
.topology-panel, .alert-panel, .traffic-panel, .stack-panel, .server-facts, .kernel-panel, .retention-panel, .account-panel, .discord-panel, .backup-panel, .origin-guidance {
  padding: 22px;
  border-radius: 8px;
}
.topology-panel { position: relative; min-height: 440px; overflow: hidden; }
.global-map { display: block; width: 100%; height: 350px; }
.map-overlay {
  position: absolute;
  right: 20px;
  bottom: 18px;
  display: flex;
  min-height: 36px;
  align-items: center;
  gap: 16px;
  padding: 0 14px;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  background: var(--surface);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  box-shadow: var(--shadow-card);
}
.map-overlay span { color: var(--muted); }
.map-overlay strong { color: var(--green); }

.alert-panel { min-height: 440px; }
.alert-list { display: grid; gap: 8px; }
.alert-item {
  display: grid;
  min-height: 68px;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--sub-panel-bg);
}
.alert-item > svg { width: 17px; height: 17px; color: var(--amber); }
.alert-critical > svg { color: var(--red); }
.alert-item strong { display: block; font-size: 11px; font-weight: 750; color: var(--text-bright); }
.alert-item span { display: block; margin-top: 3px; color: var(--muted); font-size: 10px; line-height: 1.45; }
.alert-item b {
  color: var(--amber);
  font-family: var(--font-mono);
  font-size: 8px;
  font-weight: 800;
  text-transform: uppercase;
}
.alert-critical b { color: var(--red); }

.overview-secondary { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(340px, 0.8fr); gap: 14px; margin-top: 14px; }
.traffic-heading { align-items: flex-start; }
.traffic-panel-actions { display: flex; align-items: center; gap: 16px; }
.chart-legend { display: flex; align-items: center; gap: 12px; font-family: var(--font-mono); font-size: 10px; }
.legend-in, .legend-out { display: inline-flex; align-items: center; gap: 6px; }
.legend-in::before { width: 9px; height: 9px; border-radius: 2px; background: var(--green); content: ""; }
.legend-out::before { width: 9px; height: 9px; border-radius: 2px; background: var(--blue); content: ""; }

.chart-mode-switch { display: inline-flex; border: 1px solid var(--line-strong); border-radius: 5px; overflow: hidden; background: var(--surface-2); }
.chart-mode-switch button {
  padding: 4px 12px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
}
.chart-mode-switch button:hover { color: var(--text-bright); }
.chart-mode-switch button.active {
  background: var(--surface-3);
  color: var(--green);
}

.traffic-summary {
  display: grid;
  grid-template-columns: minmax(160px, 1.3fr) repeat(4, minmax(0, 1fr));
  gap: 10px;
  padding: 14px 18px;
  margin-bottom: 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--sub-panel-bg);
}
.traffic-summary span { display: block; color: var(--muted); font-family: var(--font-mono); font-size: 9.5px; text-transform: uppercase; font-weight: 700; }
.traffic-summary strong { display: block; margin-top: 6px; color: var(--text-bright); font-family: var(--font-mono); font-size: 17px; font-weight: 800; }
.traffic-primary strong { color: var(--green); font-size: 22px; }
.traffic-primary small { display: block; margin-top: 4px; color: var(--muted); font-size: 9px; }

.traffic-filter-summary {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  background: var(--surface-2);
}
.xdp-traffic-note {
  margin: -4px 0 12px;
  color: var(--muted);
  font-size: 10px;
  font-style: italic;
}
.traffic-chart-wrap { position: relative; width: 100%; height: 260px; }
.traffic-chart { display: block; width: 100%; height: 260px; }
.traffic-tooltip {
  position: absolute;
  z-index: 10;
  pointer-events: none;
  padding: 10px 14px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: var(--surface);
  font-family: var(--font-mono);
  font-size: 10.5px;
  box-shadow: var(--shadow-tooltip);
}

/* Stack Panel */
.stack-list { display: grid; gap: 10px; }
.stack-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--sub-panel-bg);
}
.stack-icon {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border-radius: 6px;
  background: var(--surface-2);
  color: var(--green);
}
.stack-icon svg { width: 17px; height: 17px; }
.stack-item > span { flex: 1; }
.stack-item strong { display: block; font-size: 12px; font-weight: 750; color: var(--text-bright); }
.stack-item small { display: block; margin-top: 3px; color: var(--muted); font-size: 10.5px; }
.state-pill {
  padding: 4px 9px;
  border-radius: 4px;
  border: 1px solid var(--line-strong);
  background: var(--surface-2);
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 800;
}
.state-active { border-color: var(--green-border); background: var(--green-soft); color: var(--green); }

/* Route Panel Preview */
.route-panel { margin-top: 14px; padding: 22px; }
.route-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
}
.route-card {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--sub-panel-bg);
  cursor: pointer;
  transition: all 0.2s ease;
}
.route-card:hover {
  border-color: var(--line-strong);
  transform: translateY(-2px);
}

/* ==========================================================================
   Tables & Data Presentation
   ========================================================================== */
.table-panel { padding: 0; overflow: hidden; }
.table-scroll { width: 100%; overflow-x: auto; }
table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 12.5px;
}
thead th {
  padding: 12px 18px;
  border-bottom: 1px solid var(--line-strong);
  background: var(--table-head-bg);
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 750;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
}
tbody td {
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  color: var(--text);
  vertical-align: middle;
}
tbody tr:hover { background: var(--table-hover-bg); }
tbody tr:last-child td { border-bottom: 0; }
.empty-cell { text-align: center; padding: 36px 18px; color: var(--muted); }

.service-summary-bar {
  display: flex;
  align-items: center;
  gap: 24px;
  margin-bottom: 16px;
  padding: 12px 18px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  font-family: var(--font-mono);
  font-size: 11px;
}
.service-summary-bar b { color: var(--green); font-weight: 800; font-size: 13px; }

/* Status Badges */
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 9px;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 800;
  text-transform: uppercase;
}
.status-running {
  border: 1px solid var(--green-border);
  background: var(--green-soft);
  color: var(--green);
}
.status-stopped {
  border: 1px solid var(--line-strong);
  background: var(--surface-2);
  color: var(--muted);
}
.status-warning {
  border: 1px solid var(--amber-border);
  background: var(--amber-soft);
  color: var(--amber);
}

/* ==========================================================================
   Infrastructure & Hardware
   ========================================================================== */
.infra-metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 14px; }
.infra-metrics article {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}
.infra-metric-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 12px; }
.infra-metric-head span { color: var(--muted); font-family: var(--font-mono); font-size: 10px; font-weight: 750; }
.infra-metric-head strong { color: var(--text-bright); font-family: var(--font-mono); font-size: 24px; font-weight: 850; }
progress {
  width: 100%;
  height: 8px;
  appearance: none;
  border: 0;
  border-radius: 4px;
  overflow: hidden;
  background: var(--surface-2);
}
progress::-webkit-progress-bar { background: var(--surface-2); }
progress::-webkit-progress-value { background: linear-gradient(90deg, var(--green) 0%, var(--cyan) 100%); border-radius: 4px; }
progress::-moz-progress-bar { background: var(--green); border-radius: 4px; }

.infra-layout { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr); gap: 14px; }
.server-facts dl {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin: 0;
}
.server-facts dt { color: var(--muted); font-family: var(--font-mono); font-size: 9.5px; text-transform: uppercase; font-weight: 700; }
.server-facts dd { margin: 4px 0 0; color: var(--text-bright); font-family: var(--font-mono); font-size: 12px; font-weight: 700; }

.counter-list { display: grid; gap: 8px; }
.counter-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--sub-panel-bg);
  font-family: var(--font-mono);
  font-size: 11px;
}
.counter-row span { color: var(--muted); }
.counter-row strong { color: var(--red); font-weight: 800; }

/* ==========================================================================
   Operations & Policies
   ========================================================================== */
.operations-layout { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-bottom: 14px; }
.retention-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.retention-form label, .form-grid label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 700;
  font-family: var(--font-mono);
}
.retention-form input, .form-grid input, .select-control, .dialog input, .dialog select {
  height: 40px;
  padding: 0 14px;
  border: 1px solid var(--input-border);
  border-radius: 6px;
  background: var(--input-bg);
  color: var(--text-bright);
  font-family: var(--font-mono);
  font-size: 12.5px;
}
.retention-form input:focus, .form-grid input:focus, .dialog input:focus, .dialog select:focus {
  outline: none;
  border-color: var(--green);
  box-shadow: var(--green-glow);
}
.retention-form button { grid-column: span 2; margin-top: 8px; }
.storage-line {
  display: flex;
  gap: 20px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
}
.storage-line b { color: var(--green); font-weight: 800; }

.operation-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  margin-bottom: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--sub-panel-bg);
}
.operation-row > svg { width: 22px; height: 22px; color: var(--green); }
.operation-row > div { flex: 1; }
.operation-row strong { display: block; font-size: 13px; font-weight: 750; color: var(--text-bright); }
.operation-row small { display: block; margin-top: 2px; color: var(--muted); font-size: 10.5px; }

.discord-panel { margin-bottom: 14px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.form-grid .span-2 { grid-column: span 2; }
.toggle-label {
  display: flex !important;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}
.toggle-label input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--green); }

.backup-panel { margin-bottom: 14px; }
.backup-list { display: grid; gap: 8px; }
.backup-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--sub-panel-bg);
  font-family: var(--font-mono);
  font-size: 11.5px;
}

.origin-guidance code {
  display: block;
  padding: 12px 16px;
  margin-top: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--sub-panel-bg);
  color: var(--cyan);
  font-family: var(--font-mono);
  font-size: 12px;
}

/* ==========================================================================
   Dialogs (Modals)
   ========================================================================== */
dialog {
  border: 1px solid var(--dialog-border);
  border-radius: 10px;
  background: var(--dialog-bg);
  color: var(--text);
  padding: 24px;
  box-shadow: var(--shadow-dialog);
  max-width: 90vw;
}
dialog::backdrop {
  background: var(--dialog-backdrop);
  backdrop-filter: blur(8px);
}
.login-dialog { width: 420px; }
.wide-dialog { width: 680px; }
.detail-dialog { width: 840px; }

.dialog-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 20px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}
.dialog-heading h2 { margin: 0; font-size: 18px; font-weight: 800; color: var(--text-bright); }
.dialog form { display: grid; gap: 14px; }
.dialog-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.form-error {
  margin: 4px 0 0;
  color: var(--red);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
}
.segmented {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}
.segmented label {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  background: var(--surface-2);
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 750;
  transition: all 0.15s ease;
}
.segmented input { display: none; }
.segmented label:has(input:checked) {
  border-color: var(--green-border);
  background: var(--green-soft);
  color: var(--green);
}

.advanced-settings {
  margin-top: 10px;
  padding: 12px 16px;
  border: 1px dashed var(--line-strong);
  border-radius: 6px;
  background: var(--sub-panel-bg);
}
.advanced-settings summary {
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 750;
  color: var(--muted);
}
.advanced-settings summary:hover { color: var(--text-bright); }
.advanced-grid { margin-top: 14px; }

/* Lease Panel */
.lease-panel {
  padding: 14px 18px;
  margin-bottom: 14px;
  border-radius: 7px;
  border: 1px solid var(--line);
  background: var(--surface);
  font-family: var(--font-mono);
  font-size: 11px;
}
.lease-active { border-color: var(--green-border); background: var(--green-soft); color: var(--green); }
.lease-warning { border-color: var(--amber-border); background: var(--amber-soft); color: var(--amber); }
.lease-expired { border-color: var(--red-border); background: var(--red-soft); color: var(--red); }
.lease-policy-note {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 10.5px;
}

/* Toast Notifications */
.toast {
  position: fixed;
  z-index: 100;
  right: 28px;
  bottom: 28px;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 48px;
  padding: 12px 20px;
  border-radius: 7px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--text-bright);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  box-shadow: var(--shadow-dialog);
  transform: translateY(120%);
  opacity: 0;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.25s ease;
  pointer-events: none;
}
.toast.visible {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}
.toast.toast-error { border-color: var(--red-border); background: var(--red-soft); color: #fca5a5; }
.toast.toast-success { border-color: var(--green-border); background: var(--green-soft); color: var(--green); }

/* ==========================================================================
   Firewall Component Details & SOC Table Styling
   ========================================================================== */
code {
  padding: 3px 6px;
  border-radius: 4px;
  background: var(--surface-2);
  color: var(--cyan);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
}

/* Route Cards */
.route-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 16px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--surface);
  cursor: pointer;
  transition: all 0.2s ease;
}
.route-card:hover {
  border-color: var(--line-strong);
  transform: translateY(-2px);
  box-shadow: var(--shadow-card);
}
.route-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.route-icon {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 6px;
  background: var(--surface-2);
  color: var(--green);
}
.route-icon svg { width: 15px; height: 15px; }
.route-card h3 { margin: 0; font-size: 13.5px; font-weight: 750; color: var(--text-bright); }
.route-card code { align-self: flex-start; }
.lease-countdown { margin: 0; color: var(--muted); font-size: 11px; font-family: var(--font-mono); }
.route-stats {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: auto;
  padding-top: 8px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 10px;
}
.route-stats span:first-child { color: var(--green); font-weight: 700; }

/* Service Table Details */
.service-name-cell strong { display: block; font-size: 13px; font-weight: 750; color: var(--text-bright); }
.service-name-cell span { display: block; margin-top: 2px; color: var(--muted); font-family: var(--font-mono); font-size: 11px; }

.inspection-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border-radius: 4px;
  border: 1px solid var(--line-strong);
  background: var(--surface-2);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
}
.inspection-pill svg { width: 12px; height: 12px; color: var(--cyan); }

.lease-table-cell { font-family: var(--font-mono); font-size: 11px; }
.lease-table-cell strong { display: block; color: var(--text-bright); margin-bottom: 2px; }
.lease-table-cell small { display: block; color: var(--muted); font-size: 9.5px; }
.lease-renew { margin-top: 6px; padding: 4px 10px; min-height: 28px; font-size: 10px; }

.row-actions { text-align: right; }

/* Severity Badges (Events / Threat Stream) */
.severity-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 750;
  white-space: nowrap;
}
.severity-pill > i { width: 6px; height: 6px; border-radius: 50%; }
.severity-info {
  border: 1px solid var(--blue-border);
  background: var(--blue-soft);
  color: var(--blue);
}
.severity-info > i { background: var(--blue); }
.severity-warning {
  border: 1px solid var(--amber-border);
  background: var(--amber-soft);
  color: var(--amber);
}
.severity-warning > i { background: var(--amber); }
.severity-error {
  border: 1px solid var(--red-border);
  background: var(--red-soft);
  color: var(--red);
}
.severity-error > i { background: var(--red); }

.reason-cell {
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 11px;
}

/* Backup Rows */
.backup-icon {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border-radius: 6px;
  background: var(--surface-2);
  color: var(--green);
}
.backup-icon svg { width: 16px; height: 16px; }
.latest-tag {
  padding: 2px 7px;
  border-radius: 3px;
  background: var(--green-soft);
  border: 1px solid var(--green-border);
  color: var(--green);
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 800;
}

/* Detail Modal Styling */
.detail-topline {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}
.detail-topline h2 { margin: 4px 0 6px; font-size: 20px; font-weight: 800; color: var(--text-bright); }
.detail-endpoint { font-size: 13px; color: var(--green); }
.detail-actions { display: flex; align-items: center; gap: 8px; }

.detail-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}
.detail-metrics > div {
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--sub-panel-bg);
}
.detail-metrics span { display: block; color: var(--muted); font-family: var(--font-mono); font-size: 9.5px; text-transform: uppercase; font-weight: 700; }
.detail-metrics strong { display: block; margin-top: 6px; color: var(--text-bright); font-family: var(--font-mono); font-size: 20px; font-weight: 800; }

.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}
.detail-block {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--sub-panel-bg);
}
.detail-block h3 { margin: 0 0 12px; font-size: 13px; font-weight: 750; color: var(--text-bright); }
.detail-block dl { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 0; }
.detail-block dt { color: var(--muted); font-family: var(--font-mono); font-size: 9px; text-transform: uppercase; font-weight: 700; }
.detail-block dd { margin: 2px 0 0; color: var(--text-bright); font-family: var(--font-mono); font-size: 11.5px; font-weight: 700; }

.detail-events h3 { margin: 0 0 10px; font-size: 13px; font-weight: 750; color: var(--text-bright); }
.detail-event-list {
  max-height: 220px;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--sub-panel-bg);
}
.detail-event {
  display: grid;
  grid-template-columns: 140px 140px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 8px 12px;
  border-top: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 10.5px;
}
.detail-event:first-child { border-top: 0; }
.detail-event span { color: var(--muted); }
.detail-event strong { color: var(--text-bright); }

.split-actions { justify-content: space-between; }

/* Lease Details */
.lease-heading { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 8px; }
.lease-heading strong { font-size: 13px; font-weight: 800; }
.lease-heading span { font-size: 10px; color: var(--muted); }
.lease-dates { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 0; }
.lease-dates dt { color: var(--muted); font-size: 9px; text-transform: uppercase; font-weight: 700; }
.lease-dates dd { margin: 2px 0 0; font-weight: 700; }

/* Empty States */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 42px 20px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 12px;
  text-align: center;
}
.empty-state.compact { padding: 24px 14px; font-size: 11px; }

/* XDP Packet Dot Indicator */
.xdp-layer-title { display: inline-flex; align-items: center; gap: 8px; }
.xdp-packet-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}
.xdp-dot-available { background: var(--green); box-shadow: 0 0 8px var(--green); }
.xdp-dot-unavailable { background: var(--muted); }

/* ==========================================================================
   Responsive Breakpoints
   ========================================================================== */
@media (max-width: 1200px) {
  .hero-container { grid-template-columns: 1fr; }
  .public-telemetry { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .overview-primary, .overview-secondary { grid-template-columns: 1fr; }
  .command-grid, .user-metric-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .user-charts, .infra-layout, .operations-layout { grid-template-columns: 1fr; }
}

@media (max-width: 860px) {
  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.25s ease;
  }
  .sidebar.open { transform: translateX(0); }
  .admin-content { margin-left: 0; }
  .public-header, .user-header, .admin-header { padding: 0 20px; }
  .public-stage, .user-workspace, .workspace { padding: 24px 20px 48px; }
  .hero-copy h1 { font-size: 38px; }
  .defense-architecture { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .public-telemetry { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .command-grid, .user-metric-grid, .infra-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .public-footline { display: none; }
  .user-lookup-form { grid-template-columns: 1fr; }
  .gateway-meta { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 580px) {
  .defense-architecture { grid-template-columns: 1fr; }
  .public-telemetry { grid-template-columns: 1fr; }
  .command-grid, .user-metric-grid, .infra-metrics { grid-template-columns: 1fr; }
  .header-actions .region-tag, .header-actions .threat-level-badge { display: none; }
}
