:root {
  --bg: #f4f7fb;
  --surface: #ffffff;
  --surface-alt: #eef3fa;
  --primary: #0b3558;
  --primary-dark: #07263f;
  --accent: #c08a00;
  --danger: #a12222;
  --success: #1d6f42;
  --text: #1a2530;
  --muted: #556575;
  --border: #d5deea;
  --shadow: 0 8px 24px rgba(9, 36, 62, 0.08);

  /* Spacing scale */
  --sp-1: 0.5rem;
  --sp-2: 0.75rem;
  --sp-3: 1rem;
  --sp-4: 1.25rem;
  --sp-5: 1.75rem;
  --sp-6: 2.5rem;
  --sp-7: 3.5rem;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
}

a {
  color: var(--primary);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.container {
  width: min(1120px, 92%);
  margin: 0 auto;
}

/* ── Header ── */
.site-header {
  background: var(--primary);
  color: #fff;
  border-bottom: 4px solid var(--accent);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  padding: var(--sp-4) 0;
}

.brand h1 {
  margin: 0;
  font-size: clamp(1.35rem, 2.4vw, 1.9rem);
  line-height: 1.2;
}

.brand a {
  color: #fff;
  text-decoration: none;
}

.brand a:hover {
  text-decoration: underline;
}

.brand p {
  margin: 0.2rem 0 0;
  font-size: 0.85rem;
  opacity: 0.85;
}

.nav-toggle {
  display: none;
  border: 1px solid rgba(255, 255, 255, 0.5);
  background: transparent;
  color: #fff;
  padding: var(--sp-1) var(--sp-2);
  border-radius: 4px;
}

.site-nav ul {
  display: flex;
  flex-wrap: wrap;
  list-style: none;
  margin: 0;
  padding: 0;
  gap: var(--sp-2);
}

/* ── Dropdown ── */
.dropdown {
  position: relative;
}

.dropdown-toggle {
  background: transparent;
  border: none;
  color: #fff;
  width: 40px;
  height: 36px;
  padding: 0;
  border-radius: 6px;
  cursor: pointer;
  font-size: 1.2rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.18s ease, transform 0.18s ease;
}

.dropdown-toggle:hover {
  background: rgba(255, 255, 255, 0.16);
  transform: translateY(-1px);
}

.dropdown-toggle:focus,
.dropdown-toggle:focus-visible {
  outline: none;
  box-shadow: none;
}

.dropdown-toggle i {
  transition: transform 0.18s ease;
}

.dropdown.open .dropdown-toggle {
  background: rgba(255, 255, 255, 0.18);
}

.dropdown.open .dropdown-toggle i {
  transform: rotate(90deg);
}

.dropdown-menu {
  display: none;
  position: absolute;
  right: 0;
  top: calc(100% + 0.5rem);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.97), rgba(246, 250, 255, 0.95));
  backdrop-filter: blur(8px);
  min-width: 310px;
  border: 1px solid #b9cde3;
  border-radius: 14px;
  box-shadow: 0 16px 36px rgba(5, 31, 55, 0.2);
  padding: var(--sp-2);
  z-index: 20;
}

.dropdown.open .dropdown-menu {
  display: block;
  animation: dropdownReveal 180ms ease-out;
}

