/* ========================================
   Methodist Church of Ghana - Auth Styles
   Colors from logo:
   - Navy Blue: #1B3A6B
   - Gold/Yellow: #FFD700
   - Red (Cross): #D32F2F
   - White: #FFFFFF
   ======================================== */

:root {
    --primary-blue: #1B3A6B;
    --primary-blue-dark: #122850;
    --primary-blue-light: #2A4F8F;
    --gold: #FFD700;
    --gold-dark: #C7A600;
    --gold-light: #FFE44D;
    --red: #D32F2F;
    --red-dark: #B71C1C;
    --white: #FFFFFF;
    --gray-50: #F8F9FA;
    --gray-100: #F0F2F5;
    --gray-200: #E2E6EA;
    --gray-300: #CED4DA;
    --gray-400: #ADB5BD;
    --gray-600: #6C757D;
    --gray-800: #343A40;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.12);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.15);
    --shadow-lg: 0 8px 30px rgba(0,0,0,0.2);
    --radius: 10px;
}

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--gray-100);
    color: var(--gray-800);
    min-height: 100vh;
}

/* Auth Page Layout */
.auth-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary-blue) 0%, var(--primary-blue-dark) 50%, #0D1B3E 100%);
    padding: 20px;
    position: relative;
    overflow: hidden;
}

.auth-wrapper::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at 30% 50%, rgba(255, 215, 0, 0.05) 0%, transparent 50%),
                radial-gradient(circle at 70% 80%, rgba(211, 47, 47, 0.03) 0%, transparent 50%);
    pointer-events: none;
}

.auth-container {
    width: 100%;
    max-width: 440px;
    position: relative;
    z-index: 1;
}

/* Card */
.auth-card {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}

/* Gold top accent bar */
.auth-card-header {
    background: linear-gradient(90deg, var(--gold), var(--gold-light), var(--gold));
    height: 5px;
}

.auth-card-body {
    padding: 40px 36px 36px;
}

/* Logo Section */
.auth-logo {
    text-align: center;
    margin-bottom: 28px;
}

.auth-logo img {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--gold);
    box-shadow: 0 3px 12px rgba(27, 58, 107, 0.2);
}

.auth-logo h1 {
    font-size: 18px;
    font-weight: 700;
    color: var(--primary-blue);
    margin-top: 14px;
    letter-spacing: 0.3px;
}

.auth-logo p {
    font-size: 12px;
    color: var(--gold-dark);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-top: 4px;
}

/* Form Groups */
.form-group {
    margin-bottom: 20px;
    position: relative;
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--primary-blue);
    margin-bottom: 6px;
}

.input-wrapper {
    position: relative;
}

.input-wrapper i {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gray-400);
    font-size: 16px;
    transition: color 0.2s;
}

.input-wrapper input {
    width: 100%;
    padding: 12px 14px 12px 42px;
    border: 2px solid var(--gray-200);
    border-radius: 8px;
    font-size: 14px;
    color: var(--gray-800);
    transition: border-color 0.2s, box-shadow 0.2s;
    outline: none;
    background: var(--gray-50);
}

.input-wrapper input:focus {
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 3px rgba(27, 58, 107, 0.1);
    background: var(--white);
}

.input-wrapper input:focus + i,
.input-wrapper input:focus ~ i {
    color: var(--primary-blue);
}

.input-wrapper input::placeholder {
    color: var(--gray-400);
}

/* Password toggle */
.password-toggle {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: var(--gray-400);
    font-size: 16px;
    padding: 4px;
    transition: color 0.2s;
}

.password-toggle:hover {
    color: var(--primary-blue);
}

/* Remember / Forgot row */
.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    font-size: 13px;
}

.remember-me {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    color: var(--gray-600);
}

.remember-me input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--primary-blue);
    cursor: pointer;
}

