/* ==========================================================================
   NetDecoy SOC Dashboard - Professional Modern Light Theme
   Font: Plus Jakarta Sans & JetBrains Mono
   ========================================================================== */

:root {
  /* Neutral Palette */
  --bg-app: #f8fafc;
  --bg-card: #ffffff;
  --bg-subtle: #f1f5f9;
  --bg-hover: #f8fafc;
  
  --border-light: #e2e8f0;
  --border-subtle: #f1f5f9;
  
  --text-primary: #0f172a;
  --text-secondary: #334155;
  --text-muted: #64748b;
  --text-dim: #94a3b8;
  
  /* Refined Accent Colors */
  --accent-primary: #4f46e5;      /* Indigo */
  --accent-primary-light: #eeeffe;
  
  --severity-low-bg: #ecfdf5;
  --severity-low-text: #047857;
  --severity-low-border: #a7f3d0;

  --severity-med-bg: #fffbeb;
  --severity-med-text: #b45309;
  --severity-med-border: #fde68a;

  --severity-high-bg: #fff7ed;
  --severity-high-text: #c2410c;
  --severity-high-border: #ffedd5;

  --severity-crit-bg: #fef2f2;
  --severity-crit-text: #b91c1c;
  --severity-crit-border: #fecaca;

  /* Typography */
  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  /* Shadows */
  --shadow-xs: 0 1px 2px 0 rgba(0, 0, 0, 0.04);
  --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.05), 0 1px 2px -1px rgba(0, 0, 0, 0.03);
}

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

body {
  background-color: var(--bg-app);
  color: var(--text-primary);
  font-family: var(--font-sans);
  min-height: 100vh;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* Scrollbars */
::-webkit-scrollbar {
  width: 5px;
  height: 5px;
}
::-webkit-scrollbar-track {
  background: var(--bg-app);
}
::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}

.app-layout {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* HEADER */
.app-header {
  background: #ffffff;
  border-bottom: 1px solid var(--border-light);
  padding: 12px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: var(--shadow-xs);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-logo {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: var(--accent-primary-light);
  color: var(--accent-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
}

.brand-title {
  font-size: 17px;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.4px;
  line-height: 1.1;
}

.brand-subtitle {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 600;
  display: block;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

/* Clean Status Dot Pill (Without Standalone Engine label) */
.status-indicator-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  padding: 5px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
}

.status-dot-active {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background-color: var(--severity-low-text);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2);
}

.status-label-active {
  font-size: 11px;
  font-weight: 600;
  color: var(--severity-low-text);
}

.header-clock {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 500;
}

.btn {
  padding: 7px 13px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid var(--border-light);
  background: #ffffff;
  color: var(--text-primary);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  box-shadow: var(--shadow-xs);
}

.btn:hover {
  background: var(--bg-subtle);
  border-color: #cbd5e1;
}

.btn-reset-style {
  color: var(--severity-crit-text);
  border-color: var(--severity-crit-border);
  background: var(--severity-crit-bg);
}
.btn-reset-style:hover {
  background: #fee2e2;
}

/* SIMULATION BAR */
.demo-bar {
  background: #f1f5f9;
  border-bottom: 1px solid var(--border-light);
  padding: 8px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.demo-bar.hidden {
  display: none;
}

.demo-bar-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--accent-primary);
  display: flex;
  align-items: center;
  gap: 6px;
}

.demo-bar-actions {
  display: flex;
  gap: 6px;
}

.btn-demo-action {
  background: #ffffff;
  border: 1px solid var(--border-light);
  color: var(--text-secondary);
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  align-items: center;
  gap: 5px;
}

.btn-demo-action:hover {
  border-color: var(--accent-primary);
  color: var(--accent-primary);
  background: var(--accent-primary-light);
}

/* DASHBOARD MAIN CONTENT */
.dashboard-content {
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  flex: 1;
}

/* CARDS COMMON */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: 10px;
  padding: 16px 18px;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.card:hover {
  border-color: #cbd5e1;
}

.card-header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

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

.header-icon {
  font-size: 14px;
  color: var(--accent-primary);
}

.icon-purple {
  color: #7e22ce !important;
}

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

/* KPI METRICS */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}

.metric-card {
  background: #ffffff;
  border: 1px solid var(--border-light);
  border-radius: 10px;
  padding: 14px 16px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: border-color 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.metric-card:hover {
  border-color: #cbd5e1;
}

.metric-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.metric-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
}

