/* ==========================================================================
   VANA: Forest Intelligence Command Center
   Dark Forest Intelligence Design System & Layout Architecture
   Palette: #050D0D (Base), #071312 (Header/Sidebar), #0A1716 (Cards), #19332E (Borders)
   Accents: #20D66B (Primary Green), #36E879 (Bright Green), #174D37 (Muted Green)
   Status:  #F4BC42 (Warning), #EF5158 (Error), #40BDEB (Information)
   ========================================================================== */

:root {
  /* ── 1. CORE COLOR TOKENS (PER SPECIFICATION) ────────────────────────── */
  --bg-app: #050D0D;
  --bg-sidebar: #071312;
  --bg-header: #071312;
  --bg-card: #0A1716;
  --bg-card-secondary: #0D1C1A;
  --border-card: #19332E;
  --border-subtle: #132622;
  --border-highlight: #234740;

  /* Greens */
  --primary-green: #20D66B;
  --bright-green: #36E879;
  --muted-green: #174D37;
  --green-glow: rgba(32, 214, 107, 0.22);
  --dark-green-tint: rgba(32, 214, 107, 0.10);

  /* Typography */
  --text-primary: #E8F0EC;
  --text-secondary: #9BAFA7;
  --text-muted: #647A71;
  --text-dim: #3B4D45;

  /* Status Accents */
  --color-warning: #F4BC42;
  --warning-bg: rgba(244, 188, 66, 0.12);
  --warning-border: rgba(244, 188, 66, 0.35);

  --color-error: #EF5158;
  --error-bg: rgba(239, 81, 88, 0.12);
  --error-border: rgba(239, 81, 88, 0.35);

  --color-info: #40BDEB;
  --info-bg: rgba(64, 189, 235, 0.12);
  --info-border: rgba(64, 189, 235, 0.35);

  /* Spacing Scale */
  --space-2xs: 4px;
  --space-xs: 8px;
  --space-sm: 12px;
  --space-md: 16px;
  --space-lg: 20px;
  --space-xl: 28px;

  /* Geometry & Radii */
  --radius-xs: 4px;
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 10px;
  --radius-full: 9999px;

  /* Elevation Shadows */
  --shadow-sm: 0 2px 6px rgba(0, 0, 0, 0.45);
  --shadow-card: 0 4px 16px rgba(0, 0, 0, 0.55), 0 0 0 1px var(--border-card);
  --shadow-elevated: 0 8px 24px rgba(0, 0, 0, 0.65), 0 0 0 1px var(--border-highlight);
  --shadow-modal: 0 20px 48px rgba(0, 0, 0, 0.85), 0 0 0 1px var(--border-card);

  /* Transitions */
  --transition-fast: 0.14s ease;
  --transition-normal: 0.22s ease;

  /* Monospace Font */
  --font-mono: 'JetBrains Mono', 'Fira Code', Consolas, monospace;

  /* ── 2. BACKWARD-COMPATIBLE ALIASES ──────────────────────────────────── */
  --bg-page: var(--bg-app);
  --bg-surface: var(--bg-card);
  --bg-surface-subtle: var(--bg-card-secondary);
  --bg-muted: var(--bg-card-secondary);

  --text-main: var(--text-primary);
  --text-inverse: #050D0D;

  --border-light: var(--border-card);
  --border-medium: var(--border-card);
  --border-strong: var(--border-highlight);

  --brand: var(--primary-green);
  --brand-hover: var(--bright-green);
  --brand-active: #15AB54;
  --brand-soft: var(--dark-green-tint);
  --brand-border: var(--muted-green);

  --color-primary: var(--primary-green);
  --color-primary-hover: var(--bright-green);
  --color-surface: var(--bg-card);
  --color-surface-subtle: var(--bg-card-secondary);
  --color-surface-card: var(--bg-card);
  --color-surface-hover: var(--bg-card-secondary);
  --color-border: var(--border-card);
  --color-text: var(--text-primary);
  --color-success: var(--primary-green);
  --color-danger: var(--color-error);
  --color-danger-light: var(--error-bg);
  --color-danger-border: var(--error-border);
  --color-warning-light: var(--warning-bg);
  --color-warning-border: var(--warning-border);
  --color-muted: var(--text-muted);

  --status-ok: var(--primary-green);
  --status-ok-bg: var(--dark-green-tint);
  --status-ok-border: rgba(32, 214, 107, 0.3);

  --status-warn: var(--color-warning);
  --status-warn-bg: var(--warning-bg);
  --status-warn-border: var(--warning-border);

  --status-critical: var(--color-error);
  --status-critical-bg: var(--error-bg);
  --status-critical-border: var(--error-border);

  --status-info: var(--color-info);
  --status-info-bg: var(--info-bg);
  --status-info-border: var(--info-border);

  --status-neutral: var(--text-muted);
  --status-neutral-bg: rgba(100, 122, 113, 0.15);
  --status-neutral-border: rgba(100, 122, 113, 0.3);
}

/* ==========================================================================
   RESET & FOUNDATIONS
   ========================================================================== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  width: 100%;
  height: 100%;
  background-image: linear-gradient(
    rgba(0, 15, 11, 0.40),
    rgba(0, 15, 11, 0.55)
  ), url('assets/vana-forest-background.png');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-attachment: fixed;
  background-color: #030F0B;
  color: var(--text-primary);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  font-size: 12.5px;
  line-height: 1.45;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  letter-spacing: -0.015em;
  font-weight: 600;
  color: var(--text-primary);
}

.mono {
  font-family: var(--font-mono);
  font-feature-settings: "zero" 1;
}

a {
  color: var(--primary-green);
  text-decoration: none;
  transition: color var(--transition-fast);
}
a:hover {
  color: var(--bright-green);
  text-decoration: underline;
}

:focus-visible {
  outline: 2px solid var(--primary-green);
  outline-offset: 2px;
}

/* Dark Command Center Scrollbars */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: var(--bg-app);
}
::-webkit-scrollbar-thumb {
  background: #143029;
  border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover {
  background: #1C453B;
}

/* ==========================================================================
   APPLICATION CONTAINER & ATMOSPHERIC LAYOUT SHELL
   ========================================================================== */
.app-container {
  display: flex;
  flex-direction: column;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  position: relative;
  background: transparent;
}

/* ── TOP HEADER (ATMOSPHERIC GLASS COMMAND BAR MATCHING REFERENCE) ─────── */
.top-header,
.navbar {
  height: 62px;
  min-height: 62px;
  width: 100%;
  box-sizing: border-box;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(90deg, rgba(3, 20, 16, 0.86) 0%, rgba(4, 25, 20, 0.80) 50%, rgba(3, 20, 16, 0.86) 100%) !important;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(34, 197, 94, 0.22);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.45), 0 1px 0 rgba(34, 197, 94, 0.08);
  position: sticky;
  top: 0;
  z-index: 100;
  flex-shrink: 0;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 14px;
  height: 100%;
}

.header-brand-wrap {
  display: flex;
  align-items: center;
  text-decoration: none;
  flex-shrink: 0;
  cursor: pointer;
  transition: opacity 0.15s ease;
}

.header-brand-wrap:hover {
  opacity: 0.9;
}

.header-brand-logo-img {
  height: 27px;
  width: auto;
  max-height: 28px;
  object-fit: contain;
  filter: drop-shadow(0 2px 6px rgba(34, 197, 94, 0.45));
  display: block;
}

.header-brand-leaf-img {
  width: 26px;
  height: 26px;
  object-fit: contain;
  filter: drop-shadow(0 2px 6px rgba(34, 197, 94, 0.45));
}

.header-brand-titles {
  display: flex;
  flex-direction: column;
  justify-content: center;
  line-height: 1.15;
  gap: 2.5px;
}

.header-brand-name {
  font-size: 17px;
  font-weight: 900;
  letter-spacing: 0.03em;
  color: #22c55e;
  text-transform: uppercase;
  font-family: 'Inter', sans-serif;
}

.header-brand-subtitle {
  font-size: 10px;
  font-weight: 500;
  color: #a3b8b0;
  letter-spacing: 0.02em;
  white-space: nowrap;
  line-height: 1.15;
}

.header-divider-line {
  width: 1px;
  height: 32px;
  background: rgba(255, 255, 255, 0.16);
  flex-shrink: 0;
}

.gov-id-badge {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  flex-shrink: 0;
  cursor: pointer;
  transition: opacity 0.15s ease;
}

.gov-id-badge:hover {
  opacity: 0.9;
}

.gov-emblem-img {
  height: 34px;
  width: auto;
  object-fit: contain;
  display: block;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5));
}

.gov-text-block {
  display: flex;
  flex-direction: column;
  justify-content: center;
  line-height: 1.15;
  gap: 2px;
}

.gov-title {
  font-size: 12.5px;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: -0.01em;
  white-space: nowrap;
  line-height: 1.15;
}

.gov-subtitle {
  font-size: 10px;
  color: #a3b8b0;
  white-space: nowrap;
  line-height: 1.15;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.system-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 9999px;
  background: rgba(32, 214, 107, 0.12);
  border: 1px solid rgba(32, 214, 107, 0.35);
  color: #22c55e;
  font-size: 11px;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.system-status-pill .pulse-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 6px #22c55e;
  animation: pulseGreen 2s infinite ease-in-out;
}

.header-clock-widget {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #9bafa7;
}

.header-clock-widget svg {
  width: 15px;
  height: 15px;
  color: #9bafa7;
}

