*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --navy: #0a2463;
  --navy-dark: #071a4a;
  --red: #d62828;
  --red-dark: #a81c1c;
  --red-light: #fdf0f0;
  --blue-light: #e8eef8;
  --white: #ffffff;
  --light-bg: #f5f7fc;
  --text: #1a1a2e;
  --muted: #5a6a8a;
  --border: #e2e8f0;
  --gold: #d62828;
  --light-gold: #fdf0f0;
}

body {
  font-family: 'Open Sans', sans-serif;
  color: var(--text);
  line-height: 1.7;
  background: var(--white);
}

h1, h2, h3 { font-family: 'Merriweather', serif; }

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

.container { max-width: 1140px; margin: 0 auto; padding: 0 1.5rem; }

/* ═══════════════════════════════════════
   HEADER
═══════════════════════════════════════ */
header {
  background: var(--navy);
  color: var(--white);
  position: sticky;
  top: 0;
  z-index: 200;
  box-shadow: 0 2px 24px rgba(0,0,0,0.35);
}

/* TOP BAR */
.top-bar {
  background: rgba(0,0,0,0.25);
  border-bottom: 1px solid rgba(255,255,255,0.06);
  font-size: 0.7rem;
  color: rgba(255,255,255,0.5);
  letter-spacing: 0.3px;
}

.top-bar-inner {
  max-width: 1140px;
  margin: 0 auto;
  padding: 0.3rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.top-bar-right { color: rgba(255,255,255,0.4); }

/* HEADER INNER */
.header-inner {
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 1.5rem;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.header-inner .logo-area { flex-shrink: 0; }

.logo-area { display: flex; align-items: center; gap: 0.75rem; }

.seal {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 2px solid rgba(255,255,255,0.25);
}

.logo-text h1 {
  font-size: 0.9rem;
  color: var(--white);
  line-height: 1.2;
  font-weight: 700;
}

.logo-sub {
  font-size: 0.58rem;
  color: rgba(255,255,255,0.45);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-top: 0.1rem;
}

/* NAV */
nav {
  display: flex;
  align-items: center;
  gap: 0;
}

.nav-link {
  color: rgba(255,255,255,0.7);
  padding: 0.4rem 0.65rem;
  font-size: 0.71rem;
  font-weight: 600;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  position: relative;
  transition: color 0.2s;
  white-space: nowrap;
  border-radius: 4px;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%) scaleX(0);
  width: 70%;
  height: 2px;
  background: var(--red);
  border-radius: 2px;
  transition: transform 0.22s ease;
}

.nav-link:hover { color: var(--white); }
.nav-link.active { color: var(--white); }
.nav-link:hover::after,
.nav-link.active::after { transform: translateX(-50%) scaleX(1); }

.nav-cta {
  background: var(--red);
  color: var(--white) !important;
  padding: 0.4rem 1rem;
  border-radius: 6px;
  margin-left: 0.5rem;
  font-weight: 700;
  transition: background 0.2s, transform 0.15s;
  box-shadow: 0 2px 12px rgba(214,40,40,0.4);
}
.nav-cta::after { display: none; }
.nav-cta:hover { background: var(--red-dark); transform: translateY(-1px); }

/* HAMBURGER */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.4rem;
  width: 36px;
  height: 36px;
  flex-shrink: 0;
}
.nav-toggle span {
  display: block;
  height: 2px;
  background: var(--white);
  border-radius: 2px;
  transition: all 0.28s ease;
  width: 100%;
}
.nav-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.nav-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ═══════════════════════════════════════
   HERO (generic fallback)
═══════════════════════════════════════ */
.hero {
  min-height: 600px;
  background: linear-gradient(135deg, #071a4a 0%, #0a2463 50%, #7b0000 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  position: relative;
  overflow: hidden;
}

/* ═══════════════════════════════════════
   BUTTONS
═══════════════════════════════════════ */
.btn {
  display: inline-block;
  background: var(--red);
  color: var(--white);
  padding: 0.8rem 2rem;
  border-radius: 8px;
  font-weight: 700;
  font-family: 'Open Sans', sans-serif;
  font-size: 0.88rem;
  letter-spacing: 0.3px;
  transition: background 0.2s, transform 0.15s, box-shadow 0.2s;
  box-shadow: 0 4px 16px rgba(214,40,40,0.35);
  border: none;
  cursor: pointer;
}
.btn:hover {
  background: var(--red-dark);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(214,40,40,0.45);
}

.btn-ghost {
  display: inline-block;
  background: transparent;
  color: var(--white);
  padding: 0.8rem 2rem;
  border-radius: 8px;
  font-weight: 700;
  font-family: 'Open Sans', sans-serif;
  font-size: 0.88rem;
  border: 2px solid rgba(255,255,255,0.35);
  transition: background 0.2s, transform 0.15s, border-color 0.2s;
}
.btn-ghost:hover {
  background: rgba(255,255,255,0.12);
  border-color: rgba(255,255,255,0.6);
  transform: translateY(-2px);
}

/* ═══════════════════════════════════════
   SECTIONS
═══════════════════════════════════════ */
.section { padding: 5rem 0; }
.bg-light { background: var(--light-bg); }

.section-header {
  text-align: center;
  margin-bottom: 3rem;
}

.section-label {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: var(--red);
  margin-bottom: 0.6rem;
}

.section-title {
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  color: var(--navy);
  text-align: center;
  margin-bottom: 2.75rem;
  position: relative;
  padding-bottom: 1rem;
  line-height: 1.3;
}

.section-title::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 48px;
  height: 3px;
  background: var(--red);
  border-radius: 2px;
}

