/* ==========================================================================
   WaapGuard Enterprise Control Plane — Dark Glassmorphic Design System
   ========================================================================== */

:root {
  --bg-base: #070a12;
  --bg-card: rgba(15, 23, 42, 0.72);
  --bg-card-hover: rgba(30, 41, 59, 0.85);
  --border-glass: rgba(56, 189, 248, 0.12);
  --border-glass-bright: rgba(56, 189, 248, 0.35);

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

  --cyan-bright: #38bdf8;
  --cyan-glow: rgba(56, 189, 248, 0.4);
  --magenta-bright: #f43f5e;
  --magenta-glow: rgba(244, 63, 94, 0.4);
  --amber-bright: #fbbf24;
  --amber-glow: rgba(251, 191, 36, 0.4);
  --emerald-bright: #34d399;
  --emerald-glow: rgba(52, 211, 153, 0.4);
  --purple-bright: #a855f7;

  --font-brand: 'Outfit', sans-serif;
  --font-body: 'Inter', sans-serif;
  --font-code: 'JetBrains Mono', monospace;

  --transition-smooth: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
  background-color: var(--bg-base);
  color: var(--text-primary);
  font-family: var(--font-body);
  overflow-x: hidden;
  min-height: 100vh;
  position: relative;
}

/* --- Ambient Glowing Orbs --- */
.glow-orb {
  position: fixed;
  border-radius: 50%;
  filter: blur(140px);
  pointer-events: none;
  z-index: 0;
}
.glow-cyan {
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(56, 189, 248, 0.15) 0%, transparent 70%);
  top: -100px;
  right: -100px;
}
.glow-magenta {
  width: 450px;
  height: 450px;
  background: radial-gradient(circle, rgba(244, 63, 94, 0.12) 0%, transparent 70%);
  bottom: -50px;
  left: 200px;
}

/* --- App Layout --- */
.app-layout {
  display: flex;
  min-height: 100vh;
  position: relative;
  z-index: 1;
}

/* --- Sidebar --- */
.sidebar {
  width: 260px;
  background: rgba(10, 15, 29, 0.85);
  backdrop-filter: blur(20px);
  border-right: 1px solid var(--border-glass);
  display: flex;
  flex-direction: column;
  padding: 1.5rem 1rem;
  flex-shrink: 0;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0.75rem 1.5rem;
  border-bottom: 1px solid var(--border-glass);
  margin-bottom: 1.5rem;
}

.brand-logo {
  width: 38px;
  height: 38px;
  background: linear-gradient(135deg, var(--cyan-bright), #6366f1);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  color: #fff;
  box-shadow: 0 0 20px var(--cyan-glow);
}

.brand-text {
  display: flex;
  flex-direction: column;
}

.brand-name {
  font-family: var(--font-brand);
  font-weight: 700;
  font-size: 1.25rem;
  letter-spacing: -0.5px;
  color: #fff;
}

.brand-tag {
  font-size: 0.65rem;
  letter-spacing: 1.5px;
  color: var(--cyan-bright);
  font-weight: 700;
}

.nav-menu {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.nav-section-title {
  font-size: 0.68rem;
  letter-spacing: 1.2px;
  color: var(--text-muted);
  font-weight: 700;
  padding: 0.75rem 0.75rem 0.35rem;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition-smooth);
  width: 100%;
  text-align: left;
}

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

.nav-item.active {
  background: rgba(56, 189, 248, 0.1);
  border-color: var(--border-glass-bright);
  color: var(--cyan-bright);
  box-shadow: 0 0 15px rgba(56, 189, 248, 0.15);
}

.nav-item i {
  font-size: 1rem;
  width: 18px;
  text-align: center;
}

.badge-pill {
  margin-left: auto;
  font-size: 0.65rem;
  padding: 2px 7px;
  border-radius: 20px;
  font-weight: 600;
}

.pulse-badge {
  background: rgba(56, 189, 248, 0.2);
  color: var(--cyan-bright);
  border: 1px solid var(--cyan-bright);
}

.alert-pill {
  background: rgba(244, 63, 94, 0.2);
  color: var(--magenta-bright);
  border: 1px solid var(--magenta-bright);
}

.success-pill {
  background: rgba(52, 211, 153, 0.2);
  color: var(--emerald-bright);
  border: 1px solid var(--emerald-bright);
}

.sidebar-footer {
  padding-top: 1rem;
  border-top: 1px solid var(--border-glass);
}

.user-profile {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
}

.avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, #475569, #1e293b);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
}