@keyframes dropdownReveal {
  from {
    opacity: 0;
    transform: translateY(-6px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.dropdown-menu a {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-2);
  color: var(--primary-dark);
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  font-weight: 600;
  letter-spacing: 0.1px;
  transition: background-color 0.16s ease, transform 0.16s ease;
  margin-bottom: 0.25rem;
}

.dropdown-menu a:last-child {
  margin-bottom: 0;
}

.dropdown-menu a i {
  font-size: 1.1rem;
  color: #2f6da2;
  margin-top: 0.05rem;
  flex-shrink: 0;
}

.dropdown-item-text {
  display: block;
}

.dropdown-item-title {
  display: block;
  line-height: 1.25;
}

.dropdown-item-subtitle {
  display: block;
  font-size: 0.76rem;
  font-weight: 400;
  color: #5f6f82;
  margin-top: 0.2rem;
  line-height: 1.35;
}

.site-nav .dropdown-menu a {
  color: var(--primary-dark);
  background: transparent;
}

.site-nav .dropdown-menu a:hover,
.site-nav .dropdown-menu a.active {
  background: #e4eefb;
  color: var(--primary-dark);
  transform: translateX(2px);
  text-decoration: none;
}

/* ── Emergency alert ── */
.emergency-alert {
  background: #ffe9e9;
  color: #5d1313;
  border: 1px solid #f3bbbb;
  border-left: 6px solid var(--danger);
  padding: var(--sp-3) var(--sp-4);
  margin: var(--sp-5) 0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--sp-3);
  border-radius: 8px;
}

.alert-dismiss {
  background: transparent;
  border: 1px solid #c48383;
  color: #5d1313;
  border-radius: 4px;
  cursor: pointer;
  padding: 0.25rem 0.5rem;
  flex-shrink: 0;
}

/* ── Hero ── */
.hero {
  background: linear-gradient(135deg, var(--primary), #174f80);
  color: #fff;
  padding: var(--sp-6) 0;
}

.hero h2 {
  margin: var(--sp-2) 0 var(--sp-3);
  font-size: clamp(1.5rem, 3vw, 2.2rem);
  line-height: 1.25;
}

.hero p {
  margin: 0 0 var(--sp-3);
  max-width: 720px;
  opacity: 0.92;
}

.badge {
  display: inline-block;
  background: rgba(255, 255, 255, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.35);
  padding: 0.28rem 0.6rem;
  border-radius: 20px;
  font-size: 0.78rem;
  margin-right: var(--sp-1);
}

/* ── Main content ── */
main {
  padding: var(--sp-4) 0 var(--sp-5);
}

main > section,
main > div.emergency-alert {
  margin-bottom: var(--sp-4);
}

main > section:last-child {
  margin-bottom: 0;
}

.page-title {
  margin: 0 0 0.05rem;
  color: var(--primary-dark);
  font-size: 1.55rem;
}

.page-lead {
  color: var(--muted);
  margin-top: 0;
  margin-bottom: var(--sp-4);
  font-size: 0.97rem;
}

.section-title {
  margin: 0 0 0.6rem;
  color: var(--primary-dark);
  font-size: 1.15rem;
}

.lead {
  color: var(--muted);
  margin-top: 0.1rem;
  margin-bottom: var(--sp-3);
  font-size: 1rem;
}

/* ── Grid ── */
.grid {
  display: grid;
  gap: var(--sp-3);
}

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

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

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

/* ── Cards ── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  border-radius: 10px;
  padding: var(--sp-4);
}

.card h3,
.card h4 {
  margin-top: 0;
  margin-bottom: var(--sp-2);
  color: var(--primary-dark);
}

.card p:last-child,
.card ul:last-child {
  margin-bottom: 0;
}

/* ── Stat numbers ── */
.stat-number {
  font-size: 2rem;
  font-weight: 700;
  color: var(--primary);
  margin: var(--sp-1) 0 var(--sp-1);
  line-height: 1;
}

.muted {
  color: var(--muted);
  font-size: 0.9rem;
}

/* ── Tables ── */
.table-wrap {
  overflow-x: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 640px;
}

th,
td {
  border-bottom: 1px solid var(--border);
  padding: var(--sp-3) var(--sp-4);
  text-align: left;
  font-size: 0.92rem;
}

tr:last-child td {
  border-bottom: none;
}

th {
  background: var(--surface-alt);
  color: var(--primary-dark);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.status {
  display: inline-block;
  border-radius: 999px;
  padding: 0.25rem 0.6rem;
  font-size: 0.78rem;
  font-weight: 600;
}

.status.success {
  background: #d7f1e0;
  color: #0b5b32;
}

.status.warn {
  background: #fff0c7;
  color: #865f00;
}

.status.danger {
  background: #ffdada;
  color: #7f1414;
}

/* ── Forms ── */
form .field {
  margin-bottom: var(--sp-4);
}

label {
  display: block;
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: var(--sp-1);
}

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

input,
select,
textarea {
  width: 100%;
  border: 1px solid #b9c6d8;
  border-radius: 8px;
  padding: 0.6rem 0.75rem;
  background: #fff;
  transition: border-color 0.15s ease;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: #2f6da2;
  box-shadow: 0 0 0 3px rgba(47, 109, 162, 0.12);
}

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

.btn {
  background: var(--primary);
  color: #fff;
  border: 0;
  padding: 0.65rem var(--sp-4);
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  transition: background-color 0.15s ease;
}

.btn:hover {
  background: var(--primary-dark);
}

.notice {
  border-left: 4px solid var(--accent);
  background: #fff7dd;
  padding: var(--sp-3) var(--sp-4);
  border-radius: 6px;
  font-size: 0.92rem;
  margin-top: var(--sp-3);
}

.form-message {
  margin-top: var(--sp-3);
  padding: var(--sp-3) var(--sp-4);
  border-radius: 8px;
  border: 1px solid #98d0af;
  background: #e9f7ef;
  color: #194f30;
  display: none;
}

/* ── Chart bars ── */
.chart-bar {
  margin: var(--sp-3) 0;
}

.chart-bar .label {
  font-size: 0.87rem;
  color: var(--muted);
  margin-bottom: 0.35rem;
}

.bar {
  background: #dce8f6;
  border-radius: 20px;
  overflow: hidden;
  height: 10px;
}

.bar span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #2f6da2, #5d9bd0);
}

/* ── FAQ ── */
.faq-item {
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 8px;
  margin-bottom: var(--sp-2);
}

.faq-question {
  width: 100%;
  text-align: left;
  background: none;
  border: 0;
  padding: var(--sp-3) var(--sp-4);
  cursor: pointer;
  font-weight: 600;
  color: var(--primary-dark);
}

.faq-answer {
  display: none;
  padding: 0 var(--sp-4) var(--sp-3);
  color: var(--muted);
  line-height: 1.6;
}

.faq-item.open .faq-answer {
  display: block;
}

/* ── Search row ── */
.search-row {
  display: flex;
  gap: var(--sp-2);
  flex-wrap: wrap;
  margin-bottom: var(--sp-4);
}

.search-row input,
.search-row select {
  flex: 1 1 180px;
}

/* ── Footer ── */
.site-footer {
  margin-top: var(--sp-6);
  background: var(--primary-dark);
  color: #d8e4f2;
  padding: var(--sp-4) 0;
  font-size: 0.9rem;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  gap: var(--sp-3);
  flex-wrap: wrap;
}

/* ── Responsive ── */
@media (max-width: 900px) {
  .grid-4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

@media (max-width: 700px) {
  .nav-toggle {
    display: inline-block;
  }

  .site-nav {
    width: 100%;
    display: none;
  }

  .site-nav.open {
    display: block;
  }

  .site-nav ul {
    flex-direction: column;
    margin-top: var(--sp-2);
  }

  .dropdown-menu {
    position: static;
    min-width: 100%;
    margin-top: var(--sp-2);
    border-radius: 10px;
  }

  .grid-2,
  .grid-3,
  .grid-4 {
    grid-template-columns: 1fr;
  }

  .header-inner {
    flex-wrap: wrap;
  }

  main {
    padding: var(--sp-3) 0 var(--sp-5);
  }

  .hero {
    padding: var(--sp-5) 0;
  }

  .card {
    padding: var(--sp-3);
  }
}