.forgot-link {
    color: var(--red);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

.forgot-link:hover {
    color: var(--red-dark);
    text-decoration: underline;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    line-height: 1.4;
}

.btn-primary {
    width: 100%;
    background: linear-gradient(135deg, var(--primary-blue), var(--primary-blue-light));
    color: var(--white);
    padding: 14px;
    font-size: 15px;
    letter-spacing: 0.3px;
    box-shadow: 0 3px 10px rgba(27, 58, 107, 0.3);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-blue-dark), var(--primary-blue));
    box-shadow: 0 4px 14px rgba(27, 58, 107, 0.4);
    transform: translateY(-1px);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-primary:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.btn-gold {
    background: linear-gradient(135deg, var(--gold), var(--gold-light));
    color: var(--primary-blue);
    box-shadow: 0 3px 10px rgba(255, 215, 0, 0.3);
}

.btn-gold:hover {
    background: linear-gradient(135deg, var(--gold-dark), var(--gold));
    transform: translateY(-1px);
}

.btn-outline {
    background: transparent;
    color: var(--primary-blue);
    border: 2px solid var(--primary-blue);
}

.btn-outline:hover {
    background: var(--primary-blue);
    color: var(--white);
}

.btn-link {
    background: none;
    color: var(--primary-blue);
    padding: 0;
    font-weight: 500;
}

.btn-link:hover {
    color: var(--primary-blue-light);
    text-decoration: underline;
}

/* Loading spinner */
.btn .spinner {
    display: none;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top: 2px solid var(--white);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.btn.loading .spinner {
    display: inline-block;
}

.btn.loading .btn-text {
    display: none;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Alert messages */
.alert {
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 13px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    line-height: 1.5;
}

.alert i {
    font-size: 18px;
    flex-shrink: 0;
}

.alert-danger {
    background: #FFF5F5;
    color: var(--red-dark);
    border: 1px solid #FECACA;
}

.alert-danger i { color: var(--red); }

.alert-success {
    background: #F0FFF4;
    color: #276749;
    border: 1px solid #C6F6D5;
}

.alert-success i { color: #38A169; }

.alert-warning {
    background: #FFFBEB;
    color: #92400E;
    border: 1px solid #FDE68A;
}

.alert-warning i { color: #D97706; }

.alert-info {
    background: #EFF6FF;
    color: var(--primary-blue);
    border: 1px solid #BFDBFE;
}

.alert-info i { color: var(--primary-blue-light); }

/* Footer text below card */
.auth-footer {
    text-align: center;
    margin-top: 24px;
    color: rgba(255, 255, 255, 0.5);
    font-size: 12px;
}

.auth-footer a {
    color: var(--gold);
    text-decoration: none;
    font-weight: 500;
}

.auth-footer a:hover {
    text-decoration: underline;
}

/* Card footer links */
.auth-card-footer {
    text-align: center;
    padding: 0 36px 28px;
    font-size: 13px;
    color: var(--gray-600);
}

.auth-card-footer a {
    color: var(--primary-blue);
    text-decoration: none;
    font-weight: 600;
}

.auth-card-footer a:hover {
    text-decoration: underline;
}

/* Divider */
.divider {
    display: flex;
    align-items: center;
    margin: 24px 0;
    color: var(--gray-400);
    font-size: 12px;
}

.divider::before,
.divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--gray-200);
}

.divider span {
    padding: 0 12px;
}

/* OTP Input Boxes */
.otp-inputs {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin: 24px 0;
}

.otp-inputs input {
    width: 50px;
    height: 56px;
    text-align: center;
    font-size: 22px;
    font-weight: 700;
    color: var(--primary-blue);
    border: 2px solid var(--gray-200);
    border-radius: 8px;
    background: var(--gray-50);
    outline: none;
    transition: all 0.2s;
}

.otp-inputs input:focus {
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(255, 215, 0, 0.2);
    background: var(--white);
}

/* Resend timer */
.resend-section {
    text-align: center;
    margin-top: 20px;
    font-size: 13px;
    color: var(--gray-600);
}

.resend-section a {
    color: var(--primary-blue);
    font-weight: 600;
    text-decoration: none;
}

.resend-section a:hover {
    text-decoration: underline;
}

.resend-section a.disabled {
    color: var(--gray-400);
    pointer-events: none;
}

/* Password strength meter */
.password-strength {
    margin-top: 8px;
}

.strength-bar {
    height: 4px;
    background: var(--gray-200);
    border-radius: 2px;
    overflow: hidden;
}

.strength-bar-fill {
    height: 100%;
    width: 0%;
    border-radius: 2px;
    transition: width 0.3s, background 0.3s;
}

.strength-text {
    font-size: 11px;
    margin-top: 4px;
    font-weight: 500;
}

/* Back to login link */
.back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--gray-600);
    font-size: 13px;
    text-decoration: none;
    margin-bottom: 20px;
    transition: color 0.2s;
}

