/* ============================================================
   Baptist Connect — Admin Dashboard Stylesheet
   ============================================================ */

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

:root {
  --sidebar-bg:     #0D1B5E;
  --sidebar-hover:  rgba(255,255,255,.07);
  --sidebar-active: rgba(255,255,255,.12);
  --sidebar-w:      240px;
  --primary:        #1B3FA0;
  --primary-light:  #EEF2FF;
  --accent:         #F59E0B;
  --white:          #FFFFFF;
  --bg:             #F5F7FF;
  --card-bg:        #FFFFFF;
  --border:         #E5E7EB;
  --gray-400:       #9CA3AF;
  --gray-500:       #6B7280;
  --gray-600:       #4B5563;
  --gray-700:       #374151;
  --gray-800:       #1F2937;
  --gray-900:       #111827;
  --success:        #10B981;
  --danger:         #EF4444;
  --warning:        #F59E0B;
  --info:           #3B82F6;
  --font:           'Inter', -apple-system, sans-serif;
  --radius:         12px;
  --radius-sm:      8px;
  --radius-lg:      16px;
  --shadow:         0 1px 4px rgba(0,0,0,.08);
  --shadow-md:      0 4px 16px rgba(0,0,0,.1);
  --transition:     0.2s cubic-bezier(.4,0,.2,1);
}

html, body { height: 100%; }
body { font-family: var(--font); background: var(--bg); color: var(--gray-800); display: flex; min-height: 100vh; font-size: 14px; -webkit-font-smoothing: antialiased; }

