:root {
  --ink: #171717;
  --muted: #6b6f76;
  --line: #d8dde3;
  --panel: #ffffff;
  --page: #f4f5f2;
  --accent: #0f766e;
  --accent-2: #c2410c;
  --accent-3: #854d0e;
  --blue: #2563eb;
  --red: #dc2626;
  --violet: #7c3aed;
  --cyan: #0891b2;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--page);
  font-family: Inter, Segoe UI, Arial, sans-serif;
}

button,
input,
select {
  font: inherit;
}

.dashboard-shell {
  width: min(1560px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 18px 0 28px;
}

.topbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  padding: 8px 0 16px;
  border-bottom: 1px solid var(--line);
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  font-size: clamp(28px, 4vw, 54px);
  line-height: 1;
}

h2 {
  font-size: 17px;
}

.meta {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
  color: var(--muted);
  font-weight: 700;
}

.meta span {
  border: 1px solid var(--line);
  background: var(--panel);
  padding: 8px 10px;
  border-radius: 6px;
}

.filters,
.weapon-filter {
  display: flex;
  align-items: end;
  gap: 10px;
  flex-wrap: wrap;
  padding: 14px 0 0;
}

label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

input,
select {
  height: 38px;
  min-width: 150px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 10px;
  color: var(--ink);
  background: var(--panel);
}

.search-box input {
  min-width: 280px;
}

.segmented,
.weapon-filter {
  min-height: 38px;
}

.segmented {
  display: flex;
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
  background: var(--panel);
}

.segmented button,
.weapon-filter button {
  height: 38px;
  border: 0;
  border-right: 1px solid var(--line);
  padding: 0 12px;
  background: var(--panel);
  cursor: pointer;
}

.segmented button:last-child {
  border-right: 0;
}

.segmented button.active,
.weapon-filter button.active {
  color: #fff;
  background: var(--ink);
}

.weapon-filter button {
  border: 1px solid var(--line);
  border-radius: 6px;
  font-weight: 750;
}

.playback-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 12px 0 0;
}

.playback-controls button {
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 12px;
  background: var(--panel);
  color: var(--ink);
  cursor: pointer;
  font-weight: 800;
}

.playback-controls button.primary {
  background: var(--ink);
  color: #fff;
}

.timeline-label {
  grid-template-columns: 1fr;
  min-width: min(420px, 100%);
  flex: 1;
}

.timeline-label input {
  width: 100%;
  min-width: 240px;
  padding: 0;
}

#activeMonthLabel {
  min-width: 110px;
  color: var(--accent);
}

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

.kpis article,
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.kpis article {
  padding: 15px;
}

.kpis span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  margin-bottom: 8px;
}

.kpis strong {
  font-size: 30px;
  line-height: 1;
}

.main-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(360px, .8fr);
  gap: 10px;
}

.trend-panel {
  grid-column: span 1;
}

.map-panel {
  grid-row: span 2;
}

.panel {
  padding: 14px;
  min-width: 0;
}

.panel-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.panel-head span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.chart {
  height: 290px;
}

.chart svg,
.point-map svg {
  width: 100%;
  height: 100%;
  display: block;
}

.bar-list {
  display: grid;
  gap: 8px;
}

.bar-row {
  display: grid;
  grid-template-columns: minmax(90px, 145px) 1fr 70px;
  align-items: center;
  gap: 10px;
  min-height: 28px;
  font-size: 13px;
}

.bar-track {
  height: 12px;
  background: #eceff1;
  border-radius: 999px;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  background: var(--accent);
}

.bar-value {
  text-align: right;
  color: var(--muted);
  font-weight: 800;
}

.point-map {
  height: 500px;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.map-graticule {
  stroke: #e8eaec;
  stroke-width: 1;
}

.oblast-area {
  cursor: pointer;
  stroke: #f8fafc;
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
  transition: fill-opacity .15s ease, stroke-width .15s ease;
}

.raion-boundary {
  fill: none;
  stroke: #ffffff;
  stroke-width: .5;
  stroke-opacity: .75;
  pointer-events: none;
  vector-effect: non-scaling-stroke;
}

.oblast-area:hover {
  fill-opacity: .94;
  stroke: #111827;
  stroke-width: 1.8;
}

.map-dot,
.oblast-dot {
  cursor: pointer;
  transition: opacity .15s ease;
}

.map-dot:hover,
.oblast-dot:hover {
  opacity: 1;
  stroke-width: 2.5;
}

.oblast-dot {
  fill: #111827;
  fill-opacity: .62;
  stroke: #ffffff;
  stroke-width: .9;
}

.map-label {
  fill: #4b5563;
  font-size: 11px;
  font-weight: 800;
  pointer-events: none;
}

.map-legend {
  fill: #ffffff;
  stroke: var(--line);
  stroke-width: 1;
}

.heat-legend text,
.axis-label {
  fill: #4b5563;
  font-size: 11px;
  font-weight: 700;
}

.map-detail {
  display: grid;
  gap: 4px;
  min-height: 62px;
  margin-top: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8faf9;
  color: var(--muted);
  font-size: 13px;
}

.map-detail strong {
  color: var(--ink);
  font-size: 14px;
}

.map-detail span {
  line-height: 1.35;
}

.evidence-panel {
  display: grid;
  gap: 8px;
  max-height: 230px;
  overflow: auto;
  margin-top: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  font-size: 13px;
}

.evidence-panel strong {
  font-size: 14px;
}

.evidence-item {
  display: grid;
  gap: 3px;
  padding: 8px 0;
  border-top: 1px solid var(--line);
}

.evidence-item:first-of-type {
  border-top: 0;
}

.evidence-meta {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.table-panel {
  margin-top: 10px;
}

.table-controls {
  display: flex;
  align-items: end;
  gap: 10px;
  flex-wrap: wrap;
  padding: 0 0 12px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 12px;
}

.table-controls button {
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 12px;
  background: var(--panel);
  color: var(--ink);
  cursor: pointer;
  font-weight: 800;
}

.table-controls button:last-child {
  background: var(--ink);
  color: #fff;
}

.table-wrap {
  overflow: auto;
  max-height: 520px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 1040px;
  font-size: 13px;
}

th,
td {
  padding: 9px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f8faf9;
  font-size: 12px;
  color: var(--muted);
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 8px;
  border-radius: 999px;
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.drone { background: #ca8a04; }
.missile { background: var(--red); }
.ballistic { background: #991b1b; }
.guided_bomb { background: var(--violet); }
.aircraft_activity { background: var(--cyan); }

@media (max-width: 980px) {
  .dashboard-shell {
    width: min(100vw - 20px, 1560px);
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .kpis,
  .main-grid {
    grid-template-columns: 1fr;
  }

  .map-panel {
    grid-row: auto;
  }

  .search-box input,
  input,
  select {
    min-width: 100%;
  }

  .filters label,
  .search-box {
    width: 100%;
  }
}