/* ═══════════════════════════════════════
   ABOUT / STATS
═══════════════════════════════════════ */
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: center;
}
.about-grid p { margin-bottom: 1rem; color: var(--muted); line-height: 1.85; }

.stats-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }

.stat-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.5rem 1.25rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  box-shadow: 0 2px 16px rgba(10,36,99,0.06);
  transition: transform 0.2s, box-shadow 0.2s;
}
.stat-card:hover { transform: translateY(-4px); box-shadow: 0 8px 28px rgba(10,36,99,0.12); }
.stat-icon-top { font-size: 1.6rem; margin-bottom: 0.3rem; }
.stat-num {
  font-size: 1.65rem;
  font-weight: 700;
  font-family: 'Merriweather', serif;
  color: var(--navy);
  line-height: 1.1;
}
.stat-label {
  font-size: 0.68rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 600;
}

/* ═══════════════════════════════════════
   SERVICES
═══════════════════════════════════════ */
.services-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.25rem; }

.service-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.75rem 1.5rem;
  transition: all 0.22s;
  position: relative;
  overflow: hidden;
}
.service-card::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--navy), var(--red));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.28s ease;
}
.service-card:hover::after { transform: scaleX(1); }
.service-card:hover {
  box-shadow: 0 10px 32px rgba(10,36,99,0.1);
  transform: translateY(-4px);
  border-color: transparent;
}
.service-icon { font-size: 2.2rem; margin-bottom: 1rem; display: block; }
.service-card h3 { color: var(--navy); margin-bottom: 0.5rem; font-size: 1rem; }
.service-card p { color: var(--muted); font-size: 0.88rem; line-height: 1.65; }

/* ═══════════════════════════════════════
   OFFICIALS
═══════════════════════════════════════ */
.officials-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.25rem; }

.official-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.75rem 1.5rem;
  text-align: center;
  transition: box-shadow 0.2s, transform 0.2s;
}
.official-card:hover { box-shadow: 0 8px 28px rgba(10,36,99,0.1); transform: translateY(-3px); }
.official-card.featured {
  border-color: var(--red);
  background: linear-gradient(160deg, #fff8f8, #fff);
}
.official-photo.placeholder {
  width: 76px;
  height: 76px;
  border-radius: 50%;
  background: var(--blue-light);
  border: 3px solid var(--red);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  margin: 0 auto 1rem;
}
.official-card h3 { color: var(--navy); font-size: 0.95rem; margin-bottom: 0.3rem; }
.position { color: var(--red); font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.6px; }
.officials-note { text-align: center; color: var(--muted); font-size: 0.8rem; margin-top: 1.5rem; font-style: italic; }

/* ═══════════════════════════════════════
   NEWS
═══════════════════════════════════════ */
.news-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.25rem; }

.news-card {
  background: var(--white);
  border-radius: 14px;
  padding: 1.75rem;
  border: 1px solid var(--border);
  box-shadow: 0 2px 12px rgba(10,36,99,0.05);
  transition: transform 0.2s, box-shadow 0.2s;
  position: relative;
  overflow: hidden;
}
.news-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 4px; height: 100%;
  background: var(--red);
  border-radius: 4px 0 0 4px;
}
.news-card:hover { transform: translateY(-4px); box-shadow: 0 10px 30px rgba(10,36,99,0.1); }
.news-date { font-size: 0.7rem; color: var(--red); font-weight: 700; text-transform: uppercase; letter-spacing: 1.2px; }
.news-card h3 { color: var(--navy); margin: 0.5rem 0; font-size: 0.97rem; line-height: 1.4; }
.news-card p { color: var(--muted); font-size: 0.87rem; line-height: 1.65; }

/* ═══════════════════════════════════════
   CONTACT
═══════════════════════════════════════ */
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 2.5rem; align-items: start; }

