/* =============================================
   Church Management System — Bold & Colorful UI
   ============================================= */

:root {
    /* Brand & accents */
    --primary: #d97706;
    --primary-dark: #b45309;
    --primary-light: #fbbf24;
    --accent: #ec4899;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #06b6d4;
    --purple: #a855f7;

    /* Gradients */
    --grad-primary: linear-gradient(135deg, #fde047 0%, #fbbf24 50%, #f59e0b 100%);
    --grad-success: linear-gradient(135deg, #10b981 0%, #06b6d4 100%);
    --grad-warning: linear-gradient(135deg, #f59e0b 0%, #ef4444 100%);
    --grad-info:    linear-gradient(135deg, #06b6d4 0%, #6366f1 100%);
    --grad-pink:    linear-gradient(135deg, #ec4899 0%, #a855f7 100%);
    --grad-orange:  linear-gradient(135deg, #fb923c 0%, #ec4899 100%);

    /* Light theme */
    --bg: #f8fafc;
    --bg-elevated: #ffffff;
    --bg-sidebar: #0f172a;
    --bg-sidebar-hover: rgba(255,255,255,0.06);
    --bg-topbar: rgba(255,255,255,0.85);
    --text: #0f172a;
    --text-muted: #64748b;
    --text-subtle: #94a3b8;
    --border: #e2e8f0;
    --border-strong: #cbd5e1;
    --sidebar-text: #cbd5e1;
    --sidebar-heading: #64748b;

    --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.04);
    --shadow: 0 4px 12px rgba(15, 23, 42, 0.06);
    --shadow-lg: 0 12px 32px rgba(15, 23, 42, 0.08);
    --shadow-glow: 0 8px 24px rgba(245, 158, 11, 0.22);

    --radius: 0.75rem;
    --radius-lg: 1rem;
    --radius-xl: 1.25rem;

    --sidebar-w: 264px;
    --topbar-h: 64px;
    --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="dark"] {
    --bg: #0b1120;
    --bg-elevated: #1e293b;
    --bg-sidebar: #020617;
    --bg-sidebar-hover: rgba(255,255,255,0.04);
    --bg-topbar: rgba(15, 23, 42, 0.85);
    --text: #f1f5f9;
    --text-muted: #cbd5e1;   /* was #94a3b8 — lifted for readability */
    --text-subtle: #94a3b8;  /* was #64748b — lifted for readability */
    --border: #334155;
    --border-strong: #475569;

    --shadow-sm: 0 1px 2px rgba(0,0,0,0.3);
    --shadow: 0 4px 12px rgba(0,0,0,0.4);
    --shadow-lg: 0 12px 32px rgba(0,0,0,0.5);
}

/* Dark mode — explicit text boosts for card content */
[data-theme="dark"] .card h1,
[data-theme="dark"] .card h2,
[data-theme="dark"] .card h3,
[data-theme="dark"] .card h4,
[data-theme="dark"] .card h5,
[data-theme="dark"] .card h6,
[data-theme="dark"] .card .h1,
[data-theme="dark"] .card .h2,
[data-theme="dark"] .card .h3,
[data-theme="dark"] .card .h4,
[data-theme="dark"] .card .h5,
[data-theme="dark"] .card .h6,
[data-theme="dark"] .card .card-header,
[data-theme="dark"] .card .fw-bold,
[data-theme="dark"] .card .fw-semibold { color: var(--text); }
[data-theme="dark"] .card small,
[data-theme="dark"] .card .text-muted  { color: var(--text-muted) !important; }

/* Dark mode — fix Bootstrap utility overrides */
[data-theme="dark"] .text-dark { color: var(--text) !important; }

/* Dark mode — bg-light badges: flip to dark pill */
[data-theme="dark"] .badge.bg-light {
    background: rgba(255,255,255,0.12) !important;
    color: var(--text) !important;
    border: 1px solid var(--border);
}

/* Dark mode — pastel icon containers: replace with dark gradient pills */
[data-theme="dark"] [style*="background:#dbeafe"],
[data-theme="dark"] [style*="background:#dcfce7"],
[data-theme="dark"] [style*="background:#fef3c7"],
[data-theme="dark"] [style*="background:#fce7f3"],
[data-theme="dark"] [style*="background:#ede9fe"] {
    background: rgba(255,255,255,0.08) !important;
    color: var(--text) !important;
}

/* Dark mode — member avatar circle */
[data-theme="dark"] .member-avatar {
    background: rgba(99,102,241,0.25) !important;
    color: var(--primary-light) !important;
}

* { box-sizing: border-box; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-feature-settings: "cv02", "cv03", "cv04", "cv11";
    background: var(--bg);
    color: var(--text);
    margin: 0;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    transition: background var(--transition), color var(--transition);
}

/* ============ LAYOUT ============ */
.app-wrapper { display: flex; min-height: 100vh; }

.sidebar {
    width: var(--sidebar-w);
    background: var(--bg-sidebar);
    color: var(--sidebar-text);
    position: fixed; top: 0; left: 0; bottom: 0;
    overflow-y: auto;
    transition: transform var(--transition);
    z-index: 1000;
}
.sidebar::-webkit-scrollbar { width: 6px; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 3px; }

.main {
    flex: 1; margin-left: var(--sidebar-w);
    display: flex; flex-direction: column;
    min-height: 100vh;
}

.topbar {
    background: var(--bg-topbar);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    height: var(--topbar-h);
    padding: 0 1.75rem;
    display: flex; align-items: center; gap: 1rem;
    position: sticky; top: 0; z-index: 900;
}
.page-title {
    color: var(--text); font-weight: 700;
    font-size: 1.15rem; letter-spacing: -0.01em;
}

/* ============ SIDEBAR / BRAND ============ */
.brand {
    padding: 1.25rem 1rem;
    display: flex; align-items: center; justify-content: center;
    background: #ffffff;
    border-bottom: 3px solid #f59e0b;
    border-right: 2px solid var(--bg-sidebar);
    position: relative;
}
.brand::after {
    content: '';
    position: absolute; bottom: -3px; left: 0; right: 0;
    height: 3px;
    background: linear-gradient(90deg, #fde047, #f59e0b, #d97706);
}
.brand-logo {
    width: 100%;
    max-width: 190px;
    height: auto;
    display: block;
    object-fit: contain;
}

.sidebar .nav { padding: 0.75rem 0 2rem; }
.sidebar .nav-heading {
    color: var(--sidebar-heading);
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 1.25rem 1.5rem 0.5rem;
    font-weight: 700;
}
.sidebar .nav-link {
    color: var(--sidebar-text);
    padding: 0.65rem 1.5rem;
    display: flex; align-items: center; gap: 0.85rem;
    font-size: 0.92rem; font-weight: 500;
    border-left: 3px solid transparent;
    transition: all var(--transition);
    position: relative;
}
.sidebar .nav-link:hover {
    background: linear-gradient(90deg, rgba(245,158,11,0.22), rgba(251,191,36,0.06));
    color: #fff;
}
.sidebar .nav-link.active {
    background: linear-gradient(90deg, rgba(245,158,11,0.30), transparent);
    color: #fff;
    border-left-color: #fbbf24;
}
.sidebar .nav-link.active::before {
    content: ''; position: absolute; left: 0; top: 0; bottom: 0;
    width: 3px; background: linear-gradient(180deg, #fde047, #d97706);
    box-shadow: 0 0 10px rgba(245,158,11,0.75);
}
.sidebar .nav-link i {
    font-size: 1.1rem; width: 22px; text-align: center;
}

/* ============ CARDS ============ */
.card {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    transition: box-shadow var(--transition), transform var(--transition);
}
.card-header {
    background: transparent;
    border-bottom: 1px solid var(--border);
    font-weight: 600; padding: 1rem 1.25rem;
    color: var(--text);
}

/* ============ STAT CARDS (BOLD GRADIENT) ============ */
.stat-card {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    display: flex; align-items: center; gap: 1.25rem;
    position: relative; overflow: hidden;
    transition: transform var(--transition), box-shadow var(--transition);
    height: 100%; /* equal height within Bootstrap rows */
}
.stat-card::before {
    content: '';
    position: absolute; top: 0; right: 0;
    width: 120px; height: 120px;
    border-radius: 50%;
    opacity: 0.08;
    transform: translate(40px, -40px);
    transition: opacity var(--transition), transform var(--transition);
}
.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}
.stat-card:hover::before { opacity: 0.15; transform: translate(30px, -30px) scale(1.1); }

.stat-card .icon {
    width: 56px; height: 56px;
    border-radius: var(--radius);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.6rem; color: #fff;
    flex-shrink: 0;
    box-shadow: 0 8px 20px rgba(0,0,0,0.12);
}
.stat-card .icon.grad-primary { background: var(--grad-primary); }
.stat-card .icon.grad-success { background: var(--grad-success); }
.stat-card .icon.grad-warning { background: var(--grad-warning); }
.stat-card .icon.grad-info    { background: var(--grad-info); }
.stat-card .icon.grad-pink    { background: var(--grad-pink); }
.stat-card .icon.grad-orange  { background: var(--grad-orange); }

.stat-card .label {
    color: var(--text-muted);
    font-size: 0.82rem;
    margin-bottom: 0.25rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.stat-card .value {
    font-size: 1.65rem; font-weight: 700;
    color: var(--text);
    letter-spacing: -0.02em;
    line-height: 1.1;
}
.stat-card .trend {
    font-size: 0.78rem;
    margin-top: 0.35rem;
    display: inline-flex; align-items: center; gap: 0.25rem;
    font-weight: 600;
}
.stat-card .trend.up { color: var(--success); }
.stat-card .trend.down { color: var(--danger); }

/* Legacy bg-*-soft (kept for backward compat) */
.stat-card .icon.bg-primary-soft { background: var(--grad-primary); color: #78350f; }
.stat-card .icon.bg-success-soft { background: var(--grad-success); color: #fff; }
.stat-card .icon.bg-warning-soft { background: var(--grad-warning); color: #fff; }
.stat-card .icon.bg-info-soft    { background: var(--grad-info); color: #fff; }
.stat-card .icon.bg-danger-soft  { background: var(--grad-pink); color: #fff; }
.stat-card .icon.bg-purple-soft  { background: var(--grad-orange); color: #fff; }

/* ============ TABLES ============ */
.table {
    background: var(--bg-elevated);
    color: var(--text);
    margin-bottom: 0;
}
.table thead th {
    background: var(--bg);
    font-weight: 600;
    font-size: 0.78rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border-bottom: 1px solid var(--border);
    padding: 0.85rem 1rem;
}
.table tbody td {
    border-color: var(--border);
    padding: 0.9rem 1rem;
    vertical-align: middle;
}
.table-hover tbody tr:hover { background: var(--bg); }
.table > :not(caption) > * > * { color: inherit; }

/* ============ BUTTONS ============ */
.btn {
    font-weight: 600;
    border-radius: 0.6rem;
    transition: all var(--transition);
    padding: 0.5rem 1.1rem;
    border: none;
    font-size: 0.92rem;
}
.btn:focus { box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.3); }
.btn-primary {
    background: var(--grad-primary);
    color: #fff;
    text-shadow: 0 1px 2px rgba(120, 53, 15, 0.45);
    box-shadow: var(--shadow-glow);
}
.btn-primary:hover {
    background: linear-gradient(135deg, #facc15 0%, #f59e0b 50%, #d97706 100%);
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 12px 28px rgba(245, 158, 11, 0.4);
}
.btn-secondary {
    background: var(--bg-elevated);
    color: var(--text);
    border: 1px solid var(--border);
}
.btn-secondary:hover {
    background: var(--bg);
    color: var(--text);
    border-color: var(--border-strong);
}
.btn-light {
    background: var(--bg-elevated);
    color: var(--text);
    border: 1px solid var(--border);
}
.btn-light:hover { background: var(--bg); color: var(--text); }
.btn-outline-secondary {
    color: var(--text-muted); border-color: var(--border);
    background: transparent;
}
.btn-outline-secondary:hover {
    color: var(--text); background: var(--bg);
    border-color: var(--border-strong);
}
.btn-outline-danger {
    color: var(--danger); border-color: var(--border);
    background: transparent;
}
.btn-outline-danger:hover {
    background: var(--danger); color: #fff;
    border-color: var(--danger);
}
.btn-outline-primary {
    color: var(--primary); border-color: var(--border);
    background: transparent;
}
.btn-outline-primary:hover {
    background: var(--grad-primary); color: #fff;
    border-color: var(--primary);
}
.btn-sm { padding: 0.3rem 0.7rem; font-size: 0.82rem; }

/* ============ FORMS ============ */
.form-control, .form-select {
    background: var(--bg-elevated);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 0.55rem;
    padding: 0.55rem 0.85rem;
    font-size: 0.93rem;
    transition: all var(--transition);
}
.form-control:focus, .form-select:focus {
    background: var(--bg-elevated);
    color: var(--text);
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}
.form-control::placeholder { color: var(--text-subtle); }
.form-label { color: var(--text); font-weight: 500; }
.input-group-text {
    background: var(--bg);
    border-color: var(--border);
    color: var(--text-muted);
}
.form-check-input:checked {
    background-color: var(--primary);
    border-color: var(--primary);
}

/* ============ BADGES ============ */
.badge {
    font-weight: 600;
    padding: 0.35em 0.7em;
    border-radius: 0.4rem;
    font-size: 0.72rem;
    letter-spacing: 0.02em;
}
.badge.bg-primary { background: var(--grad-primary) !important; color: #78350f !important; }
.badge.bg-success { background: var(--grad-success) !important; }
.badge.bg-warning { background: var(--grad-warning) !important; color: #fff !important; }
.badge.bg-info    { background: var(--grad-info) !important; }
.badge.bg-danger  { background: var(--grad-pink) !important; }
.badge.bg-secondary { background: var(--text-muted) !important; }
.badge.bg-light {
    background: var(--bg) !important;
    color: var(--text) !important;
    border: 1px solid var(--border);
}

/* ============ ALERTS ============ */
.alert {
    border: none; border-radius: var(--radius);
    padding: 1rem 1.25rem;
    font-weight: 500;
    box-shadow: var(--shadow-sm);
}
.alert-success { background: rgba(16, 185, 129, 0.1); color: var(--success); border-left: 4px solid var(--success); }
.alert-danger  { background: rgba(239, 68, 68, 0.1);  color: var(--danger); border-left: 4px solid var(--danger); }
.alert-warning { background: rgba(245, 158, 11, 0.1); color: var(--warning); border-left: 4px solid var(--warning); }
.alert-info    { background: rgba(6, 182, 212, 0.1);  color: var(--info); border-left: 4px solid var(--info); }

/* ============ AUTH PAGE ============ */
.auth-body {
    background: linear-gradient(135deg, #fcd34d 0%, #f59e0b 50%, #d97706 100%);
    min-height: 100vh;
    display: flex; align-items: center; justify-content: center;
    padding: 1rem; position: relative; overflow: hidden;
}

/* Soft multi-colour bokeh — yellow-dominant with a gentle rainbow glow */
.auth-bokeh { position: absolute; inset: 0; z-index: 0; overflow: hidden; }
.auth-bokeh span {
    position: absolute;
    border-radius: 50%;
    filter: blur(60px);
    opacity: 0.55;
}
.auth-bokeh span:nth-child(1) { top: -90px;  left: -80px;  width: 360px; height: 360px; background: #fde047; opacity: 0.7; } /* yellow */
.auth-bokeh span:nth-child(2) { top: 8%;     right: -70px; width: 300px; height: 300px; background: #fbbf24; } /* amber */
.auth-bokeh span:nth-child(3) { bottom: -110px; right: 12%; width: 420px; height: 420px; background: #f59e0b; opacity: 0.6; } /* gold */
.auth-bokeh span:nth-child(4) { bottom: -80px; left: -90px; width: 340px; height: 340px; background: #fb923c; opacity: 0.45; } /* orange */
.auth-bokeh span:nth-child(5) { top: 30%;    left: 18%;    width: 200px; height: 200px; background: #f9a8d4; opacity: 0.4; }  /* pink */
.auth-bokeh span:nth-child(6) { top: 55%;    right: 22%;   width: 220px; height: 220px; background: #86efac; opacity: 0.38; } /* green */
.auth-bokeh span:nth-child(7) { top: 12%;    left: 42%;    width: 160px; height: 160px; background: #93c5fd; opacity: 0.35; } /* blue */
.auth-bokeh span:nth-child(8) { bottom: 18%; left: 35%;    width: 180px; height: 180px; background: #fef08a; opacity: 0.6; }  /* pale yellow */
.auth-wrapper { width: 100%; max-width: 440px; position: relative; z-index: 1; }
.auth-card {
    background: rgba(255,255,255,0.97);
    backdrop-filter: blur(20px);
    border-radius: var(--radius-xl);
    padding: 2.5rem 2rem;
    box-shadow: 0 25px 60px rgba(15, 23, 42, 0.25);
    border: 1px solid rgba(255,255,255,0.5);
}
.auth-brand { text-align: center; margin-bottom: 1.5rem; }
.auth-logo {
    height: 72px;
    width: auto;
    max-width: 180px;
    object-fit: contain;
}
.auth-brand i {
    font-size: 3rem;
    background: var(--grad-primary);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* ============ DROPDOWNS ============ */
.dropdown-menu {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    padding: 0.5rem;
}
.dropdown-item {
    color: var(--text); border-radius: 0.4rem;
    padding: 0.45rem 0.75rem;
    font-size: 0.9rem;
}
.dropdown-item:hover {
    background: var(--bg);
    color: var(--primary);
}
.dropdown-item-text { color: var(--text-muted); font-size: 0.85rem; padding: 0.45rem 0.75rem; }
.dropdown-divider { border-color: var(--border); }

/* ============ LIST GROUPS ============ */
.list-group-item {
    background: var(--bg-elevated);
    color: var(--text);
    border-color: var(--border);
    padding: 0.85rem 1rem;
}
.list-group-item-action:hover { background: var(--bg); color: var(--text); }

/* ============ THEME TOGGLE ============ */
.theme-toggle {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 0.45rem 0.55rem;
    color: var(--text-muted);
    cursor: pointer;
    transition: all var(--transition);
    display: inline-flex;
}
.theme-toggle:hover { color: var(--primary); border-color: var(--primary); }
[data-theme="dark"] .theme-toggle .bi-sun-fill { display: inline-block; }
[data-theme="dark"] .theme-toggle .bi-moon-stars-fill { display: none; }
.theme-toggle .bi-sun-fill { display: none; }
.theme-toggle .bi-moon-stars-fill { display: inline-block; }

/* ============ EMPTY STATES ============ */
.empty-state {
    text-align: center; padding: 3.5rem 1rem;
    color: var(--text-subtle);
}
.empty-state i {
    font-size: 3.5rem;
    background: var(--grad-primary);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    opacity: 0.6;
}
.empty-state p { margin-top: 0.75rem; font-size: 0.95rem; }

/* ============ PROGRESS BARS ============ */
.progress {
    background: var(--bg);
    border-radius: 999px;
    overflow: hidden;
}
.progress-bar { background: var(--grad-primary) !important; }

/* ============ PAGINATION ============ */
.pagination .page-link {
    background: var(--bg-elevated);
    color: var(--text);
    border-color: var(--border);
    border-radius: 0.4rem !important;
    margin: 0 2px;
}
.pagination .page-item.active .page-link {
    background: var(--grad-primary);
    border-color: transparent;
    color: #fff;
}

/* ============ MISC ============ */
.text-muted { color: var(--text-muted) !important; }
.text-truncate-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
hr { border-color: var(--border); opacity: 1; }
code { background: var(--bg); color: var(--primary); padding: 0.1em 0.35em; border-radius: 0.3em; font-size: 0.88em; }

/* ============ ORGANOGRAM (org chart) ============ */
.org-scroll {
    overflow: auto;            /* pan a zoomed chart inside this box, not the page */
    max-height: 68vh;
    padding: 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg);
}
.org-tree { text-align: center; min-width: 100%; }
.org-tree ul, .org-tree li { list-style: none; margin: 0; padding: 0; }
.org-tree ul { display: flex; justify-content: center; padding-top: 22px; position: relative; }
.org-tree li { position: relative; padding: 22px 12px 0; }
/* connectors */
.org-tree li::before, .org-tree li::after {
    content: ''; position: absolute; top: 0; right: 50%;
    border-top: 2px solid var(--border-strong); width: 50%; height: 22px;
}
.org-tree li::after { right: auto; left: 50%; border-left: 2px solid var(--border-strong); }
.org-tree li:only-child::after, .org-tree li:only-child::before { display: none; }
.org-tree li:only-child { padding-top: 0; }
.org-tree li:first-child::before, .org-tree li:last-child::after { border: 0 none; }
.org-tree li:last-child::before { border-right: 2px solid var(--border-strong); border-radius: 0 6px 0 0; }
.org-tree li:first-child::after { border-radius: 6px 0 0 0; }
.org-tree ul ul::before {
    content: ''; position: absolute; top: 0; left: 50%;
    border-left: 2px solid var(--border-strong); width: 0; height: 22px;
}
.org-tree > ul { padding-top: 0; }
.org-tree > ul > li:only-child { padding-top: 0; }

.org-node {
    display: inline-flex; flex-direction: column; align-items: center; gap: 2px;
    background: var(--bg-elevated); border: 1px solid var(--border);
    border-top: 3px solid var(--primary); border-radius: var(--radius);
    padding: 0.75rem 1rem; min-width: 150px; box-shadow: var(--shadow-sm);
    position: relative;
}
.org-avatar {
    width: 44px; height: 44px; border-radius: 50%;
    background: var(--grad-primary); color: #78350f;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 0.95rem; margin-bottom: 2px;
}
.org-title { font-weight: 700; font-size: 0.9rem; color: var(--text); line-height: 1.2; }
.org-person { font-size: 0.8rem; color: var(--text-muted); }
.org-vacant { font-style: italic; color: var(--text-subtle); }
.org-desc { font-size: 0.72rem; color: var(--text-subtle); max-width: 180px; }
.org-toggle {
    position: absolute; bottom: -12px; left: 50%; transform: translateX(-50%);
    width: 22px; height: 22px; border-radius: 50%;
    border: 1px solid var(--border-strong); background: var(--bg-elevated);
    color: var(--text-muted); font-size: 0.65rem; cursor: pointer; z-index: 2;
    display: flex; align-items: center; justify-content: center; padding: 0;
}
.org-toggle:hover { border-color: var(--primary); color: var(--primary); }
.org-collapsed { display: none !important; }

/* People chips on a department node */
.org-people { display: flex; flex-wrap: wrap; gap: 5px; justify-content: center; margin-top: 6px; }
.org-empty { font-size: 0.72rem; color: var(--text-subtle); font-style: italic; }
.org-chip {
    display: inline-flex; align-items: center; gap: 5px;
    background: var(--bg); border: 1px solid var(--border);
    border-radius: 999px; padding: 2px 8px 2px 10px;
    font-size: 0.74rem; color: var(--text); line-height: 1.6;
}
.org-chip-head {
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    border-color: #fcd34d; color: #78350f; font-weight: 600;
}
.org-chip-head .bi { color: #d97706; font-size: 0.7rem; }
.org-chip-role { font-size: 0.64rem; color: var(--text-muted); background: var(--bg-elevated); border-radius: 999px; padding: 0 6px; }
/* stylish remove button */
.org-chip-x {
    display: inline-flex; align-items: center; justify-content: center;
    width: 16px; height: 16px; border-radius: 50%; padding: 0; border: none;
    background: rgba(239, 68, 68, 0.12); color: var(--danger);
    font-size: 0.7rem; cursor: pointer; transition: all var(--transition);
}
.org-chip-x:hover { background: var(--danger); color: #fff; transform: scale(1.12); }

/* stylish "Add person" pill button */
.org-add-btn {
    margin-top: 8px; display: inline-flex; align-items: center; gap: 5px;
    background: linear-gradient(135deg, #fde047, #f59e0b);
    color: #78350f; font-weight: 600; font-size: 0.72rem;
    border: none; border-radius: 999px; padding: 4px 12px; cursor: pointer;
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.25); transition: all var(--transition);
}
.org-add-btn:hover { background: linear-gradient(135deg, #facc15, #d97706); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(245, 158, 11, 0.4); }
.org-assign-form { display: flex; flex-direction: column; gap: 5px; min-width: 180px; }
.org-assign-go {
    align-self: stretch; border: none; border-radius: 0.5rem; cursor: pointer;
    background: var(--grad-primary); color: #fff; font-weight: 700; padding: 4px 0;
    text-shadow: 0 1px 2px rgba(120,53,15,0.45); transition: all var(--transition);
}
.org-assign-go:hover { background: linear-gradient(135deg, #facc15 0%, #f59e0b 50%, #d97706 100%); }

/* ============ TOASTS (custom) ============ */
.toast-container {
    position: fixed; top: 80px; right: 24px;
    z-index: 9999;
    display: flex; flex-direction: column; gap: 0.5rem;
}
.toast-msg {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-left: 4px solid var(--primary);
    color: var(--text);
    padding: 0.85rem 1.1rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    min-width: 280px; max-width: 380px;
    animation: slideIn 0.3s ease-out;
}
.toast-msg.success { border-left-color: var(--success); }
.toast-msg.error   { border-left-color: var(--danger); }
.toast-msg.warning { border-left-color: var(--warning); }
.toast-msg.info    { border-left-color: var(--info); }

@keyframes slideIn {
    from { transform: translateX(120%); opacity: 0; }
    to   { transform: translateX(0); opacity: 1; }
}

/* ============ ANIMATIONS ============ */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}
.stat-card, .card { animation: fadeInUp 0.4s ease-out backwards; }
.stat-card:nth-child(1) { animation-delay: 0.05s; }
.stat-card:nth-child(2) { animation-delay: 0.1s; }
.stat-card:nth-child(3) { animation-delay: 0.15s; }
.stat-card:nth-child(4) { animation-delay: 0.2s; }

/* ============ SIDEBAR BACKDROP (mobile) ============ */
.sidebar-backdrop {
    display: none;
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.45);
    z-index: 999;
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    animation: fadeBackdrop 0.2s ease;
}
.sidebar-backdrop.show { display: block; }
@keyframes fadeBackdrop {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* ============ RESPONSIVE ============ */

/* ---- Tablet / small desktop ---- */
@media (max-width: 991.98px) {
    .sidebar {
        transform: translateX(-100%);
        z-index: 1050; /* above backdrop */
    }
    .sidebar.show { transform: translateX(0); }
    .main { margin-left: 0; }
    .topbar { padding: 0 1rem; }

    /* Tighten page padding */
    .container-fluid.p-4 { padding: 1rem !important; }
}

/* ---- Mobile ---- */
@media (max-width: 575.98px) {
    /* Stat card values smaller so two fit side-by-side comfortably */
    .stat-card { padding: 1rem; gap: 0.9rem; }
    .stat-card .value { font-size: 1.3rem; }
    .stat-card .label { font-size: 0.75rem; }
    .stat-card .icon { width: 46px; height: 46px; font-size: 1.3rem; }

    /* Secondary stat strip: 2 per row on xs */
    .stat-strip-card { padding: 0.85rem 0.5rem !important; }
    .stat-strip-card .h4 { font-size: 1.2rem; }

    /* Page padding */
    .container-fluid.p-4 { padding: 0.75rem !important; }

    /* Topbar */
    .topbar { height: auto; min-height: var(--topbar-h); flex-wrap: wrap; padding: 0.5rem 0.75rem; gap: 0.5rem; }
    .page-title { font-size: 1rem; }

    /* Tables: always scrollable on mobile */
    .table-responsive { -webkit-overflow-scrolling: touch; }
    .table tbody td,
    .table thead th { padding: 0.65rem 0.75rem; font-size: 0.82rem; }

    /* Cards */
    .card-header { padding: 0.75rem 1rem; font-size: 0.9rem; }

    /* Buttons */
    .btn { padding: 0.45rem 0.9rem; font-size: 0.87rem; }
    .btn-sm { padding: 0.28rem 0.6rem; font-size: 0.78rem; }

    /* Auth card */
    .auth-card { padding: 1.75rem 1.25rem; }

    /* Charts – let them reflow */
    canvas { max-height: 220px; }

    /* Toast: full width on mobile */
    .toast-container { left: 12px; right: 12px; top: 70px; }
    .toast-msg { min-width: unset; max-width: 100%; width: 100%; }

    /* Form rows: stack on mobile */
    .row.g-3 > [class*="col-sm-6"]:not([class*="col-md"]) { flex: 0 0 100%; max-width: 100%; }
}

/* =============================================
   PRAYER COMMUNITY
   ============================================= */

/* Feed layout */
.prayer-feed { display: flex; flex-direction: column; gap: 1rem; }

/* Prayer Card */
.prayer-card {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    transition: box-shadow var(--transition), border-color var(--transition);
}
.prayer-card:hover { box-shadow: var(--shadow); border-color: var(--border-strong); }
.prayer-card.is-answered { border-left: 3px solid #10b981; }

.prayer-card-header { display: flex; gap: 0.75rem; align-items: flex-start; }
.prayer-card-footer {
    display: flex; align-items: center; gap: 0.5rem;
    margin-top: 0.75rem; padding-top: 0.75rem; border-top: 1px solid var(--border);
    flex-wrap: wrap;
}

/* Avatars */
.prayer-avatar {
    width: 40px; height: 40px; border-radius: 50%; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 1rem;
}
.prayer-avatar-lg  { width: 52px; height: 52px; font-size: 1.25rem; }
.prayer-avatar-sm  { width: 32px; height: 32px; font-size: 0.8rem; }

/* Pray buttons */
.btn-pray {
    display: inline-flex; align-items: center; gap: 0.35rem;
    background: none; border: 1px solid var(--border);
    border-radius: 2rem; padding: 0.25rem 0.75rem;
    font-size: 0.8rem; font-weight: 500;
    color: var(--text-muted); cursor: pointer;
    transition: all var(--transition); text-decoration: none;
}
.btn-pray:hover { border-color: var(--primary); color: var(--primary); background: rgba(99,102,241,0.06); }
.btn-pray.active { background: rgba(99,102,241,0.1); border-color: var(--primary); color: var(--primary); }

.btn-pray-lg {
    display: inline-flex; align-items: center; gap: 0.5rem;
    background: var(--grad-primary); color: #fff;
    border: none; border-radius: 2rem; padding: 0.45rem 1.25rem;
    font-size: 0.875rem; font-weight: 600; cursor: pointer;
    transition: opacity var(--transition);
}
.btn-pray-lg:hover  { opacity: 0.9; }
.btn-pray-lg.active { background: var(--grad-success); }

/* Answered Banner */
.answered-banner {
    background: rgba(16,185,129,0.1); border: 1px solid rgba(16,185,129,0.3);
    border-radius: var(--radius); padding: 0.5rem 0.75rem;
    color: #065f46; font-size: 0.8rem;
}
[data-theme="dark"] .answered-banner { color: #6ee7b7; }

.answered-banner-full {
    background: linear-gradient(135deg,rgba(16,185,129,0.12),rgba(6,182,212,0.08));
    border: 1px solid rgba(16,185,129,0.3); border-radius: var(--radius);
    padding: 1rem 1.25rem; color: #065f46;
}
[data-theme="dark"] .answered-banner-full { color: #6ee7b7; }

/* Prayer body */
.prayer-body { line-height: 1.7; color: var(--text); }
.prayer-excerpt { line-height: 1.6; }

/* Comments */
.prayer-comments { display: flex; flex-direction: column; gap: 0.75rem; }
.prayer-comment { display: flex; gap: 0.65rem; align-items: flex-start; }
.comment-avatar {
    width: 30px; height: 30px; border-radius: 50%; flex-shrink: 0;
    background: var(--primary); color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-size: 0.75rem; font-weight: 700;
}
.comment-body {
    background: var(--bg); border: 1px solid var(--border);
    border-radius: 0 var(--radius) var(--radius) var(--radius);
    padding: 0.6rem 0.85rem; flex-grow: 1;
}

/* Prayer Groups */
.prayer-group-card {
    background: var(--bg-elevated); border: 1px solid var(--border);
    border-radius: var(--radius-lg); overflow: hidden;
    transition: box-shadow var(--transition); position: relative;
}
.prayer-group-card:hover { box-shadow: var(--shadow-lg); }
.prayer-group-cover {
    height: 80px; display: flex; align-items: center; justify-content: center; position: relative;
}
.prayer-group-icon {
    width: 52px; height: 52px; border-radius: 50%;
    background: rgba(255,255,255,0.2); display: flex; align-items: center; justify-content: center;
    font-size: 1.5rem; color: #fff;
}

/* Group Hero (show page) */
.prayer-group-hero {
    border-radius: var(--radius-xl); padding: 1.75rem 1.5rem;
    display: flex; align-items: center; gap: 1.25rem; flex-wrap: wrap;
}
.prayer-group-hero-icon {
    width: 64px; height: 64px; border-radius: 50%;
    background: rgba(255,255,255,0.2);
    display: flex; align-items: center; justify-content: center;
    font-size: 2rem; color: #fff; flex-shrink: 0;
}
.text-white-75 { color: rgba(255,255,255,0.75) !important; }

/* Prayer list item (inside group) */
.prayer-list-item {
    display: flex; align-items: center; gap: 0.75rem;
    padding: 0.65rem 0; border-bottom: 1px solid var(--border);
}
.prayer-list-item:last-child { border-bottom: none; }

/* Messaging */
.prayer-thread-item {
    display: flex; align-items: center; gap: 0.65rem;
    padding: 0.75rem 1rem; border-bottom: 1px solid var(--border);
    color: var(--text); transition: background var(--transition);
}
.prayer-thread-item:hover { background: var(--bg); }
.prayer-thread-item.unread { background: rgba(99,102,241,0.05); }
.prayer-thread-item.unread .fw-semibold { color: var(--primary); }

.prayer-thread-messages {
    max-height: 420px; overflow-y: auto; display: flex; flex-direction: column; gap: 0.75rem;
}
.prayer-message { display: flex; align-items: flex-end; gap: 0.5rem; }
.prayer-message.mine  { flex-direction: row-reverse; }
.prayer-message-bubble {
    max-width: 72%; background: var(--bg); border: 1px solid var(--border);
    border-radius: 1rem 1rem 1rem 0.15rem; padding: 0.6rem 0.9rem;
    font-size: 0.875rem; line-height: 1.5;
}
.prayer-message.mine .prayer-message-bubble {
    background: var(--grad-primary); color: #fff; border: none;
    border-radius: 1rem 1rem 0.15rem 1rem;
}
.prayer-message-time {
    font-size: 0.7rem; opacity: 0.6; margin-top: 0.25rem;
}

/* Color swatch picker */
.color-swatch-label { cursor: pointer; }
.color-swatch {
    display: block; width: 30px; height: 30px; border-radius: 50%;
    border: 3px solid transparent; transition: border-color var(--transition);
}
.color-swatch.selected,
.color-swatch:hover { border-color: var(--text); }

/* btn-white for hero */
.btn-white {
    background: #fff; color: var(--primary); border: none;
    border-radius: var(--radius); padding: 0.35rem 0.9rem;
}
.btn-white:hover { background: #f1f5f9; color: var(--primary-dark); }

/* =============================================
   COMMUNITY (BuddyPress/KLEO style)
   ============================================= */

/* Hero banner */
.community-hero {
    position: relative; border-radius: var(--radius-xl);
    overflow: hidden; min-height: 240px;
    margin-bottom: 0;
    background: linear-gradient(135deg, #1e3a8a 0%, #6366f1 40%, #06b6d4 100%);
}
.community-hero-bg {
    position: absolute; inset: 0;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 240'%3E%3Cpath fill='%23ffffff' fill-opacity='0.05' d='M0 120l60-13.3C120 93 240 67 360 53.3c120-13.3 240-13.3 360 0S960 93 1080 100s120 13 120 13v27H0z'/%3E%3C/svg%3E") bottom/cover no-repeat;
    opacity: 0.7;
}
.community-hero-content {
    position: relative; padding: 2rem 1.75rem 2rem;
    display: flex; gap: 1.5rem; align-items: center; flex-wrap: wrap;
}
.community-avatar {
    width: 110px; height: 110px; border-radius: 50%;
    background: #fff; color: var(--primary);
    display: flex; align-items: center; justify-content: center;
    font-size: 2.5rem; font-weight: 700;
    border: 5px solid rgba(255,255,255,0.4);
    box-shadow: 0 10px 30px rgba(0,0,0,0.25);
    position: relative; flex-shrink: 0;
}
.community-avatar .status-dot {
    position: absolute; bottom: 8px; right: 8px;
    width: 16px; height: 16px; border-radius: 50%;
    background: #10b981; border: 3px solid #fff;
}
.community-hero-info { flex: 1 1 300px; min-width: 0; }

.btn-hero {
    border-radius: 6px; padding: 0.4rem 1rem;
    font-weight: 600; font-size: 0.85rem;
    text-decoration: none; transition: all var(--transition);
    display: inline-flex; align-items: center; gap: 0.35rem;
}
.btn-hero-primary { background: #06b6d4; color: #fff; border: 1px solid #06b6d4; }
.btn-hero-primary:hover { background: #0891b2; color: #fff; }
.btn-hero-outline {
    background: transparent; color: #fff;
    border: 1px solid rgba(255,255,255,0.5);
}
.btn-hero-outline:hover { background: rgba(255,255,255,0.15); color: #fff; }

/* Icon tab navigation (KLEO style) */
.community-tabs {
    display: flex; gap: 0; flex-wrap: wrap;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-top: none;
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
    padding: 0.5rem 1rem;
    box-shadow: var(--shadow-sm);
    margin-bottom: 1.5rem;
}
.community-tab {
    flex: 1 1 90px; min-width: 80px;
    display: flex; flex-direction: column; align-items: center;
    padding: 0.85rem 0.5rem;
    color: var(--text-muted); text-decoration: none;
    border-bottom: 3px solid transparent;
    transition: all var(--transition);
    position: relative;
}
.community-tab:hover { color: var(--primary); }
.community-tab.active { color: var(--primary); border-bottom-color: var(--primary); }
.community-tab i { font-size: 1.4rem; margin-bottom: 0.25rem; }
.community-tab .tab-label {
    font-size: 11px; font-weight: 600;
    text-transform: uppercase; letter-spacing: 0.04em;
}
.community-tab .tab-count {
    position: absolute; top: 6px; right: 50%; transform: translateX(28px);
    min-width: 20px; height: 18px; padding: 0 5px;
    background: var(--bg); border: 1px solid var(--border);
    border-radius: 9px; color: var(--text-muted);
    font-size: 10px; font-weight: 700;
    display: flex; align-items: center; justify-content: center;
    line-height: 1;
}
.community-tab.active .tab-count { background: var(--primary); color: #fff; border-color: var(--primary); }
.community-tab .tab-count-alert { background: var(--accent); color: #fff; border-color: var(--accent); }

/* Sub-tabs (Personal / Mentions / etc) */
.wall-subtabs { display: flex; gap: 0.25rem; flex-wrap: wrap; }
.wall-subtab {
    padding: 0.35rem 0.75rem; font-size: 0.8rem;
    color: var(--text-muted); text-decoration: none;
    border-radius: var(--radius); transition: all var(--transition);
    font-weight: 500;
}
.wall-subtab:hover { color: var(--primary); background: rgba(99,102,241,0.05); }
.wall-subtab.active { color: var(--primary); border-bottom: 2px solid var(--primary); border-radius: 0; }
.wall-show-select { max-width: 180px; }

/* Composer (Facebook-style) */
.wall-composer {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1rem 1.1rem;
    margin-bottom: 1rem;
    box-shadow: var(--shadow-sm);
}
.composer-textarea {
    width: 100%; border: none; resize: vertical;
    background: transparent; color: var(--text);
    font-size: 0.95rem; line-height: 1.5;
    padding: 0.5rem 0;
    outline: none;
}
.composer-textarea::placeholder { color: var(--text-subtle); }
.composer-pill {
    border-radius: 2rem !important;
    background: var(--bg) !important;
    border: 1px solid var(--border) !important;
    padding: 0.25rem 0.85rem !important;
    font-size: 0.8rem !important;
    width: auto !important;
}

/* Wall feed */
.wall-feed { display: flex; flex-direction: column; gap: 1rem; }

.wall-post {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: box-shadow var(--transition);
}
.wall-post:hover { box-shadow: var(--shadow); }

.wall-post-header {
    display: flex; gap: 0.75rem; align-items: center;
    padding: 1rem 1.1rem 0.5rem;
}
.wall-post-body { padding: 0 1.1rem 0.75rem; }

.wall-post-counts {
    display: flex; gap: 0.75rem;
    padding: 0.5rem 1.1rem;
    font-size: 0.8rem; color: var(--text-muted);
    border-top: 1px solid var(--border);
}

.wall-post-actions {
    display: flex; gap: 0; align-items: stretch;
    border-top: 1px solid var(--border);
    padding: 0.25rem;
}
.wall-action-btn {
    flex: 1; display: inline-flex; align-items: center; justify-content: center;
    gap: 0.4rem; padding: 0.5rem;
    background: transparent; border: none;
    color: var(--text-muted); font-weight: 500; font-size: 0.85rem;
    border-radius: var(--radius); cursor: pointer; text-decoration: none;
    transition: background var(--transition), color var(--transition);
}
.wall-action-btn:hover { background: var(--bg); color: var(--text); }
.wall-action-btn.active { color: var(--primary); }
.wall-action-btn.active i { color: var(--warning); }

/* Inline comments */
.wall-comments {
    background: var(--bg);
    padding: 0.75rem 1.1rem;
    border-top: 1px solid var(--border);
    display: flex; flex-direction: column; gap: 0.5rem;
}
.wall-comments-more {
    font-size: 0.8rem; color: var(--primary); font-weight: 600;
    text-decoration: none;
}
.wall-comments-more:hover { text-decoration: underline; }

.wall-comment {
    display: flex; gap: 0.5rem; align-items: flex-start;
}
.wall-comment .comment-bubble {
    background: var(--bg-elevated); border: 1px solid var(--border);
    padding: 0.45rem 0.75rem; border-radius: 1rem;
    flex-grow: 1; min-width: 0;
}
.wall-comment .comment-time {
    font-size: 0.7rem; color: var(--text-subtle); white-space: nowrap;
    align-self: center; flex-shrink: 0;
}

.wall-reply {
    display: flex; gap: 0.5rem; align-items: center;
    margin-top: 0.25rem;
}
.wall-reply-input {
    border-radius: 2rem !important;
    background: var(--bg-elevated) !important;
}

/* Sidebar cards */
.wall-side-card { font-size: 0.875rem; }

.side-list-item {
    display: flex; gap: 0.5rem; align-items: center;
    padding: 0.5rem 0; border-bottom: 1px solid var(--border);
    text-decoration: none; color: var(--text);
}
.side-list-item:last-child { border-bottom: none; }

.active-members-grid {
    display: grid; grid-template-columns: repeat(6, 1fr); gap: 0.5rem;
}
.active-member { position: relative; }
.active-dot {
    position: absolute; bottom: 0; right: 0;
    width: 9px; height: 9px; border-radius: 50%;
    background: #10b981; border: 2px solid var(--bg-elevated);
}

/* Dark mode tweaks */
[data-theme="dark"] .community-tab .tab-count {
    background: var(--bg); color: var(--text-muted);
}

@media (max-width: 768px) {
    .community-hero-content { padding: 1.5rem 1rem; }
    .community-avatar { width: 80px; height: 80px; font-size: 2rem; }
    .community-tab { flex: 1 1 25%; padding: 0.6rem 0.25rem; }
    .community-tab i { font-size: 1.2rem; }
    .community-tab .tab-label { font-size: 10px; }
    .community-tab .tab-count { transform: translateX(20px); }
}

/* =============================================
   REACTIONS, ANONYMOUS, NOTIFICATIONS
   ============================================= */

/* Reaction picker (Facebook style) */
.reaction-trigger {
    position: relative; cursor: pointer; user-select: none;
}
.reaction-picker {
    position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%);
    display: flex; gap: 4px; padding: 6px 8px;
    background: var(--bg-elevated); border: 1px solid var(--border);
    border-radius: 2rem; box-shadow: var(--shadow-lg);
    opacity: 0; visibility: hidden; pointer-events: none;
    transition: opacity 0.18s, transform 0.18s, visibility 0.18s;
    z-index: 100; white-space: nowrap;
}
.reaction-trigger:hover .reaction-picker {
    opacity: 1; visibility: visible; pointer-events: auto;
    transform: translateX(-50%) translateY(-2px);
}
.reaction-option {
    background: none; border: none; cursor: pointer;
    width: 36px; height: 36px; border-radius: 50%;
    font-size: 1.25rem; line-height: 1;
    display: inline-flex; align-items: center; justify-content: center;
    transition: transform 0.15s;
}
.reaction-option:hover { transform: scale(1.4) translateY(-3px); }
.reaction-option.selected { background: rgba(99,102,241,0.12); }

/* Reaction chips (summary row) */
.reaction-summary { display: inline-flex; gap: 0.35rem; flex-wrap: wrap; }
.reaction-chip {
    display: inline-flex; align-items: center; gap: 0.25rem;
    background: var(--bg); border: 1px solid var(--border);
    padding: 2px 8px; border-radius: 2rem;
    font-size: 0.75rem;
}

/* Larger reaction summary (single request page) */
.reaction-chip-lg {
    display: inline-flex; align-items: center; gap: 0.4rem;
    background: var(--bg-elevated); border: 1.5px solid var(--border);
    padding: 0.35rem 0.75rem; border-radius: 2rem;
    font-size: 0.875rem;
}

/* Reaction bar on show page */
.reaction-bar {
    display: inline-flex; gap: 6px; flex-wrap: wrap;
    background: var(--bg); padding: 6px; border-radius: 2rem;
    border: 1px solid var(--border);
}
.reaction-btn-lg {
    background: none; border: 2px solid transparent; cursor: pointer;
    padding: 0.4rem 0.85rem; border-radius: 2rem;
    display: inline-flex; align-items: center; gap: 0.4rem;
    font-weight: 600; transition: all var(--transition);
    color: var(--text-muted);
}
.reaction-btn-lg:hover { background: var(--bg-elevated); transform: translateY(-1px); color: var(--text); }
.reaction-btn-lg.selected { background: var(--bg-elevated); color: var(--text); }

/* Anonymous indicators */
.anon-avatar {
    background: repeating-linear-gradient(
        45deg, #e2e8f0, #e2e8f0 4px, #f1f5f9 4px, #f1f5f9 8px
    ) !important;
}
[data-theme="dark"] .anon-avatar {
    background: repeating-linear-gradient(
        45deg, #334155, #334155 4px, #475569 4px, #475569 8px
    ) !important;
}
.composer-anon {
    display: inline-flex; align-items: center; gap: 0.35rem;
    background: var(--bg); border: 1px solid var(--border);
    border-radius: 2rem; padding: 0.25rem 0.85rem;
    font-size: 0.8rem; cursor: pointer; user-select: none;
    color: var(--text-muted);
}
.composer-anon input { margin: 0; }
.composer-anon:has(input:checked) {
    background: rgba(168,85,247,0.1);
    border-color: #a855f7; color: #a855f7;
}
.anon-check { padding: 0.5rem; background: var(--bg); border-radius: var(--radius); }

/* Sidebar nav badges */
.nav-badge {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 18px; height: 18px; padding: 0 5px;
    background: var(--accent); color: #fff;
    border-radius: 9px; font-size: 10px; font-weight: 700;
    margin-left: auto;
}

/* Notification list items */
.notif-item {
    display: flex; gap: 0.75rem; align-items: center;
    padding: 0.85rem 1.1rem;
    border-bottom: 1px solid var(--border);
    text-decoration: none; color: var(--text);
    transition: background var(--transition);
}
.notif-item:last-child { border-bottom: none; }
.notif-item:hover { background: var(--bg); }
.notif-item.unread { background: rgba(99,102,241,0.05); }
.notif-item.unread::before {
    content: ''; width: 8px; height: 8px; border-radius: 50%;
    background: var(--primary); flex-shrink: 0;
}
.notif-icon {
    width: 38px; height: 38px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 1rem; flex-shrink: 0;
}

/* ---- Print ---- */
@media print {
    .sidebar, .topbar, .btn, .alert, footer { display: none !important; }
    .main { margin-left: 0 !important; }
    .container-fluid { padding: 0 !important; }
    .card { border: 1px solid #dee2e6 !important; box-shadow: none !important; }
}


/* ============ ACCESSIBILITY ============ */
.skip-link{position:absolute;left:-9999px;top:0;z-index:2000;background:var(--primary);color:#fff;
    padding:.6rem 1rem;border-radius:0 0 .5rem 0;font-weight:600;text-decoration:none;}
.skip-link:focus{left:0;}
/* Always show a visible focus ring for keyboard users */
a:focus-visible,button:focus-visible,input:focus-visible,select:focus-visible,textarea:focus-visible{
    outline:3px solid var(--primary);outline-offset:2px;}