.metric-icon {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
}

.icon-slate { background: var(--bg-subtle); color: var(--text-secondary); }
.icon-amber { background: var(--severity-med-bg); color: var(--severity-med-text); }
.icon-rose { background: var(--severity-crit-bg); color: var(--severity-crit-text); }
.icon-emerald { background: var(--severity-low-bg); color: var(--severity-low-text); }

.metric-val {
  font-size: 24px;
  font-weight: 800;
  font-family: var(--font-mono);
  color: var(--text-primary);
  line-height: 1;
}

.text-amber { color: var(--severity-med-text); }
.text-rose { color: var(--severity-crit-text); }
.text-emerald { color: var(--severity-low-text); }

/* MIDDLE GRID */
.middle-grid {
  display: grid;
  grid-template-columns: 3fr 2fr;
  gap: 18px;
}

/* EVENT STREAM TABLE */
.event-feed-card {
  display: flex;
  flex-direction: column;
}

.feed-tabs {
  display: flex;
  gap: 4px;
  background: var(--bg-subtle);
  padding: 2px;
  border-radius: 6px;
  border: 1px solid var(--border-light);
}

.tab-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 3px 10px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.tab-btn.active {
  background: #ffffff;
  color: var(--text-primary);
  box-shadow: var(--shadow-xs);
}

.table-container {
  overflow-y: auto;
  max-height: 340px;
  border: 1px solid var(--border-light);
  border-radius: 8px;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 12px;
}

.data-table th {
  background: var(--bg-subtle);
  color: var(--text-secondary);
  padding: 8px 12px;
  font-weight: 700;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  position: sticky;
  top: 0;
  z-index: 10;
  border-bottom: 1px solid var(--border-light);
}

.data-table td {
  padding: 9px 12px;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-secondary);
}

.data-table tr:hover {
  background: var(--bg-hover);
}

.endpoint-chip {
  font-family: var(--font-mono);
  font-size: 11px;
  background: #f1f5f9;
  color: var(--accent-primary);
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid var(--border-light);
  font-weight: 600;
}

.chip-sev {
  padding: 2px 7px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
  display: inline-block;
}

.chip-low { background: var(--severity-low-bg); color: var(--severity-low-text); border: 1px solid var(--severity-low-border); }
.chip-medium { background: var(--severity-med-bg); color: var(--severity-med-text); border: 1px solid var(--severity-med-border); }
.chip-high { background: var(--severity-high-bg); color: var(--severity-high-text); border: 1px solid var(--severity-high-border); }
.chip-critical { background: var(--severity-crit-bg); color: var(--severity-crit-text); border: 1px solid var(--severity-crit-border); }

