/* ============================================================
   CCCS HUTT VALLEY - Design system (admin + shared)
   Fonts: Playfair Display (headings) / Inter (body)
   Palette: ivory #FAF7F2, white cards, charcoal #232323,
   navy #1F3A5F primary, muted gold #C9A227 accent, border #E8E2D9
   ============================================================ */

:root {
  --ivory: #FAF7F2;
  --white: #FFFFFF;
  --charcoal: #232323;
  --navy: #1F3A5F;
  --navy-dark: #16293F;
  --navy-light: #2C4E7E;
  --gold: #C9A227;
  --gold-dark: #A8891F;
  --border: #E8E2D9;
  --muted: #6E6A63;
  --success: #2E7D4F;
  --danger: #B23A3A;
  --warning: #B8860B;
  --info: #33658A;
  --radius: 12px;
  --shadow: 0 2px 10px rgba(0, 0, 0, .06);
  --font-head: 'Playfair Display', Georgia, serif;
  --font-body: 'Inter', -apple-system, 'Segoe UI', sans-serif;
  --sidebar-w: 240px;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  font-family: var(--font-body);
  background: var(--ivory);
  color: var(--charcoal);
  font-size: 15px;
  line-height: 1.55;
}

h1, h2, h3, h4, h5, h6, .font-head {
  font-family: var(--font-head);
  color: var(--navy);
}

a { color: var(--navy); }
a:hover { color: var(--navy-light); }

img { max-width: 100%; }

/* ============================================================
   ADMIN LAYOUT - fixed navy sidebar + ivory content
   ============================================================ */

.admin-wrap { min-height: 100vh; }

.admin-sidebar {
  position: fixed;
  top: 0; left: 0; bottom: 0;
  width: var(--sidebar-w);
  background: var(--navy);
  color: #E9EEF5;
  display: flex;
  flex-direction: column;
  z-index: 1040;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 18px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, .12);
}

.sidebar-logo {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--white);
  object-fit: contain;
  padding: 2px;
  flex: 0 0 auto;
}

.sidebar-brand-text { display: flex; flex-direction: column; min-width: 0; }

.sidebar-brand-name {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 16px;
  color: var(--white);
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-brand-sub {
  font-size: 11px;
  letter-spacing: 2px;
  color: var(--gold);
  text-transform: uppercase;
}

.sidebar-nav {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 12px 0;
}

.sidebar-link {
  display: block;
  padding: 10px 18px;
  color: #C9D4E2;
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  border-left: 3px solid transparent;
  transition: background .15s, color .15s;
}

.sidebar-link:hover {
  background: rgba(255, 255, 255, .07);
  color: var(--white);
}

.sidebar-link.active {
  background: rgba(201, 162, 39, .15);
  border-left-color: var(--gold);
  color: var(--white);
}

.sidebar-footer {
  border-top: 1px solid rgba(255, 255, 255, .12);
  padding: 8px 0;
}

.sidebar-logout { color: #E5B8B8; }
.sidebar-logout:hover { color: #fff; }

/* thin navy scrollbar */
.sidebar-nav::-webkit-scrollbar { width: 8px; }
.sidebar-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,.18); border-radius: 4px; }

/* Main column sits right of the sidebar */
.admin-main {
  margin-left: var(--sidebar-w);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.admin-topbar {
  position: sticky;
  top: 0;
  z-index: 1030;
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--white);
  border-bottom: 1px solid var(--border);
  padding: 12px 24px;
}

.topbar-title {
  font-size: 22px;
  margin: 0;
  flex: 1 1 auto;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.topbar-user { display: flex; align-items: center; gap: 8px; }
.topbar-user-name { font-weight: 600; font-size: 14px; }

.lang-toggle {
  display: inline-block;
  padding: 4px 10px;
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1px;
  text-decoration: none;
  color: var(--navy);
  background: var(--ivory);
}
.lang-toggle:hover { background: var(--gold); border-color: var(--gold); color: var(--white); }

/* Hamburger - hidden on desktop */
.sidebar-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  padding: 8px;
  background: none;
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
}
.sidebar-toggle span {
  display: block;
  height: 2px;
  width: 100%;
  background: var(--navy);
}

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .4);
  z-index: 1035;
}

.admin-content {
  flex: 1 0 auto;
  padding: 24px;
  width: 100%;
  max-width: 1400px;
}

.admin-footer {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  padding: 14px 24px;
  font-size: 13px;
  color: var(--muted);
  border-top: 1px solid var(--border);
  background: var(--white);
}
.admin-footer a { color: var(--muted); text-decoration: none; }
.admin-footer a:hover { color: var(--navy); }