.user-info {
  display: flex;
  flex-direction: column;
}

.user-name {
  font-size: 0.85rem;
  font-weight: 600;
}

.user-role {
  font-size: 0.7rem;
  color: var(--text-muted);
}

/* --- Main Content Area --- */
.main-content {
  flex: 1;
  padding: 1.5rem 2rem;
  overflow-y: auto;
}

/* --- Top Header --- */
.top-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  gap: 1.5rem;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  padding: 0.65rem 1.25rem;
  border-radius: 10px;
  width: 480px;
  backdrop-filter: blur(12px);
}

.search-box i {
  color: var(--text-muted);
}

.search-box input {
  background: transparent;
  border: none;
  color: var(--text-primary);
  outline: none;
  width: 100%;
  font-size: 0.85rem;
}

.search-box input::placeholder {
  color: var(--text-muted);
}

.header-right {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.domain-selector {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  padding: 0.5rem 1rem;
  border-radius: 8px;
}

.domain-selector select {
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-weight: 500;
  outline: none;
  cursor: pointer;
}

.domain-selector select option {
  background: #0f172a;
}

.edge-status-badge {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.25);
  color: var(--emerald-bright);
  padding: 0.5rem 0.85rem;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 600;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--emerald-bright);
  box-shadow: 0 0 10px var(--emerald-bright);
  animation: pulse 2s infinite;
}

.mode-badge {
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.5rem 0.85rem;
  border-radius: 8px;
}

.monitor-badge {
  background: rgba(251, 191, 36, 0.15);
  border: 1px solid rgba(251, 191, 36, 0.3);
  color: var(--amber-bright);
}

/* --- Glass Card Primitives --- */
.glass-card {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-glass);
  border-radius: 14px;
  padding: 1.5rem;
  transition: var(--transition-smooth);
}

.glass-card:hover {
  border-color: var(--border-glass-bright);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

/* --- Viewports & Tabs --- */
.tab-viewport {
  display: none;
  animation: fadeIn 0.3s ease;
}

.tab-viewport.active {
  display: block;
}

/* --- KPI Metrics Grid --- */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}

.metric-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}

.metric-title {
  font-size: 0.8rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.metric-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
}

.metric-icon.cyan { background: rgba(56, 189, 248, 0.15); color: var(--cyan-bright); }
.metric-icon.purple { background: rgba(168, 85, 247, 0.15); color: var(--purple-bright); }
.metric-icon.magenta { background: rgba(244, 63, 94, 0.15); color: var(--magenta-bright); }
.metric-icon.emerald { background: rgba(52, 211, 153, 0.15); color: var(--emerald-bright); }

.metric-value {
  font-family: var(--font-brand);
  font-size: 2.2rem;
  font-weight: 700;
  letter-spacing: -1px;
  margin-bottom: 0.5rem;
}

.metric-subtext {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.highlight-cyan { color: var(--cyan-bright); }
.highlight-magenta { color: var(--magenta-bright); }
.highlight-amber { color: var(--amber-bright); }
.highlight-emerald { color: var(--emerald-bright); }

.metric-tag { font-size: .72rem; color: var(--text-muted); font-weight: 500; text-transform: uppercase; letter-spacing: .03em; }

/* --- Traffic Split Mini --- */
.traffic-split-mini {
  margin-top: 0.5rem;
}
.split-bar {
  height: 10px;
  border-radius: 5px;
  background: #1e293b;
  display: flex;
  overflow: hidden;
  margin-bottom: 0.6rem;
}
.bar-fill.human { background: var(--cyan-bright); }
.bar-fill.bot { background: var(--magenta-bright); }
.bar-fill.scraper { background: var(--amber-bright); }
.split-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.7rem;
}
.label-human { color: var(--cyan-bright); }
.label-bot { color: var(--magenta-bright); }
.label-scraper { color: var(--amber-bright); }

/* --- Mid Dashboard Grid --- */
.dashboard-mid-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}

.card-head-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}