.contact-item { display: flex; gap: 1rem; margin-bottom: 1.25rem; align-items: flex-start; }
.contact-icon { font-size: 1.25rem; flex-shrink: 0; margin-top: 2px; }
.contact-item strong { display: block; color: var(--navy); margin-bottom: 0.15rem; font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.5px; }
.contact-item p { color: var(--muted); font-size: 0.9rem; }

.map-container { border-radius: 14px; overflow: hidden; border: 1px solid var(--border); box-shadow: 0 4px 20px rgba(10,36,99,0.08); }

/* ═══════════════════════════════════════
   FOOTER
═══════════════════════════════════════ */
footer {
  background: var(--navy-dark);
  color: var(--white);
  padding: 3.5rem 0 0;
  border-top: 3px solid var(--red);
}

.footer-inner {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 3rem;
  padding-bottom: 3rem;
  align-items: start;
}

.footer-brand { display: flex; flex-direction: column; gap: 0.75rem; }
.footer-brand img {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.2);
  object-fit: cover;
}
.footer-brand h3 { font-size: 1rem; color: var(--white); margin: 0; }
.footer-brand p { font-size: 0.82rem; color: rgba(255,255,255,0.45); line-height: 1.7; max-width: 280px; }

.footer-col h4 {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: rgba(255,255,255,0.4);
  margin-bottom: 1rem;
  font-family: 'Open Sans', sans-serif;
}

footer p { font-size: 0.85rem; color: rgba(255,255,255,0.6); }
footer strong { color: var(--white); }

.footer-contact p {
  font-size: 0.84rem;
  color: rgba(255,255,255,0.6);
  margin-bottom: 0.6rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.07);
  padding: 1.25rem 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
}
.footer-bottom p { font-size: 0.76rem; color: rgba(255,255,255,0.3); margin: 0; }

.footer-fb {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: #1877f2;
  color: var(--white);
  padding: 0.45rem 1rem;
  border-radius: 6px;
  font-size: 0.82rem;
  font-weight: 600;
  transition: background 0.2s;
}
.footer-fb:hover { background: #1565d8; }

.fb-link { color: #5b9cf6; font-weight: 600; text-decoration: underline; }
.fb-link:hover { color: #93bbf8; }
.fb-meta { font-size: 0.76rem; color: rgba(255,255,255,0.3); margin-top: 0.1rem; }

/* ═══════════════════════════════════════
   RESPONSIVE
═══════════════════════════════════════ */
@media (max-width: 900px) {
  .services-grid { grid-template-columns: 1fr 1fr; }
  .officials-grid { grid-template-columns: 1fr 1fr; }
  .news-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 768px) {
  .nav-toggle { display: flex; }
  .top-bar-right { display: none; }

  nav {
    display: none;
    flex-direction: column;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--navy);
    padding: 0.5rem 1rem 1.25rem;
    border-top: 2px solid var(--red);
    box-shadow: 0 12px 30px rgba(0,0,0,0.4);
    gap: 2px;
    z-index: 199;
  }

  nav.open { display: flex; }

  .nav-link {
    padding: 0.75rem 1rem;
    border-radius: 8px;
    font-size: 0.84rem;
    width: 100%;
  }
  .nav-link::after { display: none; }
  .nav-link:hover,
  .nav-link.active { background: rgba(255,255,255,0.07); color: var(--white); }

  .nav-cta {
    margin-left: 0;
    margin-top: 0.5rem;
    text-align: center;
    display: block;
  }

  header { position: relative; }

  .about-grid,
  .contact-grid { grid-template-columns: 1fr; gap: 2rem; }

  .services-grid,
  .officials-grid,
  .news-grid { grid-template-columns: 1fr 1fr; }

  .footer-inner { grid-template-columns: 1fr; gap: 2rem; }
  .footer-bottom { flex-direction: column; text-align: center; }
}

@media (max-width: 480px) {
  .services-grid,
  .officials-grid,
  .news-grid { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
}

/* ═══════════════════════════════════════
   PAGE LOADER
═══════════════════════════════════════ */
#page-loader {
  position: fixed;
  inset: 0;
  background: linear-gradient(135deg, #071a4a 0%, #0a2463 50%, #7b0000 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  gap: 1.25rem;
  transition: opacity 0.5s ease, visibility 0.5s ease;
}
#page-loader.hide { opacity: 0; visibility: hidden; pointer-events: none; }
#page-loader img {
  width: 80px; height: 80px;
  border-radius: 50%;
  border: 3px solid rgba(255,255,255,0.25);
  box-shadow: 0 0 0 8px rgba(214,40,40,0.15);
  animation: loaderPulse 1.6s ease-in-out infinite;
}
@keyframes loaderPulse {
  0%, 100% { box-shadow: 0 0 0 8px rgba(214,40,40,0.15); }
  50% { box-shadow: 0 0 0 16px rgba(214,40,40,0.05); }
}
.loader-text {
  color: rgba(255,255,255,0.9);
  font-family: 'Merriweather', serif;
  font-size: 0.95rem;
  font-weight: 700;
}
.loader-sub {
  color: rgba(255,255,255,0.4);
  font-size: 0.68rem;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  margin-top: -0.75rem;
}
.loader-bar {
  width: 140px; height: 2px;
  background: rgba(255,255,255,0.08);
  border-radius: 10px;
  overflow: hidden;
}
.loader-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--red), #ff6b6b);
  border-radius: 10px;
  animation: loaderBar 1.8s ease-in-out infinite;
}
@keyframes loaderBar {
  0% { width: 0%; margin-left: 0; }
  50% { width: 70%; margin-left: 0; }
  100% { width: 0%; margin-left: 100%; }
}