/* ============================================================
   CARDS + STAT CARDS
   ============================================================ */

.card-panel {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
  margin-bottom: 20px;
}

.card-panel > h2, .card-panel > h3 { margin-top: 0; }

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

.stat-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px 20px;
  border-top: 3px solid var(--navy);
}

.stat-card.gold { border-top-color: var(--gold); }
.stat-card.green { border-top-color: var(--success); }
.stat-card.red { border-top-color: var(--danger); }

.stat-card .stat-label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--muted);
  margin-bottom: 6px;
}

.stat-card .stat-value {
  font-family: var(--font-head);
  font-size: 28px;
  font-weight: 700;
  color: var(--navy);
}

.stat-card .stat-sub { font-size: 12px; color: var(--muted); margin-top: 4px; }

/* ============================================================
   BUTTONS
   ============================================================ */

.btn { border-radius: 8px; font-weight: 600; font-size: 14px; }

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

.btn-gold {
  background: var(--gold);
  border-color: var(--gold);
  color: var(--white);
}
.btn-gold:hover, .btn-gold:focus {
  background: var(--gold-dark);
  border-color: var(--gold-dark);
  color: var(--white);
}

.btn-outline-navy {
  background: transparent;
  border: 1px solid var(--navy);
  color: var(--navy);
}
.btn-outline-navy:hover, .btn-outline-navy:focus {
  background: var(--navy);
  color: var(--white);
}

.btn-outline-secondary {
  border: 1px solid var(--border);
  color: var(--charcoal);
  background: var(--white);
}
.btn-outline-secondary:hover { background: var(--ivory); color: var(--charcoal); }

.btn-danger-soft {
  background: transparent;
  border: 1px solid var(--danger);
  color: var(--danger);
}
.btn-danger-soft:hover { background: var(--danger); color: var(--white); }

/* ============================================================
   BADGES
   ============================================================ */

.badge { font-weight: 600; border-radius: 20px; padding: 4px 10px; font-size: 12px; }

