:root {
  --ink: #18263a;
  --muted: #62718a;
  --line: #dbe3ee;
  --soft: #f4f7fb;
  --panel: #ffffff;
  --nav: #17365f;
  --nav-2: #224a78;
  --green: #32a852;
  --blue: #2580c3;
  --red: #e5524d;
  --gold: #d9a12d;
  --shadow: 0 1px 2px rgba(15, 30, 55, 0.08), 0 10px 28px rgba(23, 54, 95, 0.08);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--soft);
}

button, input, select, textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.topbar {
  background: linear-gradient(180deg, #102a4c, var(--nav));
  color: white;
  padding: 16px 24px;
}

.live {
  color: #70e39d;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.brand-row {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-top: 22px;
}

.eyebrow {
  color: #bdd0e8;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

h1, h2, h3, p {
  margin: 0;
}

.campaign-title {
  margin-top: 6px;
  font-size: 22px;
}

.account {
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: right;
}

.avatar {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  border: 2px solid rgba(255,255,255,.5);
  font-weight: 900;
}

.switcher {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 22px;
}

.switcher button, .primary, .ghost, .danger {
  border: 1px solid var(--line);
  border-radius: 7px;
  min-height: 44px;
  padding: 0 16px;
  font-weight: 800;
}

.switcher button {
  color: white;
  background: rgba(255,255,255,.13);
  border-color: rgba(255,255,255,.35);
}

.switcher button.active {
  color: var(--nav);
  background: white;
}

.tabs {
  display: flex;
  gap: 0;
  padding: 0 24px;
  border-bottom: 1px solid var(--line);
  background: white;
  overflow: auto;
}

.tab {
  border: 0;
  border-bottom: 2px solid transparent;
  background: white;
  color: var(--muted);
  padding: 14px 16px;
  white-space: nowrap;
  font-weight: 800;
}

.tab.active {
  color: var(--nav);
  border-bottom-color: var(--nav);
}

.badge {
  display: inline-grid;
  place-items: center;
  min-width: 22px;
  height: 20px;
  padding: 0 7px;
  margin-left: 6px;
  border-radius: 999px;
  background: var(--red);
  color: white;
  font-size: 11px;
}

.page {
  padding: 28px 24px 40px;
}

.section-head {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: end;
  margin-bottom: 22px;
}

.section-head p, .muted {
  color: var(--muted);
}

.grid {
  display: grid;
  gap: 16px;
}

.overview-grid {
  grid-template-columns: minmax(280px, 1fr) minmax(420px, 1fr);
}

.metric-grid {
  grid-template-columns: repeat(2, minmax(180px, 1fr));
}

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.metric {
  padding: 20px;
  min-height: 110px;
}

.metric strong {
  display: block;
  font-size: 34px;
  line-height: 1;
  color: var(--nav);
}

.metric strong.green { color: var(--green); }
.metric strong.blue { color: var(--blue); }
.metric strong.red { color: var(--red); }

.metric span {
  display: block;
  margin-top: 7px;
  color: var(--muted);
}

.metric small {
  display: block;
  margin-top: 12px;
  color: #8aa0bd;
}

.chart-card {
  padding: 20px;
}

.card-title {
  color: #5c6f8e;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  margin-bottom: 18px;
}

.bars {
  display: flex;
  align-items: end;
  gap: 6px;
  height: 104px;
  border-bottom: 1px solid var(--line);
}

.bar {
  width: 20px;
  min-height: 5px;
  background: #3c5578;
  border-radius: 2px 2px 0 0;
}

.heatmap {
  height: 330px;
  position: relative;
  overflow: hidden;
  margin-top: 24px;
}

.map-header {
  position: absolute;
  z-index: 5;
  top: 14px;
  left: 18px;
  right: 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.map-legend {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
}

.map-legend i {
  width: 72px;
  height: 7px;
  border-radius: 999px;
  background: linear-gradient(90deg, #4f8fd5, #fed45b, #ef463f);
}

.map-controls {
  position: absolute;
  z-index: 6;
  top: 54px;
  left: 16px;
  display: grid;
  gap: 6px;
}

.map-btn {
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: white;
  color: var(--ink);
  font-size: 18px;
  font-weight: 900;
  box-shadow: var(--shadow);
}

.map-btn.wide {
  width: 58px;
  font-size: 12px;
}

.map-viewport {
  position: absolute;
  inset: 36px 0 34px;
  overflow: hidden;
  cursor: grab;
  touch-action: none;
  background: #d9e0e7;
}

.map-viewport:active {
  cursor: grabbing;
}

.map-stage {
  position: absolute;
  inset: 0;
  transform-origin: center;
  transition: transform .12s ease;
}

.map-art {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(22deg, transparent 0 32%, rgba(255,255,255,.44) 33% 36%, transparent 37%),
    linear-gradient(150deg, transparent 0 41%, rgba(255,255,255,.5) 42% 44%, transparent 45%),
    radial-gradient(ellipse at 58% 56%, rgba(199, 209, 218, .9), transparent 12%),
    linear-gradient(0deg, rgba(210, 219, 228, .9), rgba(244,247,251,.96));
}

.map-art:before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,.82) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.82) 1px, transparent 1px);
  background-size: 210px 80px;
}