/* ═══════════════════════════════════════
   PAGE HERO (inner pages)
═══════════════════════════════════════ */
.page-hero {
  background: linear-gradient(135deg, var(--navy-dark) 0%, var(--navy) 60%, #0a2463 100%);
  color: var(--white);
  text-align: center;
  padding: 5rem 1.5rem 4.5rem;
  position: relative;
  overflow: hidden;
}
.page-hero::before {
  content: '';
  position: absolute;
  top: -80px; right: -80px;
  width: 350px; height: 350px;
  background: radial-gradient(circle, rgba(214,40,40,0.2) 0%, transparent 70%);
  pointer-events: none;
}
.page-hero::after {
  content: '';
  position: absolute;
  bottom: -2px; left: 0; right: 0;
  height: 60px;
  background: var(--white);
  clip-path: ellipse(55% 100% at 50% 100%);
}
.page-hero-logo {
  width: 80px; height: 80px;
  border-radius: 50%;
  border: 3px solid rgba(255,255,255,0.5);
  box-shadow: 0 0 0 6px rgba(214,40,40,0.2), 0 8px 30px rgba(0,0,0,0.3);
  object-fit: cover;
  margin: 0 auto 1.25rem;
  display: block;
}
.page-hero-icon {
  font-size: 2.5rem;
  margin-bottom: 1rem;
  display: block;
}
.page-hero h2 {
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  margin-bottom: 0.75rem;
  position: relative;
  display: inline-block;
}
.page-hero h2::after {
  content: '';
  display: block;
  width: 48px; height: 3px;
  background: var(--red);
  border-radius: 2px;
  margin: 0.6rem auto 0;
}
.page-hero p {
  color: rgba(255,255,255,0.7);
  font-size: 1rem;
  max-width: 500px;
  margin: 0 auto;
  position: relative;
}
.page-hero--red {
  background: linear-gradient(135deg, #7b0000 0%, var(--red) 60%, #a81c1c 100%);
}

/* ═══════════════════════════════════════
   BARANGAY GRID
═══════════════════════════════════════ */
.barangay-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.25rem; }
.barangay-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.5rem;
  transition: box-shadow 0.2s, transform 0.2s;
}
.barangay-card:hover { box-shadow: 0 8px 24px rgba(10,36,99,0.1); transform: translateY(-3px); }
.barangay-icon { font-size: 1.75rem; margin-bottom: 0.6rem; }
.barangay-card h3 { color: var(--navy); font-size: 1rem; margin-bottom: 0.4rem; }
.barangay-card p { font-size: 0.84rem; color: var(--muted); margin-bottom: 0.2rem; }

/* ═══════════════════════════════════════
   EVENTS
═══════════════════════════════════════ */
.events-list { display: flex; flex-direction: column; gap: 1rem; }
.event-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.25rem 1.5rem;
  display: flex;
  gap: 1.5rem;
  align-items: flex-start;
  transition: box-shadow 0.2s, transform 0.2s;
}
.event-card:hover { box-shadow: 0 6px 20px rgba(10,36,99,0.08); transform: translateY(-2px); }
.event-date-box {
  background: var(--navy);
  color: var(--white);
  border-radius: 10px;
  padding: 0.75rem 1rem;
  text-align: center;
  min-width: 68px;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  flex-shrink: 0;
}
.event-month { font-size: 0.65rem; color: rgba(255,255,255,0.6); font-weight: 700; letter-spacing: 1px; text-transform: uppercase; }
.event-day { font-size: 1.8rem; font-weight: 700; font-family: 'Merriweather', serif; line-height: 1; }
.event-year { font-size: 0.65rem; color: rgba(255,255,255,0.5); }
.event-info h3 { color: var(--navy); margin-bottom: 0.4rem; font-size: 1rem; }
.event-meta { font-size: 0.84rem; color: var(--muted); margin-bottom: 0.2rem; }