.badge-success { background: #E3F1E9; color: var(--success); }
.badge-danger  { background: #F7E4E4; color: var(--danger); }
.badge-warning { background: #F6EFD9; color: var(--warning); }
.badge-info    { background: #E2EBF3; color: var(--info); }
.badge-muted   { background: #EEEAE3; color: var(--muted); }

/* donation batch statuses */
.badge-counted    { background: #F6EFD9; color: var(--warning); }
.badge-banked     { background: #E2EBF3; color: var(--info); }
.badge-reconciled { background: #E3F1E9; color: var(--success); }

/* role badges */
.role-badge { text-transform: capitalize; }
.role-pastor     { background: var(--navy); color: var(--white); }
.role-executive  { background: var(--gold); color: var(--white); }
.role-data_entry { background: #E2EBF3; color: var(--info); }
.role-member     { background: #E3F1E9; color: var(--success); }
.role-child      { background: #EEEAE3; color: var(--muted); }

/* ============================================================
   TABLES - hover, clickable rows, scroll-x on mobile
   ============================================================ */

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

.table-cccs {
  width: 100%;
  background: var(--white);
  border-collapse: collapse;
  font-size: 14px;
}

.table-cccs th {
  text-align: left;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--muted);
  border-bottom: 2px solid var(--border);
  padding: 10px 12px;
  white-space: nowrap;
}

.table-cccs td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.table-cccs tbody tr:hover { background: #F4EFE7; }

.table-cccs tr.row-link { cursor: pointer; }

.table-cccs .num, .table-cccs td.num, .table-cccs th.num { text-align: right; font-variant-numeric: tabular-nums; }

/* ============================================================
   FORMS
   ============================================================ */

.form-label { font-weight: 600; font-size: 13px; color: var(--charcoal); }

.form-control, .form-select {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 9px 12px;
  font-size: 14px;
  background: var(--white);
  color: var(--charcoal);
}

.form-control:focus, .form-select:focus {
  border-color: var(--navy);
  box-shadow: 0 0 0 3px rgba(31, 58, 95, .12);
  outline: none;
}

.form-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
  max-width: 720px;
}

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: flex-end;
  margin-bottom: 16px;
}
.filter-bar .form-control, .filter-bar .form-select { width: auto; }

/* ============================================================
   FLASH ALERTS
   ============================================================ */

.flash {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-radius: var(--radius);
  padding: 12px 16px;
  margin-bottom: 18px;
  font-size: 14px;
  font-weight: 500;
  border: 1px solid transparent;
  box-shadow: var(--shadow);
}

.flash-success { background: #E3F1E9; color: var(--success); border-color: #C4E2D1; }
.flash-error, .flash-danger { background: #F7E4E4; color: var(--danger); border-color: #EBC7C7; }
.flash-warning { background: #F6EFD9; color: var(--warning); border-color: #E9DCB4; }
.flash-info { background: #E2EBF3; color: var(--info); border-color: #C6D7E6; }

.flash-close {
  background: none;
  border: none;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  color: inherit;
  opacity: .6;
}
.flash-close:hover { opacity: 1; }

/* ============================================================
   PAGINATION
   ============================================================ */

.pagination-cccs {
  display: flex;
  gap: 6px;
  justify-content: center;
  margin: 18px 0;
  flex-wrap: wrap;
}

.pagination-cccs a, .pagination-cccs span {
  display: inline-block;
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--white);
  color: var(--navy);
  text-decoration: none;
  font-size: 14px;
}

.pagination-cccs span.current {
  background: var(--navy);
  border-color: var(--navy);
  color: var(--white);
}

.pagination-cccs a:hover { background: var(--ivory); }

/* ============================================================
   LOGIN / STANDALONE AUTH PAGES
   ============================================================ */

.auth-body {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: var(--ivory);
}

.auth-card {
  width: 100%;
  max-width: 420px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 36px 32px;
}

.auth-logo {
  display: block;
  width: 84px;
  height: 84px;
  margin: 0 auto 14px;
  border-radius: 50%;
  object-fit: contain;
  background: var(--white);
}

.auth-title {
  text-align: center;
  font-size: 24px;
  margin: 0 0 4px;
}

.auth-subtitle {
  text-align: center;
  color: var(--muted);
  font-size: 14px;
  margin-bottom: 24px;
}

.auth-card .form-control { width: 100%; }
.auth-card .btn { width: 100%; padding: 10px; }

.auth-links {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
  font-size: 13px;
}

.auth-error {
  background: #F7E4E4;
  color: var(--danger);
  border: 1px solid #EBC7C7;
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 14px;
  margin-bottom: 16px;
}

.auth-notice {
  background: #E3F1E9;
  color: var(--success);
  border: 1px solid #C4E2D1;
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 14px;
  margin-bottom: 16px;
}

/* ============================================================
   MISC
   ============================================================ */

.page-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.text-muted-cccs { color: var(--muted); }
.text-money { font-variant-numeric: tabular-nums; }
.mt-20 { margin-top: 20px; }

/* ============================================================
   RESPONSIVE - sidebar collapses to hamburger <= 1100px
   ============================================================ */

@media (max-width: 1100px) {
  .admin-sidebar {
    transform: translateX(-100%);
    transition: transform .25s ease;
  }

  body.sidebar-open .admin-sidebar { transform: translateX(0); }
  body.sidebar-open .sidebar-overlay { display: block; }

  .admin-main { margin-left: 0; }
  .sidebar-toggle { display: flex; }
  .topbar-user-name { display: none; }
}

@media (max-width: 600px) {
  .admin-content { padding: 16px 12px; }
  .topbar-title { font-size: 18px; }
  .auth-card { padding: 28px 20px; }
}

/* ============================================================
   PRINT - hide chrome, show only content
   ============================================================ */

@media print {
  .admin-sidebar, .admin-topbar, .admin-footer,
  .sidebar-overlay, .flash, .page-actions, .filter-bar,
  .no-print { display: none !important; }
  .admin-main { margin-left: 0; }
  .admin-content { padding: 0; max-width: none; }
  body { background: var(--white); }
}

/* ============================================================
   PUBLIC SITE (Agent C)
   Public navbar, hero, verse strip, sections, ministry cards,
   gallery, contact, subscribe band, footer, members + bible areas.
   ============================================================ */

.pub-body { background: var(--ivory); }

.pub-narrow { max-width: 820px; }

/* --- Public navbar --- */
.pub-nav {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.pub-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  position: relative;
  z-index: 2;
}

/* Floating brand logo: bigger circle with ivory ring that
   overlaps ~10px below the navbar's bottom edge (no height jump). */
.pub-brand-logo {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  object-fit: contain;
  background: var(--white);
  border: 3px solid #FAF7F2;
  padding: 2px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, .18);
  margin-bottom: -10px;
  transition: transform .18s ease;
}

.pub-brand:hover .pub-brand-logo { transform: scale(1.05); }

.pub-brand-text { display: flex; flex-direction: column; line-height: 1.15; }

.pub-brand-name {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 18px;
  color: var(--navy);
}

.pub-brand-sub {
  font-size: 11px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--gold);
}

.pub-link {
  color: var(--charcoal);
  font-weight: 500;
  font-size: 14px;
  padding: 8px 12px !important;
}

.pub-link:hover, .pub-link.active { color: var(--navy); }
.pub-link.active { border-bottom: 2px solid var(--gold); }

.pub-toggler { border-color: var(--border); }
.pub-toggler:focus { box-shadow: 0 0 0 3px rgba(31, 58, 95, .12); }

.pub-lang { padding: 4px 12px; white-space: nowrap; }

.pub-lang-opt {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--muted);
  text-decoration: none;
  padding: 2px 4px;
}

.pub-lang-opt:hover { color: var(--navy); }
.pub-lang-opt.current { color: var(--gold); }
.pub-lang-sep { color: var(--border); }

.pub-login-btn { padding: 7px 18px; font-weight: 700; }

.pub-flash-wrap { margin-top: 16px; }

/* --- Hero (no logo img - logo lives in the navbar) --- */
.pub-hero {
  background: var(--ivory);
  padding: 64px 0 72px;
  border-bottom: 1px solid var(--border);
}

.pub-hero-welcome {
  font-size: 14px;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 6px;
}

.pub-hero-title {
  font-size: 54px;
  font-weight: 800;
  color: var(--navy);
  margin-bottom: 6px;
}

.pub-hero-sm {
  font-family: var(--font-head);
  font-size: 20px;
  color: var(--gold-dark);
  margin-bottom: 14px;
}

.pub-founded-badge {
  display: inline-block;
  background: var(--navy);
  color: var(--white);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  border-radius: 20px;
  padding: 5px 16px;
}

.pub-hero-line { color: var(--charcoal); margin: 18px 0 26px; font-size: 16px; }

.pub-hero-cta { padding: 12px 34px; }

/* --- Verse of the day strip --- */
.pub-verse {
  background: var(--navy);
  color: #E9EEF5;
  padding: 34px 0;
}

.pub-verse-label {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 10px;
}

.pub-verse-text {
  font-family: var(--font-head);
  font-size: 22px;
  font-style: italic;
  color: var(--white);
  margin: 0 auto 8px;
  max-width: 760px;
}

.pub-verse-ref { font-style: normal; font-size: 14px; color: var(--gold); }

/* --- Sections --- */
.pub-section { padding: 72px 0; }

.pub-section-alt {
  background: var(--white);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.pub-heading {
  font-size: 34px;
  font-weight: 700;
  margin-bottom: 22px;
  position: relative;
}

.pub-heading::after {
  content: '';
  display: block;
  width: 56px;
  height: 3px;
  background: var(--gold);
  border-radius: 2px;
  margin: 12px auto 0;
}

.pub-section .pub-heading:not(.text-center) { text-align: center; }

.pub-subheading {
  font-size: 24px;
  margin: 26px 0 14px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--border);
}

.pub-lead { font-size: 17px; color: var(--charcoal); line-height: 1.75; }
.pub-lead-sm { font-size: 16px; color: var(--muted); }
.pub-note { color: var(--muted); }

.pub-pastor { margin-top: 20px; font-size: 16px; }
.pub-pastor-label {
  font-size: 12px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--muted);
  margin-right: 6px;
}

/* --- Service time cards --- */
.pub-service-card {
  background: var(--ivory);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border-top: 3px solid var(--gold);
  text-align: center;
  padding: 28px 20px;
  height: 100%;
}

.pub-section:not(.pub-section-alt) .pub-service-card { background: var(--white); }

.pub-service-card h3 { font-size: 20px; margin-bottom: 8px; }

.pub-service-time {
  font-size: 17px;
  font-weight: 600;
  color: var(--navy);
  margin-bottom: 0;
}

/* --- Ministry cards --- */
.pub-min-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 26px 22px;
  height: 100%;
}

.pub-min-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--ivory);
  border: 1px solid var(--border);
  color: var(--navy);
  margin-bottom: 14px;
}

.pub-min-card h3 { font-size: 19px; margin-bottom: 6px; }
.pub-min-card p { color: var(--muted); font-size: 14px; margin-bottom: 0; }

/* --- Announcement cards --- */
.pub-ann-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border-left: 3px solid var(--gold);
  padding: 20px 22px;
  height: 100%;
}

.pub-ann-card h3, .pub-ann-card h2 { font-size: 19px; margin: 6px 0 8px; }
.pub-ann-card p { color: var(--muted); font-size: 14px; margin-bottom: 0; }

.pub-ann-card-full p { color: var(--charcoal); font-size: 15px; }

.pub-ann-date {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--gold-dark);
}

/* --- Page head (inner public pages) --- */
.pub-page-head { padding: 60px 0 36px; }
.pub-page-head .pub-heading { margin-bottom: 8px; }

/* --- Gallery --- */
.pub-gallery-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.pub-gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.pub-gallery-item {
  display: block;
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  background: var(--white);
}

/* Bilingual caption overlay (DB-driven gallery) */
.pub-gallery-cap {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(31, 58, 95, .78);
  color: var(--white);
  font-size: 13px;
  line-height: 1.35;
  padding: 6px 12px;
  text-align: center;
}

.pub-gallery-item img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  display: block;
}

.pub-gallery-grid .pub-gallery-item img { height: 240px; }

.pub-gallery-item:hover img { opacity: .88; }

.pub-gal-modal {
  background: transparent;
  border: none;
  position: relative;
}

.pub-gal-modal img {
  width: 100%;
  border-radius: var(--radius);
  display: block;
}

.pub-gal-modal-cap {
  color: var(--white);
  text-align: center;
  font-size: 15px;
  margin: 10px 0 0;
  text-shadow: 0 1px 4px rgba(0, 0, 0, .5);
}

.pub-gal-close {
  position: absolute;
  top: -14px;
  right: -14px;
  background: var(--white);
  border-radius: 50%;
  padding: 10px;
  opacity: 1;
  box-shadow: var(--shadow);
  z-index: 5;
}

/* --- Contact --- */
.pub-contact-card {
  background: var(--ivory);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
  margin-bottom: 14px;
}

.pub-section:not(.pub-section-alt) .pub-contact-card { background: var(--white); }

.pub-contact-card h3 {
  font-size: 13px;
  font-family: var(--font-body);
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--gold-dark);
  margin-bottom: 4px;
}

.pub-contact-card p { margin-bottom: 0; font-size: 15px; }

.pub-contact-form {
  background: var(--ivory);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 26px;
}

.pub-section:not(.pub-section-alt) .pub-contact-form { background: var(--white); }

/* --- Subscribe band --- */
.pub-subscribe {
  background: var(--navy);
  color: #E9EEF5;
  padding: 64px 0;
}

.pub-subscribe .pub-heading { color: var(--white); }
.pub-subscribe .pub-lead-sm { color: #C9D4E2; }

.pub-subscribe-form {
  display: flex;
  gap: 10px;
  max-width: 640px;
  margin: 22px auto 0;
}

.pub-subscribe-form .form-control { flex: 1 1 auto; }

/* --- Footer --- */
.pub-footer {
  background: var(--navy-dark);
  color: #C9D4E2;
  padding: 56px 0 0;
  font-size: 14px;
}

.pub-footer-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }

.pub-footer-logo {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--white);
  padding: 2px;
  object-fit: contain;
}

