:root {
  --bg: #050608;
  --bg-elevated: #111319;
  --bg-elevated-soft: #181b23;
  --border-subtle: #262a34;
  --accent: #5f8cff;
  --accent-soft: rgba(95, 140, 255, 0.12);
  --text: #f5f5f7;
  --text-muted: #a0a4b5;
  --danger: #ff5c7a;
  --radius-lg: 14px;
  --radius-xl: 18px;
}

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

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "SF Pro Text",
    "Segoe UI", sans-serif;
  background: radial-gradient(circle at top, #181b23 0, #050608 55%);
  color: var(--text);
  min-height: 100vh;
  padding: 24px 12px 32px;
}

.shell {
  max-width: 1120px;
  margin: 0 auto;
}

/* HEADER */

header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.title-block {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

h1 {
  font-size: 1.45rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  font-weight: 620;
  display: flex;
  align-items: center;
  gap: 8px;
}

h1 span.badge {
  font-size: 0.7rem;
  font-weight: 500;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid var(--border-subtle);
  background: linear-gradient(
    135deg,
    rgba(95, 140, 255, 0.12),
    transparent
  );
  color: var(--accent);
  text-transform: none;
}

.subtitle {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.tagline {
  font-size: 0.78rem;
  color: var(--text-muted);
  opacity: 0.85;
}

.toolbar {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  font-size: 0.76rem;
  color: var(--text-muted);
}

/* CHIPS / FILTERS */

.chip-row {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}

.chip-row {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}

.chip {
  border-radius: var(--radius-lg);
  padding: 5px 9px;
  background: rgba(9, 11, 19, 0.7);
  border: 1px solid var(--border-subtle);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.74rem;
  color: var(--text-muted);
  cursor: pointer;
  user-select: none;
  transition:
    border 0.15s ease,
    background 0.15s ease,
    color 0.15s ease;
}

/* active state: no blue edge, just a darker pill */
.chip.active {
  border-color: #323749;
  background: #181b23;
  color: var(--text);
}

.chip.active span.dot {
  background: #d3d7e5;
}

/* hover state: same dark grey/black feel for both active and inactive */
.chip:hover {
  background: #13161f;
  border-color: #323749;
  color: var(--text);
}

/* MAIN LAYOUT / PANELS */

main {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.panel {
  background: radial-gradient(circle at top left, #1c2030 0, #111319 40%);
  border-radius: var(--radius-xl);
  border: 1px solid rgba(255, 255, 255, 0.03);
  box-shadow: 0 22px 32px rgba(0, 0, 0, 0.7);
  padding: 14px 14px 16px;
}

.panel.compact {
  padding: 12px 12px 14px;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  gap: 8px;
}

.panel-title {
  font-size: 0.92rem;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}

.panel-title::before {
  content: "";
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--danger);
  box-shadow: 0 0 0 4px rgba(255, 92, 122, 0.18);
}

.panel-subtitle {
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* STATS */

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.stat-card {
  background: radial-gradient(circle at top, #1a1e28 0, #12151d 48%);
  border-radius: var(--radius-lg);
  border: 1px solid rgba(255, 255, 255, 0.03);
  padding: 10px 11px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-height: 64px;
}

.stat-label {
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--text-muted);
}

.stat-value-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 6px;
}

.stat-value {
  font-size: 1.05rem;
  font-weight: 640;
}

.stat-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-align: right;
}

/* LAYOUT SPLIT */

.layout-split {
  display: grid;
  grid-template-columns: 1.7fr 1fr;
  gap: 10px;
  align-items: flex-start;
}

/* TABLE */

.table-wrapper {
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-subtle);
  background: radial-gradient(circle at top, #151824 0, #090b10 60%);
  overflow: hidden;
  max-height: 540px;
  display: flex;
  flex-direction: column;
}

.table-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 7px 11px;
  border-bottom: 1px solid var(--border-subtle);
  font-size: 0.76rem;
  color: var(--text-muted);
}

.table-header span.em {
  color: var(--text);
  font-weight: 500;
}

.table-scroll {
  overflow: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 640px;
  font-size: 0.8rem;
}

thead {
  background: rgba(15, 17, 24, 0.96);
  position: sticky;
  top: 0;
  z-index: 2;
}

thead th {
  text-align: left;
  padding: 7px 10px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 0.7rem;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-subtle);
  white-space: nowrap;
}

tbody tr {
  border-bottom: 1px solid rgba(255, 255, 255, 0.02);
  background: rgba(6, 8, 14, 0.9);
}

tbody tr:nth-child(even) {
  background: rgba(9, 11, 18, 0.9);
}

tbody tr:hover {
  background: rgba(24, 28, 43, 0.95);
}

tbody td {
  padding: 7px 10px;
  vertical-align: middle;
  color: #d3d7e5;
}

.col-date {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  color: var(--text-muted);
}

.col-victim {
  font-weight: 500;
}

.col-gang {
  font-size: 0.82rem;
  color: var(--danger);
  white-space: nowrap;
}

.col-country {
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* SMALL UTILS */

.small {
  font-size: 0.74rem;
  color: var(--text-muted);
}

.error {
  font-size: 0.78rem;
  color: #ff9b7b;
  background: rgba(85, 36, 28, 0.4);
  border-radius: 8px;
  padding: 7px 9px;
  margin-top: 6px;
  border: 1px solid rgba(255, 155, 123, 0.3);
}

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

.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,
    "Liberation Mono", "Courier New", monospace;
}

/* RESPONSIVE */

@media (max-width: 960px) {
  .layout-split {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 800px) {
  header {
    flex-direction: column;
    align-items: flex-start;
  }
  .toolbar {
    align-items: flex-start;
  }
  .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 580px) {
  .stats-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

.chart-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  align-items: stretch;
}

.chart-card {
  background: radial-gradient(circle at top, #1a1e28 0, #12151d 48%);
  border-radius: var(--radius-lg);
  border: 1px solid rgba(255, 255, 255, 0.03);
  padding: 10px 11px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.chart-inner {
  position: relative;
  width: 100%;
  height: 220px;
}

.chart-inner canvas {
  width: 100% !important;
  height: 100% !important;
}

footer { margin-top: 10px; font-size: 0.72rem; color: var(--text-muted); display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; } 
footer a { color: var(--accent); text-decoration: none; opacity: 0.8; } 
footer a:hover { opacity: 1; text-decoration: underline; }