/* ═══════════════════════════════════════
   FORMS PAGE
═══════════════════════════════════════ */
.filter-bar { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 1.75rem; }
.filter-btn {
  padding: 0.4rem 1.1rem;
  border: 1.5px solid var(--border);
  background: var(--white);
  color: var(--muted);
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.18s;
}
.filter-btn.active, .filter-btn:hover { background: var(--navy); color: var(--white); border-color: var(--navy); }

.forms-grid { display: flex; flex-direction: column; gap: 0.75rem; }
.form-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  transition: box-shadow 0.2s, transform 0.2s;
}
.form-card:hover { box-shadow: 0 4px 16px rgba(10,36,99,0.08); transform: translateY(-1px); }
.form-icon { font-size: 1.75rem; flex-shrink: 0; }
.form-info { flex: 1; }
.form-info h3 { color: var(--navy); font-size: 0.95rem; margin-bottom: 0.2rem; }
.form-info p { font-size: 0.84rem; color: var(--muted); }
.form-category {
  display: inline-block;
  background: var(--blue-light);
  color: var(--navy);
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.15rem 0.6rem;
  border-radius: 10px;
  margin-top: 0.3rem;
  letter-spacing: 0.3px;
}
.btn-download {
  background: var(--navy);
  color: var(--white);
  padding: 0.45rem 1.1rem;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 600;
  white-space: nowrap;
  transition: background 0.2s;
}
.btn-download:hover { background: var(--red); }

/* ═══════════════════════════════════════
   EMERGENCY
═══════════════════════════════════════ */
.emergency-banner {
  background: linear-gradient(135deg, #7b0000, var(--red));
  color: var(--white);
  border-radius: 14px;
  padding: 1.75rem 2rem;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  margin-bottom: 2rem;
  font-size: 1rem;
  font-weight: 600;
  box-shadow: 0 8px 30px rgba(214,40,40,0.3);
}
.emergency-num { font-size: 2.5rem; font-family: 'Merriweather', serif; font-weight: 700; color: #ffd700; }
.hotlines-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; }
.hotline-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  transition: box-shadow 0.2s, transform 0.2s;
}
.hotline-card:hover { box-shadow: 0 6px 20px rgba(10,36,99,0.08); transform: translateY(-2px); }
.hotline-icon { font-size: 2rem; flex-shrink: 0; }
.hotline-info { flex: 1; }
.hotline-info h3 { color: var(--navy); font-size: 0.95rem; margin-bottom: 0.2rem; }
.hotline-cat { font-size: 0.72rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.5px; }
.hotline-num {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--navy);
  white-space: nowrap;
  padding: 0.4rem 0.85rem;
  border: 2px solid var(--border);
  border-radius: 8px;
  transition: all 0.2s;
}
.hotline-num:hover { background: var(--navy); color: var(--white); border-color: var(--navy); }