.clock-text-wrap {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.clock-time {
  font-size: 11.5px;
  font-weight: 700;
  font-family: var(--font-mono);
  color: #ffffff;
}

.clock-date {
  font-size: 9px;
  color: #9bafa7;
}

.header-icon-btn {
  position: relative;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(13, 28, 26, 0.7);
  border: 1px solid rgba(25, 51, 46, 0.8);
  color: #9bafa7;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.header-icon-btn:hover {
  background: rgba(34, 197, 94, 0.15);
  border-color: rgba(34, 197, 94, 0.45);
  color: #22c55e;
}

.header-icon-btn .icon-badge {
  position: absolute;
  top: -2px;
  right: -2px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #ef4444;
  color: #ffffff;
  font-size: 8.5px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 6px rgba(239, 68, 68, 0.6);
}

/* ==========================================================================
   BUTTON DESIGN SYSTEM (VANA COMMAND CENTER DARK-GREEN THEME)
   ========================================================================== */

/* Universal Button Element Reset */
button, 
input[type="button"], 
input[type="submit"], 
input[type="reset"] {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
  background: transparent;
  border: none;
  cursor: pointer;
  outline: none;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

button:focus-visible,
input[type="button"]:focus-visible,
input[type="submit"]:focus-visible {
  outline: 2px solid var(--bright-green, #36E879);
  outline-offset: 2px;
}

/* Standard Header & Page Action Buttons */
.btn-header,
.admin-header-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 6px 14px;
  min-height: 32px;
  background: rgba(10, 23, 22, 0.85);
  background-image: linear-gradient(180deg, rgba(23, 51, 46, 0.45) 0%, rgba(8, 20, 18, 0.75) 100%);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(34, 197, 94, 0.32);
  border-radius: 6px;
  color: #E8F0EC;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.2px;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  text-decoration: none;
  user-select: none;
}

.btn-header svg,
.admin-header-btn svg {
  width: 13px;
  height: 13px;
  flex-shrink: 0;
  color: #20D66B;
  stroke: currentColor;
  transition: transform 0.2s ease, color 0.2s ease;
}

.btn-header:hover,
.admin-header-btn:hover {
  background: rgba(34, 197, 94, 0.16);
  background-image: linear-gradient(180deg, rgba(34, 197, 94, 0.22) 0%, rgba(16, 50, 38, 0.6) 100%);
  border-color: rgba(34, 197, 94, 0.7);
  color: #36E879;
  box-shadow: 0 0 14px rgba(34, 197, 94, 0.28), 0 3px 8px rgba(0, 0, 0, 0.5);
  transform: translateY(-1px);
}

.btn-header:hover svg,
.admin-header-btn:hover svg {
  color: #36E879;
  transform: scale(1.08);
}

.btn-header:active,
.admin-header-btn:active {
  transform: translateY(1px);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.5), inset 0 1px 3px rgba(0, 0, 0, 0.4);
  background: rgba(34, 197, 94, 0.24);
  border-color: rgba(34, 197, 94, 0.85);
}

/* Primary Emphasized Action Buttons */
.btn-header.primary,
.admin-header-btn.primary {
  background: linear-gradient(135deg, rgba(32, 214, 107, 0.32) 0%, rgba(20, 80, 52, 0.65) 100%);
  border: 1px solid rgba(34, 197, 94, 0.75);
  color: #FFFFFF;
  font-weight: 600;
  box-shadow: 0 0 12px rgba(32, 214, 107, 0.25), 0 2px 6px rgba(0, 0, 0, 0.4);
}

.btn-header.primary svg,
.admin-header-btn.primary svg {
  color: #36E879;
}

.btn-header.primary:hover,
.admin-header-btn.primary:hover {
  background: linear-gradient(135deg, #20D66B 0%, #15AB54 100%);
  border-color: #36E879;
  color: #031410;
  box-shadow: 0 0 20px rgba(34, 197, 94, 0.55), 0 3px 10px rgba(0, 0, 0, 0.5);
  transform: translateY(-1px);
}

.btn-header.primary:hover svg,
.admin-header-btn.primary:hover svg {
  color: #031410;
  transform: scale(1.1);
}

.btn-header.primary:active,
.admin-header-btn.primary:active {
  transform: translateY(1px);
  background: linear-gradient(135deg, #18A652 0%, #11803E 100%);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.6);
}

/* Operational Alert Drawer Actions */
.btn-op-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 5px 12px;
  min-height: 26px;
  background: rgba(10, 23, 22, 0.85);
  border: 1px solid rgba(34, 197, 94, 0.3);
  border-radius: 4px;
  color: #E8F0EC;
  font-family: 'Inter', sans-serif;
  font-size: 11.5px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.btn-op-action:hover {
  background: rgba(34, 197, 94, 0.16);
  border-color: rgba(34, 197, 94, 0.65);
  color: #36E879;
  box-shadow: 0 0 10px rgba(34, 197, 94, 0.2);
  transform: translateY(-1px);
}

.btn-op-action.primary {
  background: rgba(34, 197, 94, 0.22);
  border-color: rgba(34, 197, 94, 0.6);
  color: #36E879;
  font-weight: 600;
}

.btn-op-action.primary:hover {
  background: #20D66B;
  color: #050D0D;
  border-color: #36E879;
  box-shadow: 0 0 14px rgba(34, 197, 94, 0.45);
}

/* ── APP BODY LAYOUT: SOLID SIDEBAR + FOREST WORKSPACE ─────────────────── */
.app-body-layout {
  display: flex;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  background: transparent;
}

/* ── ATMOSPHERIC GLASS SIDEBAR MATCHING REFERENCE ──────────────────────── */
.sidebar {
  width: 235px;
  min-width: 235px;
  max-width: 235px;
  height: 100%;
  background: linear-gradient(180deg, rgba(3, 20, 16, 0.86) 0%, rgba(4, 25, 20, 0.80) 55%, rgba(2, 17, 13, 0.86) 100%) !important;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-right: 1px solid rgba(34, 197, 94, 0.22);
  box-shadow: 4px 0 24px rgba(0, 0, 0, 0.45), 1px 0 0 rgba(34, 197, 94, 0.08);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 16px 12px;
  box-sizing: border-box;
  flex-shrink: 0;
  overflow: hidden;
  position: sticky;
  top: 0;
  z-index: 90;
}

.sidebar .nav-menu {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 0;
  margin: 0;
  overflow-y: auto;
  overflow-x: hidden;
}

.sidebar .nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 8px;
  color: #9bafa7;
  font-size: 15px;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: all var(--transition-fast);
  border: 1px solid transparent;
  white-space: nowrap;
}

.sidebar .nav-item svg {
  width: 18px;
  height: 18px;
  stroke-width: 2;
  color: #9bafa7;
  flex-shrink: 0;
  transition: color var(--transition-fast);
}

.sidebar .nav-item:hover {
  background: rgba(34, 197, 94, 0.08);
  color: #ffffff;
}

.sidebar .nav-item:hover svg {
  color: #22c55e;
}

.sidebar .nav-item.active {
  background: rgba(34, 197, 94, 0.16) !important;
  border: 1px solid rgba(34, 197, 94, 0.45) !important;
  color: #22c55e !important;
  font-weight: 600;
  box-shadow: 0 0 10px rgba(34, 197, 94, 0.15);
}

.sidebar .nav-item.active svg {
  color: #22c55e !important;
}

.sidebar .sidebar-footer {
  padding-top: 12px;
  border-top: 1px solid rgba(25, 51, 46, 0.8);
  margin-top: auto;
  background: transparent;
}

.sidebar .user-profile-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 10px;
  background: rgba(3, 25, 19, 0.85);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(34, 197, 94, 0.28);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.sidebar .user-profile-card:hover {
  background: rgba(14, 38, 32, 0.95);
  border-color: rgba(34, 197, 94, 0.45);
}

.sidebar .user-avatar-circle {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(34, 197, 94, 0.15);
  border: 1px solid rgba(34, 197, 94, 0.35);
  color: #22c55e;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.sidebar .user-avatar-circle svg {
  width: 18px;
  height: 18px;
}

.sidebar .user-info {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
  min-width: 0;
  flex: 1;
}

.sidebar .user-name {
  font-size: 13.5px;
  font-weight: 600;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar .user-role {
  font-size: 11px;
  color: #8da49c;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar .user-caret {
  width: 14px;
  height: 14px;
  color: #8da49c;
  flex-shrink: 0;
}

/* ── MAIN WORKSPACE VIEWPORT ───────────────────────────────────────────── */
.main-viewport {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overflow-x: hidden;
  position: relative;
  min-width: 0;
  background: transparent;
}

.viewport-scroll-container {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 14px 24px 16px;
  max-width: 1880px;
  width: 100%;
  box-sizing: border-box;
  margin: 0 auto;
  min-height: 100%;
}

#viewOverview.view-section {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 14px;
  min-height: 0;
  width: 100%;
  box-sizing: border-box;
}

/* ==========================================================================
   VIEW 1: OVERVIEW DASHBOARD (COMMAND CENTER COMPOSITION)
   ========================================================================= */

/* Section Title Headers (Clean, No Hero Banner) */
.section-intro {
  margin-bottom: 2px;
}

.section-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.section-subtitle {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ==========================================================================
   VIEW 1: OVERVIEW DASHBOARD (COMMAND CENTER COMPOSITION)
   Glassmorphism System: Dark Translucent Green / Blur / Emerald Borders
   ========================================================================== */

/* ── 1. TOP KPI ROW (5 EQUAL GLASSMORPHIC CARDS) ─────────────────────── */
.command-kpi-row {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
  width: 100%;
  flex-shrink: 0;
}

.command-kpi-card {
  background: rgba(3, 25, 18, 0.82) !important;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(34, 197, 94, 0.25) !important;
  border-radius: 11px;
  padding: 11px 14px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 86px;
  cursor: pointer;
  transition: transform var(--transition-fast), border-color var(--transition-fast), box-shadow var(--transition-fast);
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.4);
  position: relative;
  overflow: hidden;
}

.command-kpi-card:hover {
  transform: translateY(-2px);
  border-color: rgba(34, 197, 94, 0.55) !important;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.55), 0 0 12px rgba(34, 197, 94, 0.18);
}

.kpi-top-line {
  display: flex;
  align-items: center;
  gap: 8px;
}

.kpi-icon-box {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.kpi-icon-box svg {
  width: 15px;
  height: 15px;
}

.kpi-icon-box.green {
  background: rgba(34, 197, 94, 0.16);
  color: #22c55e;
  border: 1px solid rgba(34, 197, 94, 0.35);
}

.kpi-icon-box.cyan {
  background: rgba(56, 189, 248, 0.16);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.35);
}

.kpi-icon-box.amber {
  background: rgba(245, 158, 11, 0.16);
  color: #f59e0b;
  border: 1px solid rgba(245, 158, 11, 0.35);
}

.kpi-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  white-space: nowrap;
}

.kpi-middle-line {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 8px;
  margin-top: 4px;
}

