:root {
  --ink: #172033;
  --muted: #657085;
  --line: #dfe5ef;
  --paper: #ffffff;
  --surface: #f4f7fb;
  --primary: #1f6feb;
  --primary-dark: #174ea6;
  --accent: #0f766e;
  --warm: #f59e0b;
}

html {
  font-size: 16px;
  min-height: 100%;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(135deg, rgba(31, 111, 235, 0.08), rgba(15, 118, 110, 0.08)),
    var(--surface);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

a {
  text-decoration: none;
}

.site-header {
  background: rgba(255, 255, 255, 0.92);
  border-bottom: 1px solid var(--line);
}

.navbar {
  padding: 0.85rem 0;
}

.navbar-toggler {
  border-color: var(--line);
}

.navbar-toggler-icon {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%2823,32,51,0.75%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

.navbar-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  color: var(--ink);
  font-weight: 800;
}

.brand-mark {
  display: inline-grid;
  width: 2.15rem;
  height: 2.15rem;
  place-items: center;
  color: #fff;
  background: var(--primary);
  border-radius: 0.45rem;
}

.nav-link {
  color: var(--muted);
  font-weight: 700;
  border-radius: 0.4rem;
  padding-inline: 0.85rem !important;
}

.nav-link:hover,
.nav-link.active {
  color: var(--primary-dark);
  background: rgba(31, 111, 235, 0.1);
}

.site-main {
  padding: 2rem 0 3rem;
}

.hero {
  display: grid;
  min-height: 26rem;
  align-items: center;
  padding: 4rem;
  color: #fff;
  background:
    linear-gradient(135deg, rgba(23, 32, 51, 0.92), rgba(31, 111, 235, 0.74)),
    url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160' viewBox='0 0 160 160'%3e%3cg fill='none' stroke='%23ffffff' stroke-opacity='.20'%3e%3cpath d='M0 40h160M0 80h160M0 120h160M40 0v160M80 0v160M120 0v160'/%3e%3ccircle cx='80' cy='80' r='28'/%3e%3c/g%3e%3c/svg%3e");
  background-size: cover, 10rem 10rem;
  border-radius: 0.75rem;
  box-shadow: 0 1.2rem 3rem rgba(23, 32, 51, 0.18);
}

.hero-content {
  max-width: 42rem;
}

.eyebrow {
  margin: 0 0 0.75rem;
  color: #bae6fd;
  font-size: 0.85rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hero h1 {
  max-width: 40rem;
  margin: 0;
  font-size: clamp(2.3rem, 6vw, 4.4rem);
  line-height: 1;
  font-weight: 850;
}

.hero-copy {
  max-width: 34rem;
  margin: 1.25rem 0 0;
  color: rgba(255, 255, 255, 0.82);
  font-size: 1.1rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.7rem;
}

.btn {
  border-radius: 0.45rem;
  font-weight: 800;
}

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

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

.page-grid,
.content-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
  margin-top: 1.25rem;
}

.page-card,
.content-card {
  min-height: 11rem;
  padding: 1.25rem;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 0.65rem;
  box-shadow: 0 0.8rem 2rem rgba(23, 32, 51, 0.08);
}

.page-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: transform 150ms ease, border-color 150ms ease;
}

.page-card:hover {
  color: var(--ink);
  border-color: rgba(31, 111, 235, 0.55);
  transform: translateY(-0.15rem);
}

.page-card span,
.content-card span {
  color: var(--primary);
  font-weight: 850;
}

.page-card strong,
.content-card h3 {
  margin: 0.55rem 0 0.4rem;
  font-size: 1.1rem;
  font-weight: 850;
}

.page-card p,
.content-card p,
.page-intro {
  color: var(--muted);
}

.page-title {
  margin: 0 0 0.75rem;
  font-size: 2.2rem;
  font-weight: 850;
}

.page-heading-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.page-intro {
  max-width: 44rem;
  margin-bottom: 1.25rem;
}

.data-count {
  display: inline-flex;
  align-items: center;
  min-height: 2.2rem;
  padding: 0 0.75rem;
  color: var(--primary-dark);
  background: rgba(31, 111, 235, 0.1);
  border: 1px solid rgba(31, 111, 235, 0.18);
  border-radius: 0.45rem;
  font-weight: 850;
  white-space: nowrap;
}

.data-panel {
  overflow: hidden;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 0.65rem;
  box-shadow: 0 0.8rem 2rem rgba(23, 32, 51, 0.08);
}

.barangay-table {
  margin: 0;
}

.barangay-table thead th {
  color: var(--muted);
  background: #f8fafc;
  border-bottom: 1px solid var(--line);
  font-size: 0.8rem;
  text-transform: uppercase;
}

.barangay-table tbody td {
  color: var(--ink);
  border-color: var(--line);
  vertical-align: middle;
}

.empty-cell {
  padding: 2rem !important;
  color: var(--muted) !important;
  text-align: center;
}

.metric {
  display: block;
  color: var(--accent);
  font-size: 2rem;
  font-weight: 850;
}

.site-footer {
  padding: 1.25rem 0;
  color: var(--muted);
  background: #fff;
  border-top: 1px solid var(--line);
}

.site-footer .container {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
}

@media (max-width: 992px) {
  .page-grid,
  .content-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .hero {
    padding: 3rem 2rem;
  }
}

@media (max-width: 576px) {
  .page-grid,
  .content-grid {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: auto;
    padding: 2.25rem 1.4rem;
  }

  .site-footer .container {
    flex-direction: column;
  }

  .page-heading-row {
    flex-direction: column;
  }
}