.pub-footer-name {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 18px;
  color: var(--white);
}

.pub-footer-sub {
  font-size: 11px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--gold);
}

.pub-footer-line { margin-bottom: 6px; }

.pub-footer-heading {
  font-size: 14px;
  font-family: var(--font-body);
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 14px;
}

.pub-footer-links { list-style: none; padding: 0; margin: 0; }
.pub-footer-links li { margin-bottom: 8px; }

.pub-footer-links a,
.pub-footer-link {
  color: #C9D4E2;
  text-decoration: none;
}

.pub-footer-links a:hover,
.pub-footer-link:hover { color: var(--gold); }

.pub-fb { display: inline-flex; align-items: center; gap: 8px; }

.pub-footer-bottom {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  border-top: 1px solid rgba(255, 255, 255, .12);
  margin-top: 36px;
  padding: 18px 0;
  font-size: 13px;
  color: #9FB0C4;
}

.pub-credit { color: var(--gold); text-decoration: none; }
.pub-credit:hover { color: var(--white); }

/* --- Members area --- */
.pub-member-welcome {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 14px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border-top: 3px solid var(--gold);
  padding: 24px 26px;
  margin-bottom: 10px;
}

.pub-member-title { font-size: 26px; margin-bottom: 4px; }

.pub-member-side {
  display: flex;
  align-items: center;
  gap: 10px;
}

