@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Outfit:wght@400;500;600;700;800&display=swap');

/* --- Theme Variables --- */
:root {
    --bg-dark: hsl(222, 47%, 7%);
    --bg-nebula: radial-gradient(circle at 50% 50%, hsl(222, 45%, 10%) 0%, hsl(222, 47%, 5%) 100%);
    --surface-glass: rgba(16, 22, 38, 0.55);
    --surface-glass-hover: rgba(22, 31, 54, 0.7);
    --surface-glass-solid: rgba(13, 18, 30, 0.95);
    --border-glass: rgba(255, 255, 255, 0.08);
    --border-glass-focus: rgba(30, 144, 255, 0.4);
    
    /* RCCG Brand Colors adjusted for Dark Mode readability */
    --primary: hsl(215, 90%, 60%);
    --primary-glow: hsla(215, 90%, 60%, 0.3);
    --secondary: hsl(145, 75%, 45%);
    --secondary-glow: hsla(145, 75%, 45%, 0.2);
    --accent: hsl(355, 85%, 55%);
    --accent-glow: hsla(355, 85%, 55%, 0.2);
    
    --text-main: hsl(0, 0%, 95%);
    --text-muted: hsl(215, 20%, 65%);
    --text-dim: hsl(215, 12%, 45%);
    
    --success: hsl(145, 80%, 45%);
    --success-glow: hsla(145, 80%, 45%, 0.2);
    --warning: hsl(38, 95%, 55%);
    --warning-glow: hsla(38, 95%, 55%, 0.2);
    --danger: hsl(355, 85%, 55%);
    --danger-glow: hsla(355, 85%, 55%, 0.2);
    
    --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --shadow-main: 0 8px 32px 0 rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 20px hsla(215, 90%, 60%, 0.15);

    /* Contextual background opacities for dark mode */
    --input-bg: rgba(255, 255, 255, 0.05);
    --input-bg-focus: rgba(255, 255, 255, 0.08);
    --panel-item-bg: rgba(255, 255, 255, 0.02);
    --panel-item-hover: rgba(255, 255, 255, 0.05);
    --header-bg: rgba(10, 15, 28, 0.7);

    /* Role Badge Colors */
    --role-pastor-bg: rgba(30, 144, 255, 0.15);
    --role-pastor-text: hsl(210, 100%, 70%);
    --role-admin-bg: rgba(168, 85, 247, 0.15);
    --role-admin-text: hsl(270, 80%, 75%);
    --role-hod-bg: rgba(15, 138, 95, 0.15);
    --role-hod-text: hsl(145, 80%, 70%);
}

/* --- Light Mode Variables --- */
body.light-theme {
    --bg-dark: hsl(220, 20%, 95%);
    --bg-nebula: radial-gradient(circle at 50% 50%, hsl(220, 30%, 97%) 0%, hsl(220, 20%, 91%) 100%);
    --surface-glass: rgba(255, 255, 255, 0.75);
    --surface-glass-hover: rgba(255, 255, 255, 0.95);
    --surface-glass-solid: rgba(255, 255, 255, 0.98);
    --border-glass: rgba(10, 17, 114, 0.1);
    --border-glass-focus: rgba(10, 17, 114, 0.35);
    
    /* Solid RCCG Branding Colors for Light Mode */
    --primary: hsl(233, 85%, 25%);
    --primary-glow: hsla(233, 85%, 25%, 0.15);
    --secondary: hsl(145, 80%, 25%);
    --secondary-glow: hsla(145, 80%, 25%, 0.15);
    --accent: hsl(355, 85%, 50%);
    --accent-glow: hsla(355, 85%, 50%, 0.15);
    
    --text-main: hsl(222, 47%, 12%);
    --text-muted: hsl(215, 25%, 38%);
    --text-dim: hsl(215, 15%, 52%);
    
    --success: hsl(145, 80%, 30%);
    --success-glow: hsla(145, 80%, 30%, 0.12);
    --warning: hsl(35, 90%, 40%);
    --warning-glow: hsla(35, 90%, 40%, 0.12);
    --danger: hsl(355, 85%, 45%);
    --danger-glow: hsla(355, 85%, 45%, 0.12);
    
    --shadow-main: 0 8px 32px 0 rgba(10, 17, 114, 0.06);
    --shadow-glow: 0 0 20px hsla(233, 85%, 25%, 0.06);

    /* Contextual background opacities for light mode */
    --input-bg: rgba(10, 17, 114, 0.04);
    --input-bg-focus: rgba(10, 17, 114, 0.07);
    --panel-item-bg: rgba(10, 17, 114, 0.015);
    --panel-item-hover: rgba(10, 17, 114, 0.045);
    --header-bg: rgba(255, 255, 255, 0.8);

    /* Role Badge Colors for Light Mode */
    --role-pastor-bg: rgba(10, 17, 114, 0.08);
    --role-pastor-text: hsl(233, 85%, 30%);
    --role-admin-bg: rgba(168, 85, 247, 0.12);
    --role-admin-text: hsl(270, 80%, 35%);
    --role-hod-bg: rgba(15, 138, 95, 0.08);
    --role-hod-text: hsl(145, 80%, 25%);
}

/* Global Transitions for smooth theme switching */
body, header, main, .login-card, .card-panel, .kpi-card, .btn, input, select, textarea, .absentee-item, .notice-card, .inbox-card, .trial-item, td, th {
    transition: background 0.3s ease, background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

/* --- Base Reset --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    scrollbar-width: thin;
    scrollbar-color: var(--primary) rgba(255, 255, 255, 0.1);
}

body.light-theme * {
    scrollbar-color: var(--primary) rgba(0, 0, 0, 0.1);
}

body {
    font-family: 'Inter', sans-serif;
    background: var(--bg-nebula);
    color: var(--text-main);
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.5;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
    letter-spacing: -0.02em;
}

/* --- Custom Scrollbar --- */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}
::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 5px;
}
::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 5px;
    border: 2px solid rgba(0, 0, 0, 0.3);
}
::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* Light Theme Scrollbar Overrides */
body.light-theme ::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.08);
}
body.light-theme ::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 5px;
    border: 2px solid rgba(255, 255, 255, 0.9);
}
body.light-theme ::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* --- Layout Structure --- */
#app {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Header styling */
header {
    background: var(--header-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-glass);
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.logo-icon {
    color: var(--primary);
    filter: drop-shadow(0 0 8px var(--primary-glow));
}

.logo-text {
    font-size: 1.4rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--text-main) 30%, var(--secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.user-nav-profile {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.user-badge {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--input-bg);
    border: 1px solid var(--border-glass);
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    font-size: 0.85rem;
}

.user-role-tag {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
}

.user-role-tag.pastor {
    background: var(--role-pastor-bg);
    color: var(--role-pastor-text);
    border: 1px solid var(--role-pastor-text);
}
 
.user-role-tag.admin {
    background: var(--role-admin-bg);
    color: var(--role-admin-text);
    border: 1px solid var(--role-admin-text);
}
 
.user-role-tag.hod {
    background: var(--role-hod-bg);
    color: var(--role-hod-text);
    border: 1px solid var(--role-hod-text);
}

/* --- Container App Styles --- */
main {
    flex: 1;
    padding: 2rem;
    max-width: 1400px;
    width: 100%;
    margin: 0 auto;
}

.view-section {
    display: none;
    animation: fadeIn var(--transition-normal);
}

.view-section.active {
    display: block;
}

/* --- Login View --- */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 80vh;
}

.login-card {
    background: var(--surface-glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-glass);
    width: 100%;
    max-width: 450px;
    border-radius: 16px;
    padding: 2.25rem 2rem;
    box-shadow: var(--shadow-main), var(--shadow-glow);
    animation: slideUp var(--transition-normal);
}

.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.login-logo {
    display: inline-flex;
    padding: 1rem;
    background: rgba(99, 102, 241, 0.1);
    border-radius: 12px;
    margin-bottom: 1rem;
    color: var(--primary);
    box-shadow: 0 0 15px rgba(99, 102, 241, 0.2);
}

.login-header h2 {
    font-size: 1.45rem;
    margin-bottom: 0.4rem;
}

.login-header p {
    color: var(--text-muted);
    font-size: 0.8rem;
    white-space: nowrap;
}

.login-location {
    font-size: 0.78rem;
    color: var(--text-dim);
    margin-top: -0.25rem;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.form-group label i, .form-group label svg {
    width: 14px;
    height: 14px;
    color: var(--text-muted);
    flex-shrink: 0;
}

.input-wrapper {
    position: relative;
}

.input-wrapper input, .input-wrapper select, .input-wrapper textarea {
    width: 100%;
    background: var(--input-bg);
    border: 1px solid var(--border-glass);
    padding: 0.75rem 1rem 0.75rem 2.5rem;
    color: var(--text-main);
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.95rem;
    transition: var(--transition-fast);
}

.input-wrapper input:focus, .input-wrapper select:focus, .input-wrapper textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 10px var(--primary-glow);
    background: var(--input-bg-focus);
}

.input-wrapper i, .input-wrapper svg {
    position: absolute;
    left: 0.9rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 1.1rem;
    width: 18px;
    height: 18px;
}

/* Button & Action Styles */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    font-size: 0.95rem;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    cursor: pointer;
    border: none;
    transition: var(--transition-fast);
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: white;
    box-shadow: 0 4px 15px var(--primary-glow);
}

.btn-primary:hover {
    filter: brightness(1.1);
    box-shadow: 0 4px 20px var(--primary-glow);
    transform: translateY(-1px);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-main);
    border: 1px solid var(--border-glass);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.2);
}