.kpi-data-block {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.kpi-value {
  font-size: 18px;
  font-weight: 700;
  color: #FFFFFF;
  font-family: var(--font-mono);
  line-height: 1.15;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.kpi-trend {
  font-size: 11px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

.kpi-trend.green {
  color: #22c55e;
}

.trend-arrow {
  font-size: 12px;
  font-weight: 700;
}

.kpi-sparkline {
  width: 68px;
  height: 22px;
  flex-shrink: 0;
  opacity: 0.92;
}

.kpi-sub-split {
  font-size: 10.5px;
  display: flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

.sub-amber {
  color: #f59e0b;
  font-weight: 600;
}

.sub-red {
  color: #ef4444;
  font-weight: 600;
}

.sub-sep {
  color: rgba(255, 255, 255, 0.25);
}

.gov-allow {
  color: #22c55e !important;
}

.kpi-donut-wrap {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
}

.donut-chart {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

/* ── 2. GENERIC COMMAND CENTER PANEL (GLASSMORPHISM) ──────────────────── */
.command-panel {
  background: rgba(3, 25, 18, 0.80) !important;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(34, 197, 94, 0.28) !important;
  border-radius: 13px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.45);
}

.panel-header-bar {
  padding: 12px 18px;
  background-color: rgba(7, 28, 23, 0.55);
  border-bottom: 1px solid rgba(34, 197, 94, 0.22);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 46px;
  flex-shrink: 0;
}

.panel-header-left {
  display: flex;
  align-items: center;
  gap: 9px;
}

.header-icon-dot {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
}
.header-icon-dot.green { color: #22c55e; }
.header-icon-dot.red { color: #ef4444; }
.header-icon-dot.amber { color: #f59e0b; }
.header-icon-dot svg {
  width: 16px;
  height: 16px;
}

.panel-title-text {
  font-size: 14.5px;
  font-weight: 600;
  color: #FFFFFF;
  letter-spacing: -0.01em;
}

.panel-header-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.panel-link-action {
  font-size: 12.5px;
  font-weight: 600;
  color: #22c55e;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: color var(--transition-fast);
}
.panel-link-action:hover {
  color: #36e879;
  text-decoration: underline;
}

.badge-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 8px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 600;
}
.badge-status-pill.green {
  background: rgba(34, 197, 94, 0.15);
  border: 1px solid rgba(34, 197, 94, 0.35);
  color: #22c55e;
}
.badge-status-pill.green .pulse-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 5px #22c55e;
  animation: pulseGreen 2s infinite;
}

.dark-select-compact {
  height: 28px;
  background: rgba(7, 26, 21, 0.8);
  border: 1px solid rgba(34, 197, 94, 0.3);
  border-radius: var(--radius-xs);
  color: #E8F0EC;
  font-size: 11.5px;
  padding: 0 8px;
  cursor: pointer;
}

.map-icon-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}
.map-icon-btn:hover {
  color: #22c55e;
  background: rgba(34, 197, 94, 0.12);
}

/* ── 3. MIDDLE GRID: 2 COLUMNS (MAP ON LEFT, ALERTS & GOV ON RIGHT) ───── */
.command-middle-grid {
  display: grid;
  grid-template-columns: 1.62fr 1fr;
  gap: 14px;
  width: 100%;
  flex: 1.25;
  min-height: 380px;
}

.map-panel {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 380px;
  border-radius: 13px;
}

.map-panel .panel-map-wrapper {
  flex: 1;
  min-height: 0;
  position: relative;
  background: #020807;
  overflow: hidden;
  height: auto;
}

.geo-map-viewport.compact-overview-map {
  width: 100%;
  height: 100%;
  position: relative;
}

#leafletMap {
  width: 100%;
  height: 100%;
  background: #030A09;
}

/* Floating Map Controls */
.map-floating-controls {
  position: absolute;
  top: 12px;
  left: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  z-index: 400;
}

.floating-btn {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: rgba(3, 22, 17, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(34, 197, 94, 0.35);
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
  transition: all var(--transition-fast);
}

.floating-btn:hover {
  background: rgba(34, 197, 94, 0.25);
  border-color: #22c55e;
  color: #36e879;
}

/* Bottom Legend Bar overlaid on map */
.map-overlay-legend {
  position: absolute;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 400;
  background: rgba(3, 22, 17, 0.9);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(34, 197, 94, 0.32);
  border-radius: var(--radius-full);
  padding: 4px 14px;
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 11px;
  color: var(--text-secondary);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.6);
  white-space: nowrap;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.legend-dot.green {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 5px #22c55e;
}
.legend-tri.red {
  color: #ef4444;
  font-size: 11px;
}
.legend-tri.amber {
  color: #f59e0b;
  font-size: 11px;
}
.legend-dash.green {
  color: #22c55e;
  font-weight: 700;
  letter-spacing: 1px;
}

/* Right Stack: Recent Alerts (Expanded full height) */
.command-right-stack {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 380px;
}

.alerts-panel {
  flex: 1;
  height: 100%;
  display: flex;
  flex-direction: column;
  min-height: 0;
  border-radius: 13px;
  background: var(--bg-card, #071915);
  border: 1px solid var(--border-panel, rgba(34, 197, 94, 0.2));
  overflow: hidden;
  box-sizing: border-box;
}

.alerts-feed-wrapper {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-sizing: border-box;
  scrollbar-width: thin;
  scrollbar-color: rgba(34, 197, 94, 0.3) rgba(3, 16, 13, 0.45);
}

/* Custom dark-green scrollbar matching theme */
.alerts-feed-wrapper::-webkit-scrollbar {
  width: 5px;
}
.alerts-feed-wrapper::-webkit-scrollbar-track {
  background: rgba(3, 16, 13, 0.45);
  border-radius: 4px;
}
.alerts-feed-wrapper::-webkit-scrollbar-thumb {
  background: rgba(34, 197, 94, 0.28);
  border-radius: 4px;
}
.alerts-feed-wrapper::-webkit-scrollbar-thumb:hover {
  background: rgba(34, 197, 94, 0.48);
}

.alert-feed-row {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 5px;
  padding: 12px 14px;
  border-radius: 9px;
  background: rgba(7, 26, 21, 0.65);
  border: 1px solid rgba(34, 197, 94, 0.16);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
  transition: background 0.18s ease, border-color 0.18s ease, transform 0.15s ease;
  flex-shrink: 0;
  width: 100%;
  box-sizing: border-box;
}

.alert-feed-row:hover {
  background: rgba(11, 38, 31, 0.85);
  border-color: rgba(34, 197, 94, 0.35);
  transform: translateY(-1px);
}

.alert-pill-badge {
  display: inline-flex;
  align-items: center;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  padding: 2.5px 8px;
  border-radius: 4px;
  letter-spacing: 0.04em;
  line-height: 1.2;
  margin-bottom: 2px;
}

.alert-pill-badge.high {
  background: rgba(239, 68, 68, 0.18);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.45);
}

.alert-pill-badge.medium {
  background: rgba(245, 158, 11, 0.18);
  color: #f59e0b;
  border: 1px solid rgba(245, 158, 11, 0.45);
}

.alert-pill-badge.info {
  background: rgba(56, 189, 248, 0.18);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.45);
}

.alert-content {
  width: 100%;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.alert-title {
  font-size: 13.5px;
  font-weight: 700;
  color: #ffffff;
  line-height: 1.35;
  letter-spacing: -0.01em;
  overflow-wrap: anywhere;
  word-break: break-word;
  white-space: normal;
}

.alert-sub {
  font-size: 11.5px;
  font-weight: 500;
  color: #8da49c;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.alert-time {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 500;
  color: #6b857c;
  line-height: 1.2;
  margin-top: 2px;
}

.alert-dot {
  width: 6.5px;
  height: 6.5px;
  border-radius: 50%;
  flex-shrink: 0;
  display: inline-block;
}
.alert-dot.red { background: #ef4444; box-shadow: 0 0 6px rgba(239, 68, 68, 0.7); }
.alert-dot.amber { background: #f59e0b; box-shadow: 0 0 6px rgba(245, 158, 11, 0.7); }
.alert-dot.blue { background: #38bdf8; box-shadow: 0 0 6px rgba(56, 189, 248, 0.7); }

/* Governance Summary Card */
.governance-panel {
  flex: 0.95;
  display: flex;
  flex-direction: column;
  min-height: 0;
  border-radius: 13px;
}

.gov-summary-content {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px 12px;
}

.gov-decision-columns {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  width: 100%;
}

.gov-decision-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 8px 6px;
  border-radius: 8px;
  background: rgba(7, 26, 21, 0.55);
  border: 1px solid rgba(34, 197, 94, 0.18);
}

.decision-head {
  display: flex;
  align-items: center;
  gap: 6px;
}

.decision-icon-circle {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.decision-icon-circle.green { background: rgba(34, 197, 94, 0.2); color: #22c55e; border: 1px solid rgba(34, 197, 94, 0.4); }
.decision-icon-circle.amber { background: rgba(245, 158, 11, 0.2); color: #f59e0b; border: 1px solid rgba(245, 158, 11, 0.4); }
.decision-icon-circle.red { background: rgba(239, 68, 68, 0.2); color: #ef4444; border: 1px solid rgba(239, 68, 68, 0.4); }

.decision-label {
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #FFFFFF;
}

.decision-rate {
  font-size: 24px;
  font-weight: 800;
  font-family: var(--font-mono);
  line-height: 1;
}
.decision-rate.green { color: #22c55e; }
.decision-rate.amber { color: #f59e0b; }
.decision-rate.red { color: #ef4444; }

/* ── 4. BOTTOM GRID: 3 EQUAL COLUMNS (TREND, COVERAGE, EVIDENCE & AUDIT) ── */
.command-bottom-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  width: 100%;
  flex: 1;
  min-height: 280px;
}

.command-bottom-grid .command-panel {
  height: 100%;
  min-height: 280px;
  border-radius: 13px;
  display: flex;
  flex-direction: column;
  min-width: 0;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.command-bottom-grid .command-panel:hover {
  border-color: rgba(34, 197, 94, 0.38) !important;
  box-shadow: 0 10px 32px rgba(0, 0, 0, 0.55);
}

/* ── Card 1: Trend Panel ── */
.trend-panel .panel-header-bar {
  flex-shrink: 0;
}

.filter-pill-group {
  display: flex;
  align-items: center;
  background: rgba(7, 26, 21, 0.85);
  border: 1px solid rgba(34, 197, 94, 0.28);
  border-radius: 6px;
  padding: 2px;
  gap: 2px;
}

.filter-pill-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 4px;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.filter-pill-btn:hover {
  color: #FFFFFF;
  background: rgba(34, 197, 94, 0.14);
}

.filter-pill-btn.active {
  background: rgba(34, 197, 94, 0.25);
  color: #22c55e;
  border: 1px solid rgba(34, 197, 94, 0.45);
}

.trend-chart-container {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding: 12px 18px 10px;
  position: relative;
  min-width: 0;
}

.trend-y-axis {
  position: absolute;
  left: 14px;
  top: 12px;
  bottom: 28px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  font-size: 11px;
  color: #647a71;
  font-family: var(--font-mono);
  user-select: none;
}

.trend-svg-wrap {
  flex: 1;
  min-height: 0;
  margin-left: 32px;
  position: relative;
  display: flex;
}

.trend-area-chart {
  width: 100%;
  height: 100%;
}

.trend-data-point {
  cursor: pointer;
  transition: r 0.15s ease, fill 0.15s ease;
}

.trend-data-point:hover {
  r: 5.5 !important;
  fill: #36e879 !important;
}

.trend-floating-tooltip {
  position: absolute;
  right: 14px;
  top: 6px;
  background: rgba(3, 19, 15, 0.95);
  border: 1px solid rgba(34, 197, 94, 0.45);
  border-radius: 6px;
  padding: 4px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.7);
  pointer-events: none;
  transition: all 0.2s ease;
}

.tooltip-val {
  font-size: 12.5px;
  font-weight: 700;
  color: #FFFFFF;
  font-family: var(--font-mono);
}

.tooltip-date {
  font-size: 10px;
  color: #8da49c;
}

.trend-x-axis {
  display: flex;
  justify-content: space-between;
  margin-left: 32px;
  padding-top: 8px;
  border-top: 1px solid rgba(34, 197, 94, 0.2);
  font-size: 11px;
  color: #647a71;
  user-select: none;
}

/* ── Card 2: Regional Coverage Panel ── */
.coverage-panel .panel-header-bar {
  flex-shrink: 0;
}

.regional-coverage-body {
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 10px 14px;
  min-width: 0;
}

.regional-gauge-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  width: 96px;
  cursor: pointer;
  padding: 4px;
  border-radius: 8px;
  transition: background var(--transition-fast), transform var(--transition-fast);
}

.regional-gauge-box:hover {
  background: rgba(34, 197, 94, 0.08);
  transform: scale(1.02);
}

.gauge-ring-wrap {
  position: relative;
  width: 82px;
  height: 82px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.coverage-gauge-svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.gauge-center-text {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  pointer-events: none;
}

.gauge-center-text .gauge-num {
  font-size: 18px;
  font-weight: 800;
  font-family: var(--font-mono);
  color: #FFFFFF;
  line-height: 1;
}

.gauge-center-text .gauge-sub {
  font-size: 9.5px;
  font-weight: 700;
  color: #22c55e;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-top: 3px;
  line-height: 1;
}

.gauge-label-wrap {
  text-align: center;
  line-height: 1.2;
}

.gauge-label-main {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-primary);
}

.gauge-label-sub {
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 1px;
}

.regional-bars-list {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 6px;
  min-width: 0;
}

.region-bar-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11.5px;
  padding: 2px 4px;
  border-radius: 6px;
  cursor: pointer;
  transition: background var(--transition-fast), transform 0.12s ease;
  min-width: 0;
}

.region-bar-item:hover {
  background: rgba(34, 197, 94, 0.12);
  transform: translateX(2px);
}

.region-name {
  flex: 0 0 95px;
  max-width: 100px;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
}

.reg-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 4px #22c55e;
  flex-shrink: 0;
}

.region-progress-bar {
  flex: 1;
  min-width: 25px;
  height: 6px;
  background: rgba(25, 51, 46, 0.7);
  border-radius: 3px;
  overflow: hidden;
}

.reg-fill {
  height: 100%;
  background: #22c55e;
  border-radius: 3px;
  transition: width 0.4s ease;
}

.region-val {
  flex: 0 0 65px;
  text-align: right;
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 11px;
  white-space: nowrap;
}

.region-val.live {
  color: #22c55e;
}

.region-val.standby {
  color: var(--text-muted);
}

/* ── Card 3: Evidence & Audit Panel ── */
.audit-panel .panel-header-bar {
  flex-shrink: 0;
}

.audit-panel-body {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 12px 18px;
  gap: 10px;
  min-width: 0;
}

.audit-rows-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.audit-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 4px 6px 5px;
  border-bottom: 1px solid rgba(34, 197, 94, 0.16);
  font-size: 12.5px;
  border-radius: 6px;
  min-width: 0;
  transition: background var(--transition-fast);
}

.audit-row.clickable {
  cursor: pointer;
}

.audit-row.clickable:hover {
  background: rgba(34, 197, 94, 0.1);
}

.audit-row-label {
  color: var(--text-muted);
  flex: 0 0 95px;
  font-size: 12px;
  white-space: nowrap;
}

.audit-row-code {
  flex: 1;
  min-width: 0;
  color: var(--text-primary);
  font-weight: 500;
  font-size: 12.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.status-badge {
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  flex-shrink: 0;
}

.status-badge.verified,
.status-badge.success {
  background: rgba(34, 197, 94, 0.18);
  color: #22c55e;
  border: 1px solid rgba(34, 197, 94, 0.35);
}

.copy-hash-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  padding: 3px;
  border-radius: 4px;
  transition: all var(--transition-fast);
  flex-shrink: 0;
}

.copy-hash-btn:hover {
  color: #22c55e;
  background: rgba(34, 197, 94, 0.12);
}

.audit-system-status-banner {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 8px;
  background: rgba(34, 197, 94, 0.12);
  border: 1px solid rgba(34, 197, 94, 0.3);
  color: #22c55e;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--transition-fast), border-color var(--transition-fast), transform 0.12s ease;
}

.audit-system-status-banner:hover {
  background: rgba(34, 197, 94, 0.2);
  border-color: rgba(34, 197, 94, 0.5);
  transform: translateY(-1px);
}

.status-check-circle {
  font-weight: 800;
}

/* ==========================================================================
   VIEW 2, 3, 4, 5: DARK COMMAND CENTER OVERHAUL
   ========================================================================== */

/* Cards & Generic Panels across all views */
.content-panel {
  background: rgba(3, 25, 18, 0.82) !important;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(34, 197, 94, 0.28) !important;
  border-radius: 13px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.45);
  overflow: hidden;
}

.panel-header {
  padding: 14px 20px;
  background-color: rgba(7, 28, 23, 0.65) !important;
  border-bottom: 1px solid rgba(34, 197, 94, 0.22);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.panel-title {
  font-size: 14.5px;
  font-weight: 700;
  color: #FFFFFF;
  letter-spacing: -0.01em;
}

.panel-body {
  padding: 16px 20px;
}

/* Status Pills */
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-size: 10.5px;
  font-weight: 600;
  white-space: nowrap;
}

.status-pill.active {
  background: rgba(32, 214, 107, 0.14);
  border: 1px solid rgba(32, 214, 107, 0.35);
  color: var(--bright-green);
}
.status-pill.active .status-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--bright-green);
  box-shadow: 0 0 4px var(--bright-green);
}

.status-pill.waiting,
.status-pill.pending {
  background: var(--warning-bg);
  border: 1px solid var(--warning-border);
  color: var(--color-warning);
}
.status-pill.waiting .status-dot,
.status-pill.pending .status-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--color-warning);
}

.status-pill.neutral {
  background: rgba(100, 122, 113, 0.15);
  border: 1px solid rgba(100, 122, 113, 0.3);
  color: var(--text-secondary);
}

/* Dark Data Tables */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--border-card);
  border-radius: var(--radius-sm);
  background: var(--bg-card);
}

table.data-table,
.observation-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11.5px;
  color: var(--text-primary);
}

