/**
 * AI Command Center — Traffic Intelligence Stylesheet
 * High-density glassmorphism design system matching AICC dark aesthetics.
 */

.page-traffic-intelligence {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  padding: 1.5rem;
  width: 100%;
  max-width: 1600px;
  margin: 0 auto;
}

/* Header & Title */
.traffic-header-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  padding: 1.25rem 1.5rem;
  background: rgba(18, 24, 38, 0.7);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
}

.traffic-title-row {
  display: flex;
  align-items: center;
  gap: 0.875rem;
}

.traffic-badge-icon {
  font-size: 2rem;
  background: rgba(99, 102, 241, 0.15);
  padding: 0.5rem;
  border-radius: 10px;
  border: 1px solid rgba(99, 102, 241, 0.3);
}

.traffic-main-title {
  font-size: 1.375rem;
  font-weight: 700;
  color: #f1f5f9;
  letter-spacing: -0.02em;
  margin: 0;
}

.traffic-subtitle {
  font-size: 0.8125rem;
  color: #94a3b8;
  margin-top: 0.25rem;
}

.traffic-header-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.traffic-site-select-box {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(10, 14, 23, 0.8);
  padding: 0.375rem 0.75rem;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.ts-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.ts-select {
  background: transparent;
  color: #f8fafc;
  border: none;
  font-size: 0.875rem;
  font-weight: 500;
  outline: none;
  cursor: pointer;
}

.ts-select-sm {
  background: rgba(15, 23, 42, 0.9);
  color: #e2e8f0;
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 0.375rem 0.75rem;
  border-radius: 6px;
  font-size: 0.8125rem;
}

/* Telemetry Strip */
.traffic-telemetry-strip {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1.25rem;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  font-size: 0.8125rem;
}

.tts-left {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  color: #94a3b8;
}

.tts-status-dot {
  color: #10b981;
  font-size: 0.875rem;
}

.tts-status-dot.pulse {
  animation: pulse 1.5s infinite;
}

.tts-status-dot.dot-error {
  color: #f43f5e;
}

.tts-right {
  display: flex;
  gap: 1.25rem;
}

.tts-stat-chip {
  display: flex;
  align-items: center;
  gap: 0.375rem;
}

.chip-label {
  color: #64748b;
  font-size: 0.75rem;
}

.chip-value {
  font-weight: 600;
  color: #f8fafc;
}

/* Tab Bar */
.traffic-tab-bar {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  padding-bottom: 0.25rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.traffic-tab-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.625rem 1rem;
  background: transparent;
  color: #94a3b8;
  border: none;
  border-bottom: 2px solid transparent;
  font-size: 0.8125rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.traffic-tab-btn:hover {
  color: #f1f5f9;
  background: rgba(255, 255, 255, 0.03);
}

.traffic-tab-btn.active {
  color: #6366f1;
  border-bottom-color: #6366f1;
  font-weight: 600;
}

.tab-badge {
  font-size: 0.6875rem;
  background: rgba(255, 255, 255, 0.1);
  color: #cbd5e1;
  padding: 0.125rem 0.375rem;
  border-radius: 999px;
}

.tab-badge.badge-pending {
  background: rgba(245, 158, 11, 0.2);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.4);
}

/* KPI Grid */
.traffic-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}

.traffic-kpi-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.125rem;
  background: rgba(18, 24, 38, 0.7);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.traffic-kpi-card:hover {
  transform: translateY(-2px);
  border-color: rgba(99, 102, 241, 0.3);
}

.traffic-kpi-card.kpi-warn {
  border-color: rgba(244, 63, 94, 0.3);
}

.kpi-icon {
  font-size: 1.75rem;
  background: rgba(255, 255, 255, 0.04);
  padding: 0.625rem;
  border-radius: 8px;
}

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