.back-link:hover {
    color: var(--primary-blue);
}

/* Responsive */
@media (max-width: 480px) {
    .auth-card-body {
        padding: 30px 24px 28px;
    }

    .auth-logo img {
        width: 75px;
        height: 75px;
    }

    .auth-logo h1 {
        font-size: 16px;
    }

    .otp-inputs input {
        width: 44px;
        height: 50px;
        font-size: 20px;
    }
}

/* ========================================
   Dashboard Layout Styles
   ======================================== */

/* Additional color vars */
:root {
    --green: #2E7D32;
    --green-light: #43A047;
    --purple: #6A1B9A;
    --purple-light: #8E24AA;
    --sidebar-width: 260px;
    --navbar-height: 60px;
}

/* ---- Top Navbar ---- */
.top-navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--navbar-height);
    background: var(--primary-blue);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    z-index: 1100;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.navbar-left {
    display: flex;
    align-items: center;
    gap: 14px;
}

.sidebar-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--white);
    font-size: 20px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: background 0.2s;
}

.sidebar-toggle:hover {
    background: rgba(255,255,255,0.1);
}

.navbar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--white);
}

.navbar-brand img {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--gold);
}

.navbar-brand span {
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 0.3px;
}

.navbar-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.navbar-notification {
    position: relative;
    color: var(--white);
    font-size: 18px;
    cursor: pointer;
    padding: 6px;
    border-radius: 50%;
    transition: background 0.2s;
    text-decoration: none;
}

.navbar-notification:hover {
    background: rgba(255,255,255,0.1);
}

.notification-badge {
    position: absolute;
    top: 0;
    right: 0;
    background: var(--red);
    color: var(--white);
    font-size: 10px;
    font-weight: 700;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--primary-blue);
}

.user-dropdown {
    position: relative;
}

.user-dropdown-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    background: none;
    border: none;
    color: var(--white);
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
    transition: background 0.2s;
}

.user-dropdown-toggle:hover {
    background: rgba(255,255,255,0.1);
}

.user-dropdown-toggle img {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--gold);
}

.user-dropdown-toggle .user-name {
    font-size: 13px;
    font-weight: 600;
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-dropdown-toggle .fa-chevron-down {
    font-size: 10px;
    transition: transform 0.2s;
}

.user-dropdown.open .fa-chevron-down {
    transform: rotate(180deg);
}

.user-dropdown-menu {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: var(--white);
    border-radius: 8px;
    box-shadow: var(--shadow-lg);
    min-width: 200px;
    overflow: hidden;
    z-index: 1200;
}

.user-dropdown.open .user-dropdown-menu {
    display: block;
}

.user-dropdown-menu .dropdown-header {
    padding: 12px 16px;
    border-bottom: 1px solid var(--gray-200);
}

.user-dropdown-menu .dropdown-header .name {
    font-size: 14px;
    font-weight: 600;
    color: var(--gray-800);
}

.user-dropdown-menu .dropdown-header .role {
    font-size: 11px;
    color: var(--gray-600);
    margin-top: 2px;
}

.user-dropdown-menu a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    color: var(--gray-800);
    text-decoration: none;
    font-size: 13px;
    transition: background 0.15s;
}