.pub-doc-group { padding: 18px 22px; }

.pub-doc-cat {
  font-size: 16px;
  margin-bottom: 10px;
  color: var(--navy);
}

.pub-doc-list { list-style: none; padding: 0; margin: 0; }

.pub-doc-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-top: 1px solid var(--border);
}

.pub-doc-info { display: flex; flex-direction: column; min-width: 0; }
.pub-doc-desc { font-size: 13px; color: var(--muted); }

/* --- Bible lessons (kid-friendly) --- */
.pub-bible-card {
  display: block;
  background: var(--white);
  border: 2px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 26px 24px;
  height: 100%;
  text-decoration: none;
  color: var(--charcoal);
}

.pub-bible-card:hover {
  border-color: var(--gold);
  color: var(--charcoal);
  box-shadow: 0 4px 16px rgba(0, 0, 0, .10);
}

.pub-bible-card h2 { font-size: 22px; margin: 10px 0 6px; }

.pub-bible-sm {
  font-family: var(--font-head);
  font-size: 16px;
  color: var(--gold-dark);
  margin-bottom: 10px;
}

.pub-scripture-badge {
  display: inline-block;
  background: #F6EFD9;
  color: var(--warning);
  font-size: 12px;
  font-weight: 700;
  border-radius: 20px;
  padding: 4px 12px;
}