/* ponytail: fixed short chart height — the chart-card was stretching to content */
.chart-container {
  height: 200px;
  position: relative;
}
@media (max-width: 900px) {
  .metrics-grid { grid-template-columns: repeat(2, 1fr); }
  .dashboard-mid-grid { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
  .chart-container { height: 140px; }
  .dashboard-main-grid,
  .dashboard-mid-grid,
  .dashboard-bottom-grid,
  .metrics-grid,
  .bap-cards-grid,
  .enterprise-grid { grid-template-columns: 1fr; }
}
.chart-card {
  padding: 1rem 1.25rem;
}

.head-title h3 {
  font-family: var(--font-brand);
  font-size: 1.1rem;
  font-weight: 600;
}
.head-title p {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.chart-controls {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: 0.75rem;
}

.chart-legend {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--text-secondary);
}
.dot-human { width: 8px; height: 8px; border-radius: 50%; background: var(--cyan-bright); display: inline-block; }
.dot-bot { width: 8px; height: 8px; border-radius: 50%; background: var(--magenta-bright); display: inline-block; }

.time-range-select {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-glass);
  color: var(--text-primary);
  border-radius: 6px;
  padding: 0.25rem 0.5rem;
  font-size: 0.75rem;
}
.time-range-select option { background: #0f172a; }

.canvas-wrapper {
  height: 240px;
  position: relative;
}

/* --- BAP Radar Card --- */
.threat-items-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.threat-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1rem;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-glass);
  border-radius: 8px;
}

