/* ==============================================================================
   LUMA-SOC — Enterprise Security Operations Center & WAF
   Theme: Professional SecOps (Datadog / Sentinel / CrowdStrike style)
   Responsive: Mobile, Tablet, Laptop, Desktop
   ============================================================================== */

:root {
  /* Color Palette - Enterprise Dark Slate */
  --bg-base: #0a0d14;
  --bg-sidebar: #0e1422;
  --bg-card: #121a2c;
  --bg-card-hover: #162238;
  --bg-input: #0b101b;
  --bg-panel-header: #0f1728;
  --bg-accent-subtle: rgba(37, 99, 235, 0.08);

  /* Borders */
  --border-subtle: #1e293b;
  --border-muted: #28374f;
  --border-hover: #3b4d6b;
  --border-active: #2563eb;

  /* Typography */
  --text-primary: #f8fafc;
  --text-secondary: #cbd5e1;
  --text-muted: #94a3b8;
  --text-dim: #64748b;

  /* Brand & Status Colors */
  --color-brand: #2563eb;
  --color-brand-hover: #1d4ed8;
  --color-brand-light: #60a5fa;

  --color-green: #10b981;
  --color-green-subtle: rgba(16, 185, 129, 0.12);
  --color-green-border: rgba(16, 185, 129, 0.28);

  --color-yellow: #f59e0b;
  --color-yellow-subtle: rgba(245, 158, 11, 0.12);
  --color-yellow-border: rgba(245, 158, 11, 0.28);

  --color-orange: #f97316;
  --color-orange-subtle: rgba(249, 115, 22, 0.12);
  --color-orange-border: rgba(249, 115, 22, 0.28);

  --color-red: #ef4444;
  --color-red-subtle: rgba(239, 68, 68, 0.12);
  --color-red-border: rgba(239, 68, 68, 0.32);

  --color-cyan: #38bdf8;
  --color-purple: #a855f7;
  --color-blue: #3b82f6;

  /* Fonts & Radius */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', 'SF Mono', Consolas, monospace;
  --radius-xs: 4px;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 16px 0 rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 12px 32px 0 rgba(0, 0, 0, 0.5);

  --transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ==============================================================================
   RESET & BASE
   ============================================================================== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 14px;
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
}

body {
  background-color: var(--bg-base);
  color: var(--text-primary);
  font-family: var(--font-sans);
  min-height: 100vh;
  display: flex;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body.sidebar-open-locked {
  overflow: hidden;
}

/* Scrollbars */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #1e293b; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #334155; }

/* ==============================================================================
   SIDEBAR NAVIGATION
   ============================================================================== */
.sidebar {
  width: 250px;
  background-color: var(--bg-sidebar);
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  height: 100vh;
  z-index: 50;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-subtle);
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
}

.sidebar-logo-img {
  width: 120px;
  max-height: 42px;
  object-fit: contain;
  display: block;
}

.sidebar-close-btn {
  display: none;
  background: transparent;
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}
.sidebar-close-btn:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  border-color: var(--border-muted);
}
.sidebar-close-btn svg {
  width: 18px;
  height: 18px;
}

/* Protocol Badge */
.protocol-badge {
  margin: 12px 14px 14px 14px;
  padding: 9px 12px;
  background: var(--color-green-subtle);
  border: 1px solid var(--color-green-border);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  gap: 10px;
  transition: var(--transition);
}
.protocol-badge.level-2 {
  background: var(--color-yellow-subtle);
  border-color: var(--color-yellow-border);
}
.protocol-badge.level-3 {
  background: var(--color-orange-subtle);
  border-color: var(--color-orange-border);
}
.protocol-badge.level-4 {
  background: var(--color-red-subtle);
  border-color: var(--color-red-border);
}

.protocol-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-green);
  flex-shrink: 0;
}
.protocol-badge.level-2 .protocol-dot { background: var(--color-yellow); }
.protocol-badge.level-3 .protocol-dot { background: var(--color-orange); }
.protocol-badge.level-4 .protocol-dot { background: var(--color-red); animation: blinkDot 1s infinite; }

@keyframes blinkDot {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.25; }
}

.protocol-name {
  font-size: 0.75rem;
  font-weight: 600;
  color: #fff;
  white-space: normal;
  line-height: 1.3;
  word-break: break-word;
}
.protocol-label {
  font-size: 0.62rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 1px;
}

/* Nav Menu */
.nav-items {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 0 10px;
  flex: 1;
  overflow-y: auto;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  border-left: 2px solid transparent;
}
.nav-item:hover {
  background: rgba(255, 255, 255, 0.04);
  color: #fff;
}
.nav-item.active {
  background: rgba(37, 99, 235, 0.12);
  color: #fff;
  font-weight: 600;
  border-left-color: var(--color-brand-light);
}
.nav-item.active .nav-icon {
  stroke: var(--color-brand-light);
}

.nav-icon {
  width: 17px;
  height: 17px;
  stroke: currentColor;
  flex-shrink: 0;
}

.nav-badge {
  margin-left: auto;
  font-size: 0.68rem;
  font-weight: 600;
  padding: 1px 7px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-secondary);
}
.nav-badge--red {
  background: var(--color-red-subtle);
  border: 1px solid var(--color-red-border);
  color: var(--color-red);
}
.nav-badge--green {
  background: var(--color-green-subtle);
  border: 1px solid var(--color-green-border);
  color: var(--color-green);
  font-size: 0.6rem;
  letter-spacing: 0.04em;
}

/* Sidebar Footer */
.sidebar-footer {
  padding: 12px 14px;
  border-top: 1px solid var(--border-subtle);
  font-size: 0.73rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--text-dim);
}

.connection-status {
  display: flex;
  align-items: center;
  gap: 6px;
}
.conn-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--color-green);
}
.conn-dot--live {
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.2);
}
.sidebar-time {
  font-family: var(--font-mono);
  font-size: 0.7rem;
}