.pub-age-badge {
  display: inline-block;
  background: #E2EBF3;
  color: var(--info);
  font-size: 12px;
  font-weight: 600;
  border-radius: 20px;
  padding: 3px 10px;
}

.pub-lesson-detail {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 32px;
  margin-top: 18px;
}

.pub-lesson-title { font-size: 32px; margin-bottom: 4px; }

.pub-lesson-title-sm {
  font-family: var(--font-head);
  font-size: 20px;
  color: var(--gold-dark);
  margin-bottom: 14px;
}

.pub-lesson-content { font-size: 17px; line-height: 1.8; margin-top: 18px; }

/* --- Public responsive --- */
@media (max-width: 991px) {
  .pub-gallery-strip { grid-template-columns: repeat(3, 1fr); }
  .pub-gallery-grid { grid-template-columns: repeat(2, 1fr); }
  .pub-link.active { border-bottom: none; }
  .pub-nav .navbar-nav { padding: 10px 0 14px; }
  .pub-brand-logo { width: 50px; height: 50px; margin-bottom: -6px; }
}

@media (max-width: 600px) {
  .pub-hero { padding: 44px 0 48px; }
  .pub-hero-title { font-size: 34px; }
  .pub-hero-sm { font-size: 16px; }
  .pub-heading { font-size: 26px; }
  .pub-section { padding: 52px 0; }
  .pub-verse-text { font-size: 18px; }
  .pub-gallery-strip { grid-template-columns: repeat(2, 1fr); }
  .pub-gallery-grid { grid-template-columns: 1fr; }
  .pub-subscribe-form { flex-direction: column; }
  .pub-member-welcome { flex-direction: column; }
  .pub-doc-item { flex-direction: column; align-items: flex-start; }
  .pub-lesson-detail { padding: 22px; }
}

/* ============================================================
   ADMIN EXTRAS (Agent B)
   Dashboard charts, account cards, donation grid/sheet,
   report tabs, settings layout.
   ============================================================ */

/* --- dashboard chart grid + fixed-height canvas boxes --- */
.chart-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 20px;
}

.chart-box {
  position: relative;
  height: 300px;
}

/* --- data_entry quick links --- */
.quick-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

/* --- dashboard announcement items --- */
.announce-item {
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.announce-item:last-child { border-bottom: none; }
.announce-item p { margin: 6px 0 0; font-size: 13px; }

/* --- bank account cards --- */
.account-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

.account-card {
  display: block;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px 20px;
  text-decoration: none;
  color: var(--charcoal);
  border-top: 3px solid var(--gold);
  transition: box-shadow .15s, transform .15s;
}
.account-card:hover {
  box-shadow: 0 4px 16px rgba(0, 0, 0, .10);
  transform: translateY(-2px);
  color: var(--charcoal);
}

.account-number {
  font-size: 13px;
  letter-spacing: 1px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.account-name {
  font-family: var(--font-head);
  font-weight: 700;
  color: var(--navy);
  font-size: 17px;
  margin: 4px 0;
}

.account-purpose {
  font-size: 12px;
  color: var(--muted);
  min-height: 34px;
}

.account-balance {
  font-family: var(--font-head);
  font-size: 24px;
  font-weight: 700;
  color: var(--navy);
  margin-top: 8px;
}

.account-meta { font-size: 12px; margin-top: 4px; }

/* --- donation entry grid --- */
.grid-table td { padding: 4px 12px; }
.grid-table .amt-input {
  max-width: 140px;
  margin-left: auto;
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.grid-table tfoot td {
  border-top: 2px solid var(--border);
  font-size: 16px;
  padding: 10px 12px;
}

/* --- batch detail "paper sheet" --- */
.sheet-panel { max-width: 760px; }
.sheet-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  border-bottom: 2px solid var(--border);
  padding-bottom: 12px;
  margin-bottom: 12px;
}
.sheet-head h2 { margin: 0 0 4px; }
.sheet-head p { margin: 0; }
.sheet-table tfoot td {
  border-top: 2px solid var(--border);
  font-size: 16px;
  padding: 10px 12px;
}

/* --- report tabs --- */
.report-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
}
.report-tab {
  display: inline-block;
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--white);
  color: var(--navy);
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
}
.report-tab:hover { background: var(--ivory); color: var(--navy); }
.report-tab.active {
  background: var(--navy);
  border-color: var(--navy);
  color: var(--white);
}