/* ── Sidebar ─────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  background: var(--sidebar-bg);
  color: #fff;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 200;
  overflow-y: auto;
  scrollbar-width: none;
  transition: transform var(--transition);
}
.sidebar::-webkit-scrollbar { display: none; }

.sidebar-brand {
  padding: 20px 16px 16px;
  border-bottom: 1px solid rgba(255,255,255,.08);
  display: flex;
  align-items: center;
  gap: 12px;
}
.sidebar-brand img { width: 42px; height: 42px; border-radius: 50%; border: 2px solid rgba(255,255,255,.2); }
.sidebar-brand-text h2 { font-size: .88rem; font-weight: 800; line-height: 1.1; }
.sidebar-brand-text span { font-size: .68rem; color: rgba(255,255,255,.5); display: block; margin-top: 2px; }

.sidebar-nav { flex: 1; padding: 12px 8px; }
.nav-section-label { font-size: .63rem; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; color: rgba(255,255,255,.3); padding: 10px 8px 6px; margin-top: 8px; }
.nav-section-label:first-child { margin-top: 0; }

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: var(--radius-sm);
  color: rgba(255,255,255,.7);
  font-size: .83rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
  margin-bottom: 2px;
  position: relative;
}
.sidebar-link svg { width: 18px; height: 18px; flex-shrink: 0; }
.sidebar-link:hover { background: var(--sidebar-hover); color: #fff; }
.sidebar-link.active { background: var(--sidebar-active); color: #fff; font-weight: 600; }
.sidebar-link.active::before {
  content: '';
  position: absolute;
  left: 0; top: 50%;
  transform: translateY(-50%);
  width: 3px; height: 60%;
  background: var(--accent);
  border-radius: 0 2px 2px 0;
}
.sidebar-link .badge {
  margin-left: auto;
  background: var(--danger);
  color: #fff;
  font-size: .65rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 99px;
  min-width: 18px;
  text-align: center;
}
.nav-arrow { margin-left: auto; transition: transform var(--transition); }
.sidebar-link.open .nav-arrow { transform: rotate(90deg); }

.sidebar-user {
  padding: 14px 16px;
  border-top: 1px solid rgba(255,255,255,.08);
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  transition: background var(--transition);
}
.sidebar-user:hover { background: var(--sidebar-hover); }
.sidebar-user-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--primary);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: .82rem;
  flex-shrink: 0;
  overflow: hidden;
}
.sidebar-user-avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.sidebar-user-info { flex: 1; min-width: 0; }
.sidebar-user-info strong { display: block; font-size: .82rem; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user-info span { font-size: .7rem; color: rgba(255,255,255,.5); }
.online-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--success); border: 1.5px solid var(--sidebar-bg); flex-shrink: 0; }

/* ── Main ────────────────────────────────────────────────── */
.admin-main {
  margin-left: var(--sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-width: 0;
}

/* ── Topbar ──────────────────────────────────────────────── */
.topbar {
  background: var(--card-bg);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow);
}
.topbar-left { display: flex; align-items: center; gap: 14px; }
.sidebar-toggle { display: none; background: none; border: none; cursor: pointer; padding: 6px; border-radius: var(--radius-sm); }
.sidebar-toggle svg { width: 20px; height: 20px; color: var(--gray-700); }
.topbar-title { font-size: 1.15rem; font-weight: 700; color: var(--gray-900); }
.date-badge {
  display: flex; align-items: center; gap: 6px;
  background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 6px 12px;
  font-size: .8rem;
  color: var(--gray-600);
  cursor: pointer;
}
.date-badge svg { width: 14px; height: 14px; }
.topbar-right { display: flex; align-items: center; gap: 10px; }
.icon-btn {
  width: 38px; height: 38px;
  border-radius: var(--radius-sm);
  background: var(--bg);
  border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  position: relative;
  transition: all var(--transition);
}
.icon-btn:hover { background: var(--primary-light); border-color: var(--primary); }
.icon-btn svg { width: 18px; height: 18px; color: var(--gray-600); }
.icon-btn .dot {
  position: absolute; top: 6px; right: 6px;
  width: 8px; height: 8px;
  background: var(--danger); border-radius: 50%;
  border: 1.5px solid var(--card-bg);
}
.topbar-profile {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background var(--transition);
}
.topbar-profile:hover { background: var(--bg); }
.topbar-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--primary);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: .82rem; color: #fff;
  overflow: hidden;
}
.topbar-avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.topbar-name { font-size: .82rem; font-weight: 600; color: var(--gray-800); }
.topbar-role { font-size: .7rem; color: var(--gray-400); }
.topbar-logout-btn {
  display: flex; align-items: center; gap: 6px;
  background: #FEE2E2; color: #991B1B; border: none;
  padding: 7px 12px; border-radius: 8px;
  font-size: .78rem; font-weight: 600; cursor: pointer;
  text-decoration: none; transition: background var(--transition);
}
.topbar-logout-btn:hover { background: #FCA5A5; }

/* ── Page content ────────────────────────────────────────── */
.page-content { padding: 24px; flex: 1; }
.page-header { margin-bottom: 20px; display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.page-header h1 { font-size: 1.35rem; font-weight: 800; color: var(--gray-900); }
.page-header p { font-size: .85rem; color: var(--gray-500); margin-top: 4px; }
.page-header > div { flex: 1; min-width: 0; }

/* ── Stat Cards ──────────────────────────────────────────── */
.stats-row { display: grid; grid-template-columns: repeat(5, 1fr); gap: 16px; margin-bottom: 20px; }
.stat-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 20px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  transition: box-shadow var(--transition);
}
.stat-card:hover { box-shadow: var(--shadow-md); }
.stat-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.stat-icon { width: 42px; height: 42px; border-radius: var(--radius-sm); display: flex; align-items: center; justify-content: center; }
.stat-icon svg { width: 22px; height: 22px; color: #fff; }
.stat-change { font-size: .75rem; font-weight: 700; display: flex; align-items: center; gap: 3px; }
.stat-change.up { color: var(--success); }
.stat-change.down { color: var(--danger); }
.stat-change svg { width: 12px; height: 12px; }
.stat-value { font-size: 1.55rem; font-weight: 900; color: var(--gray-900); line-height: 1; margin-bottom: 4px; }
.stat-label { font-size: .75rem; color: var(--gray-500); }
.stat-sub { font-size: .7rem; color: var(--gray-400); margin-top: 4px; }

/* ── Charts Row ──────────────────────────────────────────── */
.charts-row { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; margin-bottom: 20px; }
.chart-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 20px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}
.chart-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.chart-header h3 { font-size: .9rem; font-weight: 700; color: var(--gray-900); }
.chart-select {
  background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 5px 10px;
  font-size: .75rem; color: var(--gray-600);
  cursor: pointer;
}

/* ── Tables ──────────────────────────────────────────────── */
.data-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 20px; }
.data-row.full { grid-template-columns: 1fr; }
.table-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.table-header { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.table-header h3 { font-size: .9rem; font-weight: 700; color: var(--gray-900); }
.view-all { font-size: .78rem; color: var(--primary); font-weight: 600; text-decoration: none; }
.view-all:hover { text-decoration: underline; }
table { width: 100%; border-collapse: collapse; }
thead th {
  background: var(--bg);
  padding: 10px 16px;
  font-size: .73rem;
  font-weight: 700;
  color: var(--gray-500);
  text-transform: uppercase;
  letter-spacing: .4px;
  text-align: left;
}
tbody tr { border-bottom: 1px solid var(--border); transition: background var(--transition); }
tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: var(--bg); }
tbody td { padding: 11px 16px; font-size: .82rem; color: var(--gray-700); }