table.data-table th,
.observation-table th {
  padding: 9px 12px;
  background: var(--bg-card-secondary);
  border-bottom: 1px solid var(--border-card);
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 10px;
  letter-spacing: 0.04em;
  text-align: left;
}

table.data-table td,
.observation-table td {
  padding: 9px 12px;
  border-bottom: 1px solid rgba(25, 51, 46, 0.6);
  vertical-align: middle;
}

table.data-table tr:hover td,
.observation-table tr:hover td {
  background: rgba(32, 214, 107, 0.04);
}

/* Filter Bars & Inputs */
.filter-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: var(--bg-card-secondary);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-sm);
  margin-bottom: 12px;
}

.form-input,
.filter-select,
.search-input {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  color: var(--text-primary);
  border-radius: var(--radius-xs);
  padding: 5px 8px;
  font-size: 11.5px;
  outline: none;
}
.form-input:focus,
.filter-select:focus,
.search-input:focus {
  border-color: var(--primary-green);
}

/* Reviews & Decisions Callouts */
.assessment-callout {
  background: var(--bg-card-secondary);
  border: 1px solid var(--border-card);
  border-left: 4px solid var(--color-warning);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  margin-bottom: 14px;
}

.step-card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
}

.role-action-box {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  padding: 16px;
}

/* History Code & Diff Blocks */
pre, code, .code-block, .json-box {
  background: #040A09 !important;
  color: #A3E7BF !important;
  border: 1px solid var(--border-card);
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 11px;
}

.diff-row-clean {
  background: rgba(32, 214, 107, 0.06);
  color: var(--bright-green);
}
.diff-row-mismatch {
  background: rgba(239, 81, 88, 0.12);
  color: var(--color-error);
}

/* Modals */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(2, 8, 7, 0.85);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-content {
  background: var(--bg-card);
  border: 1px solid var(--border-highlight);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-modal);
  color: var(--text-primary);
  max-width: 520px;
  width: 90%;
  overflow: hidden;
}

.modal-header {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-card);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-card-secondary);
}

.modal-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
}

.modal-body {
  padding: 18px;
}

/* ==========================================================================
   MONITORING SUMMARY GRID (3 COMPACT STAT CARDS)
   ========================================================================== */
.monitoring-summary-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-md);
}

.monitoring-stat-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  box-shadow: var(--shadow-subtle);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
}

.mon-stat-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.mon-stat-val {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.1;
  font-family: var(--font-mono, inherit);
}

.mon-stat-label {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-main);
  margin-top: 3px;
}

.mon-stat-sub {
  font-size: 11px;
  color: var(--text-muted);
}