.user-dropdown-menu a:hover {
    background: var(--gray-50);
}

.user-dropdown-menu a i {
    width: 16px;
    text-align: center;
    color: var(--gray-600);
}

.user-dropdown-menu .dropdown-divider {
    height: 1px;
    background: var(--gray-200);
    margin: 0;
}

.user-dropdown-menu a.logout-link {
    color: var(--red);
}

.user-dropdown-menu a.logout-link i {
    color: var(--red);
}

/* ---- Sidebar ---- */
.sidebar {
    position: fixed;
    top: var(--navbar-height);
    left: 0;
    width: var(--sidebar-width);
    height: calc(100vh - var(--navbar-height));
    background: var(--white);
    box-shadow: 2px 0 8px rgba(0,0,0,0.06);
    overflow-y: auto;
    z-index: 1000;
    transition: transform 0.3s ease;
    padding: 16px 0;
}

.sidebar-nav {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar-nav li a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 24px;
    color: var(--gray-600);
    text-decoration: none;
    font-size: 13.5px;
    font-weight: 500;
    transition: all 0.15s;
    border-left: 3px solid transparent;
}

.sidebar-nav li a:hover {
    color: var(--primary-blue);
    background: var(--gray-50);
}

.sidebar-nav li a i {
    width: 20px;
    text-align: center;
    font-size: 15px;
}

.sidebar-nav li a.active {
    color: var(--primary-blue);
    background: rgba(27, 58, 107, 0.06);
    border-left-color: var(--primary-blue);
    font-weight: 600;
}

.sidebar-nav .nav-group > .nav-group-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 6px 8px 2px;
    padding: 11px 14px;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--primary-blue);
    background: rgba(27, 58, 107, 0.07);
    border-left: 4px solid var(--primary-blue);
    border-radius: 0 5px 5px 0;
    cursor: pointer;
    user-select: none;
    transition: background 0.2s;
}
.sidebar-nav .nav-group > .nav-group-label:hover {
    background: rgba(27, 58, 107, 0.14);
}
.sidebar-nav .nav-group-arrow {
    font-size: 12px;
    transition: transform 0.25s ease;
}
.sidebar-nav .nav-group.collapsed > .nav-group-label .nav-group-arrow {
    transform: rotate(-90deg);
}
.sidebar-nav .nav-group-items {
    list-style: none;
    padding: 0;
    margin: 0;
    overflow: hidden;
    max-height: 1000px;
    transition: max-height 0.3s ease, opacity 0.25s ease;
    opacity: 1;
}
.sidebar-nav .nav-group.collapsed > .nav-group-items {
    max-height: 0;
    opacity: 0;
}

.sidebar-overlay {
    display: none;
    position: fixed;
    top: var(--navbar-height);
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.4);
    z-index: 999;
}

/* ---- Main Content ---- */
.main-content {
    margin-left: var(--sidebar-width);
    margin-top: var(--navbar-height);
    padding: 24px;
    min-height: calc(100vh - var(--navbar-height));
    background: var(--gray-100);
}

.page-header {
    margin-bottom: 24px;
}

.page-header h1 {
    font-size: 22px;
    font-weight: 700;
    color: var(--gray-800);
}

.page-header p {
    font-size: 13px;
    color: var(--gray-600);
    margin-top: 4px;
}

/* ---- Stats Grid ---- */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    gap: 16px;
    transition: transform 0.15s, box-shadow 0.15s;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.stat-card .stat-icon {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    flex-shrink: 0;
}

.stat-card .stat-info h3 {
    font-size: 22px;
    font-weight: 700;
    line-height: 1.2;
}

.stat-card .stat-info p {
    font-size: 12px;
    color: var(--gray-600);
    margin-top: 2px;
    font-weight: 500;
}

/* Stat card color variants */
.stat-card.blue .stat-icon {
    background: rgba(27, 58, 107, 0.1);
    color: var(--primary-blue);
}
.stat-card.blue .stat-info h3 { color: var(--primary-blue); }

