:root {
  --bg-main: #090d16;
  --bg-card: #111827;
  --bg-row-hover: #1a2333;
  --border: #1f2937;
  --text-primary: #f3f4f6;
  --text-muted: #9ca3af;
  --cyan: #38bdf8;
  --emerald: #10b981;
  --amber: #f59e0b;
  --red: #ef4444;
  --mono: "JetBrains Mono", "Fira Code", Consolas, monospace;
  --sans: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--bg-main);
  color: var(--text-primary);
  font-family: var(--sans);
  line-height: 1.5;
}

.topbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 1.25rem 2rem;
  background-color: var(--bg-card);
  border-bottom: 1px solid var(--border);
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.9rem;
}

.brand h1 {
  font-family: var(--mono);
  font-size: 1.15rem;
  letter-spacing: 0.05em;
  color: var(--text-primary);
}

.subtitle {
  font-size: 0.82rem;
  color: var(--text-muted);
}

.pulse-dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background-color: var(--emerald);
  box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
  70% { box-shadow: 0 0 0 10px rgba(16, 185, 129, 0); }
  100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
}

.meta-badge {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--text-muted);
  background: #0d1320;
  border: 1px solid var(--border);
  padding: 0.35rem 0.65rem;
  border-radius: 6px;
}

.btn {
  font-family: var(--mono);
  font-size: 0.78rem;
  padding: 0.45rem 0.85rem;
  border-radius: 6px;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid transparent;
  transition: opacity 0.15s ease;
}

.btn:hover { opacity: 0.85; }

.btn-primary {
  background-color: var(--cyan);
  color: #05101c;
  font-weight: 600;
}

.btn-secondary {
  background-color: #1f2937;
  color: var(--text-primary);
  border-color: #374151;
}

.container {
  max-width: 1440px;
  margin: 0 auto;
  padding: 1.5rem 2rem 3rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.card {
  background-color: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.25rem;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  gap: 0.5rem;
}

.card-header h2 {
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--text-primary);
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.25rem;
}

.kpi-card {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.kpi-label {
  font-size: 0.82rem;
  color: var(--text-muted);
}

.kpi-value {
  font-family: var(--mono);
  font-size: 2rem;
  font-weight: 700;
}

.kpi-foot {
  font-size: 0.75rem;
  color: #6b7280;
}

.accent-cyan { color: var(--cyan); }
.accent-red { color: var(--red); }

.analytics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.25rem;
}

.chart-wrapper {
  position: relative;
  height: 230px;
  width: 100%;
}

.target-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.target-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0.75rem;
  background: #0d1320;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-family: var(--mono);
  font-size: 0.8rem;
}

.target-path {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--cyan);
}

.target-count {
  background: #1f2937;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  font-weight: 600;
}

.table-responsive {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}

th, td {
  text-align: left;
  padding: 0.7rem 0.75rem;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

th {
  font-family: var(--mono);
  font-size: 0.74rem;
  text-transform: uppercase;
  color: var(--text-muted);
  background: #0d1320;
}

tbody tr:hover {
  background-color: var(--bg-row-hover);
}

.mono {
  font-family: var(--mono);
}

.badge {
  display: inline-block;
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.18rem 0.5rem;
  border-radius: 4px;
}

.sev-HIGH {
  background: rgba(239, 68, 68, 0.15);
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.4);
}

.sev-MEDIUM {
  background: rgba(245, 158, 11, 0.15);
  color: #fcd34d;
  border: 1px solid rgba(245, 158, 11, 0.4);
}

.mitre-tag {
  background: rgba(56, 189, 248, 0.12);
  color: var(--cyan);
  border: 1px solid rgba(56, 189, 248, 0.3);
}

.details-cell {
  max-width: 280px;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text-muted);
}