:root {
  --brgy-primary:   #1a3a6b;
  --brgy-secondary: #2d6a4f;
  --brgy-accent:    #f4a12a;
  --sidebar-bg:     #1a2742;
  --sidebar-hover:  #253659;
  --admin-sidebar:  #12213a;
}

/* ── Reset & Base ── */
*, *::before, *::after { box-sizing: border-box; }
body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: #f4f6fb;
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ── Navbar ── */
.brgy-navbar {
  background: linear-gradient(90deg, #1a3a6b 0%, #1e4080 100%) !important;
  padding-top: .6rem;
  padding-bottom: .6rem;
}
.brgy-navbar .navbar-brand { gap: .6rem; }
.brgy-navbar .nav-link { color: rgba(255,255,255,.85) !important; transition: color .2s; padding: .4rem .75rem !important; }
.brgy-navbar .nav-link:hover { color: var(--brgy-accent) !important; }
.brgy-navbar .navbar-toggler { border-color: rgba(255,255,255,.3); }
.brgy-navbar .navbar-toggler-icon { filter: invert(1); }

/* ── Hero Section ── */
.hero-section {
  background: linear-gradient(135deg, #1a3a6b 0%, #1e4a9e 50%, #2d55a0 100%);
  position: relative;
  overflow: hidden;
  padding: 4rem 0;
}
.hero-section::before {
  content: '';
  position: absolute; inset: 0; pointer-events: none;
  background-image: radial-gradient(circle at 20% 80%, rgba(255,255,255,.04) 0%, transparent 60%),
                    radial-gradient(circle at 80% 20%, rgba(255,255,255,.04) 0%, transparent 60%);
}
.hero-section .container { position: relative; z-index: 1; }
.hero-seal {
  width: 170px; height: 170px;
  filter: drop-shadow(0 8px 24px rgba(0,0,0,.35));
  border-radius: 50%;
}
.letter-spacing { letter-spacing: 2px; }
.opacity-90 { opacity: .9; }

/* ── Service Cards (homepage) ── */
.service-card {
  background: #fff;
  transition: transform .25s, box-shadow .25s;
  border: 1px solid #e8ecf0;
}
.service-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 12px 32px rgba(0,0,0,.10) !important;
}
.service-icon {
  width: 72px; height: 72px; border-radius: 18px;
  display: inline-flex; align-items: center; justify-content: center;
  margin: 0 auto;
}
.announcement-card { border: 1px solid #e8ecf0 !important; transition: transform .2s; }
.announcement-card:hover { transform: translateY(-3px); }

/* ── Footer ── */
.brgy-footer { background: var(--brgy-primary); color: #fff; }
.brgy-footer .text-muted { color: rgba(255,255,255,.45) !important; }

/* ── Auth pages ── */
.auth-bg {
  background: linear-gradient(135deg, #1a3a6b 0%, #1e4a9e 100%);
  min-height: 100vh;
}

/* ── Sidebar Layout ── */
.sidebar-layout { overflow-x: hidden; }
#wrapper { min-height: 100vh; display: flex; }

/* Resident sidebar */
#sidebar {
  width: 255px;
  min-height: 100vh;
  background: var(--sidebar-bg);
  flex-shrink: 0;
  transition: width .3s ease, transform .3s ease;
  display: flex;
  flex-direction: column;
}
#sidebar.collapsed { width: 0; overflow: hidden; }

/* Admin sidebar */
.admin-sidebar { background: var(--admin-sidebar) !important; }

.sidebar-header { background: rgba(0,0,0,.25); }

.sidebar-user .avatar-circle {
  width: 48px; height: 48px;
  background: var(--brgy-accent);
  color: var(--brgy-primary);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 1.25rem;
  margin: 0 auto;
}

.sidebar-nav { padding: 6px 0; }
.sidebar-nav .nav-section {
  color: rgba(255,255,255,.32);
  font-size: .67rem;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  padding: 14px 14px 4px;
  font-weight: 600;
}
.sidebar-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 14px;
  border-radius: 8px;
  margin: 1px 6px;
  color: rgba(255,255,255,.72);
  text-decoration: none;
  font-size: .88rem;
  transition: background .18s, color .18s;
  white-space: nowrap;
}
.sidebar-link i { font-size: 1.05rem; min-width: 20px; }
.sidebar-link:hover  { background: var(--sidebar-hover); color: #fff; }
.sidebar-link.active {
  background: var(--brgy-accent);
  color: #1a2742;
  font-weight: 700;
}

/* ── Top Bar ── */
.top-bar {
  background: #fff;
  border-bottom: 1px solid #e8ecf0;
  min-height: 50px;
  flex-shrink: 0;
}
.admin-top-bar { background: #f8fafc; }

/* ── Page content area ── */
#page-content {
  flex: 1 1 0%;
  overflow-y: auto;
  max-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ── Stat Cards ── */
.stat-card { transition: transform .2s; }
.stat-card:hover { transform: translateY(-3px); }
.stat-icon {
  width: 58px; height: 58px;
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}

/* ── Announcement item (sidebar/dashboard) ── */
.announcement-item {
  background: #f8f9fa;
  border-left: 3px solid var(--brgy-accent);
  border-radius: 4px;
}

/* ── Avatars ── */
.avatar-sm {
  width: 34px; height: 34px;
  background: var(--brgy-primary); color: #fff;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: .8rem; font-weight: 700; flex-shrink: 0;
}
.avatar-circle-lg {
  width: 84px; height: 84px;
  background: linear-gradient(135deg, var(--brgy-primary), #2d55a0);
  color: #fff; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 2.2rem; font-weight: 700;
  margin: 0 auto;
}

/* ── Tables ── */
.table th {
  font-size: .79rem; text-transform: uppercase;
  letter-spacing: .5px; color: #6c757d; font-weight: 600;
}
.table td { font-size: .87rem; vertical-align: middle; }
.table-hover tbody tr:hover { background-color: rgba(13,110,253,.04); }

/* ── Cards ── */
.card { border: 1px solid rgba(0,0,0,.06) !important; }
.rounded-4 { border-radius: .75rem !important; }

/* ── Modals ── */
.modal-content { border: none !important; box-shadow: 0 16px 48px rgba(0,0,0,.18); }

/* ── Password strength indicator ── */
.password-strength { font-size: .74rem; min-height: 1rem; }

/* ── Cert type selection cards ── */
.cert-type-card .card,
.pay-method-card .card {
  transition: border-color .2s, background-color .2s;
  border-width: 2px !important;
}
.cert-type-card .card:hover,
.pay-method-card .card:hover {
  border-color: var(--brgy-primary) !important;
}

/* ── Badge variants ── */
.badge { font-weight: 500; letter-spacing: .3px; }

/* ── Responsive sidebar ── */
@media (max-width: 768px) {
  #sidebar {
    position: fixed;
    z-index: 1050;
    left: 0; top: 0; bottom: 0;
    transform: translateX(-100%);
    transition: transform .3s ease;
    width: 255px !important;
  }
  #sidebar.mobile-open { transform: translateX(0); }
  #page-content { max-height: 100vh; }
}

/* ── Utility ── */
.cursor-pointer { cursor: pointer; }
.fw-600 { font-weight: 600; }
.text-brgy { color: var(--brgy-primary) !important; }
.bg-brgy  { background: var(--brgy-primary) !important; }