.stat-card.gold .stat-icon {
    background: rgba(255, 215, 0, 0.15);
    color: var(--gold-dark);
}
.stat-card.gold .stat-info h3 { color: var(--gold-dark); }

.stat-card.red .stat-icon {
    background: rgba(211, 47, 47, 0.1);
    color: var(--red);
}
.stat-card.red .stat-info h3 { color: var(--red); }

.stat-card.green .stat-icon {
    background: rgba(46, 125, 50, 0.1);
    color: var(--green);
}
.stat-card.green .stat-info h3 { color: var(--green); }

.stat-card.purple .stat-icon {
    background: rgba(106, 27, 154, 0.1);
    color: var(--purple);
}
.stat-card.purple .stat-info h3 { color: var(--purple); }

/* ---- Dashboard Cards ---- */
.dashboard-card {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    margin-bottom: 24px;
    overflow: hidden;
}

.dashboard-card .card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--gray-200);
}

.dashboard-card .card-header h2 {
    font-size: 15px;
    font-weight: 700;
    color: var(--gray-800);
    display: flex;
    align-items: center;
    gap: 8px;
}

.dashboard-card .card-header h2 i {
    color: var(--primary-blue);
    font-size: 16px;
}

.dashboard-card .card-body {
    padding: 20px;
}

/* ---- 2-Column Grid ---- */
.grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
}

/* ---- Data Tables ---- */
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.data-table thead th {
    background: var(--gray-50);
    color: var(--gray-600);
    font-weight: 600;
    font-size: 11.5px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 10px 14px;
    text-align: left;
    border-bottom: 2px solid var(--gray-200);
}

.data-table tbody tr {
    border-bottom: 1px solid var(--gray-100);
    transition: background 0.15s;
}

.data-table tbody tr:hover {
    background: var(--gray-50);
}

.data-table tbody td {
    padding: 10px 14px;
    color: var(--gray-800);
    vertical-align: middle;
}

/* Status badges */
.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 50px;
    font-size: 11px;
    font-weight: 600;
    line-height: 1.5;
}

.badge-success {
    background: #E8F5E9;
    color: var(--green);
}

.badge-danger {
    background: #FFEBEE;
    color: var(--red);
}

.badge-warning {
    background: #FFF8E1;
    color: #E65100;
}

.badge-info {
    background: #E3F2FD;
    color: var(--primary-blue);
}

.badge-purple {
    background: #F3E5F5;
    color: var(--purple);
}

/* ---- Activity List ---- */
.activity-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.activity-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--gray-100);
}

.activity-item:last-child {
    border-bottom: none;
}

.activity-item .activity-icon {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: rgba(27, 58, 107, 0.08);
    color: var(--primary-blue);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    flex-shrink: 0;
    margin-top: 2px;
}

.activity-item .activity-text {
    flex: 1;
    font-size: 13px;
    color: var(--gray-800);
    line-height: 1.5;
}

.activity-item .activity-text strong {
    font-weight: 600;
}

.activity-item .activity-time {
    font-size: 11px;
    color: var(--gray-400);
    white-space: nowrap;
    margin-top: 3px;
}

/* ---- Alert Items ---- */
.alert-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 8px;
    margin-bottom: 10px;
    font-size: 13px;
}

.alert-item:last-child {
    margin-bottom: 0;
}

.alert-item i {
    font-size: 16px;
    margin-top: 1px;
    flex-shrink: 0;
}

.alert-item .alert-content {
    flex: 1;
}

.alert-item .alert-title {
    font-weight: 600;
    margin-bottom: 2px;
}

.alert-item .alert-message {
    font-size: 12px;
    opacity: 0.85;
    line-height: 1.4;
}

.alert-item .alert-time {
    font-size: 10px;
    opacity: 0.6;
    margin-top: 4px;
}

.alert-item.alert-item-info {
    background: #EFF6FF;
    color: var(--primary-blue);
}