/* Mobile Sidebar Overlay */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(3px);
  z-index: 45;
  opacity: 0;
  transition: opacity 0.25s ease;
}
.sidebar-overlay.active {
  display: block;
  opacity: 1;
}

/* ==============================================================================
   MAIN LAYOUT & TOPBAR
   ============================================================================== */
.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  height: 100vh;
  overflow-y: auto;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 24px;
  border-bottom: 1px solid var(--border-subtle);
  background: rgba(14, 20, 34, 0.85);
  backdrop-filter: blur(8px);
  position: sticky;
  top: 0;
  z-index: 30;
  gap: 12px;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.sidebar-toggle {
  display: none;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  cursor: pointer;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  flex-shrink: 0;
}
.sidebar-toggle:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  border-color: var(--border-muted);
}
.sidebar-toggle svg {
  width: 18px;
  height: 18px;
}

.topbar-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

/* Threat Score Header Widget */
.threat-score-display {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-card);
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  font-family: var(--font-mono);
  font-size: 0.78rem;
}
.ts-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--color-green);
  flex-shrink: 0;
}
.threat-score-display.level-2 .ts-dot { background: var(--color-yellow); }
.threat-score-display.level-3 .ts-dot { background: var(--color-orange); }
.threat-score-display.level-4 .ts-dot { background: var(--color-red); }

.ts-label {
  font-size: 0.68rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.ts-value {
  font-size: 0.88rem;
  font-weight: 700;
  color: #fff;
}
.ts-max {
  font-size: 0.68rem;
  color: var(--text-dim);
}

/* ==============================================================================
   BUTTONS (CLEAN ENTERPRISE STYLE)
   ============================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid transparent;
  transition: var(--transition);
  font-family: var(--font-sans);
  white-space: nowrap;
  line-height: 1.4;
}
.btn svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.btn--primary {
  background: var(--color-brand);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.1);
}
.btn--primary:hover {
  background: var(--color-brand-hover);
  border-color: rgba(255, 255, 255, 0.2);
}

.btn--danger {
  background: var(--color-red-subtle);
  border-color: var(--color-red-border);
  color: #fca5a5;
}
.btn--danger:hover {
  background: var(--color-red);
  color: #fff;
  border-color: var(--color-red);
}

.btn--ghost {
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--border-subtle);
  color: var(--text-secondary);
}
.btn--ghost:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  border-color: var(--border-muted);
}

.btn--simulate {
  background: var(--color-yellow-subtle);
  border-color: var(--color-yellow-border);
  color: #fcd34d;
}
.btn--simulate:hover {
  background: rgba(245, 158, 11, 0.2);
  border-color: var(--color-yellow);
  color: #fff;
}

/* ==============================================================================
   VIEW CONTAINERS
   ============================================================================== */
.view {
  display: none;
  padding: 20px 24px;
}
.view.active {
  display: block;
}

/* ==============================================================================
   VIEW: OVERVIEW (METRICS & GRID)
   ============================================================================== */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 14px;
  margin-bottom: 20px;
}

.metric-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: var(--transition);
}
.metric-card:hover {
  border-color: var(--border-hover);
  background: var(--bg-card-hover);
}

.metric-icon {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.metric-icon svg {
  width: 20px;
  height: 20px;
}

.metric-card--primary .metric-icon { background: rgba(37, 99, 235, 0.12); color: var(--color-brand-light); }
.metric-card--danger .metric-icon { background: var(--color-red-subtle); color: var(--color-red); }
.metric-card--success .metric-icon { background: var(--color-green-subtle); color: var(--color-green); }
.metric-card--cyan .metric-icon { background: rgba(56, 189, 248, 0.12); color: var(--color-cyan); }
.metric-card--warning .metric-icon { background: var(--color-yellow-subtle); color: var(--color-yellow); }

.metric-body {
  min-width: 0;
  flex: 1;
}
.metric-value {
  font-size: 1.45rem;
  font-weight: 700;
  color: #fff;
  line-height: 1.15;
  font-family: var(--font-mono);
}
.metric-label {
  font-size: 0.74rem;
  color: var(--text-muted);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.metric-sub {
  font-size: 0.64rem;
  color: var(--text-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Dashboard Body: 3-column layout */
.dashboard-body {
  display: grid;
  grid-template-columns: 300px 330px 1fr;
  gap: 16px;
}

.chart-panel, .timeline-panel, .alert-queue-panel {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
  gap: 10px;
  flex-wrap: wrap;
}
.panel-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: #fff;
}

/* Segmented Toggle / Filter Controls */
.chart-toggle, .queue-filters {
  display: inline-flex;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xs);
  padding: 2px;
  gap: 2px;
}

.toggle-btn, .filter-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 0.7rem;
  font-weight: 500;
  padding: 3px 8px;
  border-radius: 3px;
  cursor: pointer;
  transition: var(--transition);
}
.toggle-btn:hover, .filter-btn:hover {
  color: #fff;
}
.toggle-btn.active, .filter-btn.active {
  background: var(--border-subtle);
  color: #fff;
  font-weight: 600;
}

/* Donut Chart */
.donut-wrapper {
  position: relative;
  width: 170px;
  height: 170px;
  margin: 6px auto 12px;
}
.donut-svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}
.donut-segment {
  fill: transparent;
  stroke-width: 20;
  transition: stroke-dasharray 0.4s ease;
  cursor: pointer;
}
.donut-segment:hover {
  stroke-width: 23;
}
.donut-center {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  pointer-events: none;
}
.donut-count {
  font-size: 1.4rem;
  font-weight: 700;
  font-family: var(--font-mono);
  color: #fff;
}
.donut-label {
  font-size: 0.65rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.legend {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 8px;
}
.legend-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.74rem;
}
.legend-left {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-muted);
}
.legend-color {
  width: 8px;
  height: 8px;
  border-radius: 2px;
  flex-shrink: 0;
}
.legend-value {
  font-weight: 600;
  font-family: var(--font-mono);
  color: #fff;
}