/* RIGHT COLUMN */
.right-col-stack {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

/* RISK CARD */
.risk-widget {
  display: flex;
  gap: 16px;
  align-items: center;
}

.risk-meter-box {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.risk-circle-gauge {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  background: conic-gradient(
    var(--accent-primary) calc(var(--risk-angle) * 1deg), 
    #e2e8f0 0deg
  );
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.4s ease;
}

.risk-circle-inner {
  width: 74px;
  height: 74px;
  border-radius: 50%;
  background: #ffffff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.risk-number {
  font-size: 24px;
  font-weight: 800;
  font-family: var(--font-mono);
  color: var(--text-primary);
  line-height: 1;
}

.risk-denom {
  font-size: 9px;
  color: var(--text-muted);
}

.badge-chip {
  font-size: 10px;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 10px;
  letter-spacing: 0.5px;
}

.risk-breakdown-panel {
  flex: 1;
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  border-radius: 8px;
  padding: 10px 12px;
}

.section-label {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.signal-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.signal-item {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-secondary);
}

.signal-points {
  font-weight: 700;
  font-family: var(--font-mono);
  color: var(--severity-high-text);
}

/* MAP */
.geo-tag {
  font-size: 10px;
  font-weight: 700;
  color: var(--accent-primary);
  background: var(--accent-primary-light);
  padding: 2px 7px;
  border-radius: 4px;
}

.map-box {
  height: 285px;
  border-radius: 8px;
  overflow: hidden;
  position: relative;
  border: 1px solid var(--border-light);
  background: #f1f5f9;
  transition: height 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.map-box.expanded {
  height: 420px;
}

#leaflet-map {
  width: 100%;
  height: 100%;
  min-height: 285px;
  z-index: 1;
  background: #e2e8f0;
}

.map-size-btn {
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  padding: 3px 8px;
  font-size: 0.75rem;
  cursor: pointer;
  color: #334155;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: all 0.15s ease;
}

.map-size-btn:hover {
  background: #e2e8f0;
  color: #0f172a;
}

.map-info-banner {
  position: absolute;
  bottom: 8px;
  left: 8px;
  right: 8px;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(6px);
  border: 1px solid var(--border-light);
  padding: 8px 12px;
  border-radius: 8px;
  z-index: 1000;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.map-info-banner i {
  color: var(--severity-crit-text);
  font-size: 16px;
}

.map-location-name {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-primary);
}

.map-location-sub {
  font-size: 11px;
  color: var(--text-muted);
  font-family: var(--font-mono);
  margin-top: 1px;
}

/* MITRE ATT&CK ENTERPRISE MATRIX HEATMAP */
.mitre-matrix-card {
  width: 100%;
  margin-bottom: 20px;
}

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

.mitre-metric-badge {
  font-size: 11px;
  font-weight: 600;
  color: #334155;
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  padding: 3px 10px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.badge-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  display: inline-block;
}

.dot-red {
  background: #ef4444;
  box-shadow: 0 0 6px rgba(239, 68, 68, 0.6);
  animation: pulse 1.5s infinite;
}

.dot-blue {
  background: #3b82f6;
  box-shadow: 0 0 6px rgba(59, 130, 246, 0.4);
}

.mitre-matrix-body {
  overflow-x: auto;
  padding: 8px 2px 14px 2px;
  transition: max-height 0.3s ease, opacity 0.3s ease;
  scrollbar-width: thin;
  scrollbar-color: #cbd5e1 transparent;
}

.mitre-matrix-body.collapsed {
  display: none;
}

.mitre-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(160px, 1fr));
  gap: 12px;
  min-width: 1100px;
}

.mitre-column {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.mitre-column.engaged-tactic {
  background: #fdfbf7;
  border-color: #fed7aa;
}

.mitre-col-header {
  padding-bottom: 8px;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.mitre-tactic-id {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  color: #64748b;
  letter-spacing: 0.5px;
}

.mitre-tactic-name {
  font-size: 12px;
  font-weight: 800;
  color: #0f172a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mitre-tech-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.mitre-tech-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 8px 10px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition: all 0.2s ease;
  position: relative;
}

.mitre-tech-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  border-color: #94a3b8;
}

.tech-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
}

.tech-id {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 800;
  color: #334155;
  background: #f1f5f9;
  padding: 1px 5px;
  border-radius: 4px;
}

.tech-name {
  font-size: 11px;
  font-weight: 700;
  color: #1e293b;
  line-height: 1.3;
}

.tech-heat-badge {
  font-size: 9px;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 10px;
  letter-spacing: 0.3px;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  width: fit-content;
  margin-top: 2px;
}

/* HEAT LEVELS */
.mitre-tech-card.heat-crit {
  border-color: #fca5a5;
  background: #fff5f5;
  box-shadow: 0 0 10px rgba(239, 68, 68, 0.15);
}

.mitre-tech-card.heat-crit .tech-id {
  background: #fee2e2;
  color: #991b1b;
}

.mitre-tech-card.heat-crit .tech-heat-badge {
  background: #ef4444;
  color: #ffffff;
}

.mitre-tech-card.heat-high {
  border-color: #fdba74;
  background: #fffaf0;
  box-shadow: 0 0 8px rgba(249, 115, 22, 0.12);
}

.mitre-tech-card.heat-high .tech-id {
  background: #ffedd5;
  color: #9a3412;
}

.mitre-tech-card.heat-high .tech-heat-badge {
  background: #f97316;
  color: #ffffff;
}

.mitre-tech-card.heat-med {
  border-color: #93c5fd;
  background: #f0f9ff;
}

.mitre-tech-card.heat-med .tech-id {
  background: #e0f2fe;
  color: #0369a1;
}

.mitre-tech-card.heat-med .tech-heat-badge {
  background: #0284c7;
  color: #ffffff;
}

.mitre-tech-card.heat-inactive {
  opacity: 0.75;
}

.mitre-tech-card.heat-inactive:hover {
  opacity: 1;
}

.mitre-tech-card.heat-inactive .tech-heat-badge {
  background: #f1f5f9;
  color: #94a3b8;
}