/* ==========================================================================
   CONTENT CARDS AND PANELS
   ========================================================================== */
.content-panel {
  background: rgba(3, 25, 18, 0.82) !important;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(34, 197, 94, 0.28) !important;
  border-radius: 13px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.45);
  overflow: hidden;
  min-width: 0;
}

.panel-header {
  padding: 14px 20px;
  border-bottom: 1px solid rgba(34, 197, 94, 0.22);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: rgba(7, 28, 23, 0.65) !important;
}

.panel-title {
  font-size: 14.5px;
  font-weight: 700;
  color: #FFFFFF;
  letter-spacing: -0.01em;
}

.panel-body {
  padding: 16px 20px;
}

/* ==========================================================================
   OVERVIEW MAIN GRID (MONITORED LOCATIONS & REGIONAL MAP)
   ========================================================================== */
.overview-main-grid {
  display: grid;
  grid-template-columns: 390px 1fr;
  gap: var(--space-md);
  align-items: stretch;
}

.overview-locations-panel {
  display: flex;
  flex-direction: column;
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-subtle);
  overflow: hidden;
}

.overview-location-list {
  display: flex;
  flex-direction: column;
  flex: 1;
}

.overview-location-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-light);
  background: var(--bg-surface);
  cursor: pointer;
  transition: background var(--transition-fast), border-color var(--transition-fast);
  text-decoration: none;
}

.overview-location-row:last-child {
  border-bottom: none;
}

.overview-location-row:hover {
  background: var(--bg-surface-subtle);
}

.overview-location-row:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: -2px;
}

.location-row-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 5px;
  background: var(--border-medium);
  transition: transform var(--transition-fast);
}

.overview-location-row.live .location-row-indicator {
  background: var(--status-ok);
  box-shadow: 0 0 0 2px var(--status-ok-border);
}

.overview-location-row.pending .location-row-indicator {
  background: var(--status-warn);
}

.overview-location-row:hover .location-row-indicator {
  transform: scale(1.2);
}

.location-row-content {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.location-row-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.location-row-title-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.location-row-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-main);
  white-space: nowrap;
}

.location-zone-id {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  font-weight: 600;
  color: var(--text-secondary);
  background: var(--bg-muted);
  border: 1px solid var(--border-light);
  padding: 1px 5px;
  border-radius: var(--radius-sm);
  letter-spacing: 0.02em;
}

.location-row-desc {
  font-size: 11.5px;
  color: var(--text-secondary);
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.overview-map-panel {
  display: flex;
  flex-direction: column;
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-subtle);
  overflow: hidden;
  min-width: 0;
}

.overview-map-body {
  flex: 1;
  position: relative;
  min-height: 440px;
  background: var(--border-card, #19332E);
}

.overview-map-body .compact-overview-map {
  width: 100%;
  height: 100%;
  min-height: 440px;
  border-radius: 0;
  border: none;
}

@media (max-width: 1024px) {
  .overview-main-grid {
    grid-template-columns: 340px 1fr;
  }
}

@media (max-width: 860px) {
  .overview-main-grid {
    grid-template-columns: 1fr;
  }
  .overview-map-body {
    min-height: 350px;
  }
  .overview-map-body .compact-overview-map {
    min-height: 350px;
  }
}

/* ==========================================================================
   LOCATIONS NEEDING ATTENTION LIST
   ========================================================================== */
.attention-list {
  display: flex;
  flex-direction: column;
  divide-y: 1px solid var(--border-light);
}

.attention-row {
  padding: var(--space-md);
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-md);
  transition: background var(--transition-fast);
}

.attention-row:last-child {
  border-bottom: none;
}

.attention-row:hover {
  background: var(--bg-surface-subtle);
}

.attention-main {
  display: flex;
  flex-direction: column;
  gap: 3px;
  flex: 1;
  min-width: 0;
}

.attention-location-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 8px;
}

.attention-issue-desc {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.4;
}

.attention-meta {
  font-size: 11px;
  color: var(--text-muted);
  display: flex;
  gap: 12px;
  margin-top: 3px;
}

.attention-action {
  flex-shrink: 0;
  display: flex;
  align-items: center;
}

/* ==========================================================================
   PLAIN STATUS BADGES
   ========================================================================== */
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 7px;
  border-radius: var(--radius-sm);
  font-size: 11px;
  font-weight: 500;
  line-height: 1.2;
}

.status-pill.active {
  background: var(--status-ok-bg);
  color: var(--status-ok);
  border: 1px solid var(--status-ok-border);
}

.status-pill.waiting {
  background: var(--status-warn-bg);
  color: var(--status-warn);
  border: 1px solid var(--status-warn-border);
}

.status-pill.paused {
  background: var(--status-warn-bg);
  color: var(--status-warn);
  border: 1px solid var(--status-warn-border);
}

.status-pill.failed {
  background: var(--status-critical-bg);
  color: var(--status-critical);
  border: 1px solid var(--status-critical-border);
}

.status-pill.neutral {
  background: var(--bg-muted);
  color: var(--text-secondary);
  border: 1px solid var(--border-light);
}

/* ==========================================================================
   DATA TABLES AND WRAPPERS
   ========================================================================== */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  background: var(--bg-card, #0A1716);
}

.plain-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 12.5px;
  min-width: 600px;
}

.plain-table th {
  background: var(--bg-page);
  padding: 8px 12px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border-light);
  white-space: nowrap;
}

.plain-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-light);
  color: var(--text-main);
  vertical-align: middle;
}

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

.plain-table tr:hover td {
  background: var(--bg-card-secondary, #0D1C1A);
}

/* ==========================================================================
   FILTER BARS
   ========================================================================== */
.filter-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 10px 14px;
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
}

.filter-btn {
  padding: 4px 10px;
  border-radius: var(--radius-md);
  font-size: 11.5px;
  font-weight: 500;
  border: 1px solid var(--border-light);
  background: var(--bg-card, #0A1716);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.filter-btn:hover {
  background: var(--bg-muted);
  color: var(--text-main);
}

.filter-btn.active {
  background: var(--brand);
  color: var(--bg-card, #0A1716);
  border-color: var(--brand);
  font-weight: 600;
}

.filter-select {
  padding: 4px 8px;
  font-size: 11.5px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  background: var(--bg-card, #0A1716);
  color: var(--text-main);
  outline: none;
}

/* ==========================================================================
   ASSESSMENT REVIEWS & DECISIONS
   ========================================================================== */
.assessment-callout {
  padding: var(--space-md);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-md);
}

.assessment-callout.paused {
  background: var(--status-warn-bg);
  border: 1px solid var(--status-warn-border);
}

.assessment-status-heading {
  font-size: 14px;
  font-weight: 700;
  color: var(--color-warning, #F4BC42);
  margin-bottom: 4px;
}

.assessment-status-text {
  font-size: 12.5px;
  color: var(--text-main);
  line-height: 1.45;
}

.decision-sections-grid {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.decision-step-card {
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  background: var(--bg-surface);
}

.decision-step-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 4px;
}

.decision-step-body {
  font-size: 13px;
  color: var(--text-main);
  line-height: 1.45;
}

/* ==========================================================================
   ROLE AWARE ACTION BOX
   ========================================================================== */
.role-action-box {
  background: var(--bg-page);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  margin-top: var(--space-md);
}

.role-action-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 2px;
}

.role-action-text {
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: var(--space-sm);
  line-height: 1.4;
}

.role-action-btns {
  display: flex;
  gap: var(--space-xs);
  flex-wrap: wrap;
}

/* ==========================================================================
   COLLAPSIBLE TECHNICAL DETAILS
   ========================================================================== */
.tech-details {
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  background: var(--bg-page);
  margin-top: var(--space-md);
  overflow: hidden;
}

.tech-details summary {
  padding: 10px 14px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  user-select: none;
  background: var(--bg-surface);
}
.tech-details summary:hover {
  color: var(--brand);
}

.tech-details-content {
  padding: var(--space-md);
  border-top: 1px solid var(--border-light);
  background: var(--bg-surface);
}

.tech-kv-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.tech-kv-item {
  background: var(--bg-page);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 6px 10px;
  min-width: 0;
}

.tech-k {
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-bottom: 2px;
}

.tech-v {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-main);
  overflow-wrap: anywhere;
  word-break: break-word;
}

.code-viewer {
  background: var(--text-primary, #E8F0EC);
  color: var(--border-card, #19332E);
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  line-height: 1.5;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  overflow-x: auto;
  max-height: 320px;
  overflow-wrap: anywhere;
}

/* ==========================================================================
   MAP AND LOCATIONS LAYOUT
   ========================================================================== */
.map-page-layout {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: var(--space-md);
  align-items: start;
}

.map-viewport-wrapper {
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--bg-card, #0A1716);
}

.map-container {
  width: 100%;
  height: 480px;
  background: var(--border-card, #19332E);
  position: relative;
}

#leafletMap {
  width: 100%;
  height: 100%;
  z-index: 1;
}

.map-location-panel {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

/* ==========================================================================
   MODAL
   ========================================================================== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(31, 41, 35, 0.45);
  backdrop-filter: blur(2px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal-box {
  width: 100%;
  max-width: 400px;
  background: var(--bg-card, #0A1716);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-modal);
  border: 1px solid var(--border-light);
  overflow: hidden;
}

.modal-head {
  padding: var(--space-md);
  border-bottom: 1px solid var(--border-light);
}

.modal-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-main);
}

.modal-sub {
  font-size: 11.5px;
  color: var(--text-secondary);
  margin-top: 2px;
}

.form-group {
  padding: 10px var(--space-md) 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.form-group label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-main);
}

.form-input {
  width: 100%;
  padding: 8px 10px;
  font-size: 12.5px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  background: var(--bg-page);
  color: var(--text-main);
  outline: none;
}
.form-input:focus {
  border-color: var(--brand);
  background: var(--bg-card, #0A1716);
}

.form-actions {
  padding: var(--space-md);
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.btn-form {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 7px 16px;
  min-height: 32px;
  font-size: 12px;
  font-weight: 500;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  border-radius: var(--radius-sm, 6px);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  text-decoration: none;
  user-select: none;
}
.btn-form.primary {
  background: linear-gradient(135deg, #20D66B 0%, #15AB54 100%);
  border: 1px solid #36E879;
  color: #050D0D;
  font-weight: 600;
  box-shadow: 0 0 14px rgba(32, 214, 107, 0.35);
}
.btn-form.primary:hover {
  background: linear-gradient(135deg, #36E879 0%, #20D66B 100%);
  border-color: #55f392;
  box-shadow: 0 0 20px rgba(32, 214, 107, 0.55);
  transform: translateY(-1px);
}
.btn-form.primary:active {
  transform: translateY(1px);
}
.btn-form.secondary {
  background: rgba(10, 23, 22, 0.85);
  border: 1px solid rgba(25, 51, 46, 0.95);
  color: var(--text-secondary, #9BAFA7);
}
.btn-form.secondary:hover {
  background: rgba(16, 36, 32, 0.95);
  border-color: rgba(34, 197, 94, 0.45);
  color: #E8F0EC;
  box-shadow: 0 0 10px rgba(34, 197, 94, 0.15);
  transform: translateY(-1px);
}
.btn-form.secondary:active {
  transform: translateY(1px);
}

/* ==========================================================================
   MOBILE BOTTOM NAVIGATION
   ========================================================================== */
.mobile-bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100vw;
  height: 54px;
  background: var(--bg-card, #0A1716);
  border-top: 1px solid var(--border-light);
  z-index: 40;
  justify-content: space-around;
  align-items: center;
  padding: 0 4px;
}

.bottom-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 9.5px;
  font-weight: 500;
  cursor: pointer;
  flex: 1;
  padding: 4px;
}

.bottom-nav-item svg {
  width: 17px;
  height: 17px;
  stroke-width: 2;
}

.bottom-nav-item.active {
  color: var(--brand);
  font-weight: 600;
}

/* ==========================================================================
   MAP TELEMETRY STRIP & LINEAGE RAIL STYLES
   ========================================================================== */
.map-telemetry-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-sm);
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-top: none;
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  padding: 10px 14px;
}

.telemetry-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.telemetry-label {
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.telemetry-value {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Compatibility & Lineage Rail Aliases */
.card-panel {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-subtle);
  overflow: hidden;
  min-width: 0;
  margin-bottom: var(--space-sm);
}

.card-panel-head {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-sm);
  background: var(--bg-surface);
}

.card-panel-title {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-main);
}