.threat-info {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.threat-name {
  font-size: 0.85rem;
  font-weight: 500;
}

.threat-status {
  font-size: 0.68rem;
  font-weight: 600;
}

.status-mitigated { color: var(--cyan-bright); }
.status-blocked { color: var(--magenta-bright); }
.status-challenged { color: var(--amber-bright); }
.status-emerald { color: var(--emerald-bright); }

.threat-count {
  font-family: var(--font-brand);
  font-size: 1.1rem;
  font-weight: 700;
}

/* devdocs method chips */
.method-tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 6px;
  font-family: var(--font-code);
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .04em;
}
.method-post { background: rgba(52, 211, 153, .14); color: #34d399; }
.method-get { background: rgba(56, 189, 248, .14); color: #38bdf8; }
.method-put { background: rgba(245, 158, 11, .14); color: #f59e0b; }
.method-patch { background: rgba(129, 140, 248, .14); color: #818cf8; }
.method-delete { background: rgba(244, 63, 94, .14); color: #f43f5e; }
/* devdocs detail rows */
td details { font-family: var(--font-code); }
td details summary { color: #38bdf8; font-size: .78rem; font-weight: 600; }
td details code {
  display: block;
  padding: 8px 10px;
  margin: 6px 0;
  border-radius: 8px;
  background: rgba(2, 6, 17, .7);
  border: 1px solid rgba(148, 163, 184, .1);
  white-space: pre-wrap;
  font-size: .72rem;
  line-height: 1.5;
}
.threat-pillars-list { display: flex; flex-direction: column; gap: 0.55rem; }
.pillar-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  background: rgba(15, 23, 42, 0.55);
  border: 1px solid rgba(148, 163, 184, 0.12);
  border-radius: 10px;
  padding: 0.6rem 0.8rem;
}
.pillar-info { display: flex; flex-direction: column; gap: 0.15rem; min-width: 0; }
.pillar-name { color: var(--text-bright); font-size: 0.8rem; font-weight: 500; display: flex; align-items: center; gap: 0.45rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pillar-status { font-size: 0.68rem; font-weight: 600; letter-spacing: 0.03em; }

/* --- Bottom Grid --- */
.dashboard-bottom-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}

.badge-alert-tag {
  background: rgba(244, 63, 94, 0.15);
  color: var(--magenta-bright);
  border: 1px solid var(--magenta-bright);
  font-size: 0.7rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 20px;
}

.tier-bars-container {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.tier-bar-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: 0.8rem;
}

.tier-label { width: 60px; color: var(--text-secondary); font-weight: 500; }
.tier-progress { flex: 1; height: 8px; background: #1e293b; border-radius: 4px; overflow: hidden; }
.tier-fill.public { background: var(--cyan-bright); }
.tier-fill.auth { background: var(--purple-bright); }
.tier-fill.admin { background: var(--magenta-bright); }
.tier-fill.payment { background: var(--amber-bright); }
.tier-fill.pii { background: var(--emerald-bright); }
.tier-count { width: 90px; text-align: right; color: var(--text-muted); font-size: 0.75rem; }

/* --- Compliance Mini Gauge --- */
.gauge-center-wrapper {
  display: flex;
  align-items: center;
  gap: 2rem;
  padding: 0.5rem 0;
}

.circular-gauge {
  width: 110px;
  height: 110px;
  border-radius: 50%;
  background: conic-gradient(var(--emerald-bright) 96%, rgba(255, 255, 255, 0.05) 0%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
}

.circular-gauge::after {
  content: '';
  position: absolute;
  width: 90px;
  height: 90px;
  border-radius: 50%;
  background: var(--bg-base);
}

.gauge-number {
  position: relative;
  z-index: 1;
  font-family: var(--font-brand);
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--emerald-bright);
}

.gauge-sub {
  position: relative;
  z-index: 1;
  font-size: 0.55rem;
  letter-spacing: 1px;
  color: var(--text-muted);
}

.compliance-badges-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.4rem 0.6rem;
  flex: 1;
}

.comp-badge {
  background: rgba(52, 211, 153, 0.1);
  border: 1px solid rgba(52, 211, 153, 0.25);
  color: var(--emerald-bright);
  font-size: 0.72rem;
  padding: 0.3rem 0.5rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  border-radius: 6px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

/* --- Incident Stream Table --- */
.table-responsive {
  overflow-x: auto;
}

.incident-table, .inventory-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
  text-align: left;
}

.incident-table th, .inventory-table th {
  color: var(--text-muted);
  font-weight: 600;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border-glass);
}

.incident-table td, .inventory-table td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
  font-family: var(--font-code);
}

.action-badge {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 4px;
}
.action-block { background: rgba(244, 63, 94, 0.2); color: var(--magenta-bright); }
.action-challenge { background: rgba(251, 191, 36, 0.2); color: var(--amber-bright); }
.action-log { background: rgba(56, 189, 248, 0.2); color: var(--cyan-bright); }

/* DataTable + toast + toggle (UI_UX_Plan §3) */
.data-table th { color: var(--text-muted); font-weight: 600; padding: 0.75rem 1rem; border-bottom: 1px solid var(--border-glass); text-align: left; }
.data-table td { padding: 0.75rem 1rem; border-bottom: 1px solid rgba(255,255,255,.03); }
.data-table .mono { font-family: var(--font-code); }
.data-table .empty { text-align: center; color: var(--text-muted); padding: 2rem; }
#toast-root { position: fixed; bottom: 20px; right: 20px; z-index: 10000; display: flex; flex-direction: column; gap: 8px; }
.toast { background: rgba(15,23,42,.95); border: 1px solid rgba(148,163,184,.3); border-left: 3px solid var(--cyan-bright); color: #e2e8f0; padding: 10px 16px; border-radius: 8px; font-size: .85rem; box-shadow: 0 8px 24px rgba(0,0,0,.4); animation: toastIn .25s ease; }
.toast.danger { border-left-color: var(--magenta-bright); }
.toast.ok { border-left-color: #22c55e; }
@keyframes toastIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.toggle { appearance: none; width: 40px; height: 20px; border-radius: 10px; background: rgba(148,163,184,.35); position: relative; cursor: pointer; outline: none; transition: background .2s; }
.toggle::after { content: ''; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: left .2s; }
.toggle:checked { background: var(--cyan-bright); }
.toggle:checked::after { left: 22px; }

/* --- Challenge Ladder Grid (Tab 2) --- */
.ladder-steps {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 1rem;
  margin-top: 1.5rem;
}

.ladder-step {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-glass);
  border-radius: 10px;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.step-badge {
  font-family: var(--font-brand);
  font-weight: 700;
  font-size: 1.1rem;
}

.step-name {
  font-size: 0.9rem;
  font-weight: 600;
}

.step-desc {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* --- Buttons & UI Helpers --- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1.2rem;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-smooth);
  border: none;
}
.btn-primary { background: linear-gradient(135deg, var(--cyan-bright), #6366f1); color: #fff; }
.btn-secondary { background: rgba(255, 255, 255, 0.05); color: var(--text-primary); border: 1px solid var(--border-glass); }
.btn-secondary:hover { background: rgba(255, 255, 255, 0.1); border-color: var(--border-glass-bright); }
.btn-sm { padding: 0.4rem 0.75rem; font-size: 0.75rem; }

.section-title-bar {
  margin-bottom: 1.5rem;
}
.section-title-bar h2 {
  font-family: var(--font-brand);
  font-size: 1.5rem;
}
.section-title-bar p {
  color: var(--text-muted);
  font-size: 0.85rem;
}

.keys-grid, .compliance-packs-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

.key-box {
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--border-glass);
  padding: 0.75rem;
  border-radius: 8px;
  font-family: var(--font-code);
  font-size: 0.8rem;
  margin: 1rem 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.key-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  font-family: var(--font-body);
}

@keyframes pulse {
  0% { transform: scale(0.95); opacity: 0.7; }
  50% { transform: scale(1.15); opacity: 1; }
  100% { transform: scale(0.95); opacity: 0.7; }
}

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

@keyframes liveGlow {
  0% { background-color: rgba(244, 63, 94, 0.25); }
  100% { background-color: transparent; }
}

.live-stream-glow {
  animation: liveGlow 2.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* ponytail: auto-fit grid, fine-grained responsive layout for enterprise cards */
.enterprise-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
}
.enterprise-stat {
  color: #94a3b8;
  font-size: 0.9rem;
  margin-top: 8px;
}
.enterprise-stat strong {
  color: #f8fafc;
}

/* ==========================================================================
   Animated Gradient Guardian SVG & Dynamic Role-Based Sidebar System
   ========================================================================== */

@keyframes guardianPulse {
  0%, 100% {
    filter: drop-shadow(0 0 10px rgba(56, 189, 248, 0.7)) drop-shadow(0 0 20px rgba(99, 102, 241, 0.4));
    transform: scale(1);
  }
  50% {
    filter: drop-shadow(0 0 18px rgba(56, 189, 248, 0.95)) drop-shadow(0 0 32px rgba(244, 63, 94, 0.6));
    transform: scale(1.04);
  }
}

@keyframes iconGradientFlow {
  0% { filter: hue-rotate(0deg); }
  50% { filter: hue-rotate(45deg); }
  100% { filter: hue-rotate(0deg); }
}

.guardian-logo-svg {
  animation: guardianPulse 4s ease-in-out infinite;
  display: block;
}

.nav-svg-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-item:hover .nav-svg-icon {
  transform: scale(1.18);
  animation: iconGradientFlow 2s ease infinite;
}

.sidebar-role-filter-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(56, 189, 248, 0.2);
  border-radius: 8px;
  padding: 6px 10px;
  margin: 0 0.25rem 0.85rem 0.25rem;
  backdrop-filter: blur(10px);
}

.sidebar-role-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  display: flex;
  align-items: center;
  gap: 4px;
}

.sidebar-role-select {
  background: rgba(2, 6, 23, 0.8);
  border: 1px solid rgba(56, 189, 248, 0.3);
  color: var(--cyan-bright);
  font-size: 0.72rem;
  font-weight: 600;
  border-radius: 4px;
  padding: 2px 6px;
  cursor: pointer;
  outline: none;
}

/* Client Perspective Rules Setup Cards */
.client-scope-banner {
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.9) 0%, rgba(30, 41, 59, 0.75) 100%);
  border: 1px solid rgba(56, 189, 248, 0.25);
  border-radius: 12px;
  padding: 16px 20px;
  margin-bottom: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
}

.plan-meter-bar {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.plan-meter-pill {
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(148, 163, 184, 0.2);
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.plan-meter-pill strong {
  color: var(--cyan-bright);
}

.flag-card {
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(148, 163, 184, 0.15);
  border-radius: 10px;
  padding: 14px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: all 0.2s ease;
}

.flag-card:hover {
  border-color: rgba(56, 189, 248, 0.35);
  background: rgba(15, 23, 42, 0.85);
}

/* ==========================================================================
   BAP Intelligence Cards Grid & Comprehensive Grid Spacing System
   ========================================================================== */

.bap-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.5rem;
  margin-top: 1.5rem;
  margin-bottom: 2rem;
}

.bap-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 1.5rem;
  gap: 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: 14px;
  backdrop-filter: blur(16px);
  transition: all 0.25s ease;
}

.bap-card:hover {
  border-color: var(--border-glass-bright);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
}

.bap-card h3 {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
}

.bap-card p {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 0.75rem;
}

.signal-indicator-box {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  background: rgba(15, 23, 42, 0.65);
  border: 1px solid rgba(148, 163, 184, 0.15);
  border-radius: 10px;
  padding: 1rem;
  margin-top: 0.5rem;
}

.signal-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.82rem;
  color: var(--text-secondary);
  padding: 0.35rem 0;
}

