:root {
  --navy-950: #071a36;
  --navy-900: #0a2244;
  --navy-800: #12325b;
  --gold-700: #966821;
  --gold-600: #b98636;
  --gold-500: #c99a4f;
  --paper: #fbfaf7;
  --paper-2: #f3efe6;
  --white: #ffffff;
  --ink: #0d2442;
  --muted: #647084;
  --line: rgba(10, 34, 68, 0.14);
  --line-strong: rgba(10, 34, 68, 0.24);
  --shadow: 0 18px 52px rgba(7, 26, 54, 0.1);
  --sans: Inter, Arial, sans-serif;
  --serif: Georgia, "Times New Roman", serif;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--paper);
}

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 100% 0, rgba(201, 154, 79, 0.16), transparent 28rem),
    linear-gradient(135deg, #fbfaf7 0%, #f4f0e8 100%);
  font-family: var(--sans);
  line-height: 1.4;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select {
  font: inherit;
}

.login-shell {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 28px;
}

.login-card {
  width: min(440px, 100%);
  padding: 34px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow);
}

.login-card img {
  width: 72px;
  margin-bottom: 12px;
}

.login-card span,
.dashboard-header span,
.panel-title span,
.report-card > span {
  color: var(--gold-600);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.login-card h1,
.dashboard-header h1,
.panel h2 {
  margin: 8px 0 0;
  color: var(--navy-950);
  font-family: var(--serif);
  letter-spacing: 0;
  line-height: 1.02;
}

.login-card p,
.dashboard-header p,
.empty {
  color: var(--muted);
}

.login-card label,
.filters label {
  display: grid;
  gap: 8px;
  color: var(--navy-900);
  font-size: 14px;
  font-weight: 900;
}

.login-card input,
.filters select {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  background: var(--white);
  color: var(--ink);
  padding: 10px 12px;
}

.login-card button,
.dashboard-header a {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--navy-950);
  background: var(--navy-950);
  color: var(--gold-500);
  font-weight: 900;
  padding: 10px 18px;
}

.login-card button {
  width: 100%;
  margin-top: 18px;
}

.error {
  display: block;
  margin: 14px 0;
  color: #a33a2f;
}

.dashboard-header {
  position: sticky;
  top: 0;
  z-index: 5;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 24px;
  align-items: center;
  padding: 22px clamp(20px, 4vw, 64px);
  border-bottom: 1px solid var(--line);
  background: rgba(251, 250, 247, 0.94);
  backdrop-filter: blur(14px);
}

.dashboard-header h1 {
  font-size: clamp(42px, 5vw, 76px);
}

.dashboard-header p {
  margin: 12px 0 0;
  max-width: 760px;
}

.dashboard-header nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.dashboard-header a:last-child {
  background: transparent;
  color: var(--navy-950);
}

.dashboard {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 210px;
  gap: 20px;
  padding: 24px clamp(20px, 4vw, 64px) 64px;
}

.filters {
  position: sticky;
  top: 144px;
  grid-column: 2;
  grid-row: 1 / span 2;
  align-self: start;
  padding: 18px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 14px 36px rgba(7, 26, 54, 0.07);
}

.filters select {
  font-weight: 800;
}

.report-grid,
.metrics-grid,
.panel-grid,
.full {
  grid-column: 1;
}

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

.report-card,
.metrics-grid article,
.panel {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 16px 46px rgba(7, 26, 54, 0.08);
}

.report-card {
  display: grid;
  grid-template-rows: auto auto auto 1fr;
  min-height: 290px;
  padding: 20px;
}

.report-card > strong {
  margin-top: 12px;
  color: var(--navy-950);
  font-family: var(--serif);
  font-size: clamp(50px, 4.6vw, 76px);
  line-height: 0.88;
}

.report-card > small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.report-card dl {
  display: grid;
  gap: 0;
  margin: 18px 0 0;
}

.report-card dl div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 32px;
  border-top: 1px solid rgba(10, 34, 68, 0.1);
}

.report-card dt,
.report-card dd {
  margin: 0;
}

.report-card dt {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.report-card dd {
  color: var(--navy-950);
  font-weight: 950;
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(130px, 1fr));
  gap: 12px;
}

.metrics-grid article {
  display: grid;
  gap: 8px;
  min-height: 104px;
  align-content: center;
  padding: 16px;
}

.metrics-grid span,
.compact-row span,
.bar-row span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.metrics-grid strong {
  color: var(--navy-950);
  font-size: clamp(24px, 2vw, 34px);
  line-height: 1;
}

.panel-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

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

.panel-title {
  display: grid;
  gap: 6px;
  margin-bottom: 6px;
}

.panel h2 {
  font-size: clamp(24px, 2.2vw, 36px);
}

.bar-row {
  display: grid;
  gap: 9px;
  margin-top: 16px;
}

.bar-row div,
.compact-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 18px;
}

.bar-row strong,
.compact-row strong {
  color: var(--navy-950);
}

.bar-row i {
  display: block;
  height: 9px;
  min-width: 4%;
  background: linear-gradient(90deg, var(--navy-950), var(--gold-500));
}

.compact-row {
  padding: 12px 0;
  border-bottom: 1px solid rgba(10, 34, 68, 0.1);
}

.empty {
  margin: 14px 0 0;
  padding: 14px;
  border: 1px dashed rgba(10, 34, 68, 0.18);
  background: rgba(251, 250, 247, 0.72);
  font-weight: 700;
}

.full {
  overflow: hidden;
  padding: 22px;
}

.map-panel {
  display: grid;
  gap: 14px;
}

.map-note {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

#access-map {
  width: 100%;
  min-height: 520px;
  border: 1px solid var(--line-strong);
  background: var(--paper-2);
}

.map-meta {
  display: inline-flex;
  width: fit-content;
  align-items: baseline;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid rgba(10, 34, 68, 0.12);
  background: rgba(251, 250, 247, 0.78);
}

.map-meta strong {
  color: var(--navy-950);
  font-size: 28px;
  line-height: 1;
}

.map-meta span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.leaflet-container {
  color: var(--ink);
  font-family: var(--sans);
}

.leaflet-popup-content-wrapper {
  border-radius: 4px;
  box-shadow: 0 16px 42px rgba(7, 26, 54, 0.2);
}

.leaflet-popup-content {
  min-width: 190px;
  color: var(--navy-800);
  font-size: 13px;
  line-height: 1.45;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  min-width: 820px;
  border-collapse: collapse;
  margin-top: 18px;
}

th,
td {
  padding: 13px 12px;
  border-bottom: 1px solid rgba(10, 34, 68, 0.1);
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--gold-700);
  font-size: 12px;
  font-weight: 950;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

td {
  color: var(--navy-800);
  font-size: 14px;
}

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

  .filters,
  .report-grid,
  .metrics-grid,
  .panel-grid,
  .full {
    grid-column: 1;
  }

  .filters {
    position: static;
    justify-self: end;
    width: min(260px, 100%);
  }

  .report-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .panel-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .dashboard-header {
    position: static;
    grid-template-columns: 1fr;
  }

  .dashboard-header nav {
    justify-content: flex-start;
  }

  .metrics-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .report-grid,
  .panel-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .dashboard-header,
  .dashboard {
    padding-inline: 16px;
  }

  .dashboard-header h1 {
    font-size: 42px;
  }

  .metrics-grid {
    grid-template-columns: 1fr;
  }

  #access-map {
    min-height: 420px;
  }
}