.btn-danger {
    background: rgba(239, 68, 68, 0.15);
    color: var(--danger);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.btn-danger:hover {
    background: var(--danger);
    color: white;
    box-shadow: 0 4px 15px var(--danger-glow);
}

.btn-small {
    padding: 0.4rem 0.8rem;
    font-size: 0.8rem;
    border-radius: 6px;
}

.btn-block {
    display: flex;
    width: 100%;
}

/* Branding Footer */
.login-branding {
    text-align: center;
    margin-top: 1.75rem;
    font-size: 0.72rem;
    color: var(--text-muted);
    opacity: 0.7;
    font-weight: 500;
    letter-spacing: 0.02em;
    border-top: 1px solid var(--border-glass);
    padding-top: 1.25rem;
    transition: var(--transition-fast);
    line-height: 1.5;
}

.login-branding .brand-title {
    font-weight: 600;
    font-size: 0.78rem;
    color: var(--text-main);
    transition: var(--transition-fast);
}

.login-branding .powered-by {
    font-size: 0.68rem;
    color: var(--text-muted);
    opacity: 0.8;
}

.login-branding:hover {
    opacity: 1;
}

.login-branding:hover .brand-title {
    color: var(--primary);
    text-shadow: 0 0 8px var(--primary-glow);
}

/* HOD Dept select login row */
.hod-select-group {
    display: none;
    margin-top: 0.5rem;
    animation: fadeIn var(--transition-fast);
}

/* --- Dashboard Cards & Components --- */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    margin-bottom: 2rem;
}

@media (max-width: 1024px) {
    .dashboard-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}
@media (max-width: 640px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
}

.kpi-card {
    background: var(--surface-glass);
    border: 1px solid var(--border-glass);
    border-radius: 12px;
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1.25rem;
    box-shadow: var(--shadow-main);
    transition: var(--transition-normal);
}

.kpi-card:hover {
    background: var(--surface-glass-hover);
    transform: translateY(-2px);
    border-color: var(--primary-glow);
}

.kpi-icon {
    padding: 1rem;
    border-radius: 10px;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.kpi-icon.primary { background: var(--primary-glow); color: var(--primary); }
.kpi-icon.success { background: var(--success-glow); color: var(--success); }
.kpi-icon.warning { background: var(--warning-glow); color: var(--warning); }
.kpi-icon.danger { background: var(--danger-glow); color: var(--danger); }

.kpi-details h3 {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 500;
    margin-bottom: 0.2rem;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.kpi-details .kpi-value {
    font-size: 1.5rem;
    font-weight: 700;
    font-family: 'Outfit', sans-serif;
    letter-spacing: -0.01em;
    line-height: 1.2;
}

/* Main Section Grids */
.section-grid-2 {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.section-grid-1-1 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

@media (max-width: 1024px) {
    .section-grid-2, .section-grid-1-1 {
        grid-template-columns: 1fr;
    }
}

.card-panel {
    background: var(--surface-glass);
    border: 1px solid var(--border-glass);
    border-radius: 14px;
    padding: 1.75rem;
    box-shadow: var(--shadow-main);
    height: 100%;
    display: flex;
    flex-direction: column;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.25rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-glass);
}

.panel-header h2 {
    font-size: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.panel-header h2 i {
    color: var(--primary);
}

/* Charts Wrapper */
.chart-container {
    position: relative;
    width: 100%;
    height: 300px;
}

/* --- Tables & lists --- */
.table-wrapper {
    overflow-x: auto;
    width: 100%;
    margin-bottom: 1rem;
}

table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 0.9rem;
}

th {
    padding: 0.75rem 1rem;
    font-weight: 600;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border-glass);
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
}

td {
    padding: 0.85rem 1rem;
    border-bottom: 1px solid var(--border-glass);
    color: var(--text-main);
    vertical-align: middle;
}

tr:hover td {
    background: var(--panel-item-hover);
}

/* Badges for tables */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-success { background: rgba(16, 185, 129, 0.12); color: var(--success); border: 1px solid var(--success-glow); }
.badge-warning { background: rgba(245, 158, 11, 0.12); color: var(--warning); border: 1px solid var(--warning-glow); }
.badge-danger { background: rgba(239, 68, 68, 0.12); color: var(--danger); border: 1px solid var(--danger-glow); }
.badge-info { background: rgba(6, 182, 212, 0.12); color: var(--accent); border: 1px solid rgba(6, 182, 212, 0.2); }

/* Dropdown status selector */
.status-select {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-main);
    border: 1px solid var(--border-glass);
    border-radius: 4px;
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    font-family: inherit;
    font-weight: 500;
    cursor: pointer;
    outline: none;
    transition: var(--transition-fast);
}
.status-select:focus {
    border-color: var(--primary);
    background: var(--bg-dark);
}
.status-select option {
    background: var(--bg-dark);
    color: var(--text-main);
}


/* --- Absentee Follow-up Panel --- */
.absentee-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    max-height: 480px;
    overflow-y: auto;
    padding-right: 0.25rem;
}

.absentee-item {
    background: var(--panel-item-bg);
    border: 1px solid var(--border-glass);
    border-radius: 8px;
    padding: 1rem;
    transition: var(--transition-fast);
}

.absentee-item:hover {
    border-color: var(--danger);
    background: var(--danger-glow);
}

.absentee-meta {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.5rem;
}

.absentee-name {
    font-weight: 600;
    font-size: 0.95rem;
}

.absentee-days {
    color: var(--danger);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
}

.absentee-details {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
}

.absentee-details p {
    margin-bottom: 0.2rem;
}

.absentee-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid rgba(255, 255, 255, 0.04);
    padding-top: 0.5rem;
    margin-top: 0.5rem;
}

.absentee-reason {
    font-style: italic;
    font-size: 0.75rem;
    color: var(--warning);
}

/* Modal Styling */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    animation: fadeIn var(--transition-fast);
    overflow-y: auto; /* Enable scrolling */
    padding: 2.5rem 1rem; /* Margins around modal when viewport is small */
    box-sizing: border-box;
}

.modal-overlay.active {
    display: flex;
}

.modal {
    background: var(--surface-glass-solid);
    border: 1px solid var(--border-glass);
    border-radius: 12px;
    width: 90%;
    max-width: 550px;
    padding: 2rem;
    box-shadow: var(--shadow-main);
    animation: slideUp var(--transition-fast);
    margin: auto; /* Automatic vertical centering and scroll boundary helper */
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-glass);
    padding-bottom: 0.75rem;
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    transition: var(--transition-fast);
}

.modal-close:hover {
    color: var(--text-main);
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    margin-top: 1.5rem;
    border-top: 1px solid var(--border-glass);
    padding-top: 1rem;
}

/* --- Broadcaster notices --- */
.post-notice-form select, .post-notice-form input, .post-notice-form textarea {
    width: 100%;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-glass);
    padding: 0.6rem 0.8rem;
    color: var(--text-main);
    border-radius: 6px;
    margin-bottom: 1rem;
    font-family: inherit;
}

.post-notice-form select:focus, .post-notice-form input:focus, .post-notice-form textarea:focus {
    outline: none;
    border-color: var(--primary);
}

/* Notice boards list */
.notices-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    max-height: 480px;
    overflow-y: auto;
}

.notice-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-glass);
    border-radius: 8px;
    padding: 1.25rem;
    position: relative;
    transition: var(--transition-fast);
}

.notice-card:hover {
    background: rgba(255, 255, 255, 0.04);
}

.notice-card-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.notice-title {
    font-weight: 600;
    font-size: 1.05rem;
    color: var(--text-main);
}

.notice-dept {
    font-size: 0.75rem;
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 0.05em;
    color: var(--primary);
}

.notice-content {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
    white-space: pre-wrap;
}

.notice-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.75rem;
    color: var(--text-dim);
}

.acknowledgements-badge {
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary);
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
}

/* Department performance panels */
.department-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    max-height: 600px;
    overflow-y: auto;
}

.department-performance-item {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-glass);
    border-radius: 8px;
    padding: 1rem;
}

.department-perf-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.department-perf-name {
    font-weight: 600;
    font-size: 0.95rem;
}

.star-rating {
    color: var(--warning);
    font-size: 0.95rem;
}

.dept-perf-metrics {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
    background: rgba(255, 255, 255, 0.02);
    padding: 0.4rem;
    border-radius: 4px;
}

/* HOD Dashboard additions */
.alert-strip {
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid var(--primary-glow);
    padding: 0.75rem 1rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
}

.inbox-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.inbox-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-glass);
    border-radius: 8px;
    padding: 1.25rem;
}

.inbox-card.unread {
    border-left: 3px solid var(--primary);
    background: rgba(99, 102, 241, 0.02);
}

.attendance-sheet-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.member-check-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Custom Checkbox Toggle */
.custom-checkbox {
    cursor: pointer;
    width: 20px;
    height: 20px;
    border: 2px solid var(--text-muted);
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-fast);
}

input[type="checkbox"]:checked + .custom-checkbox {
    background: var(--success);
    border-color: var(--success);
}

input[type="checkbox"]:checked + .custom-checkbox::after {
    content: "✓";
    color: white;
    font-size: 0.8rem;
    font-weight: 700;
}

/* Tabs */
.tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-glass);
    padding-bottom: 0.5rem;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    white-space: nowrap;
}
.tabs::-webkit-scrollbar {
    display: none;
}

.tab-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    padding: 0.5rem 1rem;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: var(--transition-fast);
    border-bottom: 2px solid transparent;
    white-space: nowrap;
    flex-shrink: 0;
}