/* MITRE MODAL CONTENT */
.mitre-modal-section {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 12px;
}

.mitre-modal-label {
  font-size: 11px;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.mitre-hits-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 180px;
  overflow-y: auto;
}

.mitre-hit-item {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}


/* FULL WIDTH PANORAMIC JOURNEY CARD */
.full-width-card {
  width: 100%;

  margin-bottom: 20px;
}

.journey-header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.journey-legend {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 5px;
}

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

.legend-dot.dot-crit {
  background: #ef4444;
  box-shadow: 0 0 6px rgba(239, 68, 68, 0.4);
}

.legend-dot.dot-warn {
  background: #3b82f6;
  box-shadow: 0 0 6px rgba(59, 130, 246, 0.4);
}

.journey-meta-badge {
  font-size: 11px;
  font-weight: 700;
  color: var(--accent-primary);
  background: var(--accent-primary-light);
  padding: 3px 9px;
  border-radius: 6px;
  border: 1px solid #cbd5e1;
}

/* JOURNEY FLOW WRAPPER */
.journey-flow-wrapper {
  display: flex;
  align-items: stretch;
  gap: 14px;
  overflow-x: auto;
  padding: 10px 4px 14px 4px;
  scrollbar-width: thin;
  scrollbar-color: #cbd5e1 transparent;
}

.journey-flow-wrapper::-webkit-scrollbar {
  height: 6px;
}

.journey-flow-wrapper::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}

.journey-empty {
  color: var(--text-muted);
  font-size: 13px;
  padding: 24px;
  text-align: center;
  width: 100%;
  background: #f8fafc;
  border: 1px dashed #cbd5e1;
  border-radius: 8px;
}

.journey-step {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-shrink: 0;
}

.step-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 12px 14px;
  min-width: 180px;
  max-width: 220px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
}

.step-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08);
}

.step-card.active {
  border-color: #93c5fd;
  background: #f8fafc;
}

.step-card.critical {
  border-color: #fca5a5;
  background: #fff5f5;
}

.step-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.step-badge {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.5px;
  padding: 2px 6px;
  border-radius: 4px;
  background: #e2e8f0;
  color: #334155;
}

.step-card.critical .step-badge {
  background: #fee2e2;
  color: #991b1b;
}

.step-card.active .step-badge {
  background: #dbeafe;
  color: #1e40af;
}

.step-time {
  font-size: 10px;
  font-family: var(--font-mono);
  color: #64748b;
  display: flex;
  align-items: center;
  gap: 3px;
}

.step-endpoint-badge code {
  font-size: 13px;
  font-weight: 700;
  font-family: var(--font-mono);
  color: #0f172a;
  background: #f1f5f9;
  padding: 2px 6px;
  border-radius: 4px;
  display: inline-block;
  border: 1px solid #e2e8f0;
}

.step-card.critical .step-endpoint-badge code {
  background: #fef2f2;
  border-color: #fecaca;
  color: #b91c1c;
}

.step-desc {
  font-size: 11px;
  font-weight: 600;
  color: #334155;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 190px;
}

.step-connector {
  color: #94a3b8;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
}

/* INTELLIGENCE & PREDICTIVE GRID (2-Column) */
.intelligence-grid {
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  gap: 20px;
  align-items: stretch;
}

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

/* AI THREAT SYNTHESIS CARD */
.ai-card {
  display: flex;
  flex-direction: column;
}

.ai-chip {
  background: #f3e8ff;
  color: #7e22ce;
  border: 1px solid #e9d5ff;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 5px;
}

.ai-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
  height: 100%;
}

.ai-summary-paragraph {
  font-size: 13px;
  color: #1e293b;
  line-height: 1.6;
  background: #faf5ff;
  border: 1px solid #e9d5ff;
  border-left: 4px solid #9333ea;
  border-radius: 6px;
  padding: 12px 14px;
}

.ai-details-row {
  display: grid;
  grid-template-columns: 1.15fr 0.95fr;
  gap: 14px;
  flex: 1;
}

@media (max-width: 768px) {
  .ai-details-row {
    grid-template-columns: 1fr;
  }
}

.ai-sub-card {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 12px;
  display: flex;
  flex-direction: column;
}

.sub-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
  color: #334155;
  margin-top: 6px;
}

.ev-item {
  position: relative;
  padding-left: 14px;
  line-height: 1.5;
  word-break: break-word;
}