/* --- settings two-column layout --- */
.settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
  gap: 20px;
  align-items: start;
}

.badge-gold { background: #F6EFD9; color: var(--gold-dark); }
/* v4: Bank/Manual source badges on income & expenses lists */
.badge-navy { background: #1F3A5F; color: #fff; }

/* --- hero badge wrapper (integration fix) --- */
.pub-hero-badge { margin: 14px 0 6px; }

/* ===== ADMIN CMS (Agent D) ===== */

/* role badge for sysadmin */
.role-sysadmin { background: var(--gold-dark); color: var(--white); }

/* CMS tab nav (content.php) */
.cms-tab-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
}
.cms-tab {
  display: inline-block;
  padding: 8px 16px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--white);
  color: var(--navy);
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
}
.cms-tab:hover { background: var(--ivory); color: var(--navy); }
.cms-tab.active {
  background: var(--navy);
  border-color: var(--navy);
  color: var(--white);
}

/* content groups (texts tab) */
.cms-group h2 { text-transform: capitalize; }
.cms-field {
  border-top: 1px solid var(--border);
  padding: 14px 0 4px;
}
.cms-field-label {
  font-weight: 600;
  color: var(--navy);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.cms-key {
  font-size: 11px;
  font-weight: 400;
  color: var(--muted);
  background: var(--ivory);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 2px 6px;
}

/* verse day blocks */
.cms-verse-day {
  border-top: 1px solid var(--border);
  padding: 14px 0 4px;
}
.cms-verse-day h3 {
  font-size: 15px;
  color: var(--gold-dark);
  margin: 0 0 10px;
}

/* gallery admin grid */
.cms-gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
}
.cms-gallery-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 2px 10px rgba(0,0,0,.06);
  padding: 12px;
}
.cms-gallery-thumb {
  width: 100%;
  height: 160px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--border);
  margin-bottom: 10px;
  background: var(--ivory);
}
.cms-gallery-card .form-label { font-size: 12px; margin-bottom: 2px; }

@media print {
  .cms-tab-nav { display: none; }
}

/* ===== MIS TABS (Agent F) ===== */
/* Two-tab pill strip: Members Area / Operations (admin + public contexts) */
.mis-tabs-wrap {
  display: flex;
  justify-content: center;
  margin: 14px 16px 0;
}
.mis-tabs-admin {
  margin: 12px 24px 0;
}
.mis-tabs {
  display: inline-flex;
  gap: 6px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 5px;
  box-shadow: var(--shadow);
}
.mis-tab {
  display: inline-block;
  padding: 8px 22px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  color: var(--navy);
  background: var(--white);
  border: 1px solid transparent;
  transition: background .15s ease, color .15s ease;
  white-space: nowrap;
}
.mis-tab:hover {
  background: var(--ivory);
  color: var(--navy-light);
}
.mis-tab.active {
  background: var(--navy);
  color: var(--white);
  box-shadow: 0 2px 8px rgba(31, 58, 95, .28);
}
.mis-tab.active:hover {
  background: var(--navy-light);
  color: var(--white);
}

/* Members area sub-nav chips (jump to page sections) */
.mis-subnav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin: 0 0 26px;
}
.mis-chip {
  display: inline-block;
  padding: 7px 18px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  color: var(--navy);
  background: var(--white);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  transition: background .15s ease, border-color .15s ease;
}
.mis-chip:hover {
  background: var(--navy);
  border-color: var(--navy);
  color: var(--white);
}

/* Church programmes - card grid with date badge */
.mis-prog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.mis-prog-card {
  display: flex;
  gap: 14px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
}
.mis-prog-date {
  flex: 0 0 auto;
  align-self: flex-start;
  background: var(--navy);
  color: var(--white);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
  border-radius: 10px;
  padding: 10px 12px;
  min-width: 74px;
}
.mis-prog-body { min-width: 0; }
.mis-prog-body h3 {
  font-size: 17px;
  margin: 0 0 6px;
}
.mis-prog-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--gold-dark);
  margin: 0 0 8px;
}
.mis-prog-desc {
  font-size: 14px;
  color: var(--muted);
  margin: 0;
}