/* Timeline Panel */
.live-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.62rem;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: var(--radius-full);
  background: var(--color-red-subtle);
  border: 1px solid var(--color-red-border);
  color: var(--color-red);
  font-family: var(--font-mono);
}
.pulse-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--color-red);
}

.timeline-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow-y: auto;
  max-height: 380px;
  padding-right: 4px;
}
.timeline-item {
  display: flex;
  gap: 10px;
  padding: 8px 10px;
  background: var(--bg-input);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  border-left: 3px solid var(--border-muted);
  font-size: 0.76rem;
  transition: var(--transition);
}
.timeline-item:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-muted);
}
.timeline-item.sev-Critical { border-left-color: var(--color-red); }
.timeline-item.sev-High { border-left-color: var(--color-orange); }
.timeline-item.sev-Medium { border-left-color: var(--color-yellow); }
.timeline-item.sev-Low { border-left-color: var(--color-green); }

.timeline-time {
  font-family: var(--font-mono);
  color: var(--text-dim);
  font-size: 0.68rem;
  white-space: nowrap;
}
.timeline-body {
  flex: 1;
  min-width: 0;
}
.timeline-title {
  color: #fff;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.timeline-meta {
  display: flex;
  gap: 8px;
  color: var(--text-dim);
  font-size: 0.68rem;
  margin-top: 2px;
}

/* Alert Queue Table (SIEM Triage View) */
.alert-table-wrapper {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  flex: 1;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
}

.alert-table {
  width: 100%;
  min-width: 680px;
  border-collapse: collapse;
  font-size: 0.78rem;
  text-align: left;
}
.alert-table th {
  padding: 9px 12px;
  background: var(--bg-panel-header);
  color: var(--text-dim);
  font-weight: 600;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 1px solid var(--border-subtle);
  white-space: nowrap;
}
.alert-table td {
  padding: 10px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  color: var(--text-secondary);
  vertical-align: middle;
}
.alert-table tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

.alert-id {
  font-family: var(--font-mono);
  color: var(--color-brand-light);
  font-weight: 600;
}
.alert-title-cell {
  color: #fff;
  font-weight: 500;
  max-width: 220px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.alert-ip-cell {
  font-family: var(--font-mono);
  color: #93c5fd;
  font-size: 0.76rem;
}

/* Status & Severity Badges */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  border-radius: var(--radius-xs);
  font-size: 0.66rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
}
.badge--critical {
  background: var(--color-red-subtle);
  color: #fca5a5;
  border: 1px solid var(--color-red-border);
}
.badge--high {
  background: var(--color-orange-subtle);
  color: #fdba74;
  border: 1px solid var(--color-orange-border);
}
.badge--med {
  background: var(--color-yellow-subtle);
  color: #fcd34d;
  border: 1px solid var(--color-yellow-border);
}
.badge--low {
  background: var(--color-green-subtle);
  color: #6ee7b7;
  border: 1px solid var(--color-green-border);
}

.badge--open {
  background: var(--color-yellow-subtle);
  color: var(--color-yellow);
  border: 1px solid var(--color-yellow-border);
}
.badge--tp {
  background: var(--color-green-subtle);
  color: var(--color-green);
  border: 1px solid var(--color-green-border);
}
.badge--fp {
  background: rgba(56, 189, 248, 0.12);
  color: var(--color-cyan);
  border: 1px solid rgba(56, 189, 248, 0.28);
}

/* Table Actions */
.triage-actions {
  display: flex;
  gap: 5px;
  align-items: center;
}
.btn-tp {
  background: var(--color-green-subtle);
  border: 1px solid var(--color-green-border);
  color: var(--color-green);
  padding: 3px 7px;
  border-radius: var(--radius-xs);
  font-size: 0.68rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}
.btn-tp:hover {
  background: var(--color-green);
  color: #000;
}

.btn-fp {
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.28);
  color: var(--color-cyan);
  padding: 3px 7px;
  border-radius: var(--radius-xs);
  font-size: 0.68rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}
.btn-fp:hover {
  background: var(--color-cyan);
  color: #000;
}

.btn-view {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  padding: 3px 7px;
  border-radius: var(--radius-xs);
  font-size: 0.68rem;
  cursor: pointer;
  transition: var(--transition);
}
.btn-view:hover {
  color: #fff;
  border-color: var(--border-muted);
}

/* ==============================================================================
   VIEW: INCIDENTS, QUARANTINE, SITES, RULES
   ============================================================================== */
.view-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
  gap: 12px;
  flex-wrap: wrap;
}

.search-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 7px 12px;
  flex: 1;
  max-width: 380px;
  transition: var(--transition);
}
.search-bar:focus-within {
  border-color: var(--color-brand);
}
.search-bar svg {
  width: 15px;
  height: 15px;
  color: var(--text-dim);
  flex-shrink: 0;
}
.search-bar input {
  background: none;
  border: none;
  color: #fff;
  font-size: 0.82rem;
  width: 100%;
  outline: none;
}
.search-bar input::placeholder {
  color: var(--text-dim);
}

.view-filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.view-filters select, .input-field {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: #fff;
  padding: 7px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  outline: none;
  transition: var(--transition);
  font-family: var(--font-sans);
}
.view-filters select:focus, .input-field:focus {
  border-color: var(--color-brand);
}
.input-field--sm { width: 130px; }
.input-field--lg { flex: 1; }