.ev-item::before {
  content: "•";
  position: absolute;
  left: 0;
  color: #3b82f6;
  font-weight: bold;
}

.ev-ts {
  font-family: var(--font-mono);
  font-size: 11px;
  color: #64748b;
  font-weight: 600;
  margin-right: 4px;
}

.ev-endpoint {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  color: #0f172a;
  background: #e2e8f0;
  padding: 1px 4px;
  border-radius: 3px;
}

.rec-item {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  line-height: 1.5;
  font-size: 12px;
}

.rec-icon {
  color: #10b981;
  font-size: 13px;
  margin-top: 3px;
  flex-shrink: 0;
}

/* PREDICTION CARD */
.prediction-card {
  display: flex;
  flex-direction: column;
}

.prediction-body {
  display: flex;
  flex-direction: column;
  gap: 14px;
  height: 100%;
}

.pred-stage-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-bottom: 8px;
  border-bottom: 1px solid #e2e8f0;
}

.pred-stage-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.pred-label {
  font-size: 10px;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.pred-stage-name {
  font-size: 16px;
  font-weight: 800;
  color: #0f172a;
  letter-spacing: -0.3px;
}

.pred-badge-indicator {
  font-size: 10px;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 12px;
  letter-spacing: 0.5px;
}

.badge-normal-risk {
  background: #dbeafe;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
}

.badge-high-risk {
  background: #fee2e2;
  color: #b91c1c;
  border: 1px solid #fecaca;
  animation: pulse 2s infinite;
}

.progress-track-wrapper {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.progress-track-header {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  font-weight: 600;
  color: #475569;
}

.progress-track {
  height: 8px;
  background: #e2e8f0;
  border-radius: 4px;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #3b82f6, #9333ea);
  border-radius: 4px;
  transition: width 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.predict-basis-box {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 10px 12px;
}

.basis-note {
  font-size: 12px;
  color: #334155;
  line-height: 1.5;
  margin-top: 4px;
}

.countermeasure-preview {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: 6px;
  padding: 10px 12px;
}

.countermeasure-preview .section-label {
  color: #166534;
}

.countermeasure-item {
  font-size: 12px;
  color: #15803d;
  line-height: 1.5;
  margin-top: 4px;
}


/* FOOTER */
.app-footer {
  border-top: 1px solid var(--border-light);
  padding: 12px 24px;
  font-size: 11px;
  color: var(--text-muted);
  display: flex;
  justify-content: space-between;
  background: #ffffff;
  font-weight: 500;
}

/* 3-SYSTEM SWITCHER NAV */
.system-switch-nav {
  display: flex;
  align-items: center;
  gap: 6px;
  background: #f1f5f9;
  padding: 4px;
  border-radius: 8px;
  border: 1px solid var(--border-light);
}

.system-switch-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
  color: var(--text-muted);
  transition: all 0.15s ease;
}

.system-switch-btn:hover {
  color: var(--text-primary);
  background: #ffffff;
}

.system-switch-btn.active-soc {
  background: #ffffff;
  color: var(--accent-primary);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

/* LIVE DETECTED ATTACKS SHOWCASE */
.detected-attacks-banner {
  background: #ffffff;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-card);
  padding: 14px 18px;
  box-shadow: var(--shadow-xs);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.detected-attacks-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.attacks-title {
  font-size: 13px;
  font-weight: 800;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
  letter-spacing: -0.2px;
}

.attacks-count-badge {
  font-size: 11px;
  font-weight: 700;
  font-family: var(--font-mono);
  background: #fef2f2;
  color: #b91c1c;
  border: 1px solid #fecaca;
  padding: 2px 8px;
  border-radius: 9999px;
}

.detected-attacks-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.no-attacks-msg {
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

.attack-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
  border: 1px solid transparent;
  animation: fadeIn 0.3s ease;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}

.attack-pill:hover {
  transform: translateY(-2px);
  filter: brightness(0.95);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.attack-pill.pill-critical {
  background: #fef2f2;
  color: #991b1b;
  border-color: #fecaca;
  box-shadow: 0 0 8px rgba(239, 68, 68, 0.15);
}

.attack-pill.pill-high {
  background: #fffbeb;
  color: #92400e;
  border-color: #fde68a;
}

.attack-pill.pill-medium {
  background: #ecfeff;
  color: #155e75;
  border-color: #a5f3fc;
}

.attack-pill-page {
  font-family: var(--font-mono);
  font-size: 11px;
  background: rgba(0, 0, 0, 0.06);
  padding: 1px 4px;
  border-radius: 3px;
}

.data-table tbody tr {
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.data-table tbody tr:hover {
  background-color: rgba(37, 99, 235, 0.05);
}

/* VIEW MODE TOGGLE (RAW STREAM VS GROUPED CLUSTERS) */
.view-mode-toggle {
  display: flex;
  background: rgba(15, 23, 42, 0.06);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 2px;
  gap: 2px;
}

.mode-btn {
  background: transparent;
  border: none;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 4px;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
}

.mode-btn.active {
  background: #ffffff;
  color: var(--text-primary);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.mode-btn:hover:not(.active) {
  color: var(--text-primary);
}

/* GROUPED ATTACK CLUSTERS VIEW */
.clusters-container {
  padding: 14px;
  overflow-y: auto;
  max-height: 480px;
}

.clusters-container.hidden {
  display: none !important;
}

.clusters-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.cluster-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 14px 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: all 0.2s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.cluster-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  border-color: #cbd5e1;
}

.cluster-card.cluster-critical {
  border-left: 4px solid #ef4444;
}

.cluster-card.cluster-high {
  border-left: 4px solid #f59e0b;
}

.cluster-card.cluster-medium {
  border-left: 4px solid #06b6d4;
}

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

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

.cluster-title {
  font-size: 13px;
  font-weight: 800;
  color: #0f172a;
}

.cluster-count-chip {
  font-size: 11px;
  font-weight: 800;
  font-family: var(--font-mono);
  background: #0f172a;
  color: #ffffff;
  padding: 2px 8px;
  border-radius: 9999px;
}

.cluster-details-row {
  display: flex;
  gap: 16px;
  align-items: center;
  flex-wrap: wrap;
  font-size: 11px;
  color: #64748b;
}

.cluster-detail-item {
  display: flex;
  align-items: center;
  gap: 5px;
}

.cluster-detail-item strong {
  color: #0f172a;
}

.cluster-payload-snippet {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 4px;
  padding: 6px 10px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: #0369a1;
  word-break: break-all;
}

.cluster-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid #f1f5f9;
  padding-top: 8px;
  margin-top: 2px;
}

/* ATTACK FORENSIC DETAIL INSPECTOR MODAL */
.attack-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 9998;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.2s ease;
}

.attack-modal-overlay.hidden {
  display: none !important;
}

.attack-modal-container {
  background: #ffffff;
  border-radius: 12px;
  width: 100%;
  max-width: 840px;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.35);
  border: 1px solid #cbd5e1;
  overflow: hidden;
}

.attack-modal-header {
  background: #0f172a;
  color: #ffffff;
  padding: 16px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #334155;
}

.attack-modal-body {
  padding: 24px 28px;
  overflow-y: auto;
  color: #1e293b;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.attack-detail-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.attack-detail-card {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 12px 14px;
}

.attack-detail-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #64748b;
  margin-bottom: 4px;
}

.attack-detail-val {
  font-size: 13px;
  font-weight: 700;
  color: #0f172a;
}

.attack-payload-box {
  background: #090d16;
  color: #38bdf8;
  border-radius: 8px;
  padding: 14px 16px;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.5;
  border: 1px solid #1e293b;
  position: relative;
  overflow-x: auto;
  word-break: break-all;
  white-space: pre-wrap;
}

.attack-modal-footer {
  background: #f8fafc;
  padding: 14px 24px;
  border-top: 1px solid #e2e8f0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

/* REPORT EXPORT BUTTON IN HEADER */
.btn-report {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: #ffffff;
  border: none;
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.25);
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-report:hover {
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.35);
  transform: translateY(-1px);
}

/* FORENSIC REPORT MODAL OVERLAY */
.report-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  overflow-y: auto;
}

.report-modal-overlay.hidden {
  display: none !important;
}

.report-modal-container {
  background: #ffffff;
  border-radius: 12px;
  width: 100%;
  max-width: 960px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  border: 1px solid #e2e8f0;
  overflow: hidden;
}

.report-modal-toolbar {
  background: #0f172a;
  color: #ffffff;
  padding: 12px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #334155;
}

.toolbar-title {
  font-size: 14px;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 8px;
}

.toolbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn-close-modal {
  background: transparent;
  border: none;
  color: #94a3b8;
  font-size: 18px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
  transition: all 0.2s ease;
}

.btn-close-modal:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.1);
}