.alert-item.alert-item-warning {
    background: #FFFBEB;
    color: #92400E;
}

.alert-item.alert-item-danger {
    background: #FFF5F5;
    color: var(--red-dark);
}

.alert-item.alert-item-critical {
    background: #FBE9E7;
    color: #BF360C;
}

.alert-item.alert-item-success {
    background: #F0FFF4;
    color: #276749;
}

/* ---- Empty State ---- */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--gray-400);
}

.empty-state i {
    font-size: 40px;
    margin-bottom: 12px;
    display: block;
}

.empty-state p {
    font-size: 13px;
}

/* ---- Chart Container ---- */
.chart-container {
    position: relative;
    height: 320px;
    width: 100%;
}

/* ---- Dashboard Footer ---- */
.dashboard-footer {
    text-align: center;
    padding: 20px;
    font-size: 12px;
    color: var(--gray-400);
    margin-top: 10px;
}

/* ========================================
   CRUD Page Styles
   ======================================== */

/* Page header with actions */
.page-header-flex {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 12px;
}

.page-header-flex h1 {
    font-size: 22px;
    font-weight: 700;
    color: var(--gray-800);
}

.page-header-flex p {
    font-size: 13px;
    color: var(--gray-600);
    margin-top: 4px;
}

/* Action buttons row */
.btn-sm {
    padding: 7px 14px;
    font-size: 12.5px;
    border-radius: 6px;
}

.btn-success {
    background: var(--green);
    color: var(--white);
}

.btn-success:hover {
    background: var(--green-light);
    transform: translateY(-1px);
}

.btn-danger {
    background: var(--red);
    color: var(--white);
}

.btn-danger:hover {
    background: var(--red-dark);
    transform: translateY(-1px);
}

.btn-info {
    background: var(--primary-blue-light);
    color: var(--white);
}

.btn-info:hover {
    background: var(--primary-blue);
    transform: translateY(-1px);
}

.btn-secondary {
    background: var(--gray-600);
    color: var(--white);
}

.btn-secondary:hover {
    background: var(--gray-800);
    transform: translateY(-1px);
}

.btn-warning {
    background: #F59E0B;
    color: var(--white);
}

.btn-warning:hover {
    background: #D97706;
    transform: translateY(-1px);
}

.action-btns {
    display: flex;
    gap: 6px;
}

.action-btns .btn {
    padding: 5px 10px;
    font-size: 12px;
}

/* Toolbar: search + filters */
.toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.toolbar-search {
    position: relative;
    flex: 1;
    max-width: 360px;
}

.toolbar-search input {
    width: 100%;
    padding: 9px 14px 9px 38px;
    border: 2px solid var(--gray-200);
    border-radius: 8px;
    font-size: 13px;
    outline: none;
    transition: border-color 0.2s;
    background: var(--white);
}

.toolbar-search input:focus {
    border-color: var(--primary-blue);
}

.toolbar-search i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gray-400);
    font-size: 14px;
}

.toolbar-filter select {
    padding: 9px 14px;
    border: 2px solid var(--gray-200);
    border-radius: 8px;
    font-size: 13px;
    outline: none;
    background: var(--white);
    cursor: pointer;
    transition: border-color 0.2s;
}

.toolbar-filter select:focus {
    border-color: var(--primary-blue);
}

/* Pagination */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.pagination a,
.pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    height: 34px;
    padding: 0 8px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.15s;
    color: var(--gray-600);
    background: var(--white);
    border: 1px solid var(--gray-200);
}

.pagination a:hover {
    background: var(--gray-50);
    border-color: var(--primary-blue);
    color: var(--primary-blue);
}

.pagination .active {
    background: var(--primary-blue);
    color: var(--white);
    border-color: var(--primary-blue);
}

.pagination .disabled {
    opacity: 0.4;
    pointer-events: none;
}

.pagination-info {
    text-align: center;
    font-size: 12px;
    color: var(--gray-600);
    margin-top: 8px;
}