.card-panel-body {
  padding: 14px;
}

.field-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 10px;
}

.field-cell {
  background: var(--bg-page);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  min-width: 0;
}

.field-k {
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 2px;
  font-weight: 600;
}

.field-v {
  font-size: 12.5px;
  color: var(--text-main);
  font-weight: 500;
  overflow-wrap: anywhere;
}

.field-v.gap {
  color: var(--color-warning, #F4BC42);
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  border-radius: var(--radius-sm);
  font-size: 10.5px;
  font-weight: 600;
  text-transform: uppercase;
  background: var(--bg-muted);
  color: var(--text-secondary);
}

.badge.LIVE {
  background: var(--status-ok-bg);
  color: var(--status-ok);
  border: 1px solid var(--status-ok-border);
}

.badge.CONTROLLED {
  background: var(--status-warn-bg);
  color: var(--status-warn);
  border: 1px solid var(--status-warn-border);
}

.badge.LOCAL {
  background: var(--bg-muted);
  color: var(--text-secondary);
  border: 1px solid var(--border-light);
}

.badge.BLOCKED {
  background: var(--status-critical-bg);
  color: var(--status-critical);
  border: 1px solid var(--status-critical-border);
}



/* ==========================================================================
   ITERATION 4: MAP & LOCATIONS REDESIGN (SINGLE-PAGE VIEWPORT FIT)
   ========================================================================== */

#viewMap.view-section {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 0;
  height: 100%;
  width: 100%;
  box-sizing: border-box;
}

/* ── Top Header Bar ── */
.spatial-header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 0 2px 0;
  flex-shrink: 0;
  gap: 12px;
  flex-wrap: wrap;
}

.spatial-header-left {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.spatial-header-left .section-title {
  font-size: 16px;
  font-weight: 700;
  color: #ffffff;
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
}

.spatial-header-left .section-subtitle {
  font-size: 12px;
  color: #8da49c;
  margin: 0;
}

.spatial-header-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.spatial-header-kpis {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(3, 25, 18, 0.75);
  border: 1px solid rgba(34, 197, 94, 0.22);
  border-radius: 8px;
  padding: 4px 10px;
}

.spatial-kpi-pill {
  font-size: 11.5px;
  font-weight: 500;
  color: #94a3b8;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.spatial-kpi-pill strong {
  font-weight: 700;
  color: #ffffff;
}

/* ── Middle Grid: Map (Left ~72%) + Intelligence Panel (Right ~28%) ── */
.map-layout-grid {
  display: grid;
  grid-template-columns: 1fr 370px;
  gap: 12px;
  flex: 58;
  min-height: 340px;
  width: 100%;
  box-sizing: border-box;
}

.map-primary-panel {
  background: rgba(3, 25, 18, 0.82);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(34, 197, 94, 0.28);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  height: 100%;
  min-height: 0;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
}

.map-viewport-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 14px;
  border-bottom: 1px solid rgba(34, 197, 94, 0.20);
  background: rgba(7, 26, 21, 0.95);
  flex-shrink: 0;
  gap: 8px;
}

.full-map-slot {
  width: 100%;
  flex: 1;
  min-height: 0;
  height: 100%;
  position: relative;
  background: #030A09;
}

.full-map-slot .geo-map-viewport {
  width: 100%;
  height: 100% !important;
  min-height: 0 !important;
}

.map-legend-bar {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 7px 14px;
  background: rgba(7, 26, 21, 0.95);
  border-top: 1px solid rgba(34, 197, 94, 0.20);
  font-size: 11px;
  color: #8da49c;
  flex-shrink: 0;
  flex-wrap: wrap;
}

.map-legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.map-legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}

.map-legend-dot.live {
  background: #22c55e;
  box-shadow: 0 0 6px rgba(34, 197, 94, 0.6);
}

.map-legend-dot.pending {
  background: #f59e0b;
  box-shadow: 0 0 6px rgba(245, 158, 11, 0.6);
}

/* ── Right Column: Single Integrated Sidebar Panel ── */
.map-sidebar-panel {
  background: rgba(3, 25, 18, 0.82);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(34, 197, 94, 0.28);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  height: 100%;
  min-height: 0;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
}

.map-sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-bottom: 1px solid rgba(34, 197, 94, 0.20);
  background: rgba(7, 26, 21, 0.95);
  flex-shrink: 0;
}

.map-sidebar-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.map-detail-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(7, 26, 21, 0.75);
  border: 1px solid rgba(34, 197, 94, 0.22);
  border-radius: 8px;
  padding: 9px 12px;
  flex-shrink: 0;
}

.map-detail-val-box {
  display: flex;
  flex-direction: column;
}

.map-detail-val {
  font-size: 19px;
  font-weight: 700;
  font-family: var(--font-mono);
  color: var(--brand);
  line-height: 1.15;
}

.map-detail-param {
  font-size: 11px;
  font-weight: 600;
  color: var(--color-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-top: 2px;
}

/* Card 1: Monitored Locations (Bottom Section Grid) */
#cardMonitoredLocations .map-location-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 10px;
  width: 100%;
}

.map-location-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid rgba(34, 197, 94, 0.18);
  background: rgba(7, 26, 21, 0.65);
  cursor: pointer;
  transition: all 0.15s ease;
}

.map-location-item:hover {
  background: rgba(34, 197, 94, 0.14);
  border-color: rgba(34, 197, 94, 0.45);
}

.map-location-item.active {
  background: rgba(34, 197, 94, 0.22);
  border-color: #22c55e;
  box-shadow: 0 0 10px rgba(34, 197, 94, 0.25);
}

/* ── Bottom Section: 3 Sizable Analytics Cards (55-60% Map / 30-35% Bottom) ── */
.spatial-bottom-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  flex: 38;
  min-height: 240px;
  max-height: 295px;
  width: 100%;
  box-sizing: border-box;
}

.spatial-intel-card {
  background: rgba(3, 25, 18, 0.85);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(34, 197, 94, 0.28);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  height: 100%;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.spatial-intel-card:hover {
  border-color: rgba(34, 197, 94, 0.5);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.6), 0 0 15px rgba(34, 197, 94, 0.15);
}

.spatial-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  border-bottom: 1px solid rgba(34, 197, 94, 0.18);
  background: rgba(7, 26, 21, 0.95);
  flex-shrink: 0;
}