.tab-btn:hover {
    color: var(--text-main);
}

.tab-btn.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* --- Search & Filters Row --- */
.filters-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.search-input-wrapper {
    position: relative;
    flex: 1;
    max-width: 400px;
}

.search-input-wrapper input {
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-glass);
    padding: 0.5rem 1rem 0.5rem 2.5rem;
    border-radius: 6px;
    color: var(--text-main);
    font-size: 0.85rem;
}

.search-input-wrapper i {
    position: absolute;
    left: 0.8rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 1rem;
}

/* --- Animations --- */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* Custom list of trials in follow-up modal */
.trial-item {
    background: rgba(255, 255, 255, 0.03);
    border-left: 3px solid var(--primary);
    padding: 0.75rem;
    border-radius: 0 6px 6px 0;
    margin-bottom: 0.75rem;
    font-size: 0.8rem;
}
.trial-item-header {
    display: flex;
    justify-content: space-between;
    color: var(--text-muted);
    font-size: 0.7rem;
    margin-bottom: 0.25rem;
}

/* Simple toast notifications */
.toast-container {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.toast {
    background: var(--surface-glass-solid);
    border: 1px solid var(--border-glass);
    border-left: 4px solid var(--primary);
    color: var(--text-main);
    padding: 1rem 1.5rem;
    border-radius: 6px;
    box-shadow: var(--shadow-main);
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    animation: slideUp 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    min-width: 250px;
}

.toast.success { border-left-color: var(--success); }
.toast.error { border-left-color: var(--danger); }
.toast.warning { border-left-color: var(--warning); }

/* --- Rebranding & Theme System Styles --- */
.logo-img {
    height: 32px;
    width: auto;
    object-fit: contain;
    transition: transform var(--transition-normal);
}
.logo-img:hover {
    transform: scale(1.05);
}

.login-logo-container {
    display: flex;
    justify-content: center;
    margin-bottom: 1rem;
}

.login-logo-img {
    height: 64px;
    width: auto;
    object-fit: contain;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.15));
    transition: transform var(--transition-normal);
}
.login-logo-img:hover {
    transform: scale(1.08) rotate(5deg);
}

.theme-toggle-btn {
    background: var(--input-bg);
    border: 1px solid var(--border-glass);
    color: var(--text-main);
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition-fast);
    padding: 0;
}
.theme-toggle-btn:hover {
    background: var(--input-bg-focus);
    border-color: var(--border-glass-focus);
    transform: rotate(30deg) scale(1.05);
    color: var(--primary);
    box-shadow: 0 0 10px var(--primary-glow);
}
.theme-toggle-btn i, .theme-toggle-btn svg {
    width: 16px;
    height: 16px;
    transition: transform var(--transition-normal);
}

/* Positioning theme toggles */
.login-card {
    position: relative;
}
.login-theme-wrapper {
    position: absolute;
    top: 1rem;
    right: 1rem;
    z-index: 10;
}
.user-nav-profile {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

/* ============================================== */
/* PHASE 4: Pastor Dashboard Tabbed Interface     */
/* ============================================== */

/* 6-card KPI grid for Overview */
.dashboard-grid-6 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
    margin-bottom: 2rem;
}
@media (max-width: 1024px) {
    .dashboard-grid-6 {
        grid-template-columns: repeat(2, 1fr);
    }
}
@media (max-width: 640px) {
    .dashboard-grid-6 {
        grid-template-columns: 1fr;
    }
}

/* Pastor tab bar - horizontal scrollable */
.pastor-tabs {
    display: flex;
    gap: 0.25rem;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-glass);
    padding-bottom: 0;
    overflow-x: auto;
    scrollbar-width: thin;
    -webkit-overflow-scrolling: touch;
}
.pastor-tabs::-webkit-scrollbar {
    height: 6px;
}
.pastor-tabs::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 3px;
}

.pastor-tab-btn {
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--text-muted);
    padding: 0.65rem 1rem;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 500;
    font-family: 'Inter', sans-serif;
    transition: var(--transition-fast);
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    position: relative;
}
.pastor-tab-btn:hover {
    color: var(--text-main);
    background: var(--panel-item-hover);
}
.pastor-tab-btn.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
    font-weight: 600;
}
.pastor-tab-btn .tab-badge {
    background: var(--danger);
    color: white;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 0.1rem 0.35rem;
    border-radius: 8px;
    min-width: 16px;
    text-align: center;
    line-height: 1.2;
}

/* Department Group Cards */
.dept-group-card {
    background: var(--surface-glass);
    border: 1px solid var(--border-glass);
    border-left: 3px solid var(--primary);
    border-radius: 0 10px 10px 0;
    margin-bottom: 1.25rem;
    overflow: hidden;
    transition: var(--transition-fast);
}
.dept-group-card:hover {
    border-left-color: var(--secondary);
}

.dept-group-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.25rem;
    cursor: pointer;
    transition: var(--transition-fast);
}
.dept-group-header:hover {
    background: var(--panel-item-hover);
}
.dept-group-header h3 {
    font-size: 1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.dept-group-header .dept-count-badge {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    background: var(--input-bg);
    padding: 0.15rem 0.5rem;
    border-radius: 10px;
}
.dept-group-header .chevron-icon {
    transition: transform var(--transition-fast);
    color: var(--text-muted);
}
.dept-group-card.expanded .chevron-icon {
    transform: rotate(180deg);
}

.dept-group-body {
    display: none;
    padding: 0 1.25rem 1rem;
}
.dept-group-card.expanded .dept-group-body {
    display: block;
}

/* Member rows inside department cards */
.member-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.65rem 0.5rem;
    border-bottom: 1px solid var(--border-glass);
    transition: var(--transition-fast);
}
.member-row:last-child {
    border-bottom: none;
}
.member-row:hover {
    background: var(--panel-item-hover);
    border-radius: 6px;
}
.member-row-info {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}
.member-row-name {
    font-weight: 600;
    font-size: 0.9rem;
}
.member-row-phone {
    font-size: 0.75rem;
    color: var(--text-muted);
}
.member-row-status {
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.15rem 0.45rem;
    border-radius: 4px;
}
.member-row-status.active {
    background: var(--success-glow);
    color: var(--success);
}
.member-row-status.inactive {
    background: var(--danger-glow);
    color: var(--danger);
}

/* Attendance Grid Table */
.attendance-week-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}
.attendance-week-table th {
    padding: 0.6rem 0.75rem;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border-glass);
    text-align: center;
}
.attendance-week-table th:first-child {
    text-align: left;
}
.attendance-week-table td {
    padding: 0.6rem 0.75rem;
    text-align: center;
    border-bottom: 1px solid var(--border-glass);
    font-size: 0.85rem;
}
.attendance-week-table td:first-child {
    text-align: left;
    font-weight: 500;
}
.attendance-check {
    font-size: 1rem;
    font-weight: 700;
}
.attendance-check.present {
    color: var(--success);
}
.attendance-check.absent {
    color: var(--danger);
}
.attendance-check.pending {
    color: var(--text-dim);
}

/* Rate badges */
.rate-badge {
    font-size: 0.8rem;
    font-weight: 700;
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
}
.rate-badge.excellent {
    color: var(--success);
}
.rate-badge.average {
    color: var(--warning);
}
.rate-badge.poor {
    color: var(--danger);
}

/* Group Reports - Monthly Report Slot Cards */
.report-dept-section {
    background: var(--surface-glass);
    border: 1px solid var(--border-glass);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}
.report-dept-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-glass);
}
.report-dept-header h3 {
    font-size: 1.1rem;
    font-weight: 600;
}
.report-dept-header .report-dept-desc {
    font-size: 0.8rem;
    font-style: italic;
    color: var(--text-muted);
}

.report-month-slot {
    background: var(--panel-item-bg);
    border: 1px solid var(--border-glass);
    border-radius: 8px;
    padding: 1rem 1.25rem;
    margin-bottom: 0.75rem;
    transition: var(--transition-fast);
}
.report-month-slot:hover {
    background: var(--panel-item-hover);
}
.report-month-slot h4 {
    font-size: 0.95rem;
    color: var(--primary);
    margin-bottom: 0.35rem;
}
.report-month-slot .report-status {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}
.report-month-slot .report-content {
    font-size: 0.85rem;
    color: var(--text-main);
    line-height: 1.5;
    margin-bottom: 0.5rem;
}
.report-month-slot .report-meta {
    font-size: 0.75rem;
    color: var(--text-dim);
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}
.pastor-comment-form {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.75rem;
}
.pastor-comment-form input {
    flex: 1;
    background: var(--input-bg);
    border: 1px solid var(--border-glass);
    color: var(--text-main);
    padding: 0.4rem 0.75rem;
    border-radius: 6px;
    font-size: 0.8rem;
    font-family: inherit;
}
.pastor-comment-form input:focus {
    outline: none;
    border-color: var(--primary);
}
.pastor-comment-form button {
    padding: 0.4rem 0.75rem;
    font-size: 0.8rem;
}
.pastor-comment-display {
    margin-top: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: var(--primary-glow);
    border-left: 2px solid var(--primary);
    border-radius: 0 4px 4px 0;
    font-size: 0.8rem;
    color: var(--text-main);
}
.pastor-comment-display strong {
    color: var(--primary);
}