.signal-row span:first-child {
  font-weight: 500;
}

.badge-success {
  background: rgba(52, 211, 153, 0.15);
  color: var(--emerald-bright);
  border: 1px solid rgba(52, 211, 153, 0.3);
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 0.72rem;
  font-weight: 600;
}

.badge-danger {
  background: rgba(244, 63, 94, 0.15);
  color: var(--magenta-bright);
  border: 1px solid rgba(244, 63, 94, 0.3);
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 0.72rem;
  font-weight: 600;
}

.badge-warning {
  background: rgba(251, 191, 36, 0.15);
  color: var(--amber-bright);
  border: 1px solid rgba(251, 191, 36, 0.3);
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 0.72rem;
  font-weight: 600;
}

/* --- Command Palette Modal (Ctrl + K) --- */
.command-palette-overlay {
  position: fixed;
  inset: 0;
  background: rgba(2, 6, 23, 0.88);
  backdrop-filter: blur(14px);
  z-index: 100000;
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding-top: 10vh;
  animation: paletteFadeIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes paletteFadeIn {
  from { opacity: 0; transform: scale(0.98); }
  to { opacity: 1; transform: scale(1); }
}

.command-palette-modal {
  width: min(640px, 94vw);
  background: rgba(15, 23, 42, 0.98);
  border: 1px solid rgba(56, 189, 248, 0.4);
  box-shadow: 0 25px 70px rgba(0, 0, 0, 0.9), 0 0 30px rgba(56, 189, 248, 0.2);
  border-radius: 14px;
  overflow: hidden;
}

.command-palette-search {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.15);
  background: rgba(2, 6, 23, 0.6);
}