.ban-form, .site-form, .rule-form {
  display: flex;
  gap: 10px;
  width: 100%;
  background: var(--bg-card);
  padding: 12px 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  align-items: center;
  flex-wrap: wrap;
}

.incidents-grid, .sites-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
  gap: 14px;
}

.card-item {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: var(--transition);
}
.card-item:hover {
  border-color: var(--border-muted);
  background: var(--bg-card-hover);
}

.card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}
.card-title {
  font-size: 0.88rem;
  font-weight: 600;
  color: #fff;
}
.card-sub {
  font-size: 0.72rem;
  color: var(--text-dim);
  font-family: var(--font-mono);
}
.card-desc {
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.4;
  word-break: break-word;
}
.card-key {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--color-brand-light);
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  padding: 6px 10px;
  border-radius: var(--radius-xs);
  word-break: break-all;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.rules-info {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}
.info-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  font-size: 0.74rem;
  color: var(--text-muted);
}
.info-card strong {
  color: var(--color-brand-light);
}

.bans-list, .rules-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.ban-row, .rule-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  gap: 12px;
  transition: var(--transition);
}
.ban-row:hover, .rule-row:hover {
  border-color: var(--border-muted);
}

/* ==============================================================================
   VIEW: TERMINAL SOC (INTERACTIVE CONSOLE)
   ============================================================================== */
.terminal-container {
  background: #080c14;
  border: 1px solid #1a2436;
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  height: calc(100vh - 110px);
  min-height: 480px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  font-family: var(--font-mono);
}

.terminal-topbar {
  background: #0c121e;
  border-bottom: 1px solid #1a2436;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.terminal-dots {
  display: flex;
  gap: 6px;
}
.tdot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}
.tdot--red { background: #ef4444; }
.tdot--yellow { background: #f59e0b; }
.tdot--green { background: #10b981; }

.terminal-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.terminal-title svg {
  width: 14px;
  height: 14px;
  color: var(--color-green);
  flex-shrink: 0;
}

.terminal-action-btn {
  background: none;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  padding: 4px;
  border-radius: var(--radius-xs);
  display: flex;
  align-items: center;
}
.terminal-action-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.05);
}
.terminal-action-btn svg {
  width: 14px;
  height: 14px;
}

.terminal-body {
  flex: 1;
  padding: 16px 20px;
  overflow-y: auto;
  color: #e2e8f0;
  font-size: 0.82rem;
  line-height: 1.55;
  display: flex;
  flex-direction: column;
  gap: 6px;
  cursor: text;
}

.term-banner {
  margin-bottom: 12px;
}

.term-logo-banner {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 12px;
  padding: 12px 16px;
  background: rgba(37, 99, 235, 0.06);
  border: 1px solid rgba(37, 99, 235, 0.18);
  border-radius: var(--radius-md);
}

.term-logo-img {
  width: 48px;
  height: 48px;
  object-fit: contain;
  flex-shrink: 0;
}

.term-logo-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.term-logo-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.02em;
}

.term-version {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--color-brand-light);
  background: rgba(37, 99, 235, 0.12);
  border: 1px solid rgba(37, 99, 235, 0.25);
  padding: 1px 6px;
  border-radius: var(--radius-full);
  margin-left: 4px;
}