/* Follow-up cards */
.followup-dept-group {
    margin-bottom: 1.5rem;
}
.followup-dept-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--primary);
    border-left: 3px solid var(--primary);
    padding-left: 0.75rem;
    margin-bottom: 0.75rem;
}
.followup-member-card {
    background: var(--surface-glass);
    border: 1px solid var(--border-glass);
    border-radius: 10px;
    padding: 1rem 1.25rem;
    margin-bottom: 0.75rem;
    transition: var(--transition-fast);
}
.followup-member-card:hover {
    border-color: var(--warning);
}
.followup-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.5rem;
}
.followup-card-header .member-name {
    font-weight: 600;
    font-size: 0.95rem;
}
.followup-card-header .member-phone {
    font-size: 0.8rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 0.25rem;
}
.absence-count-badge {
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0.2rem 0.5rem;
    border-radius: 10px;
    background: var(--warning-glow);
    color: var(--warning);
}
.followup-week-entry {
    background: var(--panel-item-bg);
    border-radius: 6px;
    padding: 0.5rem 0.75rem;
    margin-bottom: 0.4rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
}
.followup-status-badge {
    font-size: 0.65rem;
    font-weight: 700;
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    text-transform: uppercase;
}
.followup-status-badge.pending {
    background: rgba(239, 68, 68, 0.12);
    color: var(--danger);
}
.followup-status-badge.resolved {
    background: var(--success-glow);
    color: var(--success);
}
.followup-action-row {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.5rem;
    align-items: center;
}
.followup-action-row input {
    flex: 1;
    background: var(--input-bg);
    border: 1px solid var(--border-glass);
    color: var(--text-main);
    padding: 0.4rem 0.75rem;
    border-radius: 6px;
    font-size: 0.8rem;
    font-family: inherit;
}
.followup-action-row input:focus {
    outline: none;
    border-color: var(--primary);
}

/* Concern cards */
.concern-card {
    background: var(--surface-glass);
    border: 1px solid var(--border-glass);
    border-radius: 10px;
    padding: 1.25rem;
    margin-bottom: 1rem;
    transition: var(--transition-fast);
}
.concern-card.unread {
    border-left: 3px solid var(--warning);
}
.concern-card:hover {
    background: var(--surface-glass-hover);
}
.concern-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.5rem;
}
.concern-card-header h4 {
    font-size: 1rem;
    font-weight: 600;
}
.concern-urgency {
    font-size: 0.65rem;
    font-weight: 700;
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    text-transform: uppercase;
}
.concern-urgency.high {
    background: var(--danger-glow);
    color: var(--danger);
}
.concern-urgency.medium {
    background: var(--warning-glow);
    color: var(--warning);
}
.concern-urgency.low {
    background: var(--primary-glow);
    color: var(--primary);
}
.concern-meta {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
    display: flex;
    gap: 1rem;
}
.concern-content {
    font-size: 0.85rem;
    line-height: 1.5;
    color: var(--text-main);
    margin-bottom: 0.75rem;
}
.concern-response {
    margin-top: 0.5rem;
    padding: 0.6rem 0.75rem;
    background: var(--success-glow);
    border-left: 2px solid var(--success);
    border-radius: 0 6px 6px 0;
    font-size: 0.8rem;
}
.concern-response strong {
    color: var(--success);
}
.concern-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.75rem;
}
.concern-actions input, .concern-actions textarea {
    flex: 1;
    background: var(--input-bg);
    border: 1px solid var(--border-glass);
    color: var(--text-main);
    padding: 0.4rem 0.75rem;
    border-radius: 6px;
    font-size: 0.8rem;
    font-family: inherit;
    resize: none;
}
.concern-actions input:focus, .concern-actions textarea:focus {
    outline: none;
    border-color: var(--primary);
}
.concern-status-badge {
    font-size: 0.65rem;
    font-weight: 700;
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    text-transform: uppercase;
}
.concern-status-badge.unread {
    background: var(--warning-glow);
    color: var(--warning);
}
.concern-status-badge.reviewed {
    background: var(--primary-glow);
    color: var(--primary);
}
.concern-status-badge.resolved {
    background: var(--success-glow);
    color: var(--success);
}

/* Activity Log Feed */
.activity-feed {
    display: flex;
    flex-direction: column;
    gap: 0;
}
.activity-entry {
    display: flex;
    gap: 1rem;
    padding: 0.85rem 0;
    border-bottom: 1px solid var(--border-glass);
    transition: var(--transition-fast);
}
.activity-entry:hover {
    background: var(--panel-item-hover);
    border-radius: 6px;
    padding-left: 0.5rem;
    padding-right: 0.5rem;
}
.activity-entry:last-child {
    border-bottom: none;
}
.activity-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--primary);
    margin-top: 0.4rem;
    flex-shrink: 0;
}
.activity-dot.action-report { background: var(--success); }
.activity-dot.action-concern { background: var(--warning); }
.activity-dot.action-followup { background: var(--danger); }
.activity-dot.action-message { background: var(--primary); }
.activity-dot.action-system { background: var(--text-dim); }

.activity-body {
    flex: 1;
}
.activity-body .activity-actor {
    font-weight: 600;
    font-size: 0.85rem;
}
.activity-body .activity-action {
    font-size: 0.85rem;
    color: var(--text-muted);
}
.activity-body .activity-details {
    font-size: 0.8rem;
    color: var(--text-dim);
    margin-top: 0.15rem;
}
.activity-timestamp {
    font-size: 0.7rem;
    color: var(--text-dim);
    white-space: nowrap;
    margin-top: 0.15rem;
}

/* Message compose layout */
.message-compose-panel {
    background: var(--surface-glass);
    border: 1px solid var(--border-glass);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.message-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}
.message-item {
    background: var(--surface-glass);
    border: 1px solid var(--border-glass);
    border-radius: 10px;
    padding: 1rem 1.25rem;
    cursor: pointer;
    transition: var(--transition-fast);
}
.message-item:hover {
    background: var(--surface-glass-hover);
    border-color: var(--primary-glow);
}
.message-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.25rem;
}
.message-item-header h4 {
    font-size: 0.95rem;
    font-weight: 600;
}
.message-item-header .message-date {
    font-size: 0.75rem;
    color: var(--text-dim);
}
.message-item-meta {
    font-size: 0.8rem;
    color: var(--text-muted);
}
.message-item-body {
    display: none;
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border-glass);
    font-size: 0.85rem;
    line-height: 1.5;
    color: var(--text-main);
}
.message-item.expanded .message-item-body {
    display: block;
}
.message-ack-summary {
    margin-top: 0.5rem;
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* New Members Section */
.new-member-card {
    background: var(--surface-glass);
    border: 1px solid var(--border-glass);
    border-radius: 10px;
    padding: 1rem 1.25rem;
    margin-bottom: 0.75rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: var(--transition-fast);
}
.new-member-card:hover {
    background: var(--surface-glass-hover);
}
.new-member-info h4 {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 0.15rem;
}
.new-member-info p {
    font-size: 0.8rem;
    color: var(--text-muted);
}
.new-member-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

/* Filter controls */
.tab-filter-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
}
.tab-filter-bar select {
    background: var(--input-bg);
    color: var(--text-main);
    border: 1px solid var(--border-glass);
    padding: 0.4rem 0.75rem;
    border-radius: 6px;
    font-size: 0.8rem;
    font-family: inherit;
}
.tab-filter-bar select:focus {
    outline: none;
    border-color: var(--primary);
}

/* General empty state */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-muted);
}
.empty-state i, .empty-state svg {
    width: 40px;
    height: 40px;
    color: var(--text-dim);
    margin-bottom: 0.75rem;
}
.empty-state p {
    font-size: 0.9rem;
}

/* --- HOD Dashboard Refinements --- */

/* Weekly Roster Grid */
.weeks-container {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin-bottom: 2rem;
}
.week-card {
    background: var(--surface-glass);
    border: 1px solid var(--border-glass);
    border-radius: 12px;
    padding: 1.25rem;
    transition: var(--transition-normal);
}
.week-card:hover {
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
}
.week-header {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 1rem;
    border-left: 4px solid var(--primary);
    padding-left: 0.5rem;
}
.attendance-grid-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}
.attendance-row-card {
    background: var(--panel-item-bg);
    border: 1px solid var(--border-glass);
    border-radius: 8px;
    padding: 0.75rem 1rem;
    display: grid;
    grid-template-columns: 1fr auto 2fr;
    align-items: center;
    gap: 1.5rem;
}
@media (max-width: 768px) {
    .attendance-row-card {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }
}
.attendance-row-card:hover {
    background: var(--panel-item-hover);
}
.attendance-member-name {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-main);
}
.attendance-toggle-buttons {
    display: flex;
    gap: 0.5rem;
}
.btn-toggle-present, .btn-toggle-absent {
    padding: 0.4rem 0.8rem;
    font-size: 0.8rem;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    border: 1px solid var(--border-glass);
    background: var(--input-bg);
    color: var(--text-muted);
    transition: var(--transition-fast);
}
.btn-toggle-present:hover {
    border-color: var(--success);
    color: var(--success);
}
.btn-toggle-absent:hover {
    border-color: var(--danger);
    color: var(--danger);
}
.btn-toggle-present.active {
    background: var(--success);
    color: #fff;
    border-color: var(--success);
}
.btn-toggle-absent.active {
    background: var(--danger);
    color: #fff;
    border-color: var(--danger);
}
.attendance-reason-input {
    width: 100%;
    background: var(--input-bg);
    border: 1px solid var(--border-glass);
    color: var(--text-main);
    padding: 0.4rem 0.75rem;
    border-radius: 6px;
    font-size: 0.85rem;
}
.attendance-reason-input:focus {
    outline: none;
    border-color: var(--primary);
}