.map-label {
  position: absolute;
  color: #8091a7;
  font-weight: 900;
  font-size: 13px;
  letter-spacing: .04em;
}

.heat-spot {
  position: absolute;
  width: var(--size);
  height: var(--size);
  border: 0;
  border-radius: 999px;
  transform: translate(-50%, -50%);
  background:
    radial-gradient(circle, rgba(239,70,63,calc(.3 + var(--heat) * .4)) 0 18%, rgba(254,212,91,calc(.35 + var(--heat) * .35)) 20% 42%, rgba(68,137,213,.28) 44% 70%, transparent 72%);
  filter: blur(.2px);
  mix-blend-mode: multiply;
}

.heat-spot:focus-visible {
  outline: 3px solid var(--nav);
  outline-offset: 4px;
}

.map-info {
  position: absolute;
  z-index: 5;
  left: 18px;
  right: 18px;
  bottom: 10px;
  min-height: 22px;
  color: var(--muted);
  font-size: 13px;
}

.zone-grid {
  grid-template-columns: 1fr 1fr;
  margin-top: 16px;
}

.panel-pad {
  padding: 18px;
}

.row-line {
  display: grid;
  grid-template-columns: 150px 1fr 78px;
  gap: 10px;
  align-items: center;
  margin: 10px 0;
  font-size: 13px;
}

.progress {
  height: 5px;
  border-radius: 999px;
  background: #e3e9f1;
  overflow: hidden;
}

.progress span {
  display: block;
  height: 100%;
  background: var(--nav);
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  min-width: 72px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 10px;
  background: #f8fafc;
}

.chip strong {
  color: var(--blue);
  display: block;
  font-size: 20px;
}

.leader-list {
  display: grid;
  gap: 10px;
}

.leader-item {
  display: grid;
  grid-template-columns: 36px 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #f8fafc;
}

.medal {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 999px;
  background: #eef3f9;
  font-size: 13px;
  font-weight: 900;
}

.table-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 12px;
}

.table-tools input, .table-tools select {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 0 12px;
  background: white;
}

.table-wrap {
  overflow: auto;
}

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

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

th {
  color: #5c6f8e;
  font-size: 11px;
  letter-spacing: .12em;
  text-transform: uppercase;
  background: #f8fafc;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  padding: 4px 8px;
  background: #eef3f9;
  font-size: 12px;
  font-weight: 800;
}

.dot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--green);
}

.primary {
  color: white;
  background: var(--nav);
  border-color: var(--nav);
}

.ghost {
  color: var(--nav);
  background: white;
}

.danger {
  color: white;
  background: var(--red);
  border-color: var(--red);
}

.public-shell, .login-shell {
  min-height: 100vh;
  display: grid;
  place-items: start center;
  padding: 54px 18px;
  background:
    radial-gradient(circle at 50% -10%, rgba(37,128,195,.12), transparent 28%),
    var(--soft);
}

.public-head, .login-head {
  text-align: center;
  margin-bottom: 26px;
}

.flag {
  font-size: 14px;
  color: var(--nav);
  font-weight: 900;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.form-card {
  width: min(430px, 100%);
  padding: 24px;
}

label {
  display: block;
  margin-top: 16px;
  margin-bottom: 7px;
  font-size: 13px;
  font-weight: 800;
}

input, select, textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 7px;
  min-height: 40px;
  padding: 10px 12px;
  background: white;
  color: var(--ink);
}

textarea {
  resize: vertical;
  min-height: 74px;
}

.consent {
  display: grid;
  grid-template-columns: 22px 1fr;
  gap: 10px;
  align-items: start;
  margin: 18px 0;
  color: #5d6f8a;
  font-size: 13px;
  line-height: 1.45;
}

.consent input {
  min-height: auto;
  margin-top: 2px;
}

.success-box {
  margin-top: 16px;
  padding: 14px;
  border-radius: 7px;
  background: #edf9f1;
  color: #1f773d;
  border: 1px solid #bfebcc;
  word-break: break-word;
}

.tree {
  display: grid;
  gap: 10px;
}

.tree-row {
  display: grid;
  grid-template-columns: 1fr 110px 110px 120px;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
}

.indent-1 { margin-left: 28px; }
.indent-2 { margin-left: 56px; }
.indent-3 { margin-left: 84px; }

.legal {
  max-width: 860px;
  margin: 18px auto;
  line-height: 1.6;
  color: #465a78;
}

.empty {
  color: #8aa0bd;
  padding: 18px;
}

@media (max-width: 900px) {
  .overview-grid, .zone-grid, .metric-grid, .switcher {
    grid-template-columns: 1fr;
  }

  .brand-row, .section-head {
    align-items: start;
    flex-direction: column;
  }

  .tree-row {
    grid-template-columns: 1fr;
  }
}