.command-palette-search i {
  color: var(--cyan-bright);
  font-size: 1.1rem;
}

.command-palette-search input {
  flex: 1;
  background: transparent;
  border: none;
  color: #fff;
  font-size: 1.05rem;
  font-family: var(--font-body);
  outline: none;
}

.command-palette-results {
  max-height: 380px;
  overflow-y: auto;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.command-palette-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 8px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition-smooth);
}

.command-palette-item:hover, .command-palette-item.active {
  background: rgba(56, 189, 248, 0.15);
  color: #fff;
  border: 1px solid rgba(56, 189, 248, 0.3);
}

.command-palette-item i {
  width: 20px;
  text-align: center;
  font-size: 1rem;
  color: var(--cyan-bright);
}

.command-palette-badge {
  margin-left: auto;
  font-size: 0.72rem;
  background: rgba(148, 163, 184, 0.15);
  padding: 2px 6px;
  border-radius: 4px;
  color: var(--text-muted);
  font-family: var(--font-code);
}

/* --- Live Cyber Threat Radar Animation --- */
.cyber-radar-card {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(56, 189, 248, 0.25);
  background: linear-gradient(135deg, rgba(15,23,42,0.85) 0%, rgba(2,6,23,0.95) 100%);
}

.radar-sweep {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 200%;
  height: 200%;
  background: conic-gradient(from 0deg at 50% 50%, rgba(56, 189, 248, 0.12) 0deg, transparent 60deg, transparent 360deg);
  transform: translate(-50%, -50%);
  animation: radarRotate 4s linear infinite;
  pointer-events: none;
}

@keyframes radarRotate {
  from { transform: translate(-50%, -50%) rotate(0deg); }
  to { transform: translate(-50%, -50%) rotate(360deg); }
}

.pulse-beacon {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--emerald-bright);
  box-shadow: 0 0 10px var(--emerald-bright);
  animation: beaconPulse 1.8s infinite;
}

@keyframes beaconPulse {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.7); }
  70% { transform: scale(1.1); box-shadow: 0 0 0 8px rgba(52, 211, 153, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(52, 211, 153, 0); }
}

/* Glass Card Elevation & Hover Glow */
.glass-card {
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.glass-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.4), 0 0 20px rgba(56, 189, 248, 0.08);
}