/* Split Inbox Panels */
.inbox-split-container {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 1.5rem;
    align-items: start;
}
@media (max-width: 992px) {
    .inbox-split-container {
        grid-template-columns: 1fr;
    }
}

/* Activity Score CSS */
.activity-score-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    gap: 1rem;
}
.activity-percentage-hero {
    font-size: 2.25rem;
    font-weight: 800;
    font-family: 'Outfit', sans-serif;
}
.activity-percentage-hero.success {
    color: var(--success);
}
.activity-percentage-hero.warning {
    color: var(--warning);
}
.activity-percentage-hero.danger {
    color: var(--danger);
}
.activities-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}
.activities-table th, .activities-table td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--border-glass);
}
.activities-table input {
    background: var(--input-bg);
    border: 1px solid var(--border-glass);
    color: var(--text-main);
    padding: 0.35rem 0.5rem;
    border-radius: 4px;
    width: 100%;
    font-family: inherit;
}
.activities-table input:focus {
    outline: none;
    border-color: var(--primary);
}
.btn-delete-row {
    color: var(--danger);
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.1rem;
    transition: var(--transition-fast);
    padding: 0.25rem 0.5rem;
}
.btn-delete-row:hover {
    transform: scale(1.1);
}
.activity-score-progress-bar {
    height: 6px;
    background: var(--input-bg);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 1rem;
}
.activity-score-progress-fill {
    height: 100%;
    background: var(--primary);
    transition: width var(--transition-normal);
}

/* Children Headcount / Teacher styles */
.children-setup-card {
    background: var(--panel-item-bg);
    border: 1px solid var(--border-glass);
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}
.teachers-checklist {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}
.teacher-check-label {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    background: var(--input-bg);
    padding: 0.35rem 0.75rem;
    border-radius: 6px;
    cursor: pointer;
    border: 1px solid var(--border-glass);
    transition: var(--transition-fast);
    color: var(--text-main);
}
.teacher-check-label:hover {
    border-color: var(--primary);
}
.teacher-check-label input {
    margin: 0;
}

/* Credentials CSS */
.credentials-sheet-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}
.credentials-sheet-table th, .credentials-sheet-table td {
    padding: 0.6rem 0.8rem;
    font-size: 0.85rem;
    text-align: left;
    border-bottom: 1px solid var(--border-glass);
}
.credentials-sheet-table tr:hover {
    background: var(--panel-item-hover);
}

.reason-missing {
    border-color: var(--danger) !important;
    background: rgba(239, 68, 68, 0.05) !important;
}

/* ============================================== */
/* PHASE 7: Upcoming Program Countdown Timer      */
/* ============================================== */

/* Countdown Card Wrapper */
.countdown-card {
    background: var(--surface-glass);
    border: 1px solid var(--border-glass);
    border-radius: 12px;
    padding: 1.25rem 1.5rem;
    margin-bottom: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1.5rem;
    box-shadow: var(--shadow-main);
    flex-wrap: wrap;
    background-image: radial-gradient(circle at top right, rgba(37, 99, 235, 0.05), transparent 60%);
}

.countdown-info {
    flex: 1;
    min-width: 250px;
}

.countdown-info h3 {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--primary);
    font-weight: 700;
    margin-bottom: 0.35rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.countdown-info .program-title {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--text-main);
    font-family: 'Outfit', sans-serif;
    margin-bottom: 0.25rem;
}

.countdown-info .program-meta {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.countdown-clock-grid {
    display: flex;
    gap: 0.75rem;
}

.countdown-digit-box {
    background: var(--panel-item-bg);
    border: 1px solid var(--border-glass);
    border-radius: 8px;
    min-width: 65px;
    padding: 0.65rem 0.5rem;
    text-align: center;
    box-shadow: var(--shadow-sm);
    transition: var(--transition-fast);
}

.countdown-digit-box:hover {
    border-color: var(--primary-glow);
    transform: translateY(-1px);
}

.countdown-number {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--text-main);
    font-family: 'Outfit', sans-serif;
    line-height: 1.2;
    display: block;
    text-shadow: 0 0 8px rgba(37, 99, 235, 0.15);
}

.countdown-label {
    font-size: 0.65rem;
    text-transform: uppercase;
    font-weight: 600;
    color: var(--text-dim);
    letter-spacing: 0.02em;
    display: block;
    margin-top: 0.15rem;
}

/* Scheduler panel styles */
.program-scheduler-panel {
    background: var(--surface-glass);
    border: 1px solid var(--border-glass);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .countdown-card {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
    }
    .countdown-clock-grid {
        justify-content: space-between;
    }
    .countdown-digit-box {
        flex: 1;
        min-width: 50px;
        padding: 0.5rem 0.25rem;
    }
    .countdown-number {
        font-size: 1.35rem;
    }
    .countdown-label {
        font-size: 0.6rem;
    }
}

/* ============================================== */
/* APP FOOTER STYLES                              */
/* ============================================== */
#app-footer {
    background: #080f2b !important;
    border-top: 2px solid #1e90ff !important;
    padding: 1.5rem 2rem;
    margin-top: 3rem;
    width: 100%;
}

.footer-container {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 2rem;
    flex-wrap: wrap;
}

.footer-left, .footer-right {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.footer-brand {
    font-size: 0.95rem;
    font-weight: 700;
    color: #1e90ff !important;
    font-family: 'Outfit', sans-serif;
    letter-spacing: 0.02em;
    margin: 0;
}

.footer-copy {
    font-size: 0.75rem;
    color: #8fa0c4 !important;
    margin: 0;
}

.footer-support {
    font-size: 0.75rem;
    color: #a5b4fc !important;
    margin: 0;
}

.footer-support strong {
    color: #ffffff !important;
}

.footer-version {
    font-size: 0.7rem;
    color: #6378a5 !important;
    text-align: right;
    margin: 0;
}

@media (max-width: 640px) {
    .footer-container {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 1rem;
    }
    .footer-version {
        text-align: center;
    }
}

/* Three-column responsive grid for charts */
.section-grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
    margin-bottom: 2rem;
}
@media (max-width: 1024px) {
    .section-grid-3 {
        grid-template-columns: repeat(2, 1fr);
    }
}
@media (max-width: 640px) {
    .section-grid-3 {
        grid-template-columns: 1fr;
    }
}

/* Unexplained Absences Warning Card Styles (matching screenshot) */
.warning-alert-card {
    background: rgba(239, 68, 68, 0.05);
    border: 1px solid rgba(239, 68, 68, 0.15);
    border-left: 4px solid var(--danger);
    border-radius: 12px;
    padding: 1.25rem 1.5rem;
    margin-bottom: 2rem;
}
.warning-alert-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}
.warning-alert-header h2 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
}
.warning-alert-header h2 i {
    color: var(--danger);
}
.warning-alert-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}
.warning-alert-item {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-glass);
    border-radius: 8px;
    padding: 0.75rem 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
}
body.light-theme .warning-alert-item {
    background: rgba(0, 0, 0, 0.015);
}
.warning-alert-member {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}
.warning-alert-member strong {
    font-size: 0.95rem;
    color: var(--text-main);
}
.warning-alert-member span {
    font-size: 0.8rem;
    color: var(--text-muted);
}
.warning-alert-badge {
    background: rgba(239, 68, 68, 0.12);
    color: var(--danger);
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    text-transform: uppercase;
}

/* Done/Not Done Premium Toggles */
.btn-toggle-done, .btn-toggle-notdone {
    padding: 0.45rem 1rem;
    font-size: 0.8rem;
    border-radius: 20px;
    cursor: pointer;
    font-weight: 600;
    border: 1px solid var(--border-glass);
    background: var(--input-bg);
    color: var(--text-muted);
    transition: all var(--transition-fast);
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.btn-toggle-done:hover {
    border-color: var(--secondary);
    color: var(--secondary);
    box-shadow: 0 0 10px var(--secondary-glow);
}
.btn-toggle-notdone:hover {
    border-color: var(--accent);
    color: var(--accent);
    box-shadow: 0 0 10px var(--accent-glow);
}
.btn-toggle-done.active {
    background: var(--secondary);
    color: #fff;
    border-color: var(--secondary);
    box-shadow: 0 0 12px var(--secondary-glow);
}
.btn-toggle-notdone.active {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
    box-shadow: 0 0 12px var(--accent-glow);
}

/* ============================================== */
/* MOBILE RESPONSIVENESS OVERRIDES               */
/* ============================================== */

@media (max-width: 768px) {
    main {
        padding: 1rem 0.75rem;
    }
}

@media (max-width: 640px) {
    header {
        padding: 0.75rem 1rem;
        flex-wrap: wrap;
        gap: 0.5rem;
        justify-content: center;
    }
    .logo-container {
        width: 100%;
        justify-content: center;
        margin-bottom: 0.25rem;
    }
    .logo-text {
        font-size: 1.15rem;
    }
    .user-nav-profile {
        width: 100%;
        justify-content: space-between;
        gap: 0.5rem;
    }
    .user-badge {
        padding: 0.3rem 0.6rem;
        font-size: 0.75rem;
        flex: 1;
        justify-content: center;
    }
    #header-user-name {
        display: none; /* Hide full name to make space on phones */
    }
    #logout-btn {
        padding: 0.35rem 0.6rem;
        font-size: 0.75rem;
        flex-shrink: 0;
    }
}

@media (max-width: 480px) {
    .modal {
        padding: 1.25rem 1rem;
        width: 95%;
    }
    .modal-header {
        margin-bottom: 1rem;
        padding-bottom: 0.5rem;
    }
    .modal-footer {
        margin-top: 1rem;
        padding-top: 0.75rem;
    }
}