/* ---- Form Styles ---- */
.form-card {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.form-card .form-card-header {
    padding: 16px 24px;
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.form-card .form-card-header h2 {
    font-size: 16px;
    font-weight: 700;
    color: var(--gray-800);
    display: flex;
    align-items: center;
    gap: 8px;
}

.form-card .form-card-header h2 i {
    color: var(--primary-blue);
}

.form-card .form-card-body {
    padding: 24px;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-bottom: 0;
}

.form-row .form-group {
    margin-bottom: 20px;
}

.form-row.cols-3 {
    grid-template-columns: repeat(3, 1fr);
}

.form-group label .required {
    color: var(--red);
    margin-left: 2px;
}

.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 14px;
    border: 2px solid var(--gray-200);
    border-radius: 8px;
    font-size: 13.5px;
    font-family: inherit;
    color: var(--gray-800);
    outline: none;
    background: var(--gray-50);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 3px rgba(27, 58, 107, 0.1);
    background: var(--white);
}

.form-group textarea {
    min-height: 100px;
    resize: vertical;
}

.form-group .form-input {
    width: 100%;
    padding: 10px 14px;
    border: 2px solid var(--gray-200);
    border-radius: 8px;
    font-size: 13.5px;
    font-family: inherit;
    color: var(--gray-800);
    outline: none;
    background: var(--gray-50);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-group .form-input:focus {
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 3px rgba(27, 58, 107, 0.1);
    background: var(--white);
}

.form-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-top: 10px;
    border-top: 1px solid var(--gray-100);
    margin-top: 10px;
}

/* ---- Detail / View Page ---- */
.detail-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0;
}

.detail-item {
    padding: 12px 0;
    border-bottom: 1px solid var(--gray-100);
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.detail-item:nth-child(odd) {
    padding-right: 20px;
}

.detail-item:nth-child(even) {
    padding-left: 20px;
    border-left: 1px solid var(--gray-100);
}

.detail-label {
    font-size: 11.5px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--gray-400);
}

.detail-value {
    font-size: 14px;
    color: var(--gray-800);
    font-weight: 500;
}

/* Confirm delete card */
.confirm-card {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    max-width: 500px;
    margin: 40px auto;
    text-align: center;
    padding: 40px 30px;
}

.confirm-card .confirm-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: #FFEBEE;
    color: var(--red);
    font-size: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
}

.confirm-card h2 {
    font-size: 18px;
    font-weight: 700;
    color: var(--gray-800);
    margin-bottom: 8px;
}

.confirm-card p {
    font-size: 13px;
    color: var(--gray-600);
    margin-bottom: 24px;
    line-height: 1.6;
}

.confirm-card .confirm-name {
    font-weight: 700;
    color: var(--red);
}

.confirm-actions {
    display: flex;
    justify-content: center;
    gap: 12px;
}

/* Table responsive wrapper */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* ========================================
   Responsive — Dashboard
   ======================================== */

/* Tablets */
@media (max-width: 1024px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .grid-2 {
        grid-template-columns: 1fr;
    }

    .sidebar-toggle {
        display: block;
    }

    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .sidebar-overlay.open {
        display: block;
    }

    .main-content {
        margin-left: 0;
    }

    .navbar-brand span {
        display: none;
    }
}

/* Mobile */
@media (max-width: 576px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }

    .main-content {
        padding: 16px;
    }

    .stat-card {
        padding: 16px;
    }

    .stat-card .stat-icon {
        width: 42px;
        height: 42px;
        font-size: 18px;
    }

    .stat-card .stat-info h3 {
        font-size: 18px;
    }

    .page-header h1,
    .page-header-flex h1 {
        font-size: 18px;
    }

    .user-dropdown-toggle .user-name {
        display: none;
    }

    .dashboard-card .card-body {
        padding: 14px;
    }

    .data-table {
        font-size: 12px;
    }

    .data-table thead th,
    .data-table tbody td {
        padding: 8px 10px;
    }

    .form-row,
    .form-row.cols-3 {
        grid-template-columns: 1fr;
    }

    .detail-grid {
        grid-template-columns: 1fr;
    }

    .detail-item:nth-child(odd) {
        padding-right: 0;
    }

    .detail-item:nth-child(even) {
        padding-left: 0;
        border-left: none;
    }

    .toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .toolbar-search {
        max-width: 100%;
    }

    .confirm-actions {
        flex-direction: column;
    }

    .form-actions {
        flex-direction: column;
    }

    .form-actions .btn {
        width: 100%;
    }
}