.term-logo-sub {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.term-welcome {
  font-size: 0.78rem;
  color: var(--text-dim);
}
.term-cmd-hint {
  color: var(--color-green);
  font-weight: 600;
}

.term-entry {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.term-cmd-line {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #fff;
  font-weight: 500;
}
.term-prompt {
  display: inline-flex;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 600;
}
.term-prompt-user { color: var(--color-green); }
.term-prompt-sep { color: var(--text-dim); }
.term-prompt-host { color: var(--color-brand-light); }
.term-prompt-arrow { color: var(--text-dim); margin-left: 4px; }

.term-cmd-text { color: #fff; font-weight: 600; }

.term-output-block {
  padding-left: 10px;
  margin-bottom: 6px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.term-line { white-space: pre-wrap; word-break: break-all; font-size: 0.78rem; }
.term-line--header { color: var(--color-brand-light); font-weight: 600; }
.term-line--section { color: var(--color-yellow); font-weight: 600; margin-top: 4px; }
.term-line--cmd { color: #e2e8f0; }
.term-line--cmd strong { color: var(--color-green); }
.term-line--desc { color: var(--text-dim); margin-left: 6px; }
.term-line--keyval { display: flex; gap: 8px; flex-wrap: wrap; }
.term-key { color: var(--text-muted); min-width: 160px; }
.term-val { color: #fff; font-weight: 600; }
.term-val--green { color: var(--color-green); }
.term-val--yellow { color: var(--color-yellow); }
.term-val--orange { color: var(--color-orange); }
.term-val--red { color: var(--color-red); }
.term-val--cyan { color: var(--color-cyan); }

.term-line--success { color: var(--color-green); font-weight: 500; }
.term-line--warning { color: var(--color-yellow); font-weight: 500; }
.term-line--error { color: var(--color-red); font-weight: 500; }
.term-line--dim { color: var(--text-dim); }

.term-input-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
}
.term-input {
  background: transparent;
  border: none;
  outline: none;
  color: #fff;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  flex: 1;
}

.terminal-statusbar {
  background: #0c121e;
  border-top: 1px solid #1a2436;
  padding: 6px 16px;
  font-size: 0.7rem;
  color: var(--text-dim);
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.term-sep { color: #1e293b; }

/* ==============================================================================
   VIEW: INTEGRATION HUB & SDKs
   ============================================================================== */
.integration-hub {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.integration-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg-card);
  padding: 14px 18px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  flex-wrap: wrap;
  gap: 12px;
}

.integration-site-picker {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.82rem;
  color: var(--text-muted);
  flex-wrap: wrap;
}
.integration-site-picker select {
  min-width: 220px;
}

.integration-ping-box {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.ping-status {
  font-size: 0.76rem;
  color: var(--text-dim);
  font-family: var(--font-mono);
}

.framework-tabs {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 4px;
  scrollbar-width: none;
}
.framework-tabs::-webkit-scrollbar {
  display: none;
}

.fw-tab {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  transition: var(--transition);
}
.fw-tab:hover {
  background: var(--bg-card-hover);
  color: #fff;
  border-color: var(--border-muted);
}
.fw-tab.active {
  background: rgba(37, 99, 235, 0.12);
  border-color: var(--color-brand);
  color: #fff;
  font-weight: 600;
}
.fw-icon {
  font-size: 0.95rem;
}

.code-display-card {
  background: #080c14;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-md);
}
.code-card-header {
  background: #0c121e;
  border-bottom: 1px solid var(--border-subtle);
  padding: 10px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}
.code-card-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: #fff;
}
.code-card-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.code-pre-wrapper {
  padding: 16px;
  max-height: 420px;
  overflow-y: auto;
  overflow-x: auto;
}
.code-pre-wrapper pre {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  line-height: 1.55;
  color: #cbd5e1;
  white-space: pre-wrap;
  word-break: break-word;
}

.integ-features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}
.integ-feature {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.if-icon { font-size: 1.4rem; }
.if-title { font-size: 0.88rem; font-weight: 600; color: #fff; }
.if-desc { font-size: 0.78rem; color: var(--text-muted); line-height: 1.45; }

/* ==============================================================================
   MODALS & TOAST
   ============================================================================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  z-index: 100;
  display: none;
}
.modal-overlay.active { display: block; }

.modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: var(--bg-card);
  border: 1px solid var(--border-muted);
  border-radius: var(--radius-lg);
  width: 92%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  z-index: 101;
  display: none;
  box-shadow: var(--shadow-lg);
  animation: modalIn 0.18s ease;
}
.modal.active { display: block; }
.modal--wide { max-width: 680px; }

@keyframes modalIn {
  from { opacity: 0; transform: translate(-50%, -48%); }
  to { opacity: 1; transform: translate(-50%, -50%); }
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-subtle);
}
.modal-header h3 { font-size: 0.98rem; font-weight: 600; color: #fff; }
.modal-close {
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 1rem;
  cursor: pointer;
  padding: 4px;
}
.modal-close:hover { color: #fff; }

.modal-body {
  padding: 18px;
}
.modal-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.sim-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}
.sim-btn {
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  cursor: pointer;
  text-align: left;
  transition: var(--transition);
}
.sim-btn:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-muted);
}
.sim-icon { font-size: 1.3rem; }
.sim-label { font-size: 0.82rem; font-weight: 600; color: #fff; }
.sim-sev {
  font-size: 0.62rem;
  font-weight: 700;
  font-family: var(--font-mono);
  padding: 1px 6px;
  border-radius: var(--radius-xs);
  align-self: flex-start;
}
.sim-sev--crit { background: var(--color-red-subtle); color: var(--color-red); border: 1px solid var(--color-red-border); }
.sim-sev--high { background: var(--color-orange-subtle); color: var(--color-orange); border: 1px solid var(--color-orange-border); }
.sim-sev--med { background: var(--color-yellow-subtle); color: var(--color-yellow); border: 1px solid var(--color-yellow-border); }
.sim-sev--low { background: var(--color-green-subtle); color: var(--color-green); border: 1px solid var(--color-green-border); }

/* Toasts */
.toast-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: calc(100vw - 40px);
}
.toast {
  background: #0f172a;
  border: 1px solid var(--border-muted);
  border-left: 3px solid var(--color-green);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 0.8rem;
  color: #fff;
  box-shadow: var(--shadow-md);
  animation: toastIn 0.25s ease;
  display: flex;
  align-items: center;
  gap: 8px;
}
.toast--error { border-left-color: var(--color-red); }
.toast--warn { border-left-color: var(--color-yellow); }
@keyframes toastIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ==============================================================================
   VIEW: TRAFFIC (LIVE STREAM & TELEMETRY)
   ============================================================================== */
.traffic-metrics-bar {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 18px;
}
.traffic-metric-item {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.tm-label {
  font-size: 0.68rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.tm-value {
  font-size: 1.25rem;
  font-weight: 700;
  font-family: var(--font-mono);
  color: #fff;
}
.tm-value--green { color: var(--color-green); }

.traffic-table th, .traffic-table td {
  padding: 8px 10px;
}

.method-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 0.65rem;
  font-weight: 700;
  font-family: var(--font-mono);
  letter-spacing: 0.03em;
}
.method--get { background: rgba(16, 185, 129, 0.12); color: #34d399; border: 1px solid rgba(16, 185, 129, 0.25); }
.method--post { background: rgba(37, 99, 235, 0.12); color: #60a5fa; border: 1px solid rgba(37, 99, 235, 0.25); }
.method--put, .method--patch { background: rgba(245, 158, 11, 0.12); color: #fbbf24; border: 1px solid rgba(245, 158, 11, 0.25); }
.method--delete { background: rgba(239, 68, 68, 0.12); color: #f87171; border: 1px solid rgba(239, 68, 68, 0.25); }

.verdict-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 7px;
  border-radius: 4px;
  font-size: 0.66rem;
  font-weight: 700;
  font-family: var(--font-mono);
}
.verdict--allow { background: rgba(16, 185, 129, 0.1); color: var(--color-green); border: 1px solid rgba(16, 185, 129, 0.25); }
.verdict--block { background: rgba(239, 68, 68, 0.12); color: var(--color-red); border: 1px solid rgba(239, 68, 68, 0.3); }

/* ==============================================================================
   VIEW: WHITELIST (ALLOWLIST)
   ============================================================================== */
.whitelist-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.wl-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  gap: 12px;
  transition: var(--transition);
}
.wl-row:hover {
  border-color: var(--border-muted);
}
.wl-info {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 0;
}
.wl-ip {
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--color-brand-light);
  font-size: 0.85rem;
}
.wl-label {
  font-size: 0.78rem;
  color: var(--text-muted);
}
.wl-date {
  font-size: 0.7rem;
  color: var(--text-dim);
  font-family: var(--font-mono);
}

/* ==============================================================================
   VIEW: AUDIT & SCANNER DE SÉCURITÉ
   ============================================================================== */
.audit-form-bar {
  display: flex;
  gap: 10px;
  width: 100%;
  background: var(--bg-card);
  padding: 12px 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  align-items: center;
  flex-wrap: wrap;
}
.audit-input-group {
  display: flex;
  gap: 10px;
  flex: 1;
  min-width: 280px;
}

.audit-loading-panel {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 40px 20px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}
.audit-spinner {
  width: 36px;
  height: 36px;
  border: 3px solid rgba(37, 99, 235, 0.15);
  border-top-color: var(--color-brand);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}
.audit-loading-text {
  font-size: 0.82rem;
  color: var(--text-muted);
}

.audit-overview-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 16px;
}
.audit-grade-box {
  width: 72px;
  height: 72px;
  border-radius: var(--radius-md);
  background: rgba(16, 185, 129, 0.12);
  border: 2px solid var(--color-green);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.audit-grade-box.grade--a { background: rgba(16, 185, 129, 0.12); border-color: var(--color-green); color: var(--color-green); }
.audit-grade-box.grade--b { background: rgba(56, 189, 248, 0.12); border-color: var(--color-cyan); color: var(--color-cyan); }
.audit-grade-box.grade--c { background: rgba(245, 158, 11, 0.12); border-color: var(--color-yellow); color: var(--color-yellow); }
.audit-grade-box.grade--d, .audit-grade-box.grade--f { background: rgba(239, 68, 68, 0.12); border-color: var(--color-red); color: var(--color-red); }

.audit-grade-val {
  font-size: 1.8rem;
  font-weight: 800;
  line-height: 1;
}
.audit-grade-label {
  font-size: 0.58rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  opacity: 0.8;
}

.audit-summary-info {
  flex: 1;
  min-width: 0;
}
.audit-domain-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: #fff;
}
.audit-score-row {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin: 4px 0;
}
.audit-score-num {
  font-size: 1.5rem;
  font-weight: 800;
  font-family: var(--font-mono);
  color: #fff;
}
.audit-score-max {
  font-size: 0.78rem;
  color: var(--text-dim);
}
.audit-score-badge {
  margin-left: 8px;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-size: 0.7rem;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-secondary);
}
.audit-meta-text {
  font-size: 0.72rem;
  color: var(--text-dim);
}

.audit-sections-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.audit-section-panel {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  flex-direction: column;
}

.audit-checks-list, .audit-files-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.audit-check-item {
  display: flex;
  gap: 10px;
  padding: 10px 12px;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  font-size: 0.76rem;
}
.audit-check-icon {
  font-size: 1rem;
  flex-shrink: 0;
  line-height: 1.2;
}
.audit-check-body {
  flex: 1;
  min-width: 0;
}
.audit-check-title {
  color: #fff;
  font-weight: 600;
}
.audit-check-val {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 2px;
  word-break: break-all;
}
.audit-check-desc {
  color: var(--text-dim);
  font-size: 0.7rem;
  margin-top: 3px;
}

.audit-file-danger {
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.3);
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.76rem;
}
.audit-file-safe {
  background: rgba(16, 185, 129, 0.06);
  border: 1px solid rgba(16, 185, 129, 0.2);
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.76rem;
  color: var(--text-secondary);
}

.audit-remediation-box {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--border-subtle);
}
.arb-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}
.audit-fix-pre {
  background: #080c14;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 12px;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  color: #cbd5e1;
  max-height: 200px;
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-word;
}

/* ==============================================================================
   VIEW: NOTIFICATIONS & WEBHOOKS
   ============================================================================== */
.webhook-settings-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.webhook-settings-header {
  background: var(--bg-panel-header);
  border-bottom: 1px solid var(--border-subtle);
  padding: 16px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.webhook-form-body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.webhook-form-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.form-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: #fff;
}
.webhook-platform-pills {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.webhook-options-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.webhook-actions-bar {
  display: flex;
  gap: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border-subtle);
  flex-wrap: wrap;
}

/* ==============================================================================
   RESPONSIVE DESIGN BREAKPOINTS
   ============================================================================== */

/* Tablet Landscape & Small Laptops (< 1200px) */
@media (max-width: 1200px) {
  .metrics-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  .dashboard-body {
    grid-template-columns: 280px 1fr;
  }
  .alert-queue-panel {
    grid-column: 1 / -1;
  }
  .integ-features-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Tablet Portrait & Small Screens (< 1024px) */
@media (max-width: 1024px) {
  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 270px;
    max-width: 85vw;
    height: 100vh;
    z-index: 100;
    transform: translateX(-100%);
    box-shadow: var(--shadow-lg);
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .sidebar-close-btn {
    display: flex;
  }
  .sidebar-toggle {
    display: flex;
  }
  .topbar {
    padding: 10px 16px;
  }
  .view {
    padding: 16px;
  }
  .dashboard-body {
    grid-template-columns: 1fr;
  }
  .chart-panel, .timeline-panel, .alert-queue-panel {
    grid-column: 1 / -1;
  }
}

/* Phablets & Mobile Phones (< 768px) */
@media (max-width: 768px) {
  .metrics-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }
  .metric-card {
    padding: 10px 12px;
  }
  .metric-value {
    font-size: 1.25rem;
  }
  .metric-icon {
    width: 34px;
    height: 34px;
  }

  .topbar-title {
    font-size: 0.95rem;
  }

  .view-header {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }
  .search-bar {
    max-width: 100%;
    width: 100%;
  }
  .view-filters {
    width: 100%;
  }
  .view-filters select {
    flex: 1;
  }

  .ban-form, .site-form, .rule-form {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }
  .input-field--sm, .input-field--lg {
    width: 100%;
  }

  .ban-row, .rule-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .integration-top {
    flex-direction: column;
    align-items: stretch;
  }
  .integration-site-picker select {
    width: 100%;
  }
  .integ-features-grid {
    grid-template-columns: 1fr;
  }

  .code-card-header {
    flex-direction: column;
    align-items: flex-start;
  }
  .code-card-actions {
    width: 100%;
  }
  .code-card-actions .btn {
    flex: 1;
  }

  .terminal-container {
    height: calc(100vh - 90px);
    min-height: 400px;
  }
  .term-logo-banner {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .toast-container {
    left: 14px;
    right: 14px;
    bottom: 14px;
  }
}

/* Small Phones (< 520px) */
@media (max-width: 520px) {
  .topbar-right .btn-text {
    display: none;
  }
  .topbar-right .btn {
    padding: 6px 8px;
  }

  .threat-score-display .ts-label {
    display: none;
  }

  .sim-grid {
    grid-template-columns: 1fr;
  }

  .incidents-grid, .sites-grid {
    grid-template-columns: 1fr;
  }
}

/* Extra Small Phones (< 380px) */
@media (max-width: 380px) {
  .metrics-grid {
    grid-template-columns: 1fr;
  }
}

/* =========================================================================
   LUMA-SOC CLOUD : STYLES SAAS MULTI-TENANT & ABONNEMENTS
   ========================================================================= */

/* Topbar SaaS Org & User Menu */
.topbar-org-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(14, 23, 42, 0.75);
  border: 1px solid rgba(56, 189, 248, 0.25);
  border-radius: var(--radius-md);
  padding: 5px 12px;
  cursor: pointer;
  transition: all 0.2s ease;
}
.topbar-org-badge:hover {
  border-color: rgba(56, 189, 248, 0.6);
  background: rgba(15, 29, 58, 0.9);
  box-shadow: 0 0 14px rgba(56, 189, 248, 0.2);
}
.topbar-org-badge .org-icon {
  font-size: 0.95rem;
}
.topbar-org-badge .org-name {
  font-size: 0.8rem;
  font-weight: 600;
  color: #e2e8f0;
  max-width: 140px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.plan-pill {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.2), rgba(59, 130, 246, 0.2));
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.4);
  letter-spacing: 0.04em;
}

/* User Menu Dropdown */
.user-menu-wrapper {
  position: relative;
}
.user-profile-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 4px 10px;
  cursor: pointer;
  color: var(--text-color);
  transition: all 0.2s ease;
}
.user-profile-btn:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-hover);
}
.user-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, #2563eb, #06b6d4);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 10px rgba(37, 99, 235, 0.4);
}
.user-display-name {
  font-size: 0.8rem;
  font-weight: 600;
  color: #f1f5f9;
  max-width: 90px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.chevron-icon {
  width: 14px;
  height: 14px;
  color: var(--text-dim);
}

.user-dropdown-menu {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 240px;
  background: rgba(10, 16, 30, 0.96);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(56, 189, 248, 0.25);
  border-radius: var(--radius-md);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.6);
  z-index: 1000;
  padding: 8px 0;
  animation: fadeInDown 0.2s ease;
}
.user-dropdown-menu.active {
  display: block;
}
.dropdown-header {
  padding: 10px 16px;
}
.dropdown-user-name {
  font-size: 0.86rem;
  font-weight: 700;
  color: #fff;
}
.dropdown-user-email {
  font-size: 0.72rem;
  color: var(--text-dim);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dropdown-divider {
  height: 1px;
  background: rgba(255, 255, 255, 0.08);
  margin: 6px 0;
}
.dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 16px;
  font-size: 0.8rem;
  color: #cbd5e1;
  text-decoration: none;
  transition: all 0.15s ease;
}
.dropdown-item svg {
  width: 16px;
  height: 16px;
  color: #94a3b8;
}
.dropdown-item:hover {
  background: rgba(56, 189, 248, 0.1);
  color: #38bdf8;
}
.dropdown-item:hover svg {
  color: #38bdf8;
}
.dropdown-item--danger:hover {
  background: rgba(239, 68, 68, 0.12);
  color: #ef4444;
}
.dropdown-item--danger:hover svg {
  color: #ef4444;
}