.spatial-card-title-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.spatial-card-icon {
  width: 26px;
  height: 26px;
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.spatial-card-icon.green { background: rgba(34, 197, 94, 0.2); color: #22c55e; }
.spatial-card-icon.blue { background: rgba(56, 189, 248, 0.2); color: #38bdf8; }
.spatial-card-icon.purple { background: rgba(168, 85, 247, 0.2); color: #a855f7; }
.spatial-card-icon.amber { background: rgba(245, 158, 11, 0.2); color: #f59e0b; }

.spatial-card-title {
  font-size: 13.5px;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: -0.01em;
}

.spatial-card-body {
  flex: 1;
  min-height: 0;
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow-y: auto;
}

/* Quality & Environmental Intelligence Rows */
.sp-quality-rows {
  display: flex;
  flex-direction: column;
  gap: 6px;
  justify-content: space-between;
  height: 100%;
}
.sp-q-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 0;
  border-bottom: 1px solid rgba(34, 197, 94, 0.12);
  font-size: 12.5px;
}
.sp-q-row:last-child {
  border-bottom: none;
}
.sp-q-label {
  color: #8da49c;
  font-size: 12px;
  font-weight: 500;
}
.sp-q-val {
  color: #ffffff;
  font-weight: 600;
  text-align: right;
  font-size: 12.5px;
}
.sp-q-val.red { color: #ef4444; }
.sp-q-val.green { color: #22c55e; }

.spatial-card-footer-note {
  font-size: 11px;
  color: #6b857c;
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  line-height: 1.35;
}

/* Card 3: Recent Activity Feed */
.sp-activity-item {
  display: flex;
  gap: 10px;
  padding: 6px 0;
  border-bottom: 1px solid rgba(34, 197, 94, 0.10);
}
.sp-activity-item:last-child {
  border-bottom: none;
}
.sp-activity-dot {
  width: 7.5px;
  height: 7.5px;
  border-radius: 50%;
  margin-top: 4px;
  flex-shrink: 0;
  display: inline-block;
}
.sp-activity-dot.green { background: #22c55e; box-shadow: 0 0 6px rgba(34, 197, 94, 0.6); }
.sp-activity-dot.amber { background: #f59e0b; box-shadow: 0 0 6px rgba(245, 158, 11, 0.6); }
.sp-activity-dot.red { background: #ef4444; box-shadow: 0 0 6px rgba(239, 68, 68, 0.6); }
.sp-activity-dot.blue { background: #38bdf8; box-shadow: 0 0 6px rgba(56, 189, 248, 0.6); }

.sp-activity-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.sp-activity-title {
  font-size: 12px;
  font-weight: 600;
  color: #ffffff;
  line-height: 1.3;
}
.sp-activity-sub {
  font-size: 11px;
  color: #8da49c;
  line-height: 1.25;
}

/* ── Screen height optimizations ── */
@media (max-height: 920px) and (min-width: 1151px) {
  .map-layout-grid {
    min-height: 380px;
  }
  .spatial-bottom-grid {
    min-height: 220px;
    max-height: 250px;
  }
  .spatial-card-header {
    padding: 8px 14px;
  }
  .spatial-card-body {
    padding: 10px 14px;
  }
  .sp-q-row {
    padding: 5px 0;
    font-size: 12px;
  }
  .sp-q-label {
    font-size: 11.5px;
  }
  .sp-q-val {
    font-size: 12px;
  }
}

@media (max-height: 780px) and (min-width: 1151px) {
  .map-layout-grid {
    min-height: 320px;
  }
  .spatial-bottom-grid {
    min-height: 185px;
    max-height: 215px;
  }
  .spatial-header-bar {
    padding: 0;
  }
  .spatial-header-left .section-title {
    font-size: 14px;
  }
  .map-viewport-header {
    padding: 6px 10px;
  }
  .spatial-card-header {
    padding: 6px 12px;
  }
  .spatial-card-body {
    padding: 8px 12px;
  }
  .sp-q-row {
    padding: 4px 0;
    font-size: 11.5px;
  }
  .sp-q-label {
    font-size: 11px;
  }
  .sp-q-val {
    font-size: 11.5px;
  }
  .spatial-card-footer-note {
    font-size: 10px;
    margin-top: 4px;
  }
}

/* ── Responsive Stacking for Tablets & Mobile ── */
@media (max-width: 1150px) {
  #viewMap.view-section {
    height: auto;
    overflow: visible;
  }
  .map-layout-grid {
    grid-template-columns: 1fr;
    height: auto;
    min-height: auto;
  }
  .full-map-slot {
    height: 400px;
    min-height: 400px;
  }
  .map-sidebar-panel {
    height: 400px;
  }
  .spatial-bottom-grid {
    grid-template-columns: 1fr;
    height: auto;
    max-height: none;
  }
  .spatial-intel-card {
    min-height: 200px;
  }
}

@media (max-width: 768px) {
  .spatial-bottom-grid {
    grid-template-columns: 1fr;
  }
  #cardMonitoredLocations .map-location-list {
    grid-template-columns: 1fr;
  }
  .full-map-slot {
    height: 320px;
    min-height: 320px;
  }
}

/* ==========================================================================
   ITERATION 5: DECISIONS & GOVERNANCE REDESIGN
   ========================================================================== */
.decision-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-md);
  margin-bottom: var(--space-sm);
}

.decision-stat-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  box-shadow: var(--shadow-subtle);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
}

.governance-scope-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--brand-soft);
  border: 1px solid var(--brand-border);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.45;
  margin-bottom: var(--space-md);
}

.governance-layout-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: var(--space-md);
  align-items: flex-start;
}

/* Primary Assessment Callout */
.assessment-callout {
  padding: 14px 16px;
  border-radius: var(--radius-md);
  margin-bottom: 14px;
  border: 1px solid var(--border-light);
  background: var(--bg-surface-subtle);
}

.assessment-callout.paused {
  background: var(--status-warn-bg);
  border-color: var(--status-warn-border);
}

.assessment-callout.allow {
  background: var(--status-ok-bg);
  border-color: var(--status-ok-border);
}

.assessment-callout.deny {
  background: var(--status-critical-bg);
  border-color: var(--status-critical-border);
}

.assessment-status-heading {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 4px;
}

.assessment-status-text {
  font-size: 12.5px;
  color: var(--text-secondary);
  line-height: 1.45;
}

/* Decision vs Execution Distinction Box */
.decision-vs-exec-box {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  background: var(--bg-surface-subtle);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  margin-bottom: 14px;
}

.dve-column {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.dve-column:first-child {
  border-right: 1px solid var(--border-light);
  padding-right: 14px;
}

.dve-header {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 2px;
}

.dve-status-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  gap: 8px;
}

.dve-label {
  color: var(--text-secondary);
}

.dve-val {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 600;
  font-size: 11.5px;
}

/* Notice Callout */
.notice-callout {
  background: var(--brand-soft);
  border: 1px solid var(--brand-border);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.notice-callout-header {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* 4 Core Inquiries Grid */
.decision-step-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 14px;
}

.decision-step-card {
  background: var(--bg-surface-subtle);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.decision-step-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

.decision-step-body {
  font-size: 12px;
  color: var(--text-main);
  line-height: 1.45;
}

/* Role Action Panel */
.role-action-box {
  background: var(--bg-surface-subtle);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 12px 14px;
}

.role-action-title {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 4px;
}

.role-action-text {
  font-size: 11.5px;
  color: var(--text-secondary);
  line-height: 1.45;
  margin-bottom: 10px;
}

.role-action-btns {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* Observation Detail Grid for Policy & Evidence Basis */
.obs-detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.obs-detail-cell {
  background: var(--bg-surface-subtle);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
}

.obs-detail-k {
  font-size: 10.5px;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 2px;
}

.obs-detail-v {
  font-size: 12px;
  color: var(--text-main);
  overflow-wrap: anywhere;
}

/* Expandable Technical Details */
.tech-details {
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  background: var(--bg-surface);
  overflow: hidden;
}

.tech-details summary {
  padding: 10px 14px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-main);
  cursor: pointer;
  background: var(--bg-surface-subtle);
  user-select: none;
  list-style: none;
  display: flex;
  align-items: center;
}

.tech-details summary::-webkit-details-marker {
  display: none;
}

.tech-details-content {
  padding: 14px;
  border-top: 1px solid var(--border-light);
  background: var(--bg-surface);
}

.tech-kv-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 12px;
}

.tech-kv-item {
  background: var(--bg-surface-subtle);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 6px 10px;
}

.tech-k {
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 2px;
}

.tech-v {
  font-size: 11.5px;
  color: var(--text-main);
  overflow-wrap: anywhere;
}

.raw-json-box {
  background: rgba(2, 14, 11, 0.94) !important;
  color: #d1fae5 !important;
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  font-size: 12px;
  line-height: 1.6;
  padding: 16px 20px;
  border-radius: 9px;
  border: 1px solid rgba(34, 197, 94, 0.28) !important;
  max-height: 480px;
  min-height: 180px;
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-all;
  box-shadow: inset 0 2px 14px rgba(0, 0, 0, 0.85);
  box-sizing: border-box;
}

/* Syntax Highlighting for Evidence Pack & Payloads */
.raw-json-box .json-key { color: #38bdf8; font-weight: 600; }
.raw-json-box .json-string { color: #86efac; }
.raw-json-box .json-number { color: #f59e0b; }
.raw-json-box .json-boolean { color: #c084fc; font-weight: 700; }
.raw-json-box .json-null { color: #ef4444; font-style: italic; }
.raw-json-box .json-punct { color: #647a71; }

/* Responsive Breakpoints for Iteration 5 */
@media (max-width: 1200px) {
  .decision-summary-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .governance-layout-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .decision-summary-grid {
    grid-template-columns: 1fr;
  }
  .decision-vs-exec-box {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .dve-column:first-child {
    border-right: none;
    border-bottom: 1px solid var(--border-light);
    padding-right: 0;
    padding-bottom: 10px;
  }
  .decision-step-grid {
    grid-template-columns: 1fr;
  }
  .obs-detail-grid {
    grid-template-columns: 1fr;
  }
  .tech-kv-grid {
    grid-template-columns: 1fr;
  }
}

/* ==========================================================================
   ITERATION 6: AUDIT & EVIDENCE REDESIGN
   ========================================================================== */
.evidence-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-md);
  margin-bottom: var(--space-sm);
}

.pipeline-stepper {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 14px;
}

.pipeline-step {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  box-shadow: var(--shadow-subtle);
  transition: all var(--transition-fast);
}

.pipeline-step-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

.pipeline-step-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-main);
}

.pipeline-step-sub {
  font-size: 11px;
  color: var(--text-secondary);
}

.gap-category-pill {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  border-radius: var(--radius-sm);
  font-size: 10.5px;
  font-weight: 600;
  line-height: 1.2;
}

.gap-category-pill.unverified {
  background: var(--status-warn-bg);
  color: var(--status-warn);
  border: 1px solid var(--status-warn-border);
}

.gap-category-pill.not-persisted {
  background: rgba(239, 81, 88, 0.12);
  color: var(--color-error, #EF5158);
  border: 1px solid rgba(239, 81, 88, 0.35);
}

.gap-category-pill.unavailable {
  background: var(--bg-muted);
  color: var(--text-secondary);
  border: 1px solid var(--border-light);
}

.gap-category-pill.missing {
  background: var(--status-critical-bg);
  color: var(--status-critical);
  border: 1px solid var(--status-critical-border);
}

/* Responsive Breakpoints for Iteration 6 */
@media (max-width: 1200px) {
  .evidence-summary-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .pipeline-stepper {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .evidence-summary-grid {
    grid-template-columns: 1fr;
  }
  .pipeline-stepper {
    grid-template-columns: 1fr;
  }
}




/* Full Map Slot for View 3: Map & Locations */
.full-map-slot {
  width: 100%;
  height: 480px;
  min-height: 420px;
  position: relative;
  background: #020807;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--border-card);
}


/* ==========================================================================
   DESKTOP 100% SCALE SPACING OPTIMIZATION & AUTO BOTTOM FILL
   ========================================================================== */
@media (min-width: 1151px) {
  .app-container {
    height: 100vh;
    max-height: 100vh;
    overflow: hidden;
  }
  .app-body-layout {
    height: calc(100vh - 62px);
    max-height: calc(100vh - 62px);
    overflow: hidden;
  }
  .main-viewport {
    height: 100%;
    overflow-y: auto;
    overflow-x: hidden;
  }
  .viewport-scroll-container {
    min-height: 100%;
    padding: 14px 24px 16px;
    gap: 14px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
  }
  #viewOverview,
  #viewMap {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 10px;
    min-height: 0;
  }
  .command-kpi-row {
    flex-shrink: 0;
    gap: 14px;
  }
  .command-middle-grid {
    flex: 1.25;
    min-height: 360px;
    gap: 14px;
  }
  .map-panel,
  .command-right-stack {
    height: 100%;
    min-height: 360px;
  }
  .command-bottom-grid {
    flex: 1;
    min-height: 280px;
    gap: 14px;
  }
  .command-bottom-grid .command-panel {
    height: 100%;
    min-height: 280px;
  }
}

/* ==========================================================================
   RESPONSIVE DESIGN SYSTEM
   ========================================================================== */
@media (max-width: 1380px) {
  .command-bottom-grid {
    grid-template-columns: repeat(auto-fit, minmax(310px, 1fr));
    gap: 12px;
  }
}

@media (max-width: 1280px) {
  .command-kpi-row {
    grid-template-columns: repeat(3, 1fr);
  }
  .command-grid-row.row-1,
  .command-grid-row.row-2,
  .command-grid-row.row-3 {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 1150px) {
  .command-middle-grid {
    grid-template-columns: 1fr;
  }
  .command-bottom-grid {
    grid-template-columns: 1fr;
  }
  .map-panel,
  .command-right-stack {
    height: auto;
    min-height: 340px;
  }
  .command-bottom-grid .command-panel {
    height: auto;
    min-height: 260px;
  }
}

@media (max-width: 992px) {
  .command-kpi-row {
    grid-template-columns: repeat(2, 1fr);
  }
  .hide-on-tablet {
    display: none !important;
  }
}

@media (max-width: 768px) {
  .command-kpi-row {
    grid-template-columns: 1fr;
  }
  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    transform: translateX(-100%);
  }
  .sidebar.mobile-open {
    transform: translateX(0);
  }
  .sidebar-backdrop.active {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 90;
  }
  .hide-on-mobile {
    display: none !important;
  }
  .top-header {
    padding: 0 10px;
  }
  .viewport-scroll-container {
    padding: 8px 10px 20px;
  }
}

/* ── MOBILE BOTTOM NAVIGATION ── */
.mobile-bottom-nav {
  display: none !important;
}

@media (max-width: 768px) {
  .mobile-bottom-nav {
    display: flex !important;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 56px;
    background: #071312;
    border-top: 1px solid #19332E;
    z-index: 1000;
    justify-content: space-around;
    align-items: center;
    padding: 0 4px;
    box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.5);
  }
  .bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    background: transparent;
    border: none;
    color: #647A71;
    font-size: 10px;
    font-family: inherit;
    cursor: pointer;
    flex: 1;
    padding: 6px 0;
    transition: color 0.15s ease;
  }
  .bottom-nav-item svg {
    width: 18px;
    height: 18px;
    stroke: currentColor;
    stroke-width: 2;
  }
  .bottom-nav-item.active {
    color: #20D66B;
  }
  .bottom-nav-item:hover {
    color: #E8F0EC;
  }
  .viewport-scroll-container {
    padding-bottom: 70px !important;
  }
}


/* ── RECENT ALERTS EMPTY STATE (ZERO FABRICATION) ── */
.alerts-empty-wrapper {
  height: 330px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at center, rgba(13, 28, 26, 0.5) 0%, rgba(5, 13, 13, 0.95) 100%);
  border-top: 1px solid var(--border-card);
}

.alerts-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-align: center;
  padding: 24px;
}

.alerts-empty-icon {
  color: var(--text-muted);
  opacity: 0.6;
}

.alerts-empty-title {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--text-primary);
}

.alerts-empty-subtitle {
  font-size: 11px;
  color: var(--text-muted);
  max-width: 280px;
  line-height: 1.45;
}

/* ── VIEW SECTIONS & UTILITIES ── */
.view-section {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
}

.mon-filter-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 14px;
  background: var(--bg-card, rgba(4, 20, 15, 0.75));
  border: 1px solid var(--border-card, rgba(34, 197, 94, 0.18));
  border-radius: var(--radius-sm, 6px);
  padding: 10px 14px;
  box-sizing: border-box;
}

.mon-search-wrap {
  position: relative;
  display: flex;
  align-items: center;
  flex: 1 1 320px;
  min-width: 220px;
}

.mon-search-wrap svg {
  position: absolute;
  left: 11px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--color-muted, #94a3b8);
  pointer-events: none;
  z-index: 2;
  transition: color var(--transition-fast, 0.15s ease);
}

.mon-search-wrap:focus-within svg {
  color: var(--brand, #22c55e);
}

.mon-search-wrap input.form-input {
  width: 100% !important;
  height: 34px !important;
  padding: 6px 12px 6px 34px !important;
  font-size: 12px !important;
  background: rgba(3, 25, 18, 0.85) !important;
  border: 1px solid var(--border-card, rgba(34, 197, 94, 0.2)) !important;
  border-radius: var(--radius-xs, 4px) !important;
  color: var(--color-text, #e2e8f0) !important;
  box-sizing: border-box !important;
  outline: none !important;
  transition: border-color 0.2s ease, box-shadow 0.2s ease !important;
}

.mon-search-wrap input.form-input:focus {
  border-color: var(--brand, #22c55e) !important;
  box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.2) !important;
}

.mon-filter-group {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.mon-filter-group label {
  font-size: 12px;
  font-weight: 500;
  color: var(--color-muted, #94a3b8);
  white-space: nowrap;
}

.mon-filter-group select.filter-select {
  height: 34px;
  padding: 0 26px 0 10px;
  font-size: 12px;
  background: rgba(3, 25, 18, 0.85);
  border: 1px solid var(--border-card, rgba(34, 197, 94, 0.2));
  border-radius: var(--radius-xs, 4px);
  color: var(--color-text, #e2e8f0);
  outline: none;
  cursor: pointer;
  transition: border-color 0.2s ease;
}

.mon-filter-group select.filter-select:focus {
  border-color: var(--brand, #22c55e);
}

/* ── Responsive & Interactive Filter Reset Button ── */
#btnResetMonFilters,
#btnEmptyResetFilters {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 34px;
  padding: 0 14px;
  font-size: 12px;
  font-weight: 500;
  color: var(--color-text, #e2e8f0);
  background: rgba(34, 197, 94, 0.08);
  border: 1px solid rgba(34, 197, 94, 0.28);
  border-radius: var(--radius-xs, 4px);
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  user-select: none;
  transition: all 0.2s ease;
}

#btnResetMonFilters:hover,
#btnEmptyResetFilters:hover {
  background: rgba(34, 197, 94, 0.18);
  border-color: var(--brand, #22c55e);
  color: #fff;
  box-shadow: 0 0 10px rgba(34, 197, 94, 0.25);
}

#btnResetMonFilters:active,
#btnEmptyResetFilters:active {
  transform: scale(0.97);
}

#btnResetMonFilters.is-spinning svg,
#btnEmptyResetFilters.is-spinning svg {
  animation: monSpin 0.65s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes monSpin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

@media (max-width: 768px) {
  .mon-filter-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    padding: 10px 12px;
  }
  .mon-search-wrap {
    width: 100%;
    min-width: 0;
  }
  .mon-filter-group {
    width: 100%;
    justify-content: space-between;
  }
  .mon-filter-group select.filter-select {
    flex: 1;
    min-width: 0;
  }
  #btnResetMonFilters {
    width: 100%;
    justify-content: center;
  }
}

.map-header-quickselect {
  display: flex;
  align-items: center;
  gap: 8px;
}

.geo-mode-group {
  display: flex;
  align-items: center;
  gap: 4px;
}

.geo-mode-btn {
  padding: 3px 8px;
  font-size: 11px;
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  color: var(--text-secondary);
  border-radius: 4px;
  cursor: pointer;
  transition: all var(--transition-fast);
}
.geo-mode-btn.active, .geo-mode-btn:hover {
  background: rgba(32, 214, 107, 0.15);
  color: var(--bright-green);
  border-color: var(--primary-green);
}

.header-info-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 8px;
  font-size: 11px;
  border-radius: var(--radius-full);
  background: var(--bg-card-secondary);
  border: 1px solid var(--border-card);
  color: var(--text-secondary);
}

.lineage-rail-track {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 12px;
}

.form-field label {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-primary);
}

.login-error-alert {
  background: var(--error-bg);
  border: 1px solid var(--error-border);
  color: var(--color-error);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: 11.5px;
  margin-bottom: 10px;
}

.notice-callout-body {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.4;
}

/* Modal Cards */
.modal-card {
  background: var(--bg-card);
  border: 1px solid var(--border-highlight);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-modal);
  color: var(--text-primary);
  max-width: 500px;
  width: 90%;
  overflow: hidden;
}

.modal-card-large {
  max-width: 720px;
}

.modal-card-header {
  padding: 14px 18px;
  background: var(--bg-card-secondary);
  border-bottom: 1px solid var(--border-card);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-card-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
}

.modal-card-sub {
  font-size: 11px;
  color: var(--text-muted);
}

.modal-scroll-body {
  padding: 18px;
  max-height: 70vh;
  overflow-y: auto;
}

.modal-card-footer {
  padding: 12px 18px;
  background: var(--bg-card-secondary);
  border-top: 1px solid var(--border-card);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

/* ==========================================================================
   VANA INTERACTIVE TOAST NOTIFICATIONS
   ========================================================================== */
.vana-toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.vana-toast {
  pointer-events: auto;
  background: rgba(3, 25, 18, 0.95);
  border: 1px solid rgba(34, 197, 94, 0.45);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  color: #FFFFFF;
  font-size: 12.5px;
  font-weight: 500;
  padding: 10px 16px;
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  gap: 9px;
  animation: vanaToastSlideIn 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  transition: opacity 0.22s ease, transform 0.22s ease;
}

.vana-toast.success {
  border-color: rgba(34, 197, 94, 0.6);
}
.vana-toast.info {
  border-color: rgba(56, 189, 248, 0.6);
}

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