/* ── Activity Feed ───────────────────────────────────────── */
.activity-feed { }
.activity-item { display: flex; gap: 12px; align-items: flex-start; padding: 12px 20px; border-bottom: 1px solid var(--border); transition: background var(--transition); }
.activity-item:last-child { border-bottom: none; }
.activity-item:hover { background: var(--bg); }
.activity-icon { width: 36px; height: 36px; border-radius: 50%; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.activity-icon svg { width: 16px; height: 16px; color: #fff; }
.activity-content { flex: 1; min-width: 0; }
.activity-content strong { font-size: .82rem; font-weight: 600; display: block; color: var(--gray-900); }
.activity-content span { font-size: .75rem; color: var(--gray-500); }
.activity-time { font-size: .72rem; color: var(--gray-400); white-space: nowrap; flex-shrink: 0; }

/* ── Quick Actions ───────────────────────────────────────── */
.quick-actions { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; padding: 16px 20px; }
.qa-btn {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 16px 8px;
  border-radius: var(--radius-sm);
  background: var(--bg);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
}
.qa-btn:hover { background: var(--primary-light); border-color: var(--primary); }
.qa-icon { width: 40px; height: 40px; border-radius: var(--radius-sm); display: flex; align-items: center; justify-content: center; }
.qa-icon svg { width: 20px; height: 20px; color: #fff; }
.qa-label { font-size: .73rem; font-weight: 600; color: var(--gray-700); text-align: center; }

/* ── Donut chart (CSS) ───────────────────────────────────── */
.donut-wrap { display: flex; flex-direction: column; align-items: center; }
.donut-svg { width: 160px; height: 160px; transform: rotate(-90deg); }
.donut-hole { }
.donut-center { position: relative; }
.donut-label { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); text-align: center; pointer-events: none; }
.donut-label strong { display: block; font-size: .9rem; font-weight: 900; color: var(--gray-900); }
.donut-label small { font-size: .65rem; color: var(--gray-500); }
.donut-legend { display: flex; flex-direction: column; gap: 8px; width: 100%; margin-top: 16px; }
.legend-item { display: flex; align-items: center; justify-content: space-between; }
.legend-dot-label { display: flex; align-items: center; gap: 8px; font-size: .78rem; color: var(--gray-700); }
.legend-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.legend-val { font-size: .78rem; font-weight: 700; color: var(--gray-900); }

/* ── Badges / Pills ──────────────────────────────────────── */
.badge { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 99px; font-size: .72rem; font-weight: 700; }
.badge-success { background: #D1FAE5; color: #065F46; }
.badge-danger  { background: #FEE2E2; color: #991B1B; }
.badge-warning { background: #FEF3C7; color: #92400E; }
.badge-info    { background: #DBEAFE; color: #1E40AF; }
.badge-gray    { background: var(--bg); color: var(--gray-600); border: 1px solid var(--border); }

/* ── Search & Filters ────────────────────────────────────── */
.filter-bar { display: flex; gap: 10px; align-items: center; padding: 14px 20px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.search-box { display: flex; align-items: center; gap: 8px; background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 7px 12px; flex: 1; min-width: 200px; }
.search-box svg { width: 15px; height: 15px; color: var(--gray-400); flex-shrink: 0; }
.search-box input { background: none; border: none; outline: none; font-size: .83rem; color: var(--gray-800); width: 100%; font-family: var(--font); }
.filter-select { background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 7px 12px; font-size: .8rem; color: var(--gray-600); cursor: pointer; }
.btn-admin { display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; border-radius: var(--radius-sm); font-size: .8rem; font-weight: 600; cursor: pointer; border: none; transition: all var(--transition); }
.btn-admin svg { width: 14px; height: 14px; }
.btn-admin-primary { background: var(--primary); color: #fff; }
.btn-admin-primary:hover { background: #0F2670; }
.btn-admin-danger { background: var(--danger); color: #fff; }
.btn-admin-danger:hover { background: #DC2626; }
.btn-admin-success { background: var(--success); color: #fff; }
.btn-admin-success:hover { background: #059669; }
.btn-admin-warning { background: var(--warning); color: #fff; }
.btn-admin-warning:hover { background: #D97706; }
.btn-admin-ghost { background: var(--bg); color: var(--gray-700); border: 1px solid var(--border); }
.btn-admin-ghost:hover { border-color: var(--primary); color: var(--primary); }

/* ── Forms ───────────────────────────────────────────────── */
.form-group { margin-bottom: 14px; }
.form-label { display: block; font-size: .78rem; font-weight: 600; color: var(--gray-700); margin-bottom: 5px; }
.form-input { width: 100%; padding: 9px 12px; border: 1.5px solid var(--border); border-radius: var(--radius-sm); font-size: .83rem; color: var(--gray-800); background: var(--card-bg); font-family: var(--font); outline: none; transition: border-color var(--transition); }
.form-input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(27,63,160,.1); }
.form-row-admin { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* ── Modal ───────────────────────────────────────────────── */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 500; display: flex; align-items: center; justify-content: center; opacity: 0; pointer-events: none; transition: opacity var(--transition); }
.modal-overlay.open { opacity: 1; pointer-events: all; }
.modal { background: var(--card-bg); border-radius: var(--radius-lg); width: 100%; max-width: 520px; max-height: 90vh; overflow-y: auto; box-shadow: 0 20px 60px rgba(0,0,0,.3); transform: translateY(20px); transition: transform var(--transition); }
.modal-overlay.open .modal { transform: translateY(0); }
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 20px 24px; border-bottom: 1px solid var(--border); }
.modal-header h3 { font-size: 1rem; font-weight: 700; color: var(--gray-900); }
.modal-close { background: none; border: none; cursor: pointer; width: 32px; height: 32px; border-radius: 6px; display: flex; align-items: center; justify-content: center; color: var(--gray-500); transition: all var(--transition); }
.modal-close:hover { background: var(--bg); color: var(--gray-900); }
.modal-body { padding: 24px; }
.modal-footer { padding: 16px 24px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 10px; }

/* ── Pagination ──────────────────────────────────────────── */
.pagination { display: flex; align-items: center; gap: 4px; padding: 14px 20px; justify-content: center; border-top: 1px solid var(--border); }
.page-btn { min-width: 32px; height: 32px; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--card-bg); font-size: .78rem; font-weight: 600; color: var(--gray-600); display: flex; align-items: center; justify-content: center; cursor: pointer; transition: all var(--transition); padding: 0 8px; }
.page-btn:hover { border-color: var(--primary); color: var(--primary); }
.page-btn.active { background: var(--primary); border-color: var(--primary); color: #fff; }

/* ── Topbar forum pill ───────────────────────────────────── */
.dept-pill { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 99px; font-size: .72rem; font-weight: 700; }
.dept-youth  { background: #EDE9FE; color: #6D28D9; }
.dept-wmu    { background: #FCE7F3; color: #BE185D; }
.dept-mmu    { background: #DBEAFE; color: #1D4ED8; }
.dept-general{ background: #F3F4F6; color: #374151; }

/* ── Admin login ─────────────────────────────────────────── */
.admin-login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, #0D1B5E 0%, #1B3FA0 100%); }
.admin-login-card { background: #fff; border-radius: 20px; padding: 44px 40px; width: 100%; max-width: 420px; box-shadow: 0 25px 60px rgba(0,0,0,.4); }
.admin-login-logo { text-align: center; margin-bottom: 28px; }
.admin-login-logo img { width: 64px; height: 64px; border-radius: 50%; margin: 0 auto 10px; }
.admin-login-logo h2 { font-size: 1.3rem; font-weight: 800; color: #111827; }
.admin-login-logo p { font-size: .82rem; color: #6B7280; margin-top: 4px; }

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 1200px) {
  .stats-row { grid-template-columns: repeat(3, 1fr); }
  .charts-row { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 900px) {
  :root { --sidebar-w: 0px; }
  .sidebar { transform: translateX(-240px); width: 240px; z-index: 300; }
  .sidebar.open { transform: translateX(0); box-shadow: 4px 0 24px rgba(0,0,0,.3); }
  .sidebar-toggle { display: flex !important; }
  .admin-main { margin-left: 0; }
  .stats-row { grid-template-columns: repeat(2, 1fr); }
  .charts-row { grid-template-columns: 1fr; }
  .data-row { grid-template-columns: 1fr; }
  .topbar-title { display: none; }
  .date-badge { display: none; }

  /* Tables: wrap container scrolls, table itself preserves layout */
  .table-card { overflow-x: auto; }
  .table-card table { min-width: 600px; }
  .card table { overflow-x: auto; display: block; }
  table.data-table { display: block; overflow-x: auto; min-width: 500px; }

  /* Grid cards: 2 columns on tablet */
  [style*="grid-template-columns:repeat(auto-fill, minmax(300px"] { grid-template-columns: 1fr 1fr !important; }
  [style*="grid-template-columns:repeat(auto-fill, minmax(350px"] { grid-template-columns: 1fr 1fr !important; }

  /* Stats grid for compatibility pages */
  .stats-grid[style*="repeat(3,1fr)"],
  .stats-grid[style*="repeat(4,1fr)"],
  .stats-grid[style*="repeat(5,1fr)"] { grid-template-columns: repeat(2, 1fr) !important; }
}

@media (max-width: 600px) {
  .stats-row { grid-template-columns: 1fr 1fr; }
  .page-content { padding: 12px; }
  .topbar { padding: 0 12px; height: 52px; }
  .quick-actions { grid-template-columns: repeat(2, 1fr); }
  .form-row-admin { grid-template-columns: 1fr; }
  .hide-mobile { display: none !important; }

  /* Mobile topbar: show only toggle, icons, logout-icon — hide everything else */
  .topbar-title { display: none !important; }
  .date-badge { display: none !important; }
  .topbar-name { display: none !important; }
  .topbar-role { display: none !important; }
  .topbar-profile { display: none !important; }
  .topbar-logout-text { display: none !important; }
  .topbar-right { gap: 6px; }

  /* Grid cards: single column on mobile */
  [style*="grid-template-columns:repeat(auto-fill, minmax(300px"] { grid-template-columns: 1fr !important; }
  [style*="grid-template-columns:repeat(auto-fill, minmax(350px"] { grid-template-columns: 1fr !important; }

  /* Stats */
  .stat-card .stat-value { font-size: 1.3rem; }

  /* Modals: full-width on small screens */
  .modal { width: 96% !important; max-width: 96% !important; }
  .bc-modal { width: 94% !important; max-width: 94% !important; }

  /* Tables: compact on mobile */
  table td, table th { font-size: .75rem !important; padding: 8px 8px !important; }

  /* Filter bar: stack on mobile */
  .filter-bar { flex-direction: column; align-items: stretch; }
  .filter-bar .search-box { min-width: unset; }

  /* Page header button: full width on mobile */
  .page-header { flex-direction: column; align-items: stretch; }
  .page-header > .btn-admin,
  .page-header > button { align-self: flex-start; }

  /* Stats grid: 2 columns max */
  .stats-grid[style] { grid-template-columns: 1fr 1fr !important; }
}

@media (max-width: 400px) {
  .stats-row { grid-template-columns: 1fr; }
  .stats-grid[style] { grid-template-columns: 1fr !important; }
}

/* Sidebar backdrop (shown only when sidebar is open on mobile) */
.sidebar-backdrop {
  display: none;
  pointer-events: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,.4);
  z-index: 299;
  cursor: pointer;
}
.sidebar-backdrop.open { display: block; pointer-events: all; }

/* Dashboard bottom row — responsive 3-column grid */
.dashboard-bottom-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 16px;
}
@media (max-width: 900px) {
  .dashboard-bottom-row { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 600px) {
  .dashboard-bottom-row { grid-template-columns: 1fr; }
}

/* ── Compatibility aliases (used by hymnal.php, readings.php) ─ */
.main-content { margin-left: var(--sidebar-w); flex: 1; display: flex; flex-direction: column; min-height: 100vh; min-width: 0; }
.content-wrapper { padding: 24px; flex: 1; }
.card { background: var(--card-bg); border-radius: var(--radius); border: 1px solid var(--border); box-shadow: var(--shadow); overflow: hidden; }
.stats-grid { display: grid; gap: 16px; margin-bottom: 20px; }
.data-table { width: 100%; border-collapse: collapse; }
.data-table thead th { background: var(--bg); padding: 10px 16px; font-size: .73rem; font-weight: 700; color: var(--gray-500); text-transform: uppercase; letter-spacing: .4px; text-align: left; }
.data-table tbody tr { border-bottom: 1px solid var(--border); transition: background var(--transition); }
.data-table tbody tr:last-child { border-bottom: none; }
.data-table tbody tr:hover { background: var(--bg); }
.data-table tbody td { padding: 11px 16px; font-size: .82rem; color: var(--gray-700); }
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 8px 16px; border-radius: var(--radius-sm); font-size: .82rem; font-weight: 600; cursor: pointer; border: 1px solid var(--border); background: var(--bg); color: var(--gray-700); transition: all var(--transition); text-decoration: none; }
.btn:hover { border-color: var(--primary); color: var(--primary); }
.btn-primary { background: var(--primary) !important; color: #fff !important; border-color: var(--primary) !important; }
.btn-primary:hover { background: #0F2670 !important; }
.btn-danger { background: var(--danger) !important; color: #fff !important; border-color: var(--danger) !important; }
.badge-primary { background: var(--primary-light); color: var(--primary); }
@media (max-width: 900px) { .main-content { margin-left: 0; } }

/* ── Custom Alert & Confirmation Modals ──────────────────── */
.bc-modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.6); z-index: 1000; display: flex; align-items: center; justify-content: center; opacity: 0; pointer-events: none; transition: opacity .2s; }
.bc-modal-overlay.open { opacity: 1; pointer-events: all; }
.bc-modal { background: #fff; border-radius: 16px; width: 90%; max-width: 400px; padding: 24px; text-align: center; transform: scale(0.9); transition: transform .2s; }
.bc-modal-overlay.open .bc-modal { transform: scale(1); }
.bc-modal-icon { width: 48px; height: 48px; border-radius: 50%; display: flex; align-items: center; justify-content: center; margin: 0 auto 16px; }
.bc-modal-title { font-size: 1.1rem; font-weight: 800; color: #111827; margin-bottom: 8px; }
.bc-modal-message { font-size: .88rem; color: #6B7280; line-height: 1.5; margin-bottom: 24px; }
.bc-modal-actions { display: flex; gap: 12px; }
.bc-modal-btn { flex: 1; padding: 10px; border-radius: 10px; font-size: .85rem; font-weight: 700; cursor: pointer; border: none; }
.bc-modal-btn-confirm { background: var(--primary); color: #fff; }
.bc-modal-btn-cancel { background: #F3F4F6; color: #374151; }