/* PRINTABLE DOSSIER STYLES */
.printable-document {
  padding: 32px 40px;
  overflow-y: auto;
  font-family: var(--font-sans);
  color: #1e293b;
  line-height: 1.5;
  background: #ffffff;
}

.doc-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 16px;
}

.doc-brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.doc-logo {
  width: 44px;
  height: 44px;
  background: #2563eb;
  color: #ffffff;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
}

.doc-org-title {
  font-size: 18px;
  font-weight: 800;
  color: #0f172a;
  letter-spacing: -0.3px;
}

.doc-org-sub {
  font-size: 12px;
  color: #64748b;
  font-weight: 600;
}

.doc-meta-box {
  text-align: right;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.doc-badge-restricted {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.05em;
  background: #fef2f2;
  color: #b91c1c;
  border: 1px solid #fecaca;
  padding: 3px 8px;
  border-radius: 4px;
  display: inline-block;
  margin-bottom: 4px;
}

.doc-meta-item {
  font-size: 11px;
  color: #475569;
}

.doc-divider {
  border: none;
  height: 1px;
  background: #e2e8f0;
  margin: 16px 0 24px 0;
}

.doc-section {
  margin-bottom: 24px;
}

.doc-section-title {
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #0f172a;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding-bottom: 4px;
  border-bottom: 1px solid #f1f5f9;
}

.doc-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.doc-card {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 14px 16px;
}

.doc-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: #64748b;
  display: block;
  margin-bottom: 4px;
}