@media (max-width: 400px) {
    .login-card {
        padding: 1.5rem 1.25rem;
    }
    .login-header h2 {
        font-size: 1.25rem;
    }
    .login-header p {
        font-size: 0.75rem;
    }
}

/* ============================================== */
/* PHASE 11: Premium Modal & Input Enhancements   */
/* ============================================== */

/* Glassmorphic Backdrop and Overlay Blur */
.modal-overlay {
    background: rgba(10, 15, 30, 0.45) !important;
    backdrop-filter: blur(12px) saturate(180%) !important;
    -webkit-backdrop-filter: blur(12px) saturate(180%) !important;
}

body.light-theme .modal-overlay {
    background: rgba(10, 17, 114, 0.08) !important;
}

/* Rounded Frosted Glass Modals */
.modal {
    background: var(--surface-glass-solid) !important;
    border: 1px solid var(--border-glass) !important;
    border-radius: 20px !important;
    padding: 2.25rem 2rem !important;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45) !important;
    backdrop-filter: blur(25px) saturate(110%);
    -webkit-backdrop-filter: blur(25px) saturate(110%);
}

body.light-theme .modal {
    background: rgba(255, 255, 255, 0.98) !important;
    box-shadow: 0 24px 60px rgba(10, 17, 114, 0.1) !important;
}

/* Premium Typography & Modal Header */
.modal-header {
    border-bottom: 1px solid var(--border-glass) !important;
    padding-bottom: 1rem !important;
    margin-bottom: 1.75rem !important;
}

.modal-header h2 {
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    font-size: 1.3rem;
    color: var(--text-main);
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    margin: 0;
    letter-spacing: -0.01em;
}

/* Circular Close Button with subtle rotate on hover */
.modal-close {
    background: rgba(255, 255, 255, 0.04);
    border: none;
    color: var(--text-muted);
    font-size: 1.1rem;
    cursor: pointer;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    line-height: 1;
    padding: 0;
}

body.light-theme .modal-close {
    background: rgba(10, 17, 114, 0.05);
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-main);
    transform: rotate(90deg);
}

body.light-theme .modal-close:hover {
    background: rgba(10, 17, 114, 0.08);
}

/* Modal Footer Separator */
.modal-footer {
    border-top: 1px solid var(--border-glass) !important;
    padding-top: 1.25rem !important;
    margin-top: 2.25rem !important;
}

/* Sleek Modern Form Inputs & Select fields inside Modals */
.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    background: var(--input-bg);
    border: 1px solid var(--border-glass);
    padding: 0.8rem 1rem;
    color: var(--text-main);
    border-radius: 10px;
    font-family: inherit;
    font-size: 0.92rem;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.01);
}

/* Focus styles using macOS-like ring glows */
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
    background: var(--surface-glass-solid);
}

body.light-theme .form-group input:focus,
body.light-theme .form-group select:focus,
body.light-theme .form-group textarea:focus {
    background: #ffffff;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

/* Input hover transitions */
.form-group input:hover,
.form-group select:hover,
.form-group textarea:hover {
    border-color: rgba(255, 255, 255, 0.16);
    background: var(--input-bg-focus);
}

body.light-theme .form-group input:hover,
body.light-theme .form-group select:hover,
body.light-theme .form-group textarea:hover {
    border-color: rgba(10, 17, 114, 0.2);
}

/* Light Theme Button Override for Neutral Feel */
body.light-theme .btn-secondary {
    background: rgba(10, 17, 114, 0.04);
    color: var(--text-main);
    border: 1px solid var(--border-glass);
}

body.light-theme .btn-secondary:hover {
    background: rgba(10, 17, 114, 0.08);
    border-color: rgba(10, 17, 114, 0.2);
}

/* Prevent background body scroll when modals are active */
body.modal-open {
    overflow: hidden !important;
}

/* Eliminate main layout padding entirely during login mode for a full-bleed splash/login screen */
body.login-mode main {
    padding: 0 !important;
    margin: 0 !important;
    max-width: 100% !important;
    width: 100% !important;
    min-height: 100vh !important;
}

/* ============================================== */
/* MOBILE DEVICE APP-LIKE FULL VIEW OPTIMIZATIONS */
/* ============================================== */
@media (max-width: 1024px) {
    /* Full bleed body and main layout wrappers */
    body {
        margin: 0 !important;
        padding: 0 !important;
        background: var(--bg-nebula) !important;
    }
    
    #app {
        min-height: 100vh;
        display: flex;
        flex-direction: column;
    }
    
    main {
        padding: 0 !important; /* Eliminate outer padding so layout reaches exact screen edges */
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
        box-sizing: border-box;
    }
    
    header {
        padding: 0.75rem 1rem !important; /* Full width header */
        border-radius: 0 !important;
        border-left: none !important;
        border-right: none !important;
        width: 100% !important;
        margin: 0 !important;
        box-sizing: border-box;
        position: sticky !important;
        top: 0;
        z-index: 100;
    }

    /* Tab bars scrollable horizontally, full-bleed feel */
    .tabs, .pastor-tabs {
        padding: 0 0.5rem !important;
        margin-bottom: 0.75rem !important;
        border-radius: 0 !important;
        border-bottom: 1px solid var(--border-glass) !important;
        width: 100% !important;
    }

    /* KPI Cards and Panels stretch to phone viewport edges with border-radius removed */
    .card-panel, .kpi-card, .dept-group-card, .concern-card, .followup-member-card, .new-member-card, .message-item {
        border-radius: 0 !important;
        border-left: none !important;
        border-right: none !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        margin-bottom: 0.5rem !important;
        width: 100% !important;
        padding: 1.15rem 1rem !important; /* Maintain inner text margins */
        box-shadow: none !important;
    }

    .kpi-card {
        gap: 0.85rem !important;
    }

    .alert-strip {
        border-radius: 0 !important;
        border-left: none !important;
        border-right: none !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        margin-bottom: 0.75rem !important;
        padding: 0.75rem 1rem !important;
        width: 100% !important;
    }

    /* Full-screen app modal transition on mobile */
    .modal-overlay {
        padding: 0 !important;
    }
    
    .modal-overlay.active {
        display: flex !important;
        align-items: flex-start !important;
        justify-content: center !important;
    }

    .modal {
        width: 100vw !important;
        max-width: 100vw !important;
        height: 100% !important;
        min-height: 100vh !important;
        border-radius: 0 !important;
        border: none !important;
        padding: 2.5rem 1.25rem 2rem !important;
        display: flex;
        flex-direction: column;
        justify-content: flex-start;
        margin: 0 !important;
        overflow-y: auto !important;
        box-shadow: none !important;
        background: var(--surface-glass-solid) !important;
        backdrop-filter: blur(20px) !important;
        -webkit-backdrop-filter: blur(20px) !important;
    }

    body.light-theme .modal {
        background: #ffffff !important;
    }

    .modal-header {
        margin-top: 0.5rem !important;
        border-bottom: 1px solid var(--border-glass) !important;
    }
    
    .modal-footer {
        margin-top: auto !important; /* Push buttons to bottom if space is available */
        padding-top: 1.5rem !important;
    }

    /* Full-screen Login Card to match Image 3 */
    .login-container {
        min-height: 100vh !important;
        height: 100vh !important;
        padding: 0 !important;
        margin: 0 !important;
        align-items: stretch !important;
        justify-content: center !important;
    }

    .login-card {
        border: none !important;
        border-radius: 0 !important;
        max-width: 100vw !important;
        width: 100vw !important;
        min-height: 100vh !important;
        height: 100vh !important;
        margin: 0 !important;
        display: flex;
        flex-direction: column;
        justify-content: center;
        padding: 2.5rem 1.5rem !important;
        box-shadow: none !important;
        background: var(--surface-glass-solid) !important;
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
    }

    body.light-theme .login-card {
        background: #ffffff !important;
    }

    .login-card input {
        font-size: 16px !important; /* Prevent iOS auto-zoom on input focus */
    }
}

/* ============================================== */
/* PREMIUM MOCKUPS & SPLIT LOGIN SCREEN SHOWCASE */
/* ============================================== */
.login-split-container {
    display: grid;
    grid-template-columns: 1fr 1.25fr;
    min-height: 100vh;
    width: 100vw;
    margin: 0;
    padding: 0;
    overflow: hidden;
}

.login-form-side {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2.5rem;
    z-index: 5;
    position: relative;
    background: transparent;
}