/* Bible study link card on the members page */
.mis-bible-card {
  display: block;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
  text-decoration: none;
  color: var(--charcoal);
  border-left: 4px solid var(--gold);
  transition: box-shadow .15s ease, transform .15s ease;
}
.mis-bible-card:hover {
  box-shadow: 0 6px 18px rgba(0, 0, 0, .10);
  transform: translateY(-2px);
  color: var(--charcoal);
}
.mis-bible-card h3 {
  margin: 0 0 6px;
  font-size: 19px;
}
.mis-bible-card p { color: var(--muted); }

@media (max-width: 1100px) {
  .mis-tabs-admin { margin: 10px 14px 0; }
}

@media print {
  .mis-tabs-wrap, .mis-subnav { display: none; }
}


/* ============================================================
   V7 SIDEBAR GROUPS + DASHBOARD TABS
   Collapsible sidebar groups (Internal Operation / Bank) and
   the dashboard Internal-vs-Bank pill tabs + verdict badges.
   ============================================================ */

/* Sidebar group header: button styled like a sidebar section label */
.sidebar-group-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 10px 18px;
  background: transparent;
  border: 0;
  border-left: 3px solid transparent;
  color: #C9D4E2;
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .5px;
  text-transform: uppercase;
  cursor: pointer;
  transition: background .15s, color .15s;
}
.sidebar-group-toggle:hover {
  background: rgba(255, 255, 255, .07);
  color: var(--white);
}
.sidebar-group-toggle:focus {
  outline: none;
}
/* chevron: down when open, right when collapsed */
.sidebar-group-toggle::after {
  content: "";
  flex: 0 0 auto;
  width: 8px;
  height: 8px;
  margin-left: 8px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
  transition: transform .2s ease;
}
.sidebar-group-toggle:not(.open)::after {
  transform: rotate(-45deg);
}
/* group containing the current page: subtle gold accent on the header */
.sidebar-group.group-active .sidebar-group-toggle {
  color: var(--gold);
  border-left-color: var(--gold);
}

/* Group children: hidden unless the group wrapper is .open */
.sidebar-group:not(.open) .sidebar-group-items {
  display: none;
}
.sidebar-sublink {
  padding-left: 32px;
  font-size: 13px;
  font-weight: 500;
}

/* Dashboard pill tabs (reuse the v3 .mis-tabs/.mis-tab pill styles,
   left-aligned inside the content column) */
.dash-tabs {
  display: flex;
  margin: 0 0 18px;
}

/* Small muted note line under dashboard panels */
.dash-note {
  font-size: 13px;
  color: var(--muted);
  margin: 10px 0 0;
}

/* Deposit-verification verdict badges (v7) */
.badge-ok   { background: #E3F1E9; color: var(--success); }
.badge-warn { background: #F6EFD9; color: var(--warning); }
.badge-bad  { background: #F7E4E4; color: var(--danger); }

/* ============================================================
   V8 DASHBOARD CHARTS
   Year filter bar beside the dashboard pill tabs, plus the
   selected-year context note above each tab's chart grid.
   ============================================================ */
.dash-filterbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}
.dash-yearform {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-size: 13px;
  color: var(--muted);
}
.dash-yearform select {
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 13px;
  background: var(--white);
  color: var(--charcoal);
}
.dash-yrctx {
  margin: -8px 0 14px;
}

/* ============================================================
   V9 STAT-CARD DELTAS
   Additional stat-card line under .stat-sub: % vs previous
   month (.up green / .down red by value movement) plus the
   month share of the selected-year (or all-years) total.
   ============================================================ */
.stat-card .stat-delta {
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}
.stat-card .stat-delta.up   { color: #2E7D4F; }
.stat-card .stat-delta.down { color: #B23A3A; }
.stat-card .stat-delta .stat-delta-scope { color: var(--muted); }

/* ============================================================
   V10 OUTSIDE DOUGHNUT LABELS
   Doughnut charts now draw two-line datalabels outside the
   slices (category name + "$value (pct%)"). Their panels get
   extra height so the labels plus the padding room declared
   in the chart config never clip against the fixed chart box.
   ============================================================ */
.chart-box-tall {
  min-height: 340px;
}

/* ============================================================
   V12 CHART FILTER CONTEXT TAGS
   Small muted line directly under every chart panel's <h3>
   showing the active filter context (year / category / account)
   so a screenshot of a single card still carries its filter
   context. Tiny gold dot prefix ties it to the brand accent.
   Chart box heights are unchanged.
   ============================================================ */
.chart-filter-tag {
  font-size: 11px;
  color: #6E6A63;
  margin-top: -6px;
  margin-bottom: 8px;
}
.chart-filter-tag::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #C9A227;
  margin-right: 6px;
  vertical-align: 1px;
}