/* SaaS Usage Cards & Gauges */
.saas-usage-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}
.saas-usage-card {
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
  backdrop-filter: blur(8px);
}
.saas-card-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 10px;
}
.saas-metric-title {
  font-size: 0.84rem;
  color: var(--text-muted);
  font-weight: 500;
}
.saas-metric-ratio {
  font-family: var(--font-mono);
  font-size: 1.15rem;
  font-weight: 700;
  color: #fff;
}
.saas-progress-bar {
  width: 100%;
  height: 8px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 8px;
}
.saas-progress-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #2563eb, #38bdf8);
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.5);
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}
.saas-progress-fill--cyan {
  background: linear-gradient(90deg, #06b6d4, #10b981);
}
.saas-progress-fill--green {
  background: linear-gradient(90deg, #10b981, #34d399);
}
.saas-card-sub {
  font-size: 0.72rem;
  color: var(--text-dim);
}

/* SaaS Plans Container & Pricing Cards */
.saas-plans-container {
  margin-top: 24px;
}
.saas-plans-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.saas-plans-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(310px, 1fr));
  gap: 24px;
  align-items: stretch;
}
.saas-plan-card {
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-lg);
  padding: 28px;
  display: flex;
  flex-direction: column;
  position: relative;
  transition: all 0.3s ease;
  backdrop-filter: blur(12px);
}
.saas-plan-card:hover {
  transform: translateY(-4px);
  border-color: rgba(56, 189, 248, 0.4);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.4);
}
.saas-plan-card--featured {
  border-color: rgba(6, 182, 212, 0.6);
  background: linear-gradient(180deg, rgba(8, 47, 73, 0.6) 0%, rgba(15, 23, 42, 0.8) 100%);
  box-shadow: 0 0 30px rgba(6, 182, 212, 0.15);
}
.plan-badge-top {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(90deg, #06b6d4, #2563eb);
  color: #fff;
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 3px 12px;
  border-radius: 999px;
  box-shadow: 0 4px 12px rgba(6, 182, 212, 0.4);
}
.plan-header {
  margin-bottom: 20px;
}
.plan-card-name {
  font-size: 1.25rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 8px;
}
.plan-price-row {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin-bottom: 4px;
}
.plan-price-val {
  font-family: var(--font-mono);
  font-size: 2.2rem;
  font-weight: 800;
  color: #fff;
  line-height: 1;
}
.plan-price-period {
  font-size: 0.84rem;
  color: var(--text-dim);
}
.plan-features-list {
  list-style: none;
  padding: 0;
  margin: 0 0 24px 0;
  flex: 1;
}
.plan-feature-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.82rem;
  color: #cbd5e1;
  margin-bottom: 12px;
  line-height: 1.4;
}
.plan-check-icon {
  width: 16px;
  height: 16px;
  color: #10b981;
  flex-shrink: 0;
  margin-top: 2px;
}
.plan-action-btn {
  width: 100%;
  padding: 12px;
  border-radius: var(--radius-md);
  font-size: 0.86rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid transparent;
}
.plan-action-btn--current {
  background: rgba(16, 185, 129, 0.15);
  border-color: rgba(16, 185, 129, 0.4);
  color: #34d399;
  cursor: default;
}
.plan-action-btn--upgrade {
  background: linear-gradient(135deg, #2563eb, #06b6d4);
  color: #fff;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35);
}
.plan-action-btn--upgrade:hover {
  filter: brightness(1.15);
  box-shadow: 0 6px 20px rgba(37, 99, 235, 0.5);
  transform: translateY(-1px);
}
.plan-action-btn--downgrade {
  background: transparent;
  border-color: rgba(255, 255, 255, 0.2);
  color: #cbd5e1;
}
.plan-action-btn--downgrade:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.4);
}