.login-showcase-side {
    position: relative;
    background: radial-gradient(circle at 70% 30%, hsl(222, 45%, 15%) 0%, hsl(222, 47%, 4%) 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    padding: 2.5rem;
    border-left: 1px solid var(--border-glass);
}

.showcase-gradient-bg {
    position: absolute;
    width: 140%;
    height: 140%;
    background: radial-gradient(circle at 50% 50%, var(--primary-glow) 0%, transparent 55%),
                radial-gradient(circle at 30% 70%, var(--secondary-glow) 0%, transparent 60%);
    animation: rotateBg 25s linear infinite;
    z-index: 1;
}

@keyframes rotateBg {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.mockups-container {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    height: 100%;
    position: relative;
    z-index: 2;
    transform: translateY(10px);
}

/* Phone Mockup Frame */
.phone-mockup {
    position: relative;
    width: 250px;
    height: 500px;
    background: #000000;
    border-radius: 38px;
    border: 9px solid #1c1c1e;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.6),
                0 0 30px rgba(30, 144, 255, 0.1),
                inset 0 0 8px rgba(255, 255, 255, 0.15);
    overflow: hidden;
    transition: all 0.5s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.phone-inner {
    width: 100%;
    height: 100%;
    position: relative;
    background: var(--bg-dark);
    display: flex;
    flex-direction: column;
}

.phone-notch {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 110px;
    height: 18px;
    background: #1c1c1e;
    border-bottom-left-radius: 10px;
    border-bottom-right-radius: 10px;
    z-index: 12;
}

.phone-screen {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    padding-top: 22px; /* status bar height */
    color: var(--text-main);
    overflow: hidden;
    font-family: 'Inter', sans-serif;
}

.phone-header {
    height: 18px;
    padding: 0 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.65rem;
    color: var(--text-muted);
    font-weight: 600;
    position: absolute;
    top: 4px;
    left: 0;
    right: 0;
    z-index: 10;
}

.phone-status-icons {
    display: flex;
    gap: 4px;
    align-items: center;
}

.phone-app-bar {
    height: 40px;
    padding: 0 0.85rem;
    display: flex;
    align-items: center;
    gap: 6px;
    border-bottom: 1px solid var(--border-glass);
    background: var(--header-bg);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.phone-logo {
    height: 18px;
    width: auto;
}

.phone-title {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--text-main);
}

.phone-body {
    flex: 1;
    padding: 0.65rem;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    overflow-y: auto;
    font-size: 0.7rem;
    scrollbar-width: none;
}
.phone-body::-webkit-scrollbar {
    display: none;
}

/* Simulated Content widgets inside phone screen */
.phone-kpi-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.45rem;
}

.phone-kpi-card {
    background: var(--surface-glass);
    border: 1px solid var(--border-glass);
    border-radius: 8px;
    padding: 0.45rem;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.phone-kpi-card .kpi-val {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--primary);
}

.phone-kpi-card .kpi-lbl {
    font-size: 0.52rem;
    color: var(--text-muted);
    text-transform: uppercase;
}

.phone-panel {
    background: var(--surface-glass);
    border: 1px solid var(--border-glass);
    border-radius: 8px;
    padding: 0.55rem;
}

.phone-panel-header {
    font-weight: 600;
    font-size: 0.65rem;
    margin-bottom: 0.35rem;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border-glass);
    padding-bottom: 0.2rem;
}

.phone-chart {
    height: 50px;
    display: flex;
    align-items: flex-end;
    justify-content: space-around;
    padding-top: 0.2rem;
}

.phone-chart-bar {
    width: 12px;
    background: linear-gradient(to top, var(--primary), var(--secondary));
    border-radius: 2px 2px 0 0;
}

.phone-list-item {
    font-size: 0.6rem;
    line-height: 1.3;
}

.phone-list-item p {
    color: var(--text-muted);
    margin-top: 1px;
}

.phone-alert-banner {
    background: var(--primary-glow);
    border: 1px solid var(--primary-glow);
    color: var(--primary);
    padding: 0.3rem 0.45rem;
    border-radius: 5px;
    font-size: 0.6rem;
    display: flex;
    align-items: center;
    gap: 3px;
    font-weight: 600;
}

.phone-directive-card {
    background: var(--panel-item-bg);
    border: 1px solid var(--border-glass);
    border-radius: 5px;
    padding: 0.35rem;
    margin-bottom: 0.3rem;
    line-height: 1.25;
}

.phone-directive-card strong {
    display: block;
    color: var(--primary);
    font-size: 0.65rem;
}

.phone-directive-card span {
    display: block;
    font-size: 0.5rem;
    color: var(--text-muted);
    font-weight: 500;
}

.phone-directive-card p {
    color: var(--text-dim);
    margin-top: 2px;
    font-size: 0.58rem;
}

/* Phone Splash Custom UI */
.phone-splash {
    background: linear-gradient(135deg, hsl(233, 85%, 22%) 0%, hsl(222, 47%, 4%) 100%) !important;
    position: relative;
}

body.light-theme .phone-splash {
    background: linear-gradient(135deg, hsl(233, 70%, 35%) 0%, hsl(233, 80%, 15%) 100%) !important;
}

.splash-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    padding: 0.85rem;
    text-align: center;
}

.splash-logo {
    height: 42px;
    width: auto;
    margin-bottom: 0.65rem;
    filter: drop-shadow(0 0 8px rgba(255,255,255,0.25));
}

.splash-content h2 {
    font-size: 1.15rem;
    font-weight: 800;
    color: #ffffff;
    letter-spacing: 0.05em;
    margin: 0;
}

.splash-content h3 {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--secondary);
    letter-spacing: 0.02em;
    margin-bottom: 0.4rem;
}

.splash-loc {
    font-size: 0.6rem;
    color: var(--text-muted);
    margin-bottom: 1.25rem;
}

.splash-nav-menu {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    margin-bottom: 1.25rem;
}

.splash-menu-item {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 8px;
    padding: 0.55rem 0.85rem;
    color: #ffffff;
    font-size: 0.7rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.splash-menu-item:hover {
    background: rgba(255, 255, 255, 0.12);
    transform: translateY(-1px);
}

.splash-footer-text {
    font-size: 0.52rem;
    color: rgba(255, 255, 255, 0.35);
    position: absolute;
    bottom: 10px;
    left: 0;
    right: 0;
    text-align: center;
}

/* Stack Layout for Overlapping iPhones */
.phone-left {
    transform: translateX(35px) scale(0.85) rotate(-6deg);
    opacity: 0.65;
    z-index: 1;
    filter: blur(0.5px);
}

.phone-center {
    z-index: 3;
    transform: scale(1);
    box-shadow: 0 35px 70px rgba(0, 0, 0, 0.75),
                0 0 40px rgba(30, 144, 255, 0.2);
    animation: floatCenterPhone 5s ease-in-out infinite;
}

.phone-right {
    transform: translateX(-35px) scale(0.85) rotate(6deg);
    opacity: 0.65;
    z-index: 2;
    filter: blur(0.5px);
}

/* Float Animation for center display phone */
@keyframes floatCenterPhone {
    0% { transform: translateY(0px) scale(1); }
    50% { transform: translateY(-12px) scale(1); }
    100% { transform: translateY(0px) scale(1); }
}

/* Interactive Hover States */
.phone-left:hover {
    opacity: 0.95;
    z-index: 4;
    transform: translateX(15px) scale(0.9) rotate(0deg);
    filter: none;
    box-shadow: 0 35px 70px rgba(0, 0, 0, 0.75);
}

.phone-right:hover {
    opacity: 0.95;
    z-index: 4;
    transform: translateX(-15px) scale(0.9) rotate(0deg);
    filter: none;
    box-shadow: 0 35px 70px rgba(0, 0, 0, 0.75);
}

/* Responsive Overrides to hide showcase on tablets and phones */
@media (max-width: 991px) {
    .login-split-container {
        grid-template-columns: 1fr;
    }
    
    .login-showcase-side {
        display: none !important;
    }
    
    .login-form-side {
        width: 100% !important;
        padding: 0 !important;
        min-height: 100vh !important;
    }
    
    .login-card {
        max-width: 100% !important;
        width: 100% !important;
        height: 100vh !important;
        border-radius: 0 !important;
        border: none !important;
    }
}

/* ============================================== */
/* PREMIUM INNER PAGE COMPONENT ENHANCEMENTS      */
/* ============================================== */

/* Dashboard Hero Banner */
.dashboard-hero-banner {
    background: linear-gradient(135deg, var(--primary) 0%, hsl(222, 45%, 10%) 100%);
    border: 1px solid var(--border-glass);
    border-radius: 16px;
    padding: 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 2rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-main), var(--shadow-glow);
    flex-wrap: wrap;
    color: #ffffff; /* keep text readable on dark hero gradient */
}

body.light-theme .dashboard-hero-banner {
    background: linear-gradient(135deg, var(--primary) 0%, hsl(233, 85%, 15%) 100%);
}

.hero-left {
    flex: 1.5;
    min-width: 280px;
}

.hero-greeting {
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--secondary);
    font-weight: 700;
}

.hero-title {
    font-size: 1.8rem;
    font-weight: 800;
    font-family: 'Outfit', sans-serif;
    margin-top: 0.25rem;
    margin-bottom: 0.5rem;
    text-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.hero-subtitle {
    font-size: 0.9rem;
    font-style: italic;
    color: rgba(255, 255, 255, 0.7);
}

.hero-right {
    flex: 1;
    min-width: 250px;
}

/* Quick Actions Grid */
.quick-actions-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    justify-items: center;
}

.action-btn {
    background: none;
    border: none;
    color: inherit;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    transition: all var(--transition-fast);
}

.action-btn:hover {
    transform: translateY(-2px);
}

.action-btn span {
    font-size: 0.72rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.85);
    text-align: center;
    line-height: 1.2;
    white-space: nowrap;
}

.action-icon {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 10px rgba(0,0,0,0.15);
    transition: all var(--transition-fast);
}