.doc-val-large {
  font-size: 15px;
  font-weight: 800;
  margin-bottom: 4px;
}

.doc-risk-score {
  font-size: 24px;
  font-weight: 800;
  font-family: var(--font-mono);
  color: #b91c1c;
}

.doc-p {
  font-size: 12px;
  color: #475569;
  line-height: 1.5;
}

.doc-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  overflow: hidden;
}

.doc-table th {
  background: #f1f5f9;
  padding: 8px 12px;
  text-align: left;
  font-weight: 700;
  color: #334155;
  border-bottom: 1px solid #cbd5e1;
}

.doc-table td {
  padding: 8px 12px;
  border-bottom: 1px solid #f1f5f9;
  color: #334155;
}

.doc-table tbody tr:nth-child(even) {
  background: #f8fafc;
}

.doc-evidence-box {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.evidence-item {
  background: #0f172a;
  color: #f8fafc;
  border-radius: 6px;
  padding: 10px 14px;
  font-family: var(--font-mono);
  font-size: 11px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

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

.ev-ts { color: #94a3b8; }
.ev-target { color: #38bdf8; font-weight: 700; }
.ev-code {
  color: #a7f3d0;
  background: rgba(0, 0, 0, 0.4);
  padding: 6px 10px;
  border-radius: 4px;
  word-break: break-all;
  margin-top: 2px;
}

.doc-directives-box {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: 8px;
  padding: 14px 18px;
}

.doc-checklist {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 12px;
  color: #166534;
  font-weight: 600;
}

.doc-footer {
  margin-top: 32px;
  padding-top: 16px;
  border-top: 1px solid #e2e8f0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.official-seal {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* PRINT MEDIA QUERY (PERFECT PDF OUTPUT) */
@media print {
  body * {
    visibility: hidden;
  }
  
  .report-modal-overlay,
  .report-modal-container,
  .printable-document,
  .printable-document * {
    visibility: visible !important;
  }

  .report-modal-overlay {
    position: absolute;
    inset: 0;
    background: transparent !important;
    padding: 0 !important;
    display: block !important;
  }

  .report-modal-container {
    max-width: 100% !important;
    max-height: 100% !important;
    box-shadow: none !important;
    border: none !important;
  }

  .report-modal-toolbar {
    display: none !important;
  }

  .printable-document {
    padding: 0 !important;
  }

  .doc-section {
    page-break-inside: avoid;
  }
}

/* RESPONSIVE */
@media (max-width: 1100px) {
  .metrics-grid { grid-template-columns: repeat(2, 1fr); }
  .middle-grid { grid-template-columns: 1fr; }
  .bottom-grid { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
  .metrics-grid { grid-template-columns: 1fr; }
  .ai-details-row { grid-template-columns: 1fr; }
  .system-switch-nav { display: none; }
  .doc-grid-2 { grid-template-columns: 1fr; }
}