/* ---- Level Switcher ---- */
.level-switcher {
    position: relative;
}

.level-switcher-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 215, 0, 0.15);
    border: 1px solid rgba(255, 215, 0, 0.3);
    color: var(--gold);
    padding: 7px 14px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.2s;
}

.level-switcher-toggle:hover {
    background: rgba(255, 215, 0, 0.25);
    border-color: var(--gold);
}

.level-switcher-toggle .fa-chevron-down {
    font-size: 10px;
    transition: transform 0.2s;
}

.level-switcher.open .level-switcher-toggle .fa-chevron-down {
    transform: rotate(180deg);
}

.level-switcher-menu {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    min-width: 260px;
    z-index: 1200;
    overflow: hidden;
    border: 1px solid var(--gray-200);
}

.level-switcher.open .level-switcher-menu {
    display: block;
    animation: levelSlideDown 0.2s ease;
}

@keyframes levelSlideDown {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}

.level-switcher-header {
    padding: 12px 16px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--gray-400);
    border-bottom: 1px solid var(--gray-200);
    background: var(--gray-50);
}

.level-switcher-divider {
    height: 1px;
    background: var(--gray-200);
    margin: 4px 0;
}

.level-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    color: var(--gray-800);
    text-decoration: none;
    transition: background 0.15s;
}

.level-item:hover {
    background: var(--gray-50);
}

.level-item i {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: var(--gray-100);
    color: var(--primary-blue);
    font-size: 14px;
    flex-shrink: 0;
}

.level-item div {
    display: flex;
    flex-direction: column;
}

.level-item strong {
    font-size: 13px;
    font-weight: 600;
    color: var(--gray-800);
}

.level-item small {
    font-size: 11px;
    color: var(--gray-400);
}

.level-item-active {
    background: rgba(27, 58, 107, 0.06);
}

.level-item-active i {
    background: var(--primary-blue);
    color: var(--white);
}

.level-item-active strong {
    color: var(--primary-blue);
}

/* Level Switcher responsive */
@media (max-width: 768px) {
    .level-switcher-toggle span {
        display: none;
    }

    .level-switcher-toggle {
        padding: 7px 10px;
    }

    .level-switcher-menu {
        right: -40px;
        min-width: 240px;
    }
}

/* ── Quill rich-text content rendering ─────────────────────────────────────── */
.ql-content p          { margin: 0 0 10px; }
.ql-content ol,
.ql-content ul         { padding-left: 1.5em; margin: 0 0 10px; }
.ql-content ol li      { list-style: decimal; margin-bottom: 4px; }
.ql-content ul li      { list-style: disc;    margin-bottom: 4px; }
.ql-content strong     { font-weight: 700; }
.ql-content em         { font-style: italic; }
.ql-content u          { text-decoration: underline; }
.ql-content h1         { font-size: 1.6em; font-weight: 700; margin: 0 0 10px; }
.ql-content h2         { font-size: 1.3em; font-weight: 700; margin: 0 0 10px; }
.ql-content h3         { font-size: 1.1em; font-weight: 700; margin: 0 0 10px; }
.ql-content blockquote { border-left: 4px solid var(--gray-300); padding-left: 12px; color: var(--gray-500); margin: 0 0 10px; }
.ql-content a          { color: var(--primary-blue); text-decoration: underline; }
.ql-align-justify      { text-align: justify; }
.ql-align-center       { text-align: center; }
.ql-align-right        { text-align: right; }
