
:root {
  --primary:       #4a1e8f;
  --primary-dk:    #330f6e;
  --primary-lt:    #6b35c7;
  --primary-fade:  rgba(74,30,143,.08);
  --accent:        #d4a017;
  --accent-lt:     #f0c040;
  --accent-fade:   rgba(212,160,23,.12);
  --success:       #28a745;
  --danger:        #dc3545;
  --warning:       #ffc107;
  --info:          #17a2b8;
  --text:          #1e1e2d;
  --text-muted:    #6c757d;
  --border:        #e4ddf5;
  --bg:            #f3f2f8;
  --white:         #ffffff;
  --shadow-sm:     0 1px 6px rgba(74,30,143,.07);
  --shadow:        0 4px 18px rgba(74,30,143,.12);
  --shadow-lg:     0 10px 40px rgba(74,30,143,.18);
  --sidebar-w:     260px;
  --topbar-h:      62px;
  --radius:        10px;
  --radius-sm:     6px;
  --radius-lg:     14px;
  --transition:    all .22s ease;
}


/* ============================================================
   2. BASE RESET
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: 'Segoe UI', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.6;
  overflow-x: hidden;
  min-height: 100vh;
}
a    { text-decoration: none; color: inherit; }
img  { max-width: 100%; display: block; }
button, input, select, textarea { font-family: inherit; }
ul, ol { list-style: none; }

/* Scrollbar */
::-webkit-scrollbar        { width: 5px; height: 5px; }
::-webkit-scrollbar-track  { background: transparent; }
::-webkit-scrollbar-thumb  { background: var(--border); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: var(--primary-lt); }


/* ============================================================
   3. CMS SHELL
   ============================================================ */
.cms-layout { display: flex; min-height: 100vh; }

/* Prevent body scroll when a modal is open */
body.cms-modal-open { overflow: hidden !important; }


/* ============================================================
   4. SIDEBAR
   ============================================================ */