/* ═══════════════════════════════════════
   HISTORY
═══════════════════════════════════════ */
.heritage-highlight {
  background: linear-gradient(135deg, var(--navy-dark) 0%, var(--navy) 60%, #0a2463 100%);
  color: var(--white);
  border-radius: 14px;
  padding: 2rem 2.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 2rem;
  margin-bottom: 2.5rem;
  border-left: 4px solid var(--red);
  box-shadow: 0 8px 32px rgba(10,36,99,0.2);
}
.heritage-text h3 { color: var(--white); margin-bottom: 0.75rem; }
.heritage-text p { color: rgba(255,255,255,0.75); font-size: 0.95rem; line-height: 1.75; }
.heritage-badge { text-align: center; flex-shrink: 0; display: flex; flex-direction: column; gap: 0.25rem; }
.heritage-year { font-size: 3rem; font-weight: 700; font-family: 'Merriweather', serif; color: var(--red); line-height: 1; }
.heritage-badge span:last-child { font-size: 0.78rem; color: rgba(255,255,255,0.5); }

.history-list { display: flex; flex-direction: column; gap: 2rem; }
.history-item { display: flex; gap: 1.5rem; align-items: flex-start; }
.history-img { width: 200px; height: 140px; object-fit: cover; border-radius: 10px; flex-shrink: 0; }
.history-year {
  display: inline-block;
  background: var(--red-light);
  color: var(--red);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.2rem 0.65rem;
  border-radius: 6px;
  margin-bottom: 0.5rem;
}
.history-content h3 { color: var(--navy); margin-bottom: 0.5rem; }
.history-content p { color: var(--muted); font-size: 0.93rem; line-height: 1.75; }

/* ═══════════════════════════════════════
   FEEDBACK FORM
═══════════════════════════════════════ */
.feedback-wrap { max-width: 700px; margin: 0 auto; }
.feedback-form {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 2.5rem;
  box-shadow: 0 4px 24px rgba(10,36,99,0.06);
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.form-group { margin-bottom: 1.25rem; }
.form-group label { display: block; font-weight: 600; font-size: 0.84rem; color: var(--navy); margin-bottom: 0.4rem; }
.form-group input, .form-group textarea, .form-group select {
  width: 100%;
  padding: 0.65rem 0.9rem;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-family: 'Open Sans', sans-serif;
  font-size: 0.9rem;
  transition: border-color 0.2s, box-shadow 0.2s;
  background: var(--white);
  color: var(--text);
}
.form-group input:focus, .form-group textarea:focus, .form-group select:focus {
  outline: none;
  border-color: var(--navy);
  box-shadow: 0 0 0 3px rgba(10,36,99,0.08);
}
.optional { color: var(--muted); font-weight: 400; }
.required { color: var(--red); }
.success { color: #16a34a; font-weight: 600; margin-top: 1rem; }
.error { color: var(--red); font-weight: 600; margin-top: 0.5rem; }
.loading { color: var(--muted); font-style: italic; }
.empty { color: var(--muted); font-style: italic; text-align: center; padding: 2.5rem; }

/* ═══════════════════════════════════════
   ADMIN LAYOUT
═══════════════════════════════════════ */
.admin-body {
  background: #0c0f1a;
  min-height: 100vh;
  font-family: 'Inter', 'Open Sans', sans-serif;
}
.admin-layout { display: flex; min-height: 100vh; }

.admin-sidebar {
  width: 248px;
  background: #111827;
  color: var(--white);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  border-right: 1px solid rgba(255,255,255,0.06);
}

.admin-logo {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 1.5rem 1.25rem 1.25rem;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.admin-logo img {
  width: 36px; height: 36px;
  border-radius: 50%;
  border: 2px solid rgba(214,40,40,0.5);
}
.admin-logo-text { display: flex; flex-direction: column; }
.admin-logo-text span:first-child {
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--white);
  letter-spacing: 0.3px;
}
.admin-logo-text span:last-child {
  font-size: 0.68rem;
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-top: 1px;
}

.admin-nav { display: flex; flex-direction: column; padding: 1rem 0.75rem; flex: 1; gap: 2px; }
.admin-nav-section {
  font-size: 0.62rem;
  font-weight: 700;
  color: rgba(200,168,75,0.5);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  padding: 0.75rem 0.5rem 0.35rem;
  margin-top: 0.25rem;
}
.admin-nav a {
  color: rgba(255,255,255,0.6);
  padding: 0.6rem 0.85rem;
  font-size: 0.83rem;
  font-weight: 500;
  transition: all 0.18s;
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  letter-spacing: 0.1px;
}
.admin-nav a:hover {
  background: rgba(255,255,255,0.07);
  color: var(--white);
}
.admin-nav a.active {
  background: linear-gradient(90deg, rgba(200,168,75,0.18), rgba(200,168,75,0.06));
  color: var(--gold);
  font-weight: 600;
  box-shadow: inset 3px 0 0 var(--gold);
}
.admin-nav .signout {
  margin-top: auto;
  color: rgba(255,100,100,0.65);
  border-radius: 8px;
}
.admin-nav .signout:hover { color: #ff7b7b; background: rgba(255,80,80,0.1); }

.admin-main {
  flex: 1;
  padding: 2rem 2.25rem;
  overflow-y: auto;
  background: #0f1117;
}

.admin-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.75rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.admin-header h2 {
  color: var(--white);
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.3px;
}
.admin-header-actions { display: flex; gap: 0.5rem; align-items: center; }

.admin-card {
  background: #161b2e;
  border-radius: 14px;
  padding: 1.5rem;
  border: 1px solid rgba(255,255,255,0.05);
  box-shadow: 0 4px 24px rgba(0,0,0,0.3);
}
.admin-card h3 {
  color: var(--white);
  margin-bottom: 1.25rem;
  font-size: 0.95rem;
  font-weight: 600;
}

.admin-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }

.admin-stat-card {
  background: #161b2e;
  border-radius: 14px;
  padding: 1.4rem 1.25rem;
  border: 1px solid rgba(255,255,255,0.05);
  display: flex;
  align-items: center;
  gap: 1rem;
  transition: transform 0.2s, box-shadow 0.2s;
}
.admin-stat-card:hover { transform: translateY(-2px); box-shadow: 0 8px 28px rgba(0,0,0,0.3); }
.stat-icon-wrap {
  width: 46px; height: 46px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  flex-shrink: 0;
}
.stat-icon-wrap.c1 { background: rgba(99,102,241,0.15); }
.stat-icon-wrap.c2 { background: rgba(16,185,129,0.15); }
.stat-icon-wrap.c3 { background: rgba(245,158,11,0.15); }
.stat-icon-wrap.c4 { background: rgba(239,68,68,0.15); }
.stat-icon-wrap.c5 { background: rgba(59,130,246,0.15); }
.stat-icon-wrap.c6 { background: rgba(168,85,247,0.15); }
.stat-text { display: flex; flex-direction: column; gap: 2px; }
.stat-count {
  font-size: 1.7rem;
  font-weight: 700;
  font-family: 'Merriweather', serif;
  color: var(--white);
  line-height: 1;
}
.stat-name {
  font-size: 0.72rem;
  color: rgba(255,255,255,0.4);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  font-weight: 600;
}

/* ===== ADMIN TABLE ===== */
.admin-table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
.admin-table th {
  background: rgba(255,255,255,0.04);
  color: rgba(255,255,255,0.5);
  font-weight: 600;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  padding: 0.75rem 1rem;
  text-align: left;
  border-bottom: 1px solid rgba(255,255,255,0.07);
}
.admin-table td {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  color: rgba(255,255,255,0.8);
  vertical-align: middle;
}
.admin-table tr:last-child td { border-bottom: none; }
.admin-table tr:hover td { background: rgba(255,255,255,0.03); }
.row-unread td { color: var(--white); font-weight: 600; }

.btn-sm {
  padding: 0.38rem 0.85rem;
  background: rgba(200,168,75,0.15);
  color: var(--gold);
  border: 1px solid rgba(200,168,75,0.3);
  border-radius: 6px;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.18s;
  white-space: nowrap;
}
.btn-sm:hover {
  background: var(--gold);
  color: #0d1b2a;
  border-color: var(--gold);
}
.btn-sm.btn-danger {
  background: rgba(239,68,68,0.12);
  color: #f87171;
  border-color: rgba(239,68,68,0.25);
}
.btn-sm.btn-danger:hover { background: #ef4444; color: var(--white); border-color: #ef4444; }

.btn-outline {
  padding: 0.5rem 1.25rem;
  background: transparent;
  border: 1px solid rgba(255,255,255,0.2);
  color: rgba(255,255,255,0.7);
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.18s;
}
.btn-outline:hover { background: rgba(255,255,255,0.08); color: var(--white); border-color: rgba(255,255,255,0.35); }

.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.65rem;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.3px;
}
.badge-red { background: rgba(239,68,68,0.15); color: #f87171; }
.badge-green { background: rgba(16,185,129,0.15); color: #34d399; }

/* ===== MODAL ===== */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999;
  padding: 1rem;
}
.modal.hidden { display: none; }
.modal-box {
  background: #1a1f2e;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 16px;
  padding: 2rem;
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 25px 80px rgba(0,0,0,0.6);
}
.modal-box h3 { color: var(--white); margin-bottom: 1.5rem; font-size: 1.1rem; }
.modal-actions { display: flex; gap: 0.75rem; justify-content: flex-end; margin-top: 1.5rem; padding-top: 1rem; border-top: 1px solid rgba(255,255,255,0.07); }

/* Dark form inputs inside admin */
.admin-body .form-group label { color: rgba(255,255,255,0.7); }
.admin-body .form-group input,
.admin-body .form-group textarea,
.admin-body .form-group select {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.12);
  color: var(--white);
  border-radius: 8px;
}
.admin-body .form-group input::placeholder,
.admin-body .form-group textarea::placeholder { color: rgba(255,255,255,0.25); }
.admin-body .form-group input:focus,
.admin-body .form-group textarea:focus,
.admin-body .form-group select:focus {
  outline: none;
  border-color: var(--gold);
  background: rgba(200,168,75,0.05);
}
.admin-body .form-group select option { background: #1a1f2e; color: var(--white); }
.admin-body .btn {
  display: inline-block;
  background: linear-gradient(135deg, var(--gold), #e0b84e);
  color: #0d1b2a;
  padding: 0.6rem 1.5rem;
  border-radius: 8px;
  font-weight: 700;
  font-size: 0.88rem;
  border: none;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.2s;
}
.admin-body .btn:hover { opacity: 0.9; transform: translateY(-1px); }

/* ===== LOGIN ===== */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #0d1b2a 0%, #0f1117 50%, #1a2e45 100%);
  position: relative;
  overflow: hidden;
}
.login-wrap::before {
  content: '';
  position: absolute;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(200,168,75,0.08) 0%, transparent 70%);
  top: -100px;
  right: -100px;
  pointer-events: none;
}
.login-card {
  background: #1a1f2e;
  border: 1px solid rgba(200,168,75,0.2);
  border-radius: 20px;
  padding: 2.75rem 2.5rem;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 30px 80px rgba(0,0,0,0.5);
  text-align: center;
  position: relative;
}
.login-seal {
  width: 76px;
  height: 76px;
  border-radius: 50%;
  border: 3px solid var(--gold);
  box-shadow: 0 0 0 6px rgba(200,168,75,0.12), 0 8px 24px rgba(0,0,0,0.3);
  margin-bottom: 1.25rem;
}
.login-card h2 { color: var(--white); margin-bottom: 0.3rem; font-size: 1.5rem; }
.login-sub { color: rgba(255,255,255,0.45); font-size: 0.85rem; margin-bottom: 2rem; }
.login-card .form-group { text-align: left; }
.login-card .btn {
  width: 100%;
  background: linear-gradient(135deg, var(--gold), #e0b84e);
  color: #0d1b2a;
  font-weight: 700;
  border: none;
  cursor: pointer;
  padding: 0.8rem;
  font-size: 0.95rem;
  border-radius: 8px;
  transition: opacity 0.2s, transform 0.2s;
}
.login-card .btn:hover { opacity: 0.9; transform: translateY(-1px); }

/* ===== AI CHATBOT ===== */
#chat-widget {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 9000;
  font-family: 'Open Sans', sans-serif;
}
#chat-toggle {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--navy), var(--red));
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  box-shadow: 0 4px 20px rgba(10,36,99,0.4);
  transition: transform 0.2s, box-shadow 0.2s;
  margin-left: auto;
}
#chat-toggle:hover { transform: scale(1.08); box-shadow: 0 8px 28px rgba(10,36,99,0.5); }
#chat-box {
  width: 320px;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 12px 50px rgba(10,36,99,0.2);
  overflow: hidden;
  margin-bottom: 0.75rem;
  display: none;
  flex-direction: column;
  max-height: 460px;
}
#chat-box.open { display: flex; }
#chat-head {
  background: linear-gradient(135deg, var(--navy), #1a3a7c);
  color: #fff;
  padding: 0.85rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  border-bottom: 2px solid var(--red);
}
#chat-head .chat-avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: rgba(255,255,255,0.15);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}
#chat-head .chat-title { font-size: 0.88rem; font-weight: 700; }
#chat-head .chat-sub { font-size: 0.68rem; color: rgba(255,255,255,0.6); }
#chat-head .chat-close {
  margin-left: auto;
  background: none;
  border: none;
  color: rgba(255,255,255,0.6);
  cursor: pointer;
  font-size: 1.1rem;
  line-height: 1;
  padding: 0.2rem;
}
#chat-head .chat-close:hover { color: #fff; }
#chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  background: #f4f6fb;
}
.chat-msg {
  max-width: 82%;
  padding: 0.55rem 0.85rem;
  border-radius: 12px;
  font-size: 0.83rem;
  line-height: 1.55;
  word-break: break-word;
}
.chat-msg.bot {
  background: #fff;
  color: var(--text);
  border-bottom-left-radius: 4px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
  align-self: flex-start;
}
.chat-msg.user {
  background: var(--navy);
  color: #fff;
  border-bottom-right-radius: 4px;
  align-self: flex-end;
}
.chat-msg.typing { color: var(--muted); font-style: italic; }
#chat-input-row {
  display: flex;
  gap: 0.5rem;
  padding: 0.75rem;
  background: #fff;
  border-top: 1px solid #e8eef8;
}
#chat-input {
  flex: 1;
  border: 1px solid #dde3f0;
  border-radius: 20px;
  padding: 0.45rem 0.9rem;
  font-size: 0.83rem;
  font-family: 'Open Sans', sans-serif;
  outline: none;
  transition: border-color 0.2s;
}
#chat-input:focus { border-color: var(--navy); }
#chat-send {
  background: var(--navy);
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 34px; height: 34px;
  cursor: pointer;
  font-size: 1rem;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: background 0.2s;
}
#chat-send:hover { background: var(--red); }
@media (max-width: 480px) {
  #chat-box { width: calc(100vw - 3rem); }
  #chat-widget { bottom: 1rem; right: 1rem; }
}

/* ===== RESPONSIVE ADDITIONS ===== */
@media (max-width: 768px) {
  .barangay-grid, .hotlines-grid { grid-template-columns: 1fr 1fr; }
  .admin-stats { grid-template-columns: 1fr 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .heritage-highlight { flex-direction: column; text-align: center; }
  .history-item { flex-direction: column; }
  .history-img { width: 100%; }
  .admin-sidebar { width: 220px; }
}

@media (max-width: 480px) {
  .barangay-grid, .hotlines-grid { grid-template-columns: 1fr; }
  .admin-stats { grid-template-columns: 1fr 1fr; }
  .admin-layout { flex-direction: column; }
  .admin-sidebar { width: 100%; height: auto; position: relative; }
  .admin-nav { flex-direction: row; flex-wrap: wrap; padding: 0.5rem; gap: 2px; }
  .admin-nav a { padding: 0.4rem 0.65rem; font-size: 0.78rem; border-radius: 6px; box-shadow: none; }
  .admin-nav a.active { box-shadow: none; }
  .admin-main { padding: 1.25rem; }
  .event-card { flex-direction: column; }
}