.kpi-label {
  font-size: 0.6875rem;
  font-weight: 600;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.kpi-value {
  font-size: 1.375rem;
  font-weight: 700;
  color: #f8fafc;
  margin: 0.125rem 0;
}

.kpi-sub {
  font-size: 0.75rem;
  color: #94a3b8;
}

.score-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Section Cards */
.traffic-section-card {
  background: rgba(18, 24, 38, 0.7);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

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

.card-title-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.card-icon {
  font-size: 1.125rem;
}

.card-title {
  font-size: 1rem;
  font-weight: 600;
  color: #f1f5f9;
  margin: 0;
}

.card-hint {
  font-size: 0.75rem;
  color: #64748b;
}

/* Quality Meter Bar */
.quality-meter-bar {
  display: flex;
  height: 12px;
  width: 100%;
  border-radius: 6px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.05);
}

.meter-segment {
  height: 100%;
  transition: width 0.3s ease;
}

.seg-good { background: #10b981; }
.seg-watch { background: #f59e0b; }
.seg-suspicious { background: #8b5cf6; }
.seg-high-risk { background: #f43f5e; }

.quality-legend-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin-top: 0.5rem;
}

.legend-box {
  background: rgba(10, 14, 23, 0.6);
  padding: 0.875rem;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.04);
}

.legend-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.375rem;
}

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

.dot-good { background: #10b981; }
.dot-watch { background: #f59e0b; }
.dot-suspicious { background: #8b5cf6; }
.dot-high-risk { background: #f43f5e; }

.legend-title {
  font-size: 0.75rem;
  font-weight: 600;
  color: #94a3b8;
}

.legend-val {
  font-size: 1.125rem;
  font-weight: 700;
  color: #f8fafc;
}

.legend-pct {
  font-size: 0.8125rem;
  font-weight: 400;
  color: #64748b;
}

.legend-desc {
  font-size: 0.6875rem;
  color: #64748b;
  margin-top: 0.25rem;
  line-height: 1.3;
}

/* Tables */
.table-responsive {
  overflow-x: auto;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.traffic-data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8125rem;
  color: #cbd5e1;
}

.traffic-data-table th {
  background: rgba(15, 23, 42, 0.8);
  padding: 0.75rem 0.875rem;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #94a3b8;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.traffic-data-table td {
  padding: 0.75rem 0.875rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  vertical-align: middle;
}

.traffic-data-table tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

.td-campaign {
  max-width: 300px;
}

.campaign-cell {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.campaign-name {
  font-weight: 600;
  color: #f1f5f9;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.campaign-meta {
  display: flex;
  align-items: center;
  gap: 0.375rem;
}

.campaign-id {
  font-size: 0.6875rem;
  color: #64748b;
}

/* Status Pills */
.status-pill {
  display: inline-block;
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.badge-good {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge-watch {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.badge-suspicious {
  background: rgba(139, 92, 246, 0.15);
  color: #c084fc;
  border: 1px solid rgba(139, 92, 246, 0.3);
}

.badge-high-risk {
  background: rgba(244, 63, 94, 0.15);
  color: #fb7185;
  border: 1px solid rgba(244, 63, 94, 0.3);
}

.attr-pill {
  padding: 0.1rem 0.375rem;
  border-radius: 4px;
  font-size: 0.625rem;
  font-weight: 600;
  text-transform: uppercase;
}

.badge-attr-direct {
  background: rgba(16, 185, 129, 0.2);
  color: #34d399;
}

.badge-attr-prob {
  background: rgba(59, 130, 246, 0.2);
  color: #60a5fa;
}

.badge-attr-unknown {
  background: rgba(100, 116, 139, 0.2);
  color: #94a3b8;
}

/* Buttons */
.btn-action-xs {
  background: rgba(99, 102, 241, 0.15);
  color: #818cf8;
  border: 1px solid rgba(99, 102, 241, 0.3);
  padding: 0.25rem 0.5rem;
  border-radius: 6px;
  font-size: 0.6875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-action-xs:hover {
  background: rgba(99, 102, 241, 0.25);
  color: #c7d2fe;
}

.btn-ghost {
  background: transparent;
  color: #94a3b8;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.05);
  color: #f1f5f9;
}

/* Drilldown Hierarchy */
.drilldown-tree-container {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.drilldown-meta-bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  background: rgba(99, 102, 241, 0.1);
  border: 1px solid rgba(99, 102, 241, 0.2);
  border-radius: 8px;
  font-size: 0.875rem;
}

.dm-label { color: #818cf8; font-weight: 600; }
.dm-value { color: #f8fafc; font-weight: 700; }

.drilldown-adset-card {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.drilldown-adset-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: #f1f5f9;
}

.adset-id, .ad-id {
  font-size: 0.75rem;
  color: #64748b;
  font-weight: 400;
}

.drilldown-ad-box {
  background: rgba(10, 14, 23, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: 6px;
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-left: 1rem;
}

.drilldown-ad-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8125rem;
  font-weight: 500;
  color: #cbd5e1;
}

.drilldown-placement-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.375rem 0.625rem;
  background: rgba(255, 255, 255, 0.02);
  border-radius: 4px;
  font-size: 0.75rem;
}

.dp-left {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  color: #94a3b8;
}

.dp-metrics {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.dp-stat {
  color: #cbd5e1;
}

/* Anomalies */
.anomalies-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1rem;
}

.anomaly-card {
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.anomaly-card.anomaly-high {
  border-color: rgba(244, 63, 94, 0.3);
  background: rgba(244, 63, 94, 0.03);
}

.anomaly-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.5rem;
}

.anomaly-title-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.anomaly-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: #f1f5f9;
}

.anomaly-badges {
  display: flex;
  align-items: center;
  gap: 0.375rem;
}

.entity-tag {
  font-size: 0.6875rem;
  color: #94a3b8;
  background: rgba(255, 255, 255, 0.05);
  padding: 0.125rem 0.375rem;
  border-radius: 4px;
}

.anomaly-desc {
  font-size: 0.8125rem;
  color: #cbd5e1;
  line-height: 1.4;
  margin: 0;
}

.anomaly-metrics-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.anomaly-metric-chip {
  background: rgba(0, 0, 0, 0.3);
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  font-size: 0.6875rem;
}

.am-key { color: #64748b; }
.am-val { color: #f8fafc; font-weight: 600; margin-left: 0.25rem; }

.anomaly-footer {
  display: flex;
  justify-content: space-between;
  font-size: 0.6875rem;
  color: #64748b;
  border-top: 1px solid rgba(255, 255, 255, 0.04);
  padding-top: 0.5rem;
}

/* Recommendations */
.recommendations-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.recommendation-card {
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.875rem;
}

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

.rec-title-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.rec-title {
  font-size: 0.9375rem;
  font-weight: 600;
  color: #f8fafc;
}

.rec-status-group {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.rec-confidence {
  font-size: 0.75rem;
  color: #818cf8;
  font-weight: 600;
}

.rec-body {
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
}

.rec-label {
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  color: #64748b;
}

.rec-text {
  font-size: 0.8125rem;
  color: #cbd5e1;
  margin: 0.25rem 0 0;
  line-height: 1.4;
}

.action-section {
  background: rgba(99, 102, 241, 0.05);
  border-left: 3px solid #6366f1;
  padding: 0.5rem 0.75rem;
  border-radius: 0 6px 6px 0;
}

.rec-action-text {
  font-size: 0.8125rem;
  font-weight: 500;
  color: #e2e8f0;
  margin: 0.25rem 0 0;
}

.rec-targets {
  display: flex;
  gap: 0.5rem;
}

.target-tag {
  font-size: 0.6875rem;
  background: rgba(255, 255, 255, 0.06);
  padding: 0.125rem 0.5rem;
  border-radius: 4px;
  color: #94a3b8;
}

.rec-audit-box {
  background: rgba(0, 0, 0, 0.3);
  padding: 0.5rem 0.75rem;
  border-radius: 6px;
  font-size: 0.75rem;
  color: #94a3b8;
}

.rec-actions-toolbar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  padding-top: 0.875rem;
}

/* Modals & Report */
.traffic-modal {
  max-width: 800px;
}

.report-markdown-preview {
  background: rgba(10, 14, 23, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 1.25rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.8125rem;
  color: #e2e8f0;
  white-space: pre-wrap;
  max-height: 500px;
  overflow-y: auto;
  line-height: 1.5;
}

.recon-info-footer {
  font-size: 0.75rem;
  color: #64748b;
  padding: 0.75rem;
  background: rgba(255, 255, 255, 0.02);
  border-radius: 6px;
  margin-top: 0.5rem;
}

/* Loading & Empty States */
.traffic-loading-state, .traffic-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem 1.5rem;
  color: #64748b;
  gap: 0.75rem;
  text-align: center;
}

.empty-icon {
  font-size: 2.5rem;
}

.text-success { color: #10b981 !important; }
.text-danger { color: #f43f5e !important; }
.text-warning { color: #f59e0b !important; }
.text-accent { color: #818cf8 !important; }
.font-medium { font-weight: 500; }
.text-right { text-align: right; }
.text-center { text-align: center; }
.text-capitalize { text-transform: capitalize; }

/* Interactive Table Rows */
.clickable-row {
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.clickable-row:hover {
  background-color: rgba(99, 102, 241, 0.08) !important;
}

/* Clusters Grid & Cards (Phase 9) */
.clusters-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 1.25rem;
  margin-top: 1rem;
}

.cluster-card-box {
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.875rem;
  transition: border-color 0.2s ease, transform 0.15s ease;
}

.cluster-card-box:hover {
  border-color: rgba(99, 102, 241, 0.4);
  transform: translateY(-2px);
}

.cluster-card-box.border-warning {
  border-left: 3px solid #f59e0b;
}

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

.cluster-code-pill {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.2rem 0.5rem;
  background: rgba(99, 102, 241, 0.15);
  color: #818cf8;
  border-radius: 4px;
}

.cluster-card-title {
  font-size: 0.9375rem;
  font-weight: 600;
  color: #f8fafc;
  margin: 0;
  line-height: 1.35;
}

.cluster-meta-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  background: rgba(0, 0, 0, 0.35);
  border-radius: 6px;
  padding: 0.5rem;
  text-align: center;
  gap: 0.25rem;
}

.cluster-stat {
  display: flex;
  flex-direction: column;
}

.cluster-stat .stat-num {
  font-size: 0.9375rem;
  font-weight: 700;
  color: #f1f5f9;
}

.cluster-stat .stat-label {
  font-size: 0.625rem;
  text-transform: uppercase;
  color: #64748b;
  margin-top: 2px;
}

.cluster-signals-box {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: 6px;
  padding: 0.625rem 0.75rem;
}

.signals-header {
  display: block;
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  color: #94a3b8;
  margin-bottom: 0.375rem;
}

.signals-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.75rem;
  color: #cbd5e1;
}

.cluster-card-footer {
  margin-top: auto;
  padding-top: 0.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

/* Reports Container & Table (Phase 14) */
.reports-container {
  margin-top: 1rem;
}

.report-title-cell {
  display: flex;
  flex-direction: column;
}

.report-title-cell strong {
  color: #f1f5f9;
  font-size: 0.875rem;
}

.report-title-cell .cell-sub {
  font-size: 0.6875rem;
  color: #64748b;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

.btn-group-sm {
  display: flex;
  gap: 0.375rem;
  justify-content: flex-end;
}

/* Session Detail Modal (Phase 12 & 13) */
.session-detail-layout {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.session-summary-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 1rem 1.25rem;
  align-items: center;
}

.summary-metric {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.sm-label {
  font-size: 0.625rem;
  text-transform: uppercase;
  font-weight: 600;
  color: #64748b;
}

.session-detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

@media (max-width: 768px) {
  .session-detail-grid {
    grid-template-columns: 1fr;
  }
}

.detail-card {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  padding: 1rem;
}

.detail-card-title {
  font-size: 0.8125rem;
  font-weight: 600;
  color: #818cf8;
  margin: 0 0 0.75rem 0;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.attr-table {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.attr-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.75rem;
  padding-bottom: 0.25rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.attr-row .ak {
  color: #94a3b8;
  font-weight: 500;
}

.attr-row .av {
  color: #f1f5f9;
  text-align: right;
  max-width: 60%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.evidence-factors-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.evidence-factor-row {
  background: rgba(0, 0, 0, 0.25);
  border-radius: 6px;
  padding: 0.5rem 0.75rem;
  border-left: 2px solid #ef4444;
}

.factor-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.factor-penalty {
  font-size: 0.75rem;
  font-weight: 700;
}

.factor-name {
  font-size: 0.8125rem;
  color: #f1f5f9;
}

.factor-desc {
  margin: 0.25rem 0 0 0;
  color: #94a3b8;
}

/* Support Case Modal (Phase 17) */
.support-case-box {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.case-field-group {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

.case-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: #94a3b8;
  text-transform: uppercase;
}

.case-input-row {
  display: flex;
  gap: 0.5rem;
}

.form-textarea {
  width: 100%;
  background: rgba(10, 14, 23, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  color: #e2e8f0;
  padding: 0.75rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.8125rem;
  line-height: 1.5;
  resize: vertical;
}

.case-attachments-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.case-attachments-list li {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  padding: 0.375rem 0.75rem;
  font-size: 0.75rem;
  color: #cbd5e1;
}

/* Attribution Confidence Badges */
.badge-attr-exact {
  background: rgba(16, 185, 129, 0.2);
  color: #34d399;
  font-size: 0.6875rem;
  font-weight: 600;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
}

.badge-attr-high {
  background: rgba(59, 130, 246, 0.2);
  color: #60a5fa;
  font-size: 0.6875rem;
  font-weight: 600;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
}

.badge-attr-medium {
  background: rgba(245, 158, 11, 0.2);
  color: #fbbf24;
  font-size: 0.6875rem;
  font-weight: 600;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
}

.badge-attr-low, .badge-attr-unknown {
  background: rgba(100, 116, 139, 0.2);
  color: #94a3b8;
  font-size: 0.6875rem;
  font-weight: 600;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
}

/* Session Explorer Pagination Styles */
.sessions-total-badge {
  font-size: 0.75rem;
  font-weight: 600;
  color: #818cf8;
  background: rgba(99, 102, 241, 0.12);
  border: 1px solid rgba(99, 102, 241, 0.25);
  padding: 0.25rem 0.625rem;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
}

.traffic-pagination-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 0 0.25rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  margin-top: 1rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.pagination-info {
  font-size: 0.8125rem;
  color: #94a3b8;
}

.pagination-controls {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  flex-wrap: wrap;
}

.btn-page-nav {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #cbd5e1;
  padding: 0.35rem 0.65rem;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-page-nav:hover:not(:disabled) {
  background: rgba(99, 102, 241, 0.2);
  border-color: rgba(99, 102, 241, 0.4);
  color: #f1f5f9;
}

.btn-page-nav:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.page-pills-group {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.page-pill {
  min-width: 2rem;
  height: 2rem;
  padding: 0 0.5rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  color: #94a3b8;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.page-pill:hover:not(:disabled) {
  background: rgba(99, 102, 241, 0.15);
  color: #f1f5f9;
  border-color: rgba(99, 102, 241, 0.3);
}

.page-pill.active {
  background: #6366f1;
  color: #ffffff;
  border-color: #6366f1;
  font-weight: 700;
  cursor: default;
  box-shadow: 0 0 10px rgba(99, 102, 241, 0.4);
}

.page-pill-dots {
  color: #64748b;
  padding: 0 0.25rem;
  font-weight: 700;
  font-size: 0.8125rem;
}

/* ==========================================================================
   TRAFFIC INTELLIGENCE — HIGH CONTRAST LIGHT THEME ADAPTATION
   ========================================================================== */
:root:not([data-theme="dark"]) .traffic-header-container,
[data-theme="light"] .traffic-header-container,
:root:not([data-theme="dark"]) .traffic-telemetry-strip,
[data-theme="light"] .traffic-telemetry-strip,
:root:not([data-theme="dark"]) .traffic-kpi-card,
[data-theme="light"] .traffic-kpi-card,
:root:not([data-theme="dark"]) .traffic-section-card,
[data-theme="light"] .traffic-section-card,
:root:not([data-theme="dark"]) .cluster-card,
[data-theme="light"] .cluster-card,
:root:not([data-theme="dark"]) .cluster-card-box,
[data-theme="light"] .cluster-card-box,
:root:not([data-theme="dark"]) .evidence-card,
[data-theme="light"] .evidence-card,
:root:not([data-theme="dark"]) .traffic-summary-banner,
[data-theme="light"] .traffic-summary-banner,
:root:not([data-theme="dark"]) .anomaly-card,
[data-theme="light"] .anomaly-card,
:root:not([data-theme="dark"]) .recommendation-card,
[data-theme="light"] .recommendation-card,
:root:not([data-theme="dark"]) .drilldown-adset-card,
[data-theme="light"] .drilldown-adset-card,
:root:not([data-theme="dark"]) .drilldown-ad-box,
[data-theme="light"] .drilldown-ad-box,
:root:not([data-theme="dark"]) .legend-box,
[data-theme="light"] .legend-box,
:root:not([data-theme="dark"]) .session-summary-bar,
[data-theme="light"] .session-summary-bar,
:root:not([data-theme="dark"]) .detail-card,
[data-theme="light"] .detail-card,
:root:not([data-theme="dark"]) .support-case-box,
[data-theme="light"] .support-case-box,
:root:not([data-theme="dark"]) .traffic-modal,
[data-theme="light"] .traffic-modal {
  background: var(--bg-card) !important;
  border-color: var(--border-color) !important;
  box-shadow: var(--shadow-sm);
  color: var(--text-main) !important;
}

:root:not([data-theme="dark"]) .traffic-main-title,
[data-theme="light"] .traffic-main-title,
:root:not([data-theme="dark"]) .kpi-value,
[data-theme="light"] .kpi-value,
:root:not([data-theme="dark"]) .campaign-name,
[data-theme="light"] .campaign-name,
:root:not([data-theme="dark"]) .card-title,
[data-theme="light"] .card-title,
:root:not([data-theme="dark"]) .cluster-title,
[data-theme="light"] .cluster-title,
:root:not([data-theme="dark"]) .cluster-card-title,
[data-theme="light"] .cluster-card-title,
:root:not([data-theme="dark"]) .rec-title,
[data-theme="light"] .rec-title,
:root:not([data-theme="dark"]) .score-value,
[data-theme="light"] .score-value,
:root:not([data-theme="dark"]) .legend-title,
[data-theme="light"] .legend-title,
:root:not([data-theme="dark"]) .legend-val,
[data-theme="light"] .legend-val,
:root:not([data-theme="dark"]) .report-title-cell strong,
[data-theme="light"] .report-title-cell strong,
:root:not([data-theme="dark"]) .drilldown-adset-header,
[data-theme="light"] .drilldown-adset-header {
  color: var(--text-main) !important;
  font-weight: 700 !important;
}

/* Sub-labels, hints, and descriptions */
:root:not([data-theme="dark"]) .traffic-subtitle,
[data-theme="light"] .traffic-subtitle,
:root:not([data-theme="dark"]) .tts-text,
[data-theme="light"] .tts-text,
:root:not([data-theme="dark"]) .kpi-sub,
[data-theme="light"] .kpi-sub,
:root:not([data-theme="dark"]) .card-hint,
[data-theme="light"] .card-hint,
:root:not([data-theme="dark"]) .legend-desc,
[data-theme="light"] .legend-desc,
:root:not([data-theme="dark"]) .rec-desc,
[data-theme="light"] .rec-desc,
:root:not([data-theme="dark"]) .factor-desc,
[data-theme="light"] .factor-desc {
  color: var(--text-muted) !important;
}

:root:not([data-theme="dark"]) .kpi-label,
[data-theme="light"] .kpi-label,
:root:not([data-theme="dark"]) .chip-label,
[data-theme="light"] .chip-label,
:root:not([data-theme="dark"]) .ts-label,
[data-theme="light"] .ts-label,
:root:not([data-theme="dark"]) .legend-pct,
[data-theme="light"] .legend-pct,
:root:not([data-theme="dark"]) .signals-header,
[data-theme="light"] .signals-header,
:root:not([data-theme="dark"]) .sm-label,
[data-theme="light"] .sm-label,
:root:not([data-theme="dark"]) .case-label,
[data-theme="light"] .case-label {
  color: var(--text-dim) !important;
  font-weight: 600 !important;
}

:root:not([data-theme="dark"]) .chip-value,
[data-theme="light"] .chip-value {
  color: var(--text-main) !important;
  font-weight: 700 !important;
}

:root:not([data-theme="dark"]) .kpi-icon,
[data-theme="light"] .kpi-icon {
  background: var(--bg-subtle) !important;
  border: 1px solid var(--border-color) !important;
}

/* Site and Filter Selectors */
:root:not([data-theme="dark"]) .traffic-site-select-box,
[data-theme="light"] .traffic-site-select-box,
:root:not([data-theme="dark"]) .ts-select-sm,
[data-theme="light"] .ts-select-sm,
:root:not([data-theme="dark"]) .traffic-filter-input,
[data-theme="light"] .traffic-filter-input,
:root:not([data-theme="dark"]) .traffic-filter-select,
[data-theme="light"] .traffic-filter-select {
  background: var(--bg-card) !important;
  border-color: var(--border-color) !important;
  color: var(--text-main) !important;
}

:root:not([data-theme="dark"]) .ts-select,
[data-theme="light"] .ts-select {
  color: var(--text-main) !important;
}

/* Tab Navigation */
:root:not([data-theme="dark"]) .traffic-tab-bar,
[data-theme="light"] .traffic-tab-bar {
  border-bottom: 2px solid var(--border-color) !important;
}

:root:not([data-theme="dark"]) .traffic-tab-btn,
[data-theme="light"] .traffic-tab-btn {
  color: var(--text-muted) !important;
  font-weight: 600 !important;
}

:root:not([data-theme="dark"]) .traffic-tab-btn:hover,
[data-theme="light"] .traffic-tab-btn:hover {
  color: var(--text-main) !important;
  background: var(--bg-card-hover) !important;
}

:root:not([data-theme="dark"]) .traffic-tab-btn.active,
[data-theme="light"] .traffic-tab-btn.active {
  color: var(--accent-primary) !important;
  border-bottom: 3px solid var(--accent-primary) !important;
  font-weight: 700 !important;
}

:root:not([data-theme="dark"]) .tab-badge,
[data-theme="light"] .tab-badge {
  background: #e2e8f0 !important;
  color: #0f172a !important;
  font-weight: 700 !important;
}

:root:not([data-theme="dark"]) .tab-badge.badge-pending,
[data-theme="light"] .tab-badge.badge-pending {
  background: #fef3c7 !important;
  color: #78350f !important;
  border: 1px solid #fde68a !important;
  font-weight: 700 !important;
}

/* Tables in Light Theme */
:root:not([data-theme="dark"]) .table-responsive,
[data-theme="light"] .table-responsive {
  border-color: var(--border-color) !important;
  background: var(--bg-card);
}

:root:not([data-theme="dark"]) .traffic-data-table th,
[data-theme="light"] .traffic-data-table th {
  background: var(--bg-subtle) !important;
  color: var(--text-main) !important;
  font-weight: 700 !important;
  border-bottom: 1px solid var(--border-color) !important;
}

:root:not([data-theme="dark"]) .traffic-data-table td,
[data-theme="light"] .traffic-data-table td {
  color: var(--text-main) !important;
  border-bottom: 1px solid var(--border-color) !important;
}

:root:not([data-theme="dark"]) .traffic-data-table tr:hover td,
[data-theme="light"] .traffic-data-table tr:hover td {
  background: var(--bg-card-hover) !important;
}

/* Code & Raw Previews */
:root:not([data-theme="dark"]) .td-code,
[data-theme="light"] .td-code,
:root:not([data-theme="dark"]) .raw-signals-box,
[data-theme="light"] .raw-signals-box,
:root:not([data-theme="dark"]) .cluster-signature-box,
[data-theme="light"] .cluster-signature-box,
:root:not([data-theme="dark"]) .cluster-signals-box,
[data-theme="light"] .cluster-signals-box,
:root:not([data-theme="dark"]) .report-markdown-preview,
[data-theme="light"] .report-markdown-preview {
  background: var(--bg-subtle) !important;
  color: var(--text-secondary) !important;
  border: 1px solid var(--border-color) !important;
}

:root:not([data-theme="dark"]) .signals-list,
[data-theme="light"] .signals-list {
  color: var(--text-secondary) !important;
}

:root:not([data-theme="dark"]) .cluster-meta-row,
[data-theme="light"] .cluster-meta-row {
  background: var(--bg-subtle) !important;
  border: 1px solid var(--border-color) !important;
}

:root:not([data-theme="dark"]) .cluster-stat .stat-num,
[data-theme="light"] .cluster-stat .stat-num {
  color: var(--text-main) !important;
}

:root:not([data-theme="dark"]) .cluster-code-pill,
[data-theme="light"] .cluster-code-pill {
  background: #eef2ff !important;
  color: #4338ca !important;
  border: 1px solid #c7d2fe !important;
}

/* Drilldown Hierarchy Light Mode */
:root:not([data-theme="dark"]) .drilldown-meta-bar,
[data-theme="light"] .drilldown-meta-bar {
  background: #eef2ff !important;
  border: 1px solid #c7d2fe !important;
}

:root:not([data-theme="dark"]) .dm-label,
[data-theme="light"] .dm-label {
  color: #4338ca !important;
}

:root:not([data-theme="dark"]) .dm-value,
[data-theme="light"] .dm-value {
  color: #1e1b4b !important;
}

:root:not([data-theme="dark"]) .drilldown-ad-header,
[data-theme="light"] .drilldown-ad-header {
  color: var(--text-main) !important;
  font-weight: 600 !important;
}

:root:not([data-theme="dark"]) .drilldown-placement-row,
[data-theme="light"] .drilldown-placement-row {
  background: var(--bg-card) !important;
  border: 1px solid #e2e8f0 !important;
}

:root:not([data-theme="dark"]) .dp-left,
[data-theme="light"] .dp-left {
  color: var(--text-secondary) !important;
}

:root:not([data-theme="dark"]) .dp-stat,
[data-theme="light"] .dp-stat {
  color: var(--text-main) !important;
  font-weight: 600 !important;
}

/* High-Contrast Status Pills */
:root:not([data-theme="dark"]) .badge-good,
[data-theme="light"] .badge-good {
  background: #dcfce7 !important;
  color: #14532d !important;
  border: 1px solid #86efac !important;
  font-weight: 700 !important;
}

:root:not([data-theme="dark"]) .badge-watch,
[data-theme="light"] .badge-watch {
  background: #fef3c7 !important;
  color: #78350f !important;
  border: 1px solid #fde68a !important;
  font-weight: 700 !important;
}

:root:not([data-theme="dark"]) .badge-suspicious,
[data-theme="light"] .badge-suspicious {
  background: #f3e8ff !important;
  color: #581c87 !important;
  border: 1px solid #d8b4fe !important;
  font-weight: 700 !important;
}

:root:not([data-theme="dark"]) .badge-high-risk,
[data-theme="light"] .badge-high-risk {
  background: #ffe4e6 !important;
  color: #881337 !important;
  border: 1px solid #fecdd3 !important;
  font-weight: 700 !important;
}

/* Attribution Confidence Badges */
:root:not([data-theme="dark"]) .badge-attr-exact,
[data-theme="light"] .badge-attr-exact,
:root:not([data-theme="dark"]) .badge-attr-direct,
[data-theme="light"] .badge-attr-direct {
  background: #dcfce7 !important;
  color: #14532d !important;
  border: 1px solid #86efac !important;
}

:root:not([data-theme="dark"]) .badge-attr-high,
[data-theme="light"] .badge-attr-high,
:root:not([data-theme="dark"]) .badge-attr-prob,
[data-theme="light"] .badge-attr-prob {
  background: #dbeafe !important;
  color: #1e40af !important;
  border: 1px solid #93c5fd !important;
}

:root:not([data-theme="dark"]) .badge-attr-medium,
[data-theme="light"] .badge-attr-medium {
  background: #fef3c7 !important;
  color: #78350f !important;
  border: 1px solid #fde68a !important;
}

:root:not([data-theme="dark"]) .badge-attr-low,
[data-theme="light"] .badge-attr-low,
:root:not([data-theme="dark"]) .badge-attr-unknown,
[data-theme="light"] .badge-attr-unknown {
  background: #f1f5f9 !important;
  color: #334155 !important;
  border: 1px solid #cbd5e1 !important;
}

/* Session Explorer Metadata Tags */
.source-tag, .camp-tag, .device-tag {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

:root:not([data-theme="dark"]) .source-tag,
[data-theme="light"] .source-tag {
  background: #f1f5f9;
  color: #0f172a;
  border: 1px solid #cbd5e1;
}

:root:not([data-theme="dark"]) .camp-tag,
[data-theme="light"] .camp-tag {
  background: #eef2ff;
  color: #312e81;
  border: 1px solid #c7d2fe;
}

:root:not([data-theme="dark"]) .device-tag,
[data-theme="light"] .device-tag {
  background: #f8fafc;
  color: #334155;
  border: 1px solid #cbd5e1;
}

[data-theme="dark"] .source-tag {
  background: rgba(255, 255, 255, 0.06);
  color: #e2e8f0;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .camp-tag {
  background: rgba(99, 102, 241, 0.15);
  color: #c7d2fe;
  border: 1px solid rgba(99, 102, 241, 0.3);
}

[data-theme="dark"] .device-tag {
  background: rgba(255, 255, 255, 0.04);
  color: #cbd5e1;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

/* Pagination Bar & Navigation Pills */
:root:not([data-theme="dark"]) .traffic-pagination-toolbar,
[data-theme="light"] .traffic-pagination-toolbar {
  background: var(--bg-card) !important;
  border: 1px solid var(--border-color) !important;
  color: var(--text-main) !important;
  box-shadow: var(--shadow-sm);
}

:root:not([data-theme="dark"]) .pagination-info,
[data-theme="light"] .pagination-info {
  color: var(--text-secondary) !important;
}

:root:not([data-theme="dark"]) .btn-page-nav,
[data-theme="light"] .btn-page-nav {
  background: var(--bg-card) !important;
  border: 1px solid var(--border-color) !important;
  color: var(--text-main) !important;
  font-weight: 600 !important;
}

:root:not([data-theme="dark"]) .btn-page-nav:hover:not(:disabled),
[data-theme="light"] .btn-page-nav:hover:not(:disabled) {
  background: var(--bg-card-hover) !important;
  border-color: #94a3b8 !important;
  color: var(--text-main) !important;
}

:root:not([data-theme="dark"]) .btn-page-nav:disabled,
[data-theme="light"] .btn-page-nav:disabled {
  opacity: 0.45;
  background: var(--bg-subtle) !important;
  color: var(--text-dim) !important;
}

:root:not([data-theme="dark"]) .page-pill,
[data-theme="light"] .page-pill {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  font-weight: 600;
}

:root:not([data-theme="dark"]) .page-pill:hover:not(:disabled),
[data-theme="light"] .page-pill:hover:not(:disabled) {
  background: var(--bg-card-hover);
  color: var(--accent-primary);
  border-color: var(--accent-primary);
}

:root:not([data-theme="dark"]) .page-pill.active,
[data-theme="light"] .page-pill.active {
  background: var(--accent-primary);
  color: #ffffff;
  border-color: var(--accent-primary);
  font-weight: 700;
}

/* Action Buttons */
:root:not([data-theme="dark"]) .btn-action-xs,
[data-theme="light"] .btn-action-xs {
  background: #eef2ff !important;
  color: #4338ca !important;
  border: 1px solid #c7d2fe !important;
  font-weight: 700 !important;
}

:root:not([data-theme="dark"]) .btn-action-xs:hover,
[data-theme="light"] .btn-action-xs:hover {
  background: #e0e7ff !important;
  color: #3730a3 !important;
  border-color: #a5b4fc !important;
}

:root:not([data-theme="dark"]) .btn-ghost,
[data-theme="light"] .btn-ghost {
  color: var(--text-secondary) !important;
  border-color: var(--border-color) !important;
}

:root:not([data-theme="dark"]) .btn-ghost:hover,
[data-theme="light"] .btn-ghost:hover {
  background: var(--bg-card-hover) !important;
  color: var(--text-main) !important;
}

/* Session Detail Modal Elements */
:root:not([data-theme="dark"]) .detail-card-title,
[data-theme="light"] .detail-card-title {
  color: #4338ca !important;
  font-weight: 700 !important;
}

:root:not([data-theme="dark"]) .attr-row,
[data-theme="light"] .attr-row {
  border-bottom: 1px solid #e2e8f0 !important;
}

:root:not([data-theme="dark"]) .attr-row .ak,
[data-theme="light"] .attr-row .ak {
  color: var(--text-dim) !important;
  font-weight: 600 !important;
}

:root:not([data-theme="dark"]) .attr-row .av,
[data-theme="light"] .attr-row .av {
  color: var(--text-main) !important;
  font-weight: 600 !important;
}

:root:not([data-theme="dark"]) .evidence-factor-row,
[data-theme="light"] .evidence-factor-row {
  background: var(--bg-subtle) !important;
  border: 1px solid var(--border-color) !important;
  border-left: 3px solid #be123c !important;
}

:root:not([data-theme="dark"]) .factor-name,
[data-theme="light"] .factor-name {
  color: var(--text-main) !important;
  font-weight: 700 !important;
}

:root:not([data-theme="dark"]) .case-attachments-list li,
[data-theme="light"] .case-attachments-list li {
  background: var(--bg-subtle) !important;
  border: 1px solid var(--border-color) !important;
  color: var(--text-main) !important;
  font-weight: 600 !important;
}

/* Anomaly Cards Light Theme High-Contrast Overrides */
:root:not([data-theme="dark"]) .anomaly-card,
[data-theme="light"] .anomaly-card {
  background: var(--bg-card) !important;
  border: 1px solid var(--border-color) !important;
  box-shadow: var(--shadow-sm);
}

:root:not([data-theme="dark"]) .anomaly-card.anomaly-high,
[data-theme="light"] .anomaly-card.anomaly-high {
  background: #fff1f2 !important;
  border: 1px solid #fecdd3 !important;
  border-left: 4px solid #e11d48 !important;
  box-shadow: 0 2px 10px rgba(225, 29, 72, 0.08);
}

:root:not([data-theme="dark"]) .anomaly-title,
[data-theme="light"] .anomaly-title {
  color: #0f172a !important;
  font-weight: 800 !important;
  font-size: 0.95rem !important;
}

:root:not([data-theme="dark"]) .anomaly-desc,
[data-theme="light"] .anomaly-desc {
  color: #1e293b !important;
  font-weight: 500 !important;
  line-height: 1.5 !important;
}

:root:not([data-theme="dark"]) .entity-tag,
[data-theme="light"] .entity-tag {
  background: #f1f5f9 !important;
  color: #0f172a !important;
  border: 1px solid #cbd5e1 !important;
  font-weight: 700 !important;
  padding: 0.2rem 0.5rem !important;
}

:root:not([data-theme="dark"]) .anomaly-metric-chip,
[data-theme="light"] .anomaly-metric-chip {
  background: #ffffff !important;
  border: 1px solid #cbd5e1 !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

:root:not([data-theme="dark"]) .am-key,
[data-theme="light"] .am-key {
  color: #475569 !important;
  font-weight: 600 !important;
}

:root:not([data-theme="dark"]) .am-val,
[data-theme="light"] .am-val {
  color: #0f172a !important;
  font-weight: 800 !important;
}

:root:not([data-theme="dark"]) .anomaly-footer,
[data-theme="light"] .anomaly-footer {
  color: #475569 !important;
  border-top: 1px solid #e2e8f0 !important;
}

:root:not([data-theme="dark"]) .anomaly-time,
[data-theme="light"] .anomaly-time {
  color: #475569 !important;
  font-weight: 500 !important;
}

:root:not([data-theme="dark"]) .anomaly-status,
[data-theme="light"] .anomaly-status {
  color: #475569 !important;
  font-weight: 600 !important;
}

:root:not([data-theme="dark"]) .anomaly-status strong,
[data-theme="light"] .anomaly-status strong {
  color: #be123c !important;
  font-weight: 800 !important;
}

/* Recommendations Light Theme Enhancements */
:root:not([data-theme="dark"]) .rec-text,
[data-theme="light"] .rec-text {
  color: #1e293b !important;
  font-weight: 500 !important;
}

:root:not([data-theme="dark"]) .action-section,
[data-theme="light"] .action-section {
  background: #eef2ff !important;
  border-left: 3px solid #4338ca !important;
}

:root:not([data-theme="dark"]) .rec-action-text,
[data-theme="light"] .rec-action-text {
  color: #1e1b4b !important;
  font-weight: 600 !important;
}

:root:not([data-theme="dark"]) .target-tag,
[data-theme="light"] .target-tag {
  background: #f1f5f9 !important;
  color: #0f172a !important;
  border: 1px solid #cbd5e1 !important;
  font-weight: 600 !important;
}

:root:not([data-theme="dark"]) .rec-audit-box,
[data-theme="light"] .rec-audit-box {
  background: var(--bg-subtle) !important;
  border: 1px solid var(--border-color) !important;
  color: #475569 !important;
}

/* Reconciliation Matrix */
:root:not([data-theme="dark"]) .reconcile-cell,
[data-theme="light"] .reconcile-cell,
:root:not([data-theme="dark"]) .reconcile-head,
[data-theme="light"] .reconcile-head {
  color: var(--text-main) !important;
}

/* Clusters & Reports */
:root:not([data-theme="dark"]) .cluster-size,
[data-theme="light"] .cluster-size {
  color: var(--text-secondary) !important;
  font-weight: 600 !important;
}

:root:not([data-theme="dark"]) .report-meta,
[data-theme="light"] .report-meta {
  color: var(--text-muted) !important;
}

:root:not([data-theme="dark"]) .report-text,
[data-theme="light"] .report-text {
  color: var(--text-main) !important;
}

:root:not([data-theme="dark"]) .rec-action,
[data-theme="light"] .rec-action {
  color: var(--text-main) !important;
  font-weight: 600 !important;
}

/* Traffic Filter Buttons */
:root:not([data-theme="dark"]) .traffic-filter-btn,
[data-theme="light"] .traffic-filter-btn {
  background: var(--bg-card) !important;
  border: 1px solid var(--border-color) !important;
  color: var(--text-secondary) !important;
  font-weight: 600 !important;
}

:root:not([data-theme="dark"]) .traffic-filter-btn:hover,
[data-theme="light"] .traffic-filter-btn:hover {
  background: var(--bg-card-hover) !important;
  color: var(--text-main) !important;
}

:root:not([data-theme="dark"]) .traffic-filter-btn.active,
[data-theme="light"] .traffic-filter-btn.active {
  background: var(--accent-primary) !important;
  color: #ffffff !important;
  border-color: var(--accent-primary) !important;
  font-weight: 700 !important;
}