.sidebar {
  width: var(--sidebar-w);
  min-width: var(--sidebar-w);
  background: linear-gradient(175deg, var(--primary-dk) 0%, var(--primary) 55%, #5a2aaa 100%);
  position: fixed;
  top: 0; left: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overflow-x: hidden;
  z-index: 200;
  box-shadow: 4px 0 24px rgba(0,0,0,.2);
  transition: transform .3s cubic-bezier(.4,0,.2,1);
}

/* Brand */
.sidebar-brand {
  padding: 22px 20px 15px;
  border-bottom: 1px solid rgba(255,255,255,.1);
  flex-shrink: 0;
}
.sidebar-brand .cross { display: block; font-size: 2.4rem; color: var(--accent); line-height: 1; margin-bottom: 8px; }
.sidebar-brand h2     { color: #fff; font-size: 14.5px; font-weight: 700; line-height: 1.3; }
.sidebar-brand p      { color: rgba(255,255,255,.42); font-size: 10.5px; margin-top: 3px; letter-spacing: .4px; }

.sidebar-logo {
  width: 58px; height: 58px;
  object-fit: contain;
  border-radius: 50%;
  background: #fff;
  padding: 5px;
  margin-bottom: 8px;
}

/* User pill */
.sidebar-user {
  margin: 12px 14px;
  padding: 10px 13px;
  background: rgba(0,0,0,.18);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.sidebar-user .avatar {
  width: 36px; height: 36px;
  background: var(--accent);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 800; font-size: 15px; flex-shrink: 0;
}
.sidebar-user .info strong { color: #fff; font-size: 12.5px; display: block; line-height: 1.3; }
.sidebar-user .info span   { color: rgba(255,255,255,.48); font-size: 10.5px; text-transform: capitalize; }

/* Nav */
.sidebar-nav { flex: 1; padding: 6px 0 24px; overflow-y: auto; }
.nav-section {
  padding: 16px 20px 5px;
  font-size: 9.5px; font-weight: 700;
  color: rgba(255,255,255,.28);
  text-transform: uppercase; letter-spacing: 1.4px;
}
.sidebar-nav a {
  display: flex; align-items: center; gap: 11px;
  padding: 10px 20px;
  color: rgba(255,255,255,.7);
  font-size: 13px; font-weight: 500;
  border-left: 3px solid transparent;
  transition: var(--transition);
  white-space: nowrap;
}
.sidebar-nav a:hover,
.sidebar-nav a.active {
  background: rgba(255,255,255,.1);
  color: #fff;
  border-left-color: var(--accent);
}
.sidebar-nav a.active { font-weight: 700; background: rgba(255,255,255,.13); }
.sidebar-nav a .icon  { width: 20px; text-align: center; font-size: 14.5px; flex-shrink: 0; }

/* Footer */
.sidebar-footer { padding: 14px 20px; border-top: 1px solid rgba(255,255,255,.1); flex-shrink: 0; }
.sidebar-footer a { color: rgba(255,255,255,.42); font-size: 12px; display: flex; align-items: center; gap: 8px; transition: var(--transition); }
.sidebar-footer a:hover { color: #fff; }

/* Mobile overlay */
.sidebar-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 199; backdrop-filter: blur(2px); }
.sidebar-overlay.show { display: block; }


/* ============================================================
   5. MAIN WRAPPER & TOPBAR
   ============================================================ */
.main-content {
  flex: 1;
  margin-left: var(--sidebar-w);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-width: 0;
  transition: margin-left .3s cubic-bezier(.4,0,.2,1);
  background: var(--bg);
}

.topbar {
  position: sticky;
  top: 0; z-index: 100;
  height: var(--topbar-h);
  background: var(--white);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 8px rgba(74,30,143,.06);
  display: flex;
  align-items: center;
  padding: 0 24px 0 16px;
  gap: 14px;
  flex-shrink: 0;
}
.topbar-toggle {
  background: none; border: none;
  font-size: 19px; color: var(--primary); cursor: pointer;
  padding: 7px 9px; border-radius: var(--radius-sm);
  display: flex; align-items: center;
  transition: var(--transition); flex-shrink: 0;
}
.topbar-toggle:hover { background: var(--primary-fade); }
.topbar-title { font-size: 17px; font-weight: 800; color: var(--primary); flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-right { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.topbar-date  { font-size: 11.5px; color: var(--text-muted); white-space: nowrap; }
.topbar-btn {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 6px 13px;
  background: var(--primary-fade); color: var(--primary);
  border-radius: var(--radius-sm);
  font-size: 12px; font-weight: 600;
  transition: var(--transition); white-space: nowrap;
}
.topbar-btn:hover { background: var(--primary); color: #fff; }
.topbar-user {
  display: flex; align-items: center; gap: 7px;
  padding: 4px 10px 4px 4px;
  background: var(--primary-fade);
  border-radius: 20px;
}
.topbar-avatar { width: 30px; height: 30px; background: var(--primary); color: #fff; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; flex-shrink: 0; }
.topbar-username { font-size: 12px; font-weight: 600; color: var(--primary); }

.content-area { flex: 1; padding: 26px 28px 44px; min-width: 0; }


/* ============================================================
   6. PAGE / MODULE HEADERS
   ============================================================ */
.page-header,
.module-header,
.module-page-header,
.data-page-header,
.form-page-header,
.profile-page-header,
.members-page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.page-header h2,
.module-title h2,
.data-title h2,
.form-page-header h2,
.profile-page-header h2,
.members-title h2 {
  margin: 0;
  font-size: 22px;
  font-weight: 800;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: 10px;
}
.page-header h2 i { font-size: 17px; opacity: .8; }

.module-title p,
.data-title p,
.form-page-header p,
.profile-page-header p,
.members-title p { margin: 4px 0 0; color: var(--text-muted); font-size: 13px; }

.module-actions,
.profile-actions,
.form-actions-inline,
.member-view-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}


/* ============================================================
   7. GRID SYSTEM  (Bootstrap-compatible, mobile-first)
   ============================================================ */
.row { display: flex; flex-wrap: wrap; margin-left: -10px; margin-right: -10px; }
[class*="col-"] { padding-left: 10px; padding-right: 10px; width: 100%; flex: 0 0 100%; max-width: 100%; }

.col-1  { flex: 0 0 8.333%;   max-width: 8.333%;   }
.col-2  { flex: 0 0 16.667%;  max-width: 16.667%;  }
.col-3  { flex: 0 0 25%;      max-width: 25%;      }
.col-4  { flex: 0 0 33.333%;  max-width: 33.333%;  }
.col-5  { flex: 0 0 41.667%;  max-width: 41.667%;  }
.col-6  { flex: 0 0 50%;      max-width: 50%;      }
.col-7  { flex: 0 0 58.333%;  max-width: 58.333%;  }
.col-8  { flex: 0 0 66.667%;  max-width: 66.667%;  }
.col-9  { flex: 0 0 75%;      max-width: 75%;      }
.col-10 { flex: 0 0 83.333%;  max-width: 83.333%;  }
.col-11 { flex: 0 0 91.667%;  max-width: 91.667%;  }
.col-12 { flex: 0 0 100%;     max-width: 100%;     }

@media (min-width: 576px) {
  .col-sm-1  { flex: 0 0 8.333%;  max-width: 8.333%;  }
  .col-sm-2  { flex: 0 0 16.667%; max-width: 16.667%; }
  .col-sm-3  { flex: 0 0 25%;     max-width: 25%;     }
  .col-sm-4  { flex: 0 0 33.333%; max-width: 33.333%; }
  .col-sm-6  { flex: 0 0 50%;     max-width: 50%;     }
  .col-sm-12 { flex: 0 0 100%;    max-width: 100%;    }
}
@media (min-width: 768px) {
  .col-md-1  { flex: 0 0 8.333%;  max-width: 8.333%;  }
  .col-md-2  { flex: 0 0 16.667%; max-width: 16.667%; }
  .col-md-3  { flex: 0 0 25%;     max-width: 25%;     }
  .col-md-4  { flex: 0 0 33.333%; max-width: 33.333%; }
  .col-md-5  { flex: 0 0 41.667%; max-width: 41.667%; }
  .col-md-6  { flex: 0 0 50%;     max-width: 50%;     }
  .col-md-7  { flex: 0 0 58.333%; max-width: 58.333%; }
  .col-md-8  { flex: 0 0 66.667%; max-width: 66.667%; }
  .col-md-9  { flex: 0 0 75%;     max-width: 75%;     }
  .col-md-10 { flex: 0 0 83.333%; max-width: 83.333%; }
  .col-md-12 { flex: 0 0 100%;    max-width: 100%;    }
}
@media (min-width: 992px) {
  .col-lg-2  { flex: 0 0 16.667%; max-width: 16.667%; }
  .col-lg-3  { flex: 0 0 25%;     max-width: 25%;     }
  .col-lg-4  { flex: 0 0 33.333%; max-width: 33.333%; }
  .col-lg-6  { flex: 0 0 50%;     max-width: 50%;     }
  .col-lg-8  { flex: 0 0 66.667%; max-width: 66.667%; }
  .col-lg-9  { flex: 0 0 75%;     max-width: 75%;     }
  .col-lg-12 { flex: 0 0 100%;    max-width: 100%;    }
}


/* ============================================================
   8. STAT CARDS & STATS GRIDS
   ============================================================ */
.stats-grid,
.module-stats-grid,
.three-per-row,
.fu-stats-grid,
.birds-stat-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}
.fu-stats-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.stat-card {
  background: #673ab7;
  border: 1px solid rgba(148,163,184,.22);
  border-radius: var(--radius-lg);
  padding: 18px;
  box-shadow: 0 8px 22px rgba(15,23,42,.08);
  display: flex;
  gap: 14px;
  align-items: center;
  transition: transform .2s, box-shadow .2s;
  cursor: default;
  color: #fff;
}
.stat-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
a .stat-card { cursor: pointer; }
a:hover .stat-card { box-shadow: var(--shadow-lg); }

.stat-icon {
  width: 48px; height: 48px;
  border-radius: 14px;
  background: rgba(74,30,143,.1);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
  color: #fff;
  flex-shrink: 0;
}
.stat-body { flex: 1; min-width: 0; }

.stat-value,
.stat-number {
  font-size: 1.6rem;
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -.5px;
  color: #fff;
}
.stat-value.small { font-size: 18px; }
.stat-label {
  font-size: 10.5px;
  font-weight: 700;
  color: #fff;
  margin-top: 4px;
  text-transform: uppercase;
  letter-spacing: .5px;
  white-space: normal;
  word-break: break-word;
  line-height: 1.35;
}


/* ============================================================
   9. CARDS
   ============================================================ */
.card { background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow-sm); border: 1px solid var(--border); overflow: hidden; }
.card + .card, .mb-3 { margin-bottom: 16px; }
.card-header {
  padding: 14px 20px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px;
  background: var(--white); font-size: 13.5px; font-weight: 700; color: var(--primary);
}
.card-header i { opacity: .75; }
.card-body   { padding: 20px; }
.card-footer { padding: 11px 20px; border-top: 1px solid var(--border); background: #faf9fd; font-size: 12.5px; }
.card-footer a { color: var(--primary); font-weight: 600; }
.card-footer a:hover { text-decoration: underline; }
.h-100 { height: 100%; }

/* Module / data card variants */
.module-card,
.data-card { overflow: hidden; }

.data-card-header,
.module-card-header {
  padding: 15px 18px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  background: #fff; color: var(--primary); flex-wrap: wrap;
}

.data-count,
.module-count,
.count-pill {
  background: var(--primary-fade); color: var(--primary);
  padding: 6px 12px; border-radius: 999px; font-weight: 800; font-size: 12px; white-space: nowrap;
}

.data-table-wrap,
.module-table-wrap { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }

.data-table,
.module-table { width: 100%; border-collapse: collapse; min-width: 980px; }
.data-table th,
.module-table th {
  background: #f5f1ff; color: var(--primary);
  font-size: 11px; text-transform: uppercase; letter-spacing: .05em;
  padding: 13px 14px; white-space: nowrap;
  border-bottom: 2px solid var(--border); text-align: left;
}
.data-table td,
.module-table td {
  padding: 13px 14px; border-bottom: 1px solid #f0ecfa;
  vertical-align: middle; color: var(--text); font-size: 13px;
}
.data-table tbody tr:hover,
.module-table tbody tr:hover { background: #faf7ff; }

/* Fundraising card */
.fundraising-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 8px 22px rgba(15,23,42,.06);
}
.fundraising-card-header {
  background: var(--primary); color: #fff;
  padding: 14px 16px;
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
}
.fundraising-card-body  { padding: 16px; }
.fundraising-card-footer {
  padding: 12px 16px; background: #f8fafc;
  border-top: 1px solid #e5e7eb;
  display: flex; gap: 8px; flex-wrap: wrap;
}
.fundraising-grid {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px;
}

/* Fin KPI */
.fin-kpi { background: var(--white); border-radius: var(--radius); padding: 16px 20px; box-shadow: var(--shadow-sm); height: 100%; }
.fin-kpi-label { font-size: .78rem; text-transform: uppercase; letter-spacing: .5px; color: var(--text-muted); margin-bottom: 6px; }
.fin-kpi-value { font-size: 1.2rem; font-weight: 700; }
.fin-report-card { transition: transform .15s; }
.fin-report-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }


/* ============================================================
   10. INFO BOX  (alert-style banners)
   ============================================================ */
.info-box {
  display: flex; gap: 14px; align-items: flex-start;
  padding: 14px 18px; border-radius: var(--radius); margin-bottom: 20px;
  border-left: 4px solid var(--primary);
  background: var(--primary-fade); color: var(--primary); font-size: 13.5px;
}
.info-box i  { font-size: 18px; flex-shrink: 0; margin-top: 2px; }
.info-box h4 { font-size: 13.5px; font-weight: 700; margin-bottom: 3px; }
.info-box p  { margin: 0; font-size: 13px; opacity: .85; }
.info-box.gold    { background: var(--accent-fade); border-left-color: var(--accent); color: #7a5000; }
.info-box.success { background: rgba(40,167,69,.09); border-left-color: var(--success); color: #1a6b2e; }
.info-box.danger  { background: rgba(220,53,69,.09); border-left-color: var(--danger); color: #7a0e1e; }
.info-box.warning { background: rgba(255,193,7,.12); border-left-color: var(--warning); color: #6b4f00; }


/* ============================================================
   11. TABLES
   ============================================================ */
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table thead th {
  background: #f5f1ff; color: var(--primary);
  font-weight: 700; font-size: 11px;
  text-transform: uppercase; letter-spacing: .55px;
  padding: 11px 14px; border-bottom: 2px solid var(--border); white-space: nowrap;
}
.table tbody tr { border-bottom: 1px solid #f0ecfa; transition: background .14s; }
.table tbody tr:last-child { border-bottom: none; }
.table tbody tr:hover { background: #faf7ff; }
.table tbody td { padding: 10px 14px; vertical-align: middle; }
.table-sm th, .table-sm td { padding: 7px 12px; font-size: 12.5px; }
.table-borderless td, .table-borderless th { border: none !important; }
.table-responsive { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table-warning { background: #fff8e1 !important; }
.table-danger  { background: #ffeaea !important; }
.table-success { background: #eaffea !important; }


/* ============================================================
   12. BADGES
   ============================================================ */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px; border-radius: 20px;
  font-size: 11px; font-weight: 600; white-space: nowrap; line-height: 1.5;
}
.badge-primary   { background: var(--primary-fade);          color: var(--primary); }
.badge-success   { background: rgba(40,167,69,.12);           color: #1a7a32; }
.badge-danger    { background: rgba(220,53,69,.12);           color: #a72030; }
.badge-warning   { background: rgba(255,193,7,.18);           color: #7a5c00; }
.badge-info      { background: rgba(23,162,184,.14);          color: #0d6e7c; }
.badge-secondary { background: rgba(108,117,125,.12);         color: #495057; }
.badge-light     { background: rgba(255,255,255,.22);         color: #fff; }
.badge-gold      { background: var(--accent-fade);            color: #7a5800; }


/* ============================================================
   13. BUTTONS
   ============================================================ */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 18px; border-radius: var(--radius-sm);
  font-size: 13px; font-weight: 600; cursor: pointer;
  border: 2px solid transparent;
  transition: var(--transition); text-decoration: none;
  white-space: nowrap; line-height: 1.4;
}
.btn i { font-size: 12px; }
.btn.disabled { pointer-events: none; opacity: .55; }

.btn-primary         { background: var(--primary);  border-color: var(--primary);  color: #fff; }
.btn-primary:hover   { background: var(--primary-dk); border-color: var(--primary-dk); }
.btn-secondary       { background: #6c757d; border-color: #6c757d; color: #fff; }
.btn-secondary:hover { background: #5a6268; border-color: #5a6268; }
.btn-success         { background: var(--success); border-color: var(--success); color: #fff; }
.btn-success:hover   { background: #1e7e34; border-color: #1e7e34; }
.btn-danger          { background: var(--danger);  border-color: var(--danger);  color: #fff; }
.btn-danger:hover    { background: #b02a37; border-color: #b02a37; }
.btn-warning         { background: var(--warning); border-color: var(--warning); color: #212529; }
.btn-warning:hover   { background: #e0a800; border-color: #e0a800; }
.btn-info            { background: var(--info);    border-color: var(--info);    color: #fff; }
.btn-info:hover      { background: #117a8b; border-color: #117a8b; }
.btn-accent          { background: var(--accent);  border-color: var(--accent);  color: #fff; }
.btn-accent:hover    { background: #b88a10; border-color: #b88a10; }

.btn-outline-primary       { background: transparent; border-color: var(--primary); color: var(--primary); }
.btn-outline-primary:hover { background: var(--primary); color: #fff; }
.btn-outline-secondary       { background: transparent; border-color: #6c757d; color: #6c757d; }
.btn-outline-secondary:hover { background: #6c757d; color: #fff; }
.btn-outline       { background: transparent; border-color: var(--primary); color: var(--primary); }
.btn-outline:hover { background: var(--primary); color: #fff; }

.btn-sm    { padding: 5px 12px; font-size: 12px; }
.btn-lg    { padding: 11px 26px; font-size: 15px; }
.btn-xs    { padding: 2px 8px; font-size: 11px; }
.btn-block { display: flex; width: 100%; justify-content: center; }
.btn-icon  { width: 34px; height: 34px; padding: 0 !important; display: inline-flex; align-items: center; justify-content: center; border-radius: 9px; }


/* ============================================================
   14. FORMS
   ============================================================ */
.form-row { display: flex; flex-wrap: wrap; margin-left: -8px; margin-right: -8px; }
.form-row > [class*="col-"] { padding-left: 8px; padding-right: 8px; }
.form-group { margin-bottom: 18px; }
.form-group label { display: block; font-size: 12.5px; font-weight: 700; color: var(--text); margin-bottom: 6px; }
.form-control {
  display: block; width: 100%;
  padding: 9px 13px; border: 2px solid #ddd; border-radius: var(--radius-sm);
  font-size: 13.5px; font-family: inherit; color: var(--text); background: var(--white);
  transition: border-color .2s, box-shadow .2s; outline: none; line-height: 1.5;
}
.form-control:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(74,30,143,.1); }
.form-control::placeholder { color: #aaa; }
select.form-control { cursor: pointer; appearance: auto; }
textarea.form-control { resize: vertical; min-height: 88px; }
.form-control-sm { padding: 6px 10px; font-size: 12.5px; }
.form-inline { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.form-check  { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.form-check-input { width: 16px; height: 16px; cursor: pointer; accent-color: var(--primary); }
.form-check-label { font-size: 13px; cursor: pointer; margin-bottom: 0; }

/* Form grids */
.form-grid,
.form-grid-2,
.modal-form-grid,
.member-form-grid,
.birds-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.form-grid-3     { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.form-grid-4     { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }

/* Full-width span helpers (all naming conventions) */
.full-span,
.form-full,
.form-group.full,
.full { grid-column: 1 / -1; }

.form-section-title,
.section-title {
  display: flex; align-items: center; gap: 8px;
  margin: 6px 0 16px; padding: 10px 12px;
  background: var(--primary-fade); border-left: 4px solid var(--primary);
  border-radius: var(--radius-sm); color: var(--primary);
  font-weight: 800; font-size: 13px;
}
.req, .required { color: var(--danger); font-weight: 800; }
.form-actions {
  display: flex; justify-content: flex-end; gap: 10px;
  margin-top: 22px; padding-top: 18px;
  border-top: 1px solid var(--border); flex-wrap: wrap;
}

/* Form card */
.form-card { overflow: hidden; }
.form-card .card-header h3 { font-size: 15px; color: var(--primary); display: flex; align-items: center; gap: 8px; }


/* ============================================================
   15. TOOLBARS & SEARCH
   ============================================================ */
.module-toolbar,
.data-toolbar,
.toolbar,
.birds-toolbar {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.module-filter-form,
.data-filter-form,
.filter-form,
.members-filter-form { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

.search-box,
.module-search-box,
.data-search-box,
.members-search-box {
  flex: 1;
  min-width: 260px;
  max-width: 420px;
  position: relative;
}
.search-box i,
.module-search-box i,
.data-search-box i,
.members-search-box i {
  position: absolute; left: 13px; top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted); font-size: 13px;
}
.search-box input,
.module-search-box input,
.data-search-box input,
.members-search-box input,
.module-filter-form select,
.data-filter-form select,
.filter-form select,
.filter-form input,
.members-filter-form select {
  width: 100%; height: 42px;
  border: 2px solid #e1d9f3; border-radius: var(--radius-sm);
  padding: 0 13px; background: #fff; color: var(--text);
  outline: none; font-size: 13px;
  transition: border-color .2s, box-shadow .2s;
}
.search-box input,
.module-search-box input,
.data-search-box input,
.members-search-box input { padding-left: 38px; }

.search-box input:focus,
.module-search-box input:focus,
.data-search-box input:focus,
.members-search-box input:focus,
.module-filter-form select:focus,
.data-filter-form select:focus,
.filter-form select:focus,
.filter-form input:focus,
.members-filter-form select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(74,30,143,.10);
}

/* Action button groups in tables */
.action-buttons,
.table-actions,
.table-action,
.birds-row-actions { display: flex; justify-content: flex-end; gap: 6px; white-space: nowrap; flex-wrap: wrap; }


/* ============================================================
   16. ALERTS
   ============================================================ */
.alert {
  padding: 12px 16px; border-radius: var(--radius-sm); margin-bottom: 18px;
  display: flex; align-items: flex-start; justify-content: space-between;
  font-size: 13.5px; border-left: 4px solid; gap: 10px;
}
.alert-success { background: rgba(40,167,69,.09);  border-color: var(--success); color: #1a6b2e; }
.alert-danger  { background: rgba(220,53,69,.09);  border-color: var(--danger);  color: #7a0e1e; }
.alert-warning { background: rgba(255,193,7,.12);  border-color: var(--warning); color: #6b4f00; }
.alert-info    { background: rgba(23,162,184,.09); border-color: var(--info);    color: #0c5460; }

.close, .close-btn {
  background: none; border: none; cursor: pointer;
  font-size: 18px; line-height: 1; opacity: .55;
  color: inherit; padding: 0 4px; flex-shrink: 0; transition: opacity .2s;
}
.close:hover, .close-btn:hover { opacity: 1; }

/* Inline / Ajax alerts */
.ajax-alert,
.app-alert,
.birds-alert {
  display: none;
  margin: 10px 0;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  font-weight: 700;
}
.ajax-alert.success,
.app-alert.success,
.birds-alert.success { display: block; background: #dcfce7; color: #166534; }
.ajax-alert.error,
.app-alert.error,
.birds-alert.error   { display: block; background: #fee2e2; color: #991b1b; }


/* ============================================================
   17. PROGRESS BARS
   ============================================================ */
.progress { background: #e9ecef; border-radius: 20px; height: 8px; overflow: hidden; width: 100%; }
.progress-bar { height: 100%; border-radius: 20px; background: var(--primary); transition: width .6s ease; }
.progress-bar.bg-success { background: var(--success); }
.progress-bar.bg-warning { background: var(--warning); }
.progress-bar.bg-danger  { background: var(--danger);  }
.progress-bar.bg-info    { background: var(--info);    }


/* ============================================================
   18. NAV TABS & BIRDS TABS
   ============================================================ */
.nav-tabs,
.birds-tabs {
  display: flex; flex-wrap: wrap; gap: 2px;
  border-bottom: 2px solid var(--border); margin-bottom: 20px; list-style: none;
  overflow-x: auto;
}
.nav-item  { margin: 0; }
.nav-link,
.birds-tabs a {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 16px; font-size: 13px; font-weight: 600; color: var(--text-muted);
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  border: 1px solid transparent; position: relative; top: 2px;
  transition: var(--transition); text-decoration: none; white-space: nowrap;
}
.nav-link:hover,
.birds-tabs a:hover  { color: var(--primary); background: var(--primary-fade); }
.nav-link.active,
.birds-tabs a.active {
  color: var(--primary); background: var(--white);
  border-color: var(--border); border-bottom-color: var(--white); font-weight: 700;
}


/* ============================================================
   19. MODALS  (all variants unified)
   ============================================================ */
@keyframes modalIn {
  from { opacity: 0; transform: scale(.96) translateY(10px); }
  to   { opacity: 1; transform: scale(1)  translateY(0); }
}

/* -- Shared backdrop -- */
.modal-overlay,
.app-modal-backdrop,
.ajax-modal-backdrop,
.birds-modal {
  position: fixed; inset: 0;
  background: rgba(15,23,42,.62);
  z-index: 9998;
  display: none;
}
.modal-overlay          { background: rgba(0,0,0,.52); z-index: 1000; backdrop-filter: blur(2px);
                           align-items: center; justify-content: center; padding: 20px; }
.modal-overlay.show     { display: flex; }
.app-modal-backdrop.show,
.ajax-modal-backdrop.show { display: block; }
.birds-modal.show        { display: block; }

/* -- Shared scroll-container -- */
.app-modal,
.ajax-modal,
.member-modal-overlay {
  position: fixed; inset: 0; z-index: 9999;
  display: none;
  align-items: flex-start; justify-content: center;
  overflow: auto; padding: 28px 14px;
}
.app-modal.show,
.ajax-modal.show,
.member-modal-overlay.show { display: flex !important; }

/* -- Dialog boxes -- */
.modal,
.app-dialog,
.ajax-dialog,
.birds-modal-dialog {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: 0 22px 60px rgba(0,0,0,.26);
  overflow: hidden;
  animation: modalIn .22s ease;
}
/* legacy .modal */
.modal { max-width: 540px; width: 100%; }
/* app-dialog */
.app-dialog       { width: min(840px, 100%); }
.app-dialog-sm    { width: min(520px, 100%); }
.app-dialog-lg    { width: min(900px, 100%); }
/* ajax-dialog */
.ajax-dialog      { width: min(720px, 100%); }
.ajax-dialog-sm   { width: min(480px, 100%); }
.ajax-dialog-lg   { width: min(820px, 100%); }
.ajax-dialog-xl   { width: min(1050px, 100%); }
/* birds */
.birds-modal-dialog { width: min(780px, 100%); margin: 30px auto; }
/* member overlay */
.member-modal-overlay {
  padding: 22px 12px !important;
  background: rgba(0,0,0,.58) !important;
}
.member-modal-overlay .modal {
  margin: auto 0 !important;
  width: 100% !important; max-width: 760px !important;
  max-height: calc(100vh - 44px) !important;
  display: flex !important; flex-direction: column !important;
}
.member-modal-overlay .modal-lg  { max-width: 980px !important; }
.member-modal-overlay .modal-body {
  flex: 1 1 auto !important;
  overflow-y: auto !important;
  max-height: calc(100vh - 182px) !important;
  -webkit-overflow-scrolling: touch !important;
}
.modal.modal-lg { max-width: 820px; }
.modal.modal-xl { max-width: 1080px; }
.modal-scrollable .modal-body,
.modal-body-scroll { max-height: calc(100vh - 190px); overflow-y: auto; }

/* -- Headers -- */
.modal-header,
.app-modal-header,
.ajax-modal-header,
.birds-modal-header {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 16px 20px;
  background: var(--primary); color: #fff;
  border-bottom: 1px solid rgba(255,255,255,.15);
}
.modal-header h4,
.app-modal-header h3,
.ajax-modal-header h4,
.birds-modal-header h3 { margin: 0; font-size: 16px; font-weight: 700; color: #fff; }

/* -- Bodies -- */
.modal-body,
.app-modal-body,
.ajax-modal-body,
.birds-modal-body {
  padding: 20px;
  max-height: calc(100vh - 190px);
  overflow-y: auto;
}
.modal-body    { padding: 24px; }

/* -- Footers -- */
.modal-footer,
.app-modal-footer,
.ajax-modal-footer {
  display: flex; justify-content: flex-end; gap: 10px;
  padding: 14px 20px;
  background: #faf9fd;
  border-top: 1px solid var(--border);
}
.modal-footer { border-top: 1px solid var(--border); }

/* Close button */
.modal-close,
.birds-close {
  border: 0; background: rgba(255,255,255,.15); color: #fff;
  font-size: 22px; line-height: 1; cursor: pointer;
  width: 32px; height: 32px; border-radius: 6px;
  display: inline-flex; align-items: center; justify-content: center;
  transition: background .2s;
}
.modal-close:hover,
.birds-close:hover { background: rgba(255,255,255,.3); }


/* ============================================================
   20. DETAIL / PROFILE SECTIONS
   ============================================================ */
/* Inline detail rows */
.detail-row { display: grid; grid-template-columns: 155px 1fr; gap: 6px; padding: 9px 0; border-bottom: 1px solid #f2eefc; }
.detail-row .dlabel { font-weight: 600; font-size: 12.5px; color: var(--text-muted); }
.detail-row .dval   { font-size: 13px; color: var(--text); }
.detail-section { margin-bottom: 22px; }
.detail-section h4 { font-size: 13.5px; font-weight: 700; color: var(--primary); margin-bottom: 10px; padding-bottom: 6px; border-bottom: 2px solid var(--border); }

/* Detail grid (modals) */
.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.detail-item {
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #f8fafc;
}
.detail-item b {
  display: block;
  font-size: 11.5px; color: var(--text-muted); font-weight: 700;
  margin-bottom: 3px; text-transform: uppercase; letter-spacing: .03em;
}
.detail-item.full { grid-column: 1 / -1; }

/* Profile grid */
.profile-grid,
.detail-profile-grid,
.member-profile-grid {
  display: grid; grid-template-columns: 340px minmax(0, 1fr); gap: 24px; align-items: start;
}
.member-view-profile {
  display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 18px;
}
.profile-card .card-body { padding: 32px 24px; }
.profile-avatar,
.large-avatar,
.member-view-avatar {
  width: 92px; height: 92px; border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--primary-lt));
  color: #fff; font-size: 34px; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 15px; box-shadow: 0 10px 24px rgba(74,30,143,.22);
}
.member-view-avatar { width: 88px; height: 88px; font-size: 32px; background: #4f46e5; }
.profile-card h3 { margin-bottom: 6px; font-size: 18px; color: var(--text); }
.summary-total,
.profile-total,
.amount-total,
.contribution-total { font-size: 30px; font-weight: 800; color: var(--primary); line-height: 1.2; }

/* Profile / detail rows */
.detail-list-row,
.profile-detail-row,
.info-row,
.member-detail-row,
.member-view-row {
  display: flex; justify-content: space-between; gap: 18px;
  padding: 12px 0; border-bottom: 1px solid #f0ecfa;
}
.detail-list-row:last-child,
.profile-detail-row:last-child,
.info-row:last-child,
.member-detail-row:last-child { border-bottom: none; }
.detail-label,
.profile-detail-label,
.info-label,
.member-detail-label,
.member-view-label { min-width: 160px; color: var(--text-muted); font-weight: 700; font-size: 13px; }
.detail-value,
.profile-detail-value,
.info-value,
.member-detail-value,
.member-view-value { flex: 1; text-align: right; color: var(--text); font-size: 13.5px; word-break: break-word; }

/* Member view card */
.member-view-card { border: 1px solid #eee; border-radius: 12px; padding: 18px; background: #fff; }
.member-view-row { display: grid; grid-template-columns: 155px minmax(0,1fr); gap: 12px; padding: 9px 0; border-bottom: 1px solid #f1f1f1; }
.member-view-label { color: #64748b; font-weight: 700; font-size: 12px; }
.member-view-value { word-break: break-word; }

/* Pills */
.pill-group,
.dept-pill { display: inline-flex; align-items: center; gap: 6px; margin: 2px 0 4px 6px; flex-wrap: wrap; }
.pill-group small,
.dept-pill small { color: var(--text-muted); font-weight: 600; }


/* ============================================================
   21. AVATAR
   ============================================================ */
.avatar-sm {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--primary); color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 13px; flex-shrink: 0;
}
.record-avatar,
.entity-avatar,
.list-avatar,
.member-avatar {
  width: 42px; height: 42px; border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--primary-lt));
  color: #fff; display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 16px; flex-shrink: 0;
  box-shadow: 0 6px 14px rgba(74,30,143,.18);
}
.record-info,
.entity-info,
.list-info,
.member-info { display: flex; align-items: center; gap: 12px; min-width: 230px; }
.record-name,
.entity-name,
.list-title,
.member-name { font-weight: 800; color: #171326; line-height: 1.2; }
.record-sub,
.entity-sub,
.list-subtitle,
.member-sub { color: var(--text-muted); font-size: 12px; margin-top: 3px; display: flex; align-items: center; gap: 5px; }


/* ============================================================
   22. CAMPAIGN / FUNDRAISING EXTRAS
   ============================================================ */
.campaign-money-row {
  display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  font-size: 13px; margin-bottom: 8px;
}
.mini-stat-row { display: grid; grid-template-columns: repeat(3,1fr); gap: 8px; margin-top: 12px; }
.mini-stat-row > div { background: #f8fafc; border: 1px solid #e5e7eb; border-radius: 10px; text-align: center; padding: 8px; }
.mini-stat-row b,
.mini-stat-row small { display: block; }

.campaign-detail-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }
.detail-card { background: #f8fafc; border: 1px solid #e5e7eb; border-radius: 12px; padding: 10px; }
.detail-card.full { grid-column: 1 / -1; }
.detail-card b { display: block; font-size: 12px; color: #64748b; margin-bottom: 4px; }


/* ============================================================
   23. BIRDS MODULE
   ============================================================ */
.rotation-item { display: flex; gap: 14px; margin-bottom: 18px; }
.rotation-dot {
  width: 38px; height: 38px; border-radius: 50%;
  background: var(--primary);
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 15px; flex-shrink: 0;
}
.rotation-dot.returned { background: var(--success); }
.rotation-dot.pending  { background: var(--warning); }
.rotation-content { flex: 1; background: #faf8ff; border-radius: var(--radius-sm); padding: 12px 16px; border-left: 3px solid var(--primary); }
.cycle-badge { display: inline-block; background: var(--accent); color: #fff; padding: 2px 10px; border-radius: 20px; font-size: 11px; font-weight: 700; }


/* ============================================================
   24. LOGIN PAGE
   ============================================================ */
.login-page {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--primary-dk) 0%, var(--primary) 50%, var(--primary-lt) 100%);
  padding: 20px;
}
.login-box {
  background: var(--white); border-radius: var(--radius-lg);
  padding: 46px 40px; width: 400px; max-width: 100%;
  box-shadow: var(--shadow-lg); text-align: center;
}
.login-box .cross    { font-size: 48px; color: var(--primary); display: block; margin-bottom: 8px; }
.login-box h1        { font-size: 21px; font-weight: 800; color: var(--primary); }
.login-box .subtitle { font-size: 12px; color: var(--text-muted); margin: 4px 0 26px; }
.login-box .form-group { margin-bottom: 16px; text-align: left; }
.btn-login {
  width: 100%; padding: 13px;
  background: var(--primary); color: #fff; border: none;
  border-radius: var(--radius-sm); font-size: 15px; font-weight: 700;
  cursor: pointer; transition: background .2s; margin-top: 8px;
}
.btn-login:hover { background: var(--primary-dk); }
.login-footer { margin-top: 18px; font-size: 11.5px; color: var(--text-muted); }


/* ============================================================
   25. SETTINGS MODULE
   ============================================================ */
.settings-page .settings-card { margin-top: 18px; }
.settings-preview-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 16px; }
.settings-preview-box { border: 1px solid #e5e7eb; border-radius: 14px; padding: 16px; background: #f8fafc; min-height: 150px; }
.settings-preview-box h5 { margin: 0 0 12px; font-weight: 800; }
.settings-logo-preview { max-width: 220px; max-height: 95px; object-fit: contain; background: #fff; border: 1px solid #e5e7eb; border-radius: 12px; padding: 10px; }
.settings-favicon-preview { width: 64px; height: 64px; object-fit: contain; background: #fff; border: 1px solid #e5e7eb; border-radius: 12px; padding: 8px; }
.empty-preview {
  min-height: 95px; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  color: #64748b; gap: 8px;
  border: 1px dashed #cbd5e1; border-radius: 12px; background: #fff;
}
.empty-preview i { font-size: 30px; }


/* ============================================================
   26. UTILITIES
   ============================================================ */
.d-none         { display: none !important; }
.d-block        { display: block !important; }
.d-flex         { display: flex !important; }
.d-inline-flex  { display: inline-flex !important; }
.d-inline-block { display: inline-block !important; }
.d-table        { display: table !important; }
.d-table-cell   { display: table-cell !important; }

.flex-wrap              { flex-wrap: wrap; }
.flex-column            { flex-direction: column; }
.flex-1                 { flex: 1; }
.align-items-center     { align-items: center !important; }
.align-items-start      { align-items: flex-start !important; }
.align-items-end        { align-items: flex-end !important; }
.align-self-center      { align-self: center !important; }
.justify-content-center  { justify-content: center !important; }
.justify-content-between { justify-content: space-between !important; }
.justify-content-end     { justify-content: flex-end !important; }
.gap-1 { gap: 4px; }  .gap-2 { gap: 8px; }  .gap-3 { gap: 16px; }  .gap-4 { gap: 24px; }

.m-0  { margin: 0 !important; }
.mt-0 { margin-top: 0 !important; }   .mt-1 { margin-top: 4px !important; }
.mt-2 { margin-top: 8px !important; } .mt-3 { margin-top: 16px !important; }
.mt-4 { margin-top: 24px !important; } .mt-5 { margin-top: 40px !important; }
.mb-0 { margin-bottom: 0 !important; } .mb-1 { margin-bottom: 4px !important; }
.mb-2 { margin-bottom: 8px !important; } .mb-3 { margin-bottom: 16px !important; }
.mb-4 { margin-bottom: 24px !important; } .mb-5 { margin-bottom: 40px !important; }
.ml-1 { margin-left: 4px !important; }  .ml-2 { margin-left: 8px !important; }
.ml-3 { margin-left: 16px !important; } .ml-auto { margin-left: auto !important; }
.mr-1 { margin-right: 4px !important; } .mr-2 { margin-right: 8px !important; }
.mr-3 { margin-right: 16px !important; } .mr-auto { margin-right: auto !important; }
.p-0  { padding: 0 !important; }  .p-1  { padding: 4px !important; }
.p-2  { padding: 8px !important; } .p-3 { padding: 16px !important; } .p-4 { padding: 24px !important; }
.py-1 { padding-top: 4px !important;  padding-bottom: 4px !important; }
.py-2 { padding-top: 8px !important;  padding-bottom: 8px !important; }
.py-3 { padding-top: 16px !important; padding-bottom: 16px !important; }
.px-2 { padding-left: 8px !important;  padding-right: 8px !important; }
.px-3 { padding-left: 16px !important; padding-right: 16px !important; }

.text-left    { text-align: left !important; }
.text-center  { text-align: center !important; }
.text-right   { text-align: right !important; }
.text-muted   { color: var(--text-muted) !important; }
.text-primary { color: var(--primary) !important; }
.text-success { color: var(--success) !important; }
.text-danger  { color: var(--danger)  !important; }
.text-warning { color: #856404 !important; }
.text-info    { color: var(--info) !important; }
.text-white   { color: #fff !important; }
.text-dark    { color: var(--text) !important; }
.font-weight-bold   { font-weight: 700 !important; }
.font-weight-normal { font-weight: 400 !important; }
.small        { font-size: 12px !important; }
.display-4    { font-size: 2.5rem; font-weight: 700; }
.text-uppercase       { text-transform: uppercase !important; }
.text-decoration-none { text-decoration: none !important; }
.opacity-75   { opacity: .75; }

.bg-success { background-color: var(--success) !important; }
.bg-danger  { background-color: var(--danger)  !important; }
.bg-warning { background-color: var(--warning) !important; }
.bg-info    { background-color: var(--info)    !important; }
.bg-primary { background-color: var(--primary) !important; }
.bg-light   { background-color: #f8f9fa !important; }
.bg-white   { background-color: #fff !important; }

.w-100  { width: 100% !important; }
.h-100  { height: 100% !important; }
.mw-100 { max-width: 100%; }

.border         { border: 1px solid var(--border) !important; }
.border-0       { border: none !important; }
.rounded        { border-radius: var(--radius-sm) !important; }
.rounded-circle { border-radius: 50% !important; }

.position-relative { position: relative; }
.overflow-hidden   { overflow: hidden; }
.overflow-x-auto   { overflow-x: auto; }

.float-right  { float: right; }
.clearfix::after { content: ''; display: table; clear: both; }
.cursor-pointer  { cursor: pointer; }
.divider { border: none; border-top: 1px solid var(--border); margin: 18px 0; }
.empty-state { text-align: center; padding: 48px 20px; color: var(--text-muted); }
.empty-state .icon { font-size: 54px; margin-bottom: 14px; opacity: .28; }
.modal-open { overflow: hidden; }


/* ============================================================
   27. RESPONSIVE — = 1100px  (4-col stat ? 2-col)
   ============================================================ */
@media (max-width: 1100px) {
  .fu-stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}


/* ============================================================
   28. RESPONSIVE — = 991px
   ============================================================ */
@media (max-width: 991px) {
  .topbar-date { display: none; }
  .topbar-btn  { display: none; }

  .stats-grid,
  .module-stats-grid,
  .three-per-row,
  .birds-stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }

  .form-grid,
  .form-grid-3,
  .modal-form-grid,
  .member-form-grid,
  .birds-form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .form-grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }

  .profile-grid,
  .detail-profile-grid,
  .member-profile-grid,
  .member-view-profile { grid-template-columns: 1fr; }

  .fundraising-grid,
  .campaign-detail-grid { grid-template-columns: 1fr 1fr; }
  .settings-preview-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}


/* ============================================================
   29. RESPONSIVE — = 767px
   ============================================================ */
@media (max-width: 767px) {
  .sidebar { transform: translateX(-100%); z-index: 300; }
  .sidebar.open { transform: translateX(0); }
  .main-content { margin-left: 0 !important; }
  .content-area { padding: 14px 14px 30px; }
  .topbar { padding: 0 14px 0 12px; }
  .topbar-username { display: none; }

  .page-header,
  .module-header,
  .module-page-header,
  .data-page-header,
  .form-page-header,
  .profile-page-header,
  .members-page-header { flex-direction: column; align-items: flex-start; }
  .page-header h2 { font-size: 18px; }

  .module-filter-form,
  .data-filter-form,
  .filter-form,
  .members-filter-form { flex-direction: column; align-items: stretch; }

  .search-box,
  .module-search-box,
  .data-search-box,
  .members-search-box { min-width: 100%; max-width: 100%; }

  .module-filter-form .btn,
  .data-filter-form .btn,
  .filter-form .btn,
  .members-filter-form .btn,
  .module-filter-form select,
  .data-filter-form select,
  .filter-form select,
  .members-filter-form select { width: 100%; justify-content: center; }

  .data-card-header,
  .module-card-header { flex-direction: column; align-items: flex-start; }

  .form-row { flex-direction: column; }
  .form-row > [class*="col-"] { max-width: 100%; flex: 0 0 100%; }

  .stat-number,
  .stat-value { font-size: 1.35rem; }
  .card-body  { padding: 14px; }

  .birds-modal { padding: 8px; }
  .birds-modal-dialog { margin: 10px auto; }
}


/* ============================================================
   30. RESPONSIVE — = 575px
   ============================================================ */
@media (max-width: 575px) {
  .topbar-user { padding: 4px; }
  .btn         { padding: 7px 14px; }
  .btn-sm      { padding: 5px 10px; font-size: 11.5px; }
  .table       { font-size: 12px; }
  .table thead th { font-size: 10px; padding: 8px 10px; }
  .table tbody td { padding: 8px 10px; }
  .stat-value,
  .stat-number { font-size: 1.2rem; }

  .stats-grid,
  .module-stats-grid,
  .three-per-row,
  .birds-stat-grid,
  .fu-stats-grid { grid-template-columns: 1fr; }

  .form-grid,
  .form-grid-2,
  .form-grid-3,
  .form-grid-4,
  .modal-form-grid,
  .member-form-grid,
  .birds-form-grid,
  .detail-grid,
  .campaign-detail-grid { grid-template-columns: 1fr; }

  .fundraising-grid,
  .settings-preview-grid,
  .mini-stat-row { grid-template-columns: 1fr; }

  .form-actions,
  .module-actions,
  .profile-actions,
  .member-view-actions { flex-direction: column; width: 100%; }
  .form-actions .btn,
  .module-actions .btn,
  .profile-actions .btn,
  .member-view-actions .btn { width: 100%; justify-content: center; }

  .detail-list-row,
  .profile-detail-row,
  .info-row,
  .member-detail-row { flex-direction: column; gap: 4px; }
  .detail-label,
  .profile-detail-label,
  .info-label,
  .member-detail-label { min-width: 0; }
  .detail-value,
  .profile-detail-value,
  .info-value,
  .member-detail-value { text-align: left; }

  .member-view-row { grid-template-columns: 1fr; gap: 3px; }

  .modal-overlay { padding: 10px; }
  .modal { max-height: 96vh; }
  .modal-body { padding: 16px; }
  .modal-header, .modal-footer { padding-left: 16px; padding-right: 16px; }

  .app-modal,
  .ajax-modal { padding: 10px 8px; }
  .app-modal-body,
  .ajax-modal-body { padding: 14px; max-height: calc(100vh - 145px); }

  .member-modal-overlay { padding: 8px !important; }
  .member-modal-overlay .modal { max-height: calc(100vh - 16px) !important; }
  .member-modal-overlay .modal-body { max-height: calc(100vh - 158px) !important; }
}


/* ============================================================
   32. BULK MESSAGING MODULE
   ============================================================ */
.bulk-message-page .bulk-page-grid {
  display: grid; grid-template-columns: 1fr; gap: 18px;
}

/* Tabs */
.bulk-message-page .bulk-tabs {
  display: flex; gap: 8px; flex-wrap: wrap;
  margin-bottom: 16px;
  border-bottom: 1px solid #e5e7eb; padding-bottom: 10px;
}
.bulk-message-page .tab-btn {
  border: 1px solid #d1d5db; background: #fff; color: #374151;
  padding: 10px 16px; border-radius: 10px; font-weight: 700; cursor: pointer;
}
.bulk-message-page .tab-btn.active {
  background: var(--primary); color: #fff; border-color: var(--primary);
}

/* Stats grid — 3 cols */
.bulk-message-page .stats-grid-3 {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px;
}

/* Stat card override (lighter style for this module) */
.bulk-message-page .stat-card {
  background:#673ab7; color: #fff; border: 1px solid #673ab7; border-radius: 14px;
  padding: 16px; box-shadow: 0 6px 18px rgba(15,23,42,.05);
}
.bulk-message-page .stat-icon {
  width: 42px; height: 42px; border-radius: 12px;
  background: #f1f5f9; color: var(--primary);
}
.bulk-message-page .stat-value { font-size: 22px; }
.bulk-message-page .stat-label { color: #fff; margin-top: 4px; }

/* Actions row */
.bulk-message-page .bulk-actions,
.bulk-message-page .bulk-recipient-actions {
  display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-top: 14px;
}

/* Recipient checkboxes */
.bulk-message-page .recipient-check,
.bulk-message-page #selectAllRecipients,
.bulk-message-page #selectAllRecipientsHead { width: 18px; height: 18px; cursor: pointer; }

/* Table */
.bulk-message-page .module-table { min-width: 780px; }

/* Local helpers */
.bulk-message-page .justify-between { justify-content: space-between; }
.bulk-message-page .align-center    { align-items: center; }

@media (max-width: 900px) {
  .bulk-message-page .stats-grid-3 { grid-template-columns: 1fr; }
  .bulk-message-page .form-grid    { grid-template-columns: 1fr; }
}


/* ============================================================
   33. DEPARTMENTS MODULE
   ============================================================ */
.dept-stats-grid {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px; margin-bottom: 20px;
}

.dept-stat-card {
  background: #fff; border-radius: 16px; padding: 18px;
  box-shadow: 0 10px 25px rgba(15,23,42,.08);
  border: 1px solid rgba(148,163,184,.25);
  display: flex; align-items: center; gap: 14px;
}
.dept-stat-icon {
  width: 48px; height: 48px; border-radius: 14px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: rgba(37,99,235,.12); font-size: 21px;
}
.dept-stat-value { font-size: 26px; font-weight: 800; line-height: 1; }
.dept-stat-label { color: #64748b; font-size: 13px; margin-top: 5px; }

/* Toolbar */
.dept-toolbar {
  display: flex; gap: 12px; align-items: center;
  justify-content: space-between; margin-bottom: 14px; flex-wrap: wrap;
}
.dept-search { min-width: 260px; flex: 1; max-width: 420px; }
.dept-search input {
  width: 100%; padding: 10px 12px;
  border: 1px solid #d1d5db; border-radius: 10px;
}

/* Dept card grid */
.dept-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 18px; }
.dept-card { border-top: 4px solid var(--primary); }
.dept-card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.dept-code  { font-size: 11px; }
.dept-title { margin: 8px 0 0; font-size: 18px; color: var(--primary); }
.dept-desc  { color: var(--text-muted); font-size: 13px; margin: 8px 0; min-height: 36px; }
.dept-meta  { display: flex; gap: 20px; align-items: center; margin-top: 12px; }
.dept-count { text-align: center; }
.dept-count strong { font-size: 22px; color: var(--primary); }
.dept-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* Alerts */
.dept-alert { display: none; margin-bottom: 12px; border-radius: 10px; padding: 10px 12px; }
.dept-alert.success { display: block; background: #dcfce7; color: #166534; }
.dept-alert.error   { display: block; background: #fee2e2; color: #991b1b; }

/* Modal */
.dept-modal-backdrop {
  position: fixed; inset: 0; background: rgba(15,23,42,.62);
  z-index: 9998; display: none;
}
.dept-modal-backdrop.show { display: block; }
.dept-modal {
  position: fixed; inset: 0; z-index: 9999;
  display: none; align-items: flex-start; justify-content: center;
  overflow: auto; padding: 30px 14px;
}
.dept-modal.show { display: flex; }

.dept-dialog {
  width: min(860px, 100%); background: #fff; border-radius: 18px;
  box-shadow: 0 20px 60px rgba(0,0,0,.25); overflow: hidden;
}
.dept-dialog-sm { width: min(520px, 100%); }

.dept-modal-header {
  padding: 16px 18px; background: #f8fafc;
  border-bottom: 1px solid #e5e7eb;
  display: flex; align-items: center; justify-content: space-between;
}
.dept-modal-title { font-weight: 800; font-size: 18px; }
.dept-close { border: 0; background: transparent; font-size: 26px; line-height: 1; cursor: pointer; }
.dept-modal-body {
  padding: 18px; max-height: calc(100vh - 180px); overflow-y: auto;
}
.dept-modal-actions {
  padding: 14px 18px; background: #f8fafc;
  border-top: 1px solid #e5e7eb;
  display: flex; justify-content: flex-end; gap: 10px;
}

/* Form grid */
.dept-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.dept-full { grid-column: 1 / -1; }
.dept-field label { font-weight: 700; font-size: 13px; margin-bottom: 6px; display: block; }
.dept-field input,
.dept-field select,
.dept-field textarea { width: 100%; border: 1px solid #d1d5db; border-radius: 10px; padding: 10px 12px; }
.dept-field textarea { min-height: 90px; resize: vertical; }

/* Member layout inside dept view */
.dept-member-layout { display: grid; grid-template-columns: 2fr 1fr; gap: 18px; }
.member-row { display: flex; align-items: center; gap: 10px; }

@media (max-width: 900px) {
  .dept-stats-grid  { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dept-form-grid,
  .dept-member-layout { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .dept-stats-grid  { grid-template-columns: 1fr; }
  .dept-search      { max-width: 100%; min-width: 100%; }
  .dept-modal       { padding: 12px 8px; }
  .dept-modal-body  { max-height: calc(100vh - 130px); }
}


/* ============================================================
   31. PRINT
   ============================================================ */
@media print {
  .sidebar, .topbar, .page-header .btn,
  .no-print, .btn-primary, .btn-danger { display: none !important; }
  .main-content { margin-left: 0 !important; }
  .content-area { padding: 0; }
  .card { box-shadow: none; border: 1px solid #ddd; }
  body { background: #fff; font-size: 12px; }
}

.login-logo {
  display: flex;
  justify-content: center;
  margin-bottom: 14px;
}
.login-logo-img {
  width: 130px;
  height: 130px;
  object-fit: contain;
  border-radius: 50%;
  background: #fff;
  padding: 4px;
  box-shadow: 0 6px 18px rgba(74,30,143,.18);
  border: 3px solid var(--primary-fade);
}
.login-logo-fallback {
  width: 110px;
  height: 110px;
  border-radius: 50%;
  background: var(--primary-fade);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  font-size: 44px;
  margin: 0 auto;
}
.login-title {
  font-size: 20px;
  font-weight: 800;
  color: var(--primary);
  margin-bottom: 22px;
  text-align: center;
}
.login-footer p {
  font-style: italic;
  line-height: 1.5;
}


.settings-tab-nav{display:flex;gap:8px;flex-wrap:wrap;padding:14px;border-bottom:1px solid #e5e7eb;background:#f8fafc}.settings-tab{border:1px solid #d1d5db;background:#fff;border-radius:10px;padding:10px 14px;font-weight:700;cursor:pointer}.settings-tab.active{background:var(--primary,#4a1e8f);color:#fff;border-color:var(--primary,#4a1e8f)}.settings-tab-panel{display:none;padding:20px}.settings-tab-panel.active{display:block}.settings-form .form-actions{margin-top:18px}.stat-value.small{font-size:18px;word-break:break-word}


.ce-module{--primary:#05645b;--ce-secondary:#d7df21;--ce-bg:#f5f7f7;--ce-border:#dfe7e5}.ce-module .content-area{padding:24px;background:var(--ce-bg);min-height:100vh}.ce-page-head,.ce-section-title{display:flex;justify-content:space-between;gap:15px;align-items:center;margin-bottom:20px}.ce-page-head h2,.ce-section-title h3{margin:0;color:#143b37}.ce-page-head p{margin:5px 0 0;color:#60706d}.ce-stats{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:15px;margin-bottom:20px}.ce-stat,.ce-card{background:#fff;border:1px solid var(--ce-border);border-radius:16px;box-shadow:0 8px 24px rgba(5,100,91,.06)}.ce-stat{padding:20px;display:grid;grid-template-columns:44px 1fr;align-items:center}.ce-stat i{grid-row:1/3;font-size:22px;color:var(--primary)}.ce-stat b{font-size:25px}.ce-stat span{color:#657572}.ce-tabs{display:flex;gap:8px;overflow:auto;margin:0 0 20px}.ce-tabs a{padding:11px 14px;border-radius:10px;background:#fff;border:1px solid var(--ce-border);color:#34514d;text-decoration:none;white-space:nowrap}.ce-tabs a.active{background:var(--primary);color:#fff}.ce-grid-2{display:grid;grid-template-columns:minmax(320px,.85fr) minmax(0,1.4fr);gap:20px;margin-bottom:24px}.ce-card{padding:20px}.ce-card h3{margin-top:0}.ce-form{display:grid;gap:14px}.ce-form label{display:grid;gap:6px;font-weight:600;color:#2f4945}.ce-form input,.ce-form select,.ce-form textarea,.ce-section-title input{width:100%;border:1px solid #ccd9d7;border-radius:9px;padding:10px 12px;background:#fff}.ce-row{display:grid;grid-template-columns:repeat(auto-fit,minmax(150px,1fr));gap:12px}.ce-check{display:flex!important;grid-template-columns:auto 1fr!important;align-items:center}.ce-check input{width:auto}.ce-table-card{overflow:hidden}.ce-table-card table{width:100%;border-collapse:collapse}.ce-table-card th,.ce-table-card td{padding:11px;border-bottom:1px solid #edf1f0;text-align:left;vertical-align:top}.ce-table-card th{font-size:12px;text-transform:uppercase;color:#657572}.ce-badge{display:inline-block;padding:4px 8px;border-radius:999px;background:#e8f3f1;color:#05645b;font-size:12px}.ce-badge.urgent,.ce-announcement.urgent{background:#fff0f0;border-color:#efb9b9}.ce-badge.important,.ce-announcement.important{background:#fff8df;border-color:#efdc91}.ce-icon-btn{border:0;background:transparent;color:#b03a3a;padding:6px;cursor:pointer}.ce-list-item,.ce-notes article{display:flex;justify-content:space-between;gap:10px;padding:14px 0;border-bottom:1px solid #edf1f0}.ce-list-item h4,.ce-notes h4{margin:5px 0}.ce-theme{padding:16px;border:1px solid var(--ce-border);border-radius:12px;margin-bottom:12px}.ce-theme-hero{background:linear-gradient(135deg,#05645b,#0d8176);color:#fff;border-radius:18px;padding:28px;margin-bottom:24px}.ce-theme-hero h2{margin:8px 0}.ce-theme-hero p{font-size:17px}.ce-progress{height:8px;background:#e7eceb;border-radius:999px;overflow:hidden}.ce-progress span{display:block;height:100%;background:var(--primary)}.ce-alert{padding:12px 15px;border-radius:10px;margin-bottom:15px}.ce-alert-success{background:#eaf8ef;color:#146331}.ce-alert-danger{background:#fff0f0;color:#8b2727}.ce-card-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(260px,1fr));gap:18px;margin-bottom:24px}.ce-media-card,.ce-service-card{background:#fff;border:1px solid var(--ce-border);border-radius:15px;overflow:hidden}.ce-media-card>div:last-child,.ce-service-card>div{padding:16px}.ce-media-thumb{height:160px;background:#0f2421;display:grid;place-items:center;position:relative;color:#fff;font-size:40px}.ce-media-thumb img,.ce-service-card>img{width:100%;height:180px;object-fit:cover}.ce-media-thumb span{position:absolute;top:10px;left:10px;background:#d92929;padding:5px 8px;border-radius:5px;font-size:12px}.ce-calendar{display:grid;grid-template-columns:repeat(7,minmax(90px,1fr));overflow:auto}.ce-calendar>div{min-height:90px;border-right:1px solid #e8edec;border-bottom:1px solid #e8edec;padding:8px}.ce-calendar>div:nth-child(-n+7){min-height:auto;font-weight:700;background:#f2f6f5}.ce-day.today{background:#eef9f7}.ce-day article{margin-top:5px;padding:5px;border-radius:6px;background:#e8f3f1;font-size:11px}.ce-day article strong,.ce-day article small{display:block}.ce-announcement{border:1px solid var(--ce-border);border-left:4px solid var(--primary);padding:14px;border-radius:10px;margin-bottom:12px}.ce-announcement h4{margin:6px 0}.ce-announcement>span{font-size:11px;text-transform:uppercase}.ce-service-card details{margin:10px 0}.ce-harvest,.ce-pledge{padding:12px 0;border-bottom:1px solid #edf1f0}.ce-harvest small,.ce-pledge small,.ce-pledge span{display:block;color:#657572}.ce-note{font-size:12px;color:#657572}.ce-empty{color:#7b8886}.btn-danger{background:#d92929!important;color:#fff!important}.btn-outline-primary{border:1px solid var(--primary)!important;color:var(--primary)!important;background:#fff!important}.btn-primary{background:var(--primary)!important;border-color:var(--primary)!important}.ce-note-form{margin-bottom:18px}@media(max-width:1000px){.ce-stats{grid-template-columns:repeat(2,1fr)}.ce-grid-2{grid-template-columns:1fr}.ce-calendar{grid-template-columns:repeat(7,120px)}}@media(max-width:600px){.ce-module .content-area{padding:14px}.ce-stats{grid-template-columns:1fr}.ce-page-head{align-items:flex-start;flex-direction:column}.ce-card{padding:15px}.ce-card-grid{grid-template-columns:1fr}}



/* Church module and settings additions */
.settings-church-card{margin-bottom:18px;padding:18px;display:flex;justify-content:space-between;align-items:center;gap:15px;flex-wrap:wrap}
.settings-church-title{margin:0 0 5px}
.settings-church-description{margin:0}
.settings-current-logo{max-height:100px;object-fit:contain;margin-top:10px}
.settings-current-favicon{width:54px;height:54px;object-fit:contain;margin-top:10px}
.settings-color-field{display:grid;grid-template-columns:58px 1fr;gap:10px;align-items:center}
.settings-color-picker{width:58px;height:42px;padding:2px;border:1px solid var(--border);border-radius:var(--radius-sm);background:var(--white);cursor:pointer}
.settings-color-code{font-family:ui-monospace,SFMono-Regular,Menlo,monospace}

.ce-progress-0{width:0%}
.ce-progress-1{width:1%}
.ce-progress-2{width:2%}
.ce-progress-3{width:3%}
.ce-progress-4{width:4%}
.ce-progress-5{width:5%}
.ce-progress-6{width:6%}
.ce-progress-7{width:7%}
.ce-progress-8{width:8%}
.ce-progress-9{width:9%}
.ce-progress-10{width:10%}
.ce-progress-11{width:11%}
.ce-progress-12{width:12%}
.ce-progress-13{width:13%}
.ce-progress-14{width:14%}
.ce-progress-15{width:15%}
.ce-progress-16{width:16%}
.ce-progress-17{width:17%}
.ce-progress-18{width:18%}
.ce-progress-19{width:19%}
.ce-progress-20{width:20%}
.ce-progress-21{width:21%}
.ce-progress-22{width:22%}
.ce-progress-23{width:23%}
.ce-progress-24{width:24%}
.ce-progress-25{width:25%}
.ce-progress-26{width:26%}
.ce-progress-27{width:27%}
.ce-progress-28{width:28%}
.ce-progress-29{width:29%}
.ce-progress-30{width:30%}
.ce-progress-31{width:31%}
.ce-progress-32{width:32%}
.ce-progress-33{width:33%}
.ce-progress-34{width:34%}
.ce-progress-35{width:35%}
.ce-progress-36{width:36%}
.ce-progress-37{width:37%}
.ce-progress-38{width:38%}
.ce-progress-39{width:39%}
.ce-progress-40{width:40%}
.ce-progress-41{width:41%}
.ce-progress-42{width:42%}
.ce-progress-43{width:43%}
.ce-progress-44{width:44%}
.ce-progress-45{width:45%}
.ce-progress-46{width:46%}
.ce-progress-47{width:47%}
.ce-progress-48{width:48%}
.ce-progress-49{width:49%}
.ce-progress-50{width:50%}
.ce-progress-51{width:51%}
.ce-progress-52{width:52%}
.ce-progress-53{width:53%}
.ce-progress-54{width:54%}
.ce-progress-55{width:55%}
.ce-progress-56{width:56%}
.ce-progress-57{width:57%}
.ce-progress-58{width:58%}
.ce-progress-59{width:59%}
.ce-progress-60{width:60%}
.ce-progress-61{width:61%}
.ce-progress-62{width:62%}
.ce-progress-63{width:63%}
.ce-progress-64{width:64%}
.ce-progress-65{width:65%}
.ce-progress-66{width:66%}
.ce-progress-67{width:67%}
.ce-progress-68{width:68%}
.ce-progress-69{width:69%}
.ce-progress-70{width:70%}
.ce-progress-71{width:71%}
.ce-progress-72{width:72%}
.ce-progress-73{width:73%}
.ce-progress-74{width:74%}
.ce-progress-75{width:75%}
.ce-progress-76{width:76%}
.ce-progress-77{width:77%}
.ce-progress-78{width:78%}
.ce-progress-79{width:79%}
.ce-progress-80{width:80%}
.ce-progress-81{width:81%}
.ce-progress-82{width:82%}
.ce-progress-83{width:83%}
.ce-progress-84{width:84%}
.ce-progress-85{width:85%}
.ce-progress-86{width:86%}
.ce-progress-87{width:87%}
.ce-progress-88{width:88%}
.ce-progress-89{width:89%}
.ce-progress-90{width:90%}
.ce-progress-91{width:91%}
.ce-progress-92{width:92%}
.ce-progress-93{width:93%}
.ce-progress-94{width:94%}
.ce-progress-95{width:95%}
.ce-progress-96{width:96%}
.ce-progress-97{width:97%}
.ce-progress-98{width:98%}
.ce-progress-99{width:99%}
.ce-progress-100{width:100%}

.settings-submit-spaced{margin-top:12px}

/* Baptism register responsive layout */
.baptism-title-icon{color:var(--primary)}
.baptism-stats-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:16px}
.baptism-stat-card{min-width:0;cursor:pointer}
.baptism-stat-card .stat-body{min-width:0}
.baptism-stat-card .stat-number,.baptism-stat-card .stat-label{writing-mode:horizontal-tb;text-orientation:mixed}
.baptism-stat-card .stat-label{white-space:normal;word-break:normal;overflow-wrap:break-word;hyphens:none}
.baptism-stat-icon-primary{background:rgba(74,30,143,.12);color:var(--primary)}
.baptism-stat-icon-accent{background:rgba(212,160,23,.15);color:var(--accent)}
.baptism-stat-icon-success{background:rgba(40,167,69,.12);color:var(--success)}
.baptism-stat-icon-info{background:rgba(23,162,184,.12);color:var(--info)}
.baptism-stat-icon-danger{background:rgba(220,53,69,.12);color:var(--danger)}
.baptism-type-filter{max-width:180px}
.baptism-loading-cell{padding:28px}

.bap-modal-backdrop{position:fixed;inset:0;background:rgba(15,23,42,.62);z-index:9998;display:none}
.bap-modal-backdrop.show{display:block}
.bap-modal{position:fixed;inset:0;z-index:9999;display:none;align-items:flex-start;justify-content:center;overflow:auto;padding:28px 14px}
.bap-modal.show{display:flex}
.bap-dialog{width:min(900px,100%);background:#fff;border-radius:18px;box-shadow:0 20px 60px rgba(0,0,0,.25);overflow:hidden;margin:auto 0}
.bap-modal-header{padding:16px 20px;background:var(--primary);color:#fff;display:flex;align-items:center;justify-content:space-between;gap:12px}
.bap-modal-title{font-weight:800;font-size:17px;color:#fff;display:flex;align-items:center;gap:8px}
.bap-close{border:0;background:rgba(255,255,255,.18);color:#fff;font-size:22px;line-height:1;cursor:pointer;width:32px;height:32px;border-radius:6px;display:inline-flex;align-items:center;justify-content:center}
.bap-close:hover{background:rgba(255,255,255,.32)}
.bap-modal-body{padding:18px;max-height:calc(100vh - 190px);overflow-y:auto}
.bap-modal-actions,.bap-modal-footer{padding:14px 20px;background:#faf9fd;border-top:1px solid var(--border);display:flex;justify-content:flex-end;gap:10px}
#bapRowsHeader,.bap-candidate-row{display:grid;grid-template-columns:22px 1fr 1fr 1fr 110px 110px 120px 36px;gap:6px;align-items:start}
#bapRowsHeader{align-items:center;padding:8px 20px;background:#f5f1ff;border-bottom:2px solid var(--border);font-size:10.5px;font-weight:700;color:var(--primary);text-transform:uppercase;letter-spacing:.5px;white-space:nowrap}
.bap-candidate-row{padding:7px 0;border-bottom:1px solid #f0ecfa}
.bap-candidate-row:last-child{border-bottom:none}
.ajax-alert{display:none;margin:10px 0;padding:10px 12px;border-radius:8px;font-size:14px}
.ajax-alert.success{display:block;background:rgba(40,167,69,.12);color:#155724}
.ajax-alert.error{display:block;background:rgba(220,53,69,.12);color:#721c24}
.cms-modal-open{overflow:hidden}
@media(max-width:991px){.baptism-stats-grid{grid-template-columns:repeat(2,minmax(0,1fr))}#bapRowsHeader,.bap-candidate-row{grid-template-columns:1fr 1fr 36px}#bapRowsHeader>div:nth-child(n+4),.bap-candidate-row>div:nth-child(n+4):not(:last-child){display:none}}
@media(max-width:767px){.baptism-stats-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}.baptism-stat-card{min-height:112px;padding:14px;gap:10px}.baptism-stat-card .stat-icon{flex:0 0 44px;width:44px;height:44px;border-radius:12px}.baptism-stat-card .stat-number{font-size:1.45rem;line-height:1.1}.baptism-stat-card .stat-label{margin-top:5px;font-size:11px;line-height:1.3;letter-spacing:0}.baptism-type-filter{max-width:none;width:100%}}
@media(max-width:560px){.bap-modal{padding:10px 6px}.bap-modal-actions,.bap-modal-footer{flex-direction:column}.bap-modal-actions .btn,.bap-modal-footer .btn{width:100%}}
@media(max-width:420px){.baptism-stats-grid{grid-template-columns:1fr}.baptism-stat-card{min-height:96px}}

/* ============================================================
   ACTIVITY LOGS
   ============================================================ */

.activity-logs-page {
    min-width: 0;
}

.activity-stats-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.activity-stat-card {
    min-width: 0;
}

.activity-stat-card .stat-icon {
    background: rgba(255, 255, 255, .15);
}

.activity-stat-card .stat-body {
    min-width: 0;
}

.activity-stat-card .stat-label {
    color: #fff;
    white-space: normal;
    word-break: normal;
    overflow-wrap: break-word;
}

.activity-card-description {
    margin: 4px 0 0;
    color: var(--text-muted);
    font-size: 12px;
}

.activity-filter-form {
    display: grid;
    grid-template-columns:
        minmax(260px, 2fr)
        minmax(160px, 1fr)
        minmax(145px, .8fr)
        minmax(145px, .8fr)
        minmax(130px, .7fr)
        auto
        auto;
    gap: 10px;
    align-items: center;
    margin-bottom: 16px;
}

.activity-search-box {
    min-width: 0;
    max-width: none;
}

.activity-filter-form .form-control,
.activity-filter-form .module-search-box input {
    height: 42px;
}

.activity-per-page {
    min-width: 125px;
}

.activity-table {
    min-width: 1040px;
}

.activity-table td {
    vertical-align: middle;
}

.activity-user {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 190px;
}

.activity-user-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 34px;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    color: #fff;
    background: var(--primary);
    font-size: 13px;
    font-weight: 800;
}

.activity-user strong,
.activity-user small {
    display: block;
}

.activity-user small,
.activity-username {
    margin-top: 2px;
    color: var(--text-muted);
    font-size: 11.5px;
}

.activity-username {
    display: block;
}

.activity-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 9px;
    border-radius: 999px;
    color: var(--primary);
    background: var(--primary-fade);
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
}

.activity-description {
    min-width: 260px;
    max-width: 440px;
    white-space: normal;
    overflow-wrap: anywhere;
}

.activity-ip {
    display: inline-block;
    padding: 4px 7px;
    border-radius: 6px;
    color: var(--text);
    background: #f3f4f6;
    font-size: 11.5px;
    white-space: nowrap;
}

.activity-pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    padding: 14px 18px;
    border-top: 1px solid var(--border);
    background: #faf9fd;
}

.activity-pagination-summary {
    color: var(--text-muted);
    font-size: 12.5px;
}

.activity-pagination-summary strong {
    color: var(--text);
}

.activity-pages {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.activity-pages a,
.activity-page-ellipsis {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    height: 34px;
    padding: 0 10px;
    border: 1px solid var(--border);
    border-radius: 7px;
    color: var(--primary);
    background: #fff;
    font-size: 12px;
    font-weight: 700;
    text-decoration: none;
    transition: var(--transition);
}

.activity-pages a:hover {
    color: #fff;
    border-color: var(--primary);
    background: var(--primary);
}

.activity-pages a.active {
    color: #fff;
    border-color: var(--primary);
    background: var(--primary);
}

.activity-page-ellipsis {
    min-width: 28px;
    border-color: transparent;
    background: transparent;
}

@media (max-width: 1200px) {
    .activity-filter-form {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .activity-search-box {
        grid-column: span 2;
    }
}

@media (max-width: 991px) {
    .activity-stats-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .activity-filter-form {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .activity-search-box {
        grid-column: 1 / -1;
    }
}

@media (max-width: 767px) {
    .activity-filter-form {
        grid-template-columns: 1fr;
    }

    .activity-search-box {
        grid-column: auto;
    }

    .activity-filter-form .btn,
    .activity-filter-form .form-control {
        width: 100%;
        justify-content: center;
    }

    .activity-pagination {
        align-items: flex-start;
        flex-direction: column;
    }
}

@media (max-width: 575px) {
    .activity-stats-grid {
        grid-template-columns: 1fr;
    }

    .activity-pages {
        width: 100%;
    }

    .activity-pages a {
        flex: 1 0 34px;
    }
}



/* ============================================================
   DEFINITIVE MOBILE SIDEBAR FIX
   Keep this block at the very end of style.css.
   ============================================================ */
.sidebar-overlay {
    position: fixed !important;
    inset: 0 !important;
    z-index: 2147483000 !important;
    display: block !important;
    background: rgba(15, 23, 42, .62) !important;
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
    transition: opacity .25s ease, visibility .25s ease !important;
}

.sidebar-overlay.show {
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
}

@media (max-width: 767px) {
    .sidebar,
    #sidebar {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        bottom: 0 !important;
        z-index: 2147483001 !important;
        width: min(280px, 86vw) !important;
        min-width: min(280px, 86vw) !important;
        max-width: 86vw !important;
        height: 100vh !important;
        height: 100dvh !important;
        transform: translate3d(-105%, 0, 0) !important;
        visibility: hidden !important;
        opacity: 1 !important;
        pointer-events: none !important;
        will-change: transform !important;
        transition: transform .28s cubic-bezier(.4, 0, .2, 1), visibility .28s ease !important;
    }

    .sidebar.open,
    #sidebar.open {
        transform: translate3d(0, 0, 0) !important;
        visibility: visible !important;
        pointer-events: auto !important;
    }

    body.sidebar-open {
        overflow: hidden !important;
        touch-action: none !important;
    }

    .main-content {
        margin-left: 0 !important;
    }

    .topbar {
        z-index: 1000 !important;
    }
}

@media (min-width: 768px) {
    .sidebar-overlay,
    .sidebar-overlay.show {
        opacity: 0 !important;
        visibility: hidden !important;
        pointer-events: none !important;
    }

    .sidebar,
    #sidebar {
        visibility: visible !important;
        pointer-events: auto !important;
        transform: none !important;
    }
}