.action-icon.primary { background: rgba(30, 144, 255, 0.2); color: #1e90ff; border: 1px solid rgba(30, 144, 255, 0.4); }
.action-icon.success { background: rgba(16, 185, 129, 0.2); color: #10b981; border: 1px solid rgba(16, 185, 129, 0.4); }
.action-icon.danger { background: rgba(239, 68, 68, 0.2); color: #ef4444; border: 1px solid rgba(239, 68, 68, 0.4); }
.action-icon.warning { background: rgba(245, 158, 11, 0.2); color: #f59e0b; border: 1px solid rgba(245, 158, 11, 0.4); }

.action-btn:hover .action-icon {
    box-shadow: 0 0 15px currentColor;
    filter: brightness(1.1);
}

/* Mobile Bottom Navigation Bar (Visible only on mobile devices) */
.mobile-bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: var(--surface-glass-solid);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid var(--border-glass);
    z-index: 1000;
    justify-content: space-around;
    align-items: center;
    box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.15);
}

.mobile-bottom-nav .nav-item {
    background: none;
    border: none;
    color: var(--text-muted);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    flex: 1;
    height: 100%;
    cursor: pointer;
    position: relative;
    transition: all var(--transition-fast);
}

.mobile-bottom-nav .nav-item i {
    width: 20px;
    height: 20px;
}

.mobile-bottom-nav .nav-item span {
    font-size: 0.65rem;
    font-weight: 600;
}

.mobile-bottom-nav .nav-item.active {
    color: var(--primary);
}

.mobile-bottom-nav .nav-item .nav-badge {
    position: absolute;
    top: 6px;
    right: 22%;
    background: var(--danger);
    color: #fff;
    font-size: 0.6rem;
    font-weight: 700;
    padding: 0.05rem 0.25rem;
    border-radius: 8px;
    min-width: 14px;
    text-align: center;
    line-height: 1;
}

/* Hide the top tab navigation bar on mobile/tablet viewports to prioritize bottom nav */
@media (max-width: 1024px) {
    .mobile-bottom-nav {
        display: flex;
    }
    
    /* Make space for the bottom nav bar */
    body {
        padding-bottom: 70px !important;
    }
}

/* ============================================== */
/* Premium Colored Header Styling                 */
/* ============================================== */
header {
    position: relative;
    background: linear-gradient(135deg, hsl(233, 85%, 22%) 0%, hsl(222, 60%, 12%) 100%) !important;
    color: #ffffff !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12) !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25) !important;
    padding: 1.4rem 2.5rem !important; /* Increased breathing space vertically and horizontally */
    overflow: hidden;
}

header::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: url('../assets/group-study.png');
    background-size: cover;
    background-position: center 30%;
    opacity: 0.08; /* Extremely soft, blended into deep blue background */
    pointer-events: none;
    z-index: 1;
}

header > * {
    position: relative;
    z-index: 2;
}

body.light-theme header {
    background: linear-gradient(135deg, hsl(233, 85%, 20%) 0%, hsl(222, 50%, 10%) 100%) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
}

/* Premium layout and branding details for header */
header .logo-text {
    background: linear-gradient(135deg, #ffffff 40%, #4ade80 100%) !important;
    -webkit-background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.15) !important;
}

header .user-badge {
    background: rgba(255, 255, 255, 0.08) !important;
    border: 1px solid rgba(255, 255, 255, 0.18) !important;
    color: #ffffff !important;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

header .user-badge i, header .user-badge svg {
    color: rgba(255, 255, 255, 0.8) !important;
}

header #header-user-name {
    color: #ffffff !important;
    font-weight: 500;
}

/* Style role tags inside header so they look premium and readable on dark blue gradient background */
header .user-role-tag.pastor {
    background: rgba(59, 130, 246, 0.25) !important;
    color: #93c5fd !important;
    border: 1px solid rgba(147, 197, 253, 0.4) !important;
}
header .user-role-tag.admin {
    background: rgba(168, 85, 247, 0.25) !important;
    color: #e9d5ff !important;
    border: 1px solid rgba(233, 213, 255, 0.4) !important;
}
header .user-role-tag.hod {
    background: rgba(16, 185, 129, 0.25) !important;
    color: #a7f3d0 !important;
    border: 1px solid rgba(167, 243, 208, 0.4) !important;
}

/* Theme toggle inside header */
header .theme-toggle-btn {
    background: rgba(255, 255, 255, 0.08) !important;
    border: 1px solid rgba(255, 255, 255, 0.18) !important;
    color: rgba(255, 255, 255, 0.8) !important;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

header .theme-toggle-btn:hover {
    background: rgba(255, 255, 255, 0.15) !important;
    border-color: rgba(255, 255, 255, 0.35) !important;
    color: #ffffff !important;
    transform: rotate(30deg) scale(1.05);
}

/* Logout button in header */
header #logout-btn {
    background: rgba(255, 255, 255, 0.1) !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    color: #ffffff !important;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

header #logout-btn:hover {
    background: rgba(255, 255, 255, 0.2) !important;
    border-color: rgba(255, 255, 255, 0.38) !important;
    color: #ffffff !important;
}

header #logout-btn i, header #logout-btn svg {
    color: rgba(255, 255, 255, 0.9) !important;
}

/* Responsive Header Breathing Space overrides */
@media (max-width: 1024px) {
    header {
        padding: 1.35rem 1.75rem !important; /* Breathing space for tablets */
    }
}
@media (max-width: 640px) {
    header {
        padding: 1.35rem 1.25rem !important; /* Breathing space for mobiles */
        gap: 0.85rem !important;
    }
}

/* Mobile Preview App Bar Premium Gradient & Image Background Matching */
.phone-app-bar {
    position: relative;
    background: linear-gradient(135deg, hsl(233, 85%, 25%) 0%, hsl(233, 60%, 15%) 100%) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12) !important;
    overflow: hidden;
    height: 48px !important; /* Spaced vertical height for mockup */
}

.phone-app-bar::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: url('../assets/group-study.png');
    background-size: cover;
    background-position: center;
    opacity: 0.08;
    pointer-events: none;
    z-index: 1;
}

.phone-app-bar > * {
    position: relative;
    z-index: 2;
}

body.light-theme .phone-app-bar {
    background: linear-gradient(135deg, hsl(233, 85%, 20%) 0%, hsl(222, 50%, 10%) 100%) !important;
}
.phone-app-bar .phone-title {
    color: #ffffff !important;
}
.phone-app-bar i, .phone-app-bar svg {
    color: rgba(255, 255, 255, 0.85) !important;
}

/* Responsive details for dashboard heroes */
@media (max-width: 768px) {
    .dashboard-hero-banner {
        padding: 1.25rem 1rem;
        gap: 1.25rem;
    }
    .hero-title {
        font-size: 1.4rem;
    }
    .hero-left {
        flex: 1 1 100%;
    }
    .hero-right {
        flex: 1 1 100%;
    }
    .quick-actions-grid {
        gap: 0.5rem;
    }
    .action-icon {
        width: 38px;
        height: 38px;
    }
    .action-btn span {
        font-size: 0.65rem;
    }
}

/* Premium Guest Log Panel - Brand Styling */
.guest-log-panel {
    background: linear-gradient(135deg, #0a1e3f 0%, #051022 100%) !important;
    border: 1px solid rgba(10, 80, 160, 0.25) !important;
    border-top: 4px solid var(--primary) !important;
    border-radius: 12px !important;
    padding: 1.5rem !important;
    color: #ffffff !important;
    box-shadow: var(--shadow-medium), 0 8px 30px rgba(9, 26, 47, 0.25) !important;
    position: relative;
    overflow: hidden;
}
.guest-log-panel h2 {
    color: #ffffff !important;
    font-size: 1.15rem !important;
    font-weight: 700 !important;
    margin-bottom: 1.25rem !important;
    display: flex !important;
    align-items: center !important;
    gap: 0.5rem !important;
}
.guest-log-panel h2 i {
    color: var(--primary) !important;
}
.guest-log-panel label {
    color: #cbd5e1 !important;
    font-size: 0.8rem !important;
    font-weight: 500 !important;
    margin-bottom: 0.35rem !important;
    display: block !important;
}
.guest-log-panel input, .guest-log-panel select {
    background: rgba(255, 255, 255, 0.05) !important;
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
    color: #ffffff !important;
    border-radius: 6px !important;
    padding: 0.55rem 0.75rem !important;
    font-size: 0.85rem !important;
    transition: all var(--transition-fast) !important;
}
.guest-log-panel input::placeholder {
    color: rgba(255, 255, 255, 0.35) !important;
}
.guest-log-panel input:focus, .guest-log-panel select:focus {
    outline: none !important;
    border-color: var(--primary) !important;
    background: rgba(255, 255, 255, 0.08) !important;
    box-shadow: 0 0 0 3px rgba(27, 117, 208, 0.25) !important;
}
.guest-log-panel button.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%) !important;
    border: none !important;
    color: #ffffff !important;
    font-weight: 600 !important;
    font-size: 0.85rem !important;
    padding: 0.65rem 1.25rem !important;
    border-radius: 6px !important;
    box-shadow: 0 4px 12px rgba(27, 117, 208, 0.3) !important;
    transition: all var(--transition-fast) !important;
    width: 100% !important;
    display: block !important;
}
.guest-log-panel button.btn-primary:hover {
    transform: translateY(-1px) !important;
    box-shadow: 0 6px 16px rgba(27, 117, 208, 0.4) !important;
}

/* Responsive KPI Card Text Size Adjustments */
@media (max-width: 1024px) {
    .kpi-details h3 {
        font-size: 0.76rem !important;
    }
    .kpi-details .kpi-value {
        font-size: 1.35rem !important;
    }
    .kpi-icon {
        padding: 0.8rem !important;
        font-size: 1.3rem !important;
    }
}

@media (max-width: 640px) {
    .kpi-card {
        padding: 1rem 0.85rem !important;
        gap: 0.75rem !important;
    }
    .kpi-details h3 {
        font-size: 0.72rem !important;
    }
    .kpi-details .kpi-value {
        font-size: 1.2rem !important;
    }
    .kpi-icon {
        padding: 0.65rem !important;
        font-size: 1.15rem !important;
    }
}