/* Authentication Modal */
.auth-modal {
  max-width: 440px;
  width: 90%;
  background: rgba(10, 16, 30, 0.98);
  border: 1px solid rgba(56, 189, 248, 0.3);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8), 0 0 40px rgba(56, 189, 248, 0.15);
  border-radius: var(--radius-xl);
  backdrop-filter: blur(20px);
}
.auth-modal-header {
  padding: 24px 24px 16px 24px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.auth-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}
.auth-brand-logo {
  width: 36px;
  height: 36px;
  object-fit: contain;
}
.auth-brand-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.02em;
}
.auth-badge {
  font-size: 0.65rem;
  font-weight: 800;
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.15);
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid rgba(56, 189, 248, 0.3);
  margin-left: 4px;
}
.auth-brand-sub {
  font-size: 0.72rem;
  color: var(--text-dim);
  margin-top: 2px;
}
.auth-tabs {
  display: flex;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(0, 0, 0, 0.2);
}
.auth-tab {
  flex: 1;
  padding: 12px;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.84rem;
  cursor: pointer;
  transition: all 0.2s ease;
}
.auth-tab.active {
  color: #38bdf8;
  border-bottom-color: #38bdf8;
  background: rgba(56, 189, 248, 0.05);
}
.auth-modal-body {
  padding: 24px;
}
.auth-alert {
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  margin-bottom: 16px;
  line-height: 1.4;
}
.auth-alert--error {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.35);
  color: #fca5a5;
}
.auth-alert--success {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.35);
  color: #6ee7b7;
}
.auth-divider {
  display: flex;
  align-items: center;
  text-align: center;
  margin: 18px 0;
  color: var(--text-dim);
  font-size: 0.72rem;
  font-weight: 600;
}
.auth-divider::before, .auth-divider::after {
  content: '';
  flex: 1;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.auth-divider span {
  padding: 0 10px;
}
.auth-demo-btn {
  border-color: rgba(56, 189, 248, 0.35);
  color: #38bdf8;
  font-weight: 600;
  padding: 10px;
}
.auth-demo-btn:hover {
  background: rgba(56, 189, 248, 0.12);
  border-color: rgba(56, 189, 248, 0.6);
}
.btn--full {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
}
.btn-icon-right {
  width: 16px;
  height: 16px;
}

/* Form Controls & Labels inside Modals */
.form-group {
  margin-bottom: 16px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
  text-align: left;
}
.form-group label {
  font-size: 0.78rem;
  font-weight: 600;
  color: #94a3b8;
  letter-spacing: 0.02em;
}
.form-control {
  width: 100% !important;
  background: rgba(15, 23, 42, 0.85) !important;
  border: 1px solid rgba(56, 189, 248, 0.25) !important;
  border-radius: var(--radius-md) !important;
  padding: 10px 14px !important;
  font-size: 0.88rem !important;
  color: #f1f5f9 !important;
  font-family: inherit !important;
  outline: none !important;
  box-sizing: border-box !important;
  transition: all 0.2s ease !important;
}
.form-control:focus {
  border-color: #38bdf8 !important;
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.35) !important;
  background: rgba(15, 23, 42, 1) !important;
}
.form-control::placeholder {
  color: #475569 !important;
}

