/* ============================================================
   MUST CU MANAGEMENT SYSTEM — COMPLETE STYLESHEET
   Theme: #0207ba (Blue) | #ff7900 (Orange)
   ============================================================ */

/* ============================================================
   1. CSS VARIABLES & RESET
   ============================================================ */
:root {
    /* Primary Palette */
    --cu-blue: #0207ba;
    --cu-blue-rgb: 2, 7, 186;
    --cu-blue-light: #0207ba;
    --cu-blue-lighter: #0207ba;
    --cu-blue-dark: #0105a0;
    --cu-blue-darker: #01037a;
    --cu-blue-10: rgba(11, 19, 235, 0.548);
    --cu-blue-20: rgba(16, 12, 236, 0.692);
    --cu-blue-30: rgba(5, 12, 201, 0.685);

    --cu-orange: #ff7900;
    --cu-orange-rgb: 255, 121, 0;
    --cu-orange-light: #ff9a40;
    --cu-orange-lighter: #ffb870;
    --cu-orange-dark: #e66a00;
    --cu-orange-darker: #cc5e00;
    --cu-orange-10: rgba(255, 121, 0, 0.10);
    --cu-orange-20: rgba(255, 121, 0, 0.20);

    /* Neutrals */
    --cu-dark: #1a1a2e;
    --cu-darker: #12121f;
    --cu-darkest: #0b0b15;
    --body-bg: #f0f2f5;
    --card-bg: #ffffff;
    --text-primary: #1a1a2e;
    --text-secondary: #5a607f;
    --text-muted: #9ca3af;
    --border-color: #e5e7eb;
    --border-light: #f3f4f6;

    /* Status Colors */
    --success: #10b981;
    --success-bg: #ecfdf5;
    --danger: #ef4444;
    --danger-bg: #fef2f2;
    --warning: #f59e0b;
    --warning-bg: #fffbeb;
    --info: #06b6d4;
    --info-bg: #ecfeff;
    --purple: #fff000;
    --purple-bg: #f5f3ff;

    /* Layout */
    --sidebar-width: 270px;
    --topbar-height: 64px;
    --radius-sm: 6px;
    --radius: 10px;
    --radius-lg: 14px;
    --radius-xl: 18px;
    --shadow-xs: 0 1px 2px rgba(0,0,0,0.04);
    --shadow-sm: 0 1px 4px rgba(0,0,0,0.06);
    --shadow-md: 0 4px 16px rgba(0,0,0,0.08);
    --shadow-lg: 0 8px 30px rgba(0,0,0,0.10);
    --shadow-xl: 0 16px 50px rgba(0,0,0,0.12);
    --shadow-blue: 0 4px 14px rgba(2, 7, 186, 0.25);
    --shadow-orange: 0 4px 14px rgba(255, 121, 0, 0.25);
    --transition-fast: all 0.15s ease;
    --transition: all 0.25s ease;
    --transition-slow: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

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

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-family);
    background: var(--body-bg);
    color: var(--text-primary);
    font-size: 0.875rem;
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a {
    color: var(--cu-blue);
    text-decoration: none;
    transition: var(--transition-fast);
}
a:hover {
    color: var(--cu-blue-dark);
}

img {
    max-width: 100%;
    height: auto;
}

::selection {
    background: var(--cu-blue-20);
    color: var(--cu-blue-dark);
}


/* ============================================================
   2. SIDEBAR — FULL FEATURED
   ============================================================ */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    height: 100dvh;
    background: var(--cu-darker);
    z-index: 1050;
    transition: var(--transition-slow);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border-right: 1px solid rgba(255,255,255,0.05);
}

/* Desktop: collapsed state */
.sidebar.collapsed {
    margin-left: calc(-1 * var(--sidebar-width));
}

/* Mobile: hidden by default, slides in */
@media (max-width: 991.98px) {
    .sidebar {
        margin-left: calc(-1 * var(--sidebar-width));
        box-shadow: none;
    }
    .sidebar.show {
        margin-left: 0;
        box-shadow: var(--shadow-xl);
    }
}

/* --- Sidebar Header --- */
.sidebar-header {
    padding: 1.25rem 1.15rem;
    border-bottom: 1px solid rgba(255,255,255,0.07);
    flex-shrink: 0;
    min-height: 72px;
    display: flex;
    align-items: center;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    width: 100%;
}

.brand-icon {
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, var(--cu-orange), var(--cu-orange-dark));
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.3rem;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(255, 121, 0, 0.35);
}

.brand-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.brand-name {
    color: #fff;
    font-weight: 800;
    font-size: 1.1rem;
    letter-spacing: -0.02em;
    line-height: 1.2;
}

.brand-sub {
    color: rgba(255,255,255,0.40);
    font-size: 0.68rem;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 180px;
    margin-top: 1px;
}

/* --- Sidebar Navigation --- */
.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 0.5rem 0;
    scrollbar-width: thin;
    scrollbar-color: rgba(7, 29, 228, 0.781) transparent;
}

.sidebar-nav::-webkit-scrollbar {
    width: 5px;
}
.sidebar-nav::-webkit-scrollbar-track {
    background: transparent;
}
.sidebar-nav::-webkit-scrollbar-thumb {
    background: rgba(4, 59, 209, 0.616);
    border-radius: 10px;
}
.sidebar-nav::-webkit-scrollbar-thumb:hover {
    background: rgba(255,255,255,0.20);
}

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

/* Section Label */
.nav-section {
    padding: 1.1rem 1.35rem 0.4rem;
    font-size: 0.62rem;
    font-weight: 700;
    color: rgba(255,255,255,0.25);
    text-transform: uppercase;
    letter-spacing: 0.12em;
    user-select: none;
}

/* Nav Link */
.nav-item .nav-link {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.62rem 1.35rem;
    color: rgba(255,255,255,0.55);
    font-size: 0.84rem;
    font-weight: 450;
    transition: var(--transition-fast);
    border-left: 3px solid transparent;
    margin: 2px 0;
    position: relative;
    text-decoration: none;
}

.nav-item .nav-link:hover {
    color: rgba(255,255,255,0.90);
    background: rgba(255,255,255,0.05);
    border-left-color: rgba(255,255,255,0.15);
}

.nav-item .nav-link.active {
    color: #fff;
    background: linear-gradient(90deg, rgba(var(--cu-blue-rgb), 0.35), rgba(var(--cu-blue-rgb), 0.10));
    border-left-color: var(--cu-orange);
    font-weight: 600;
}

.nav-item .nav-link.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 60%;
    background: var(--cu-orange);
    border-radius: 0 3px 3px 0;
    box-shadow: 0 0 8px rgba(255, 121, 0, 0.5);
}

.nav-item .nav-link i {
    font-size: 1.15rem;
    width: 24px;
    text-align: center;
    flex-shrink: 0;
    transition: var(--transition-fast);
}

.nav-item .nav-link.active i {
    color: var(--cu-orange-lighter);
}

.nav-item .nav-link span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Badge inside nav link */
.nav-item .nav-link .badge {
    margin-left: auto;
    font-size: 0.65rem;
    padding: 0.25em 0.5em;
    flex-shrink: 0;
    animation: badgePulse 2s infinite;
}

@keyframes badgePulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}


/* ============================================================
   3. MOBILE SIDEBAR OVERLAY
   ============================================================ */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(5, 55, 219, 0.55);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    z-index: 1045;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.sidebar-overlay.show {
    display: block;
    opacity: 1;
}


/* ============================================================
   4. MAIN CONTENT AREA
   ============================================================ */
.main-content {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    transition: var(--transition-slow);
    background: var(--body-bg);
}

/* When sidebar is collapsed on desktop */
body.sidebar-collapsed .main-content {
    margin-left: 0;
}

@media (min-width: 992px) {
    .main-content {
        width: auto;
        min-width: 0;
    }
    .sidebar-toggle {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-width: 40px;
        min-height: 40px;
        cursor: pointer;
    }
}

@media (max-width: 991.98px) {
    body.sidebar-collapsed .main-content { margin-left: 0; }
}

/* Mobile: always full width */
@media (max-width: 991.98px) {
    .main-content {
        margin-left: 0;
    }
}


/* ============================================================
   5. TOP NAVBAR
   ============================================================ */
.top-navbar {
    height: var(--topbar-height);
    background: var(--card-bg);
    border-bottom: 1px solid var(--border-color);
    padding: 0 1.25rem;
    position: sticky;
    top: 0;
    z-index: 1030;
    box-shadow: var(--shadow-xs);
    display: flex;
    align-items: center;
}

.sidebar-toggle {
    color: var(--text-secondary);
    font-size: 1.35rem;
    padding: 0.35rem 0.5rem;
    border: none !important;
    border-radius: var(--radius-sm);
    transition: var(--transition-fast);
    line-height: 1;
}

.sidebar-toggle:hover {
    color: var(--cu-blue);
    background: var(--cu-blue-10);
}

.top-navbar .dropdown-toggle::after {
    display: none;
}

.top-navbar .dropdown-menu {
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    padding: 0.5rem;
    min-width: 200px;
}

.top-navbar .dropdown-item {
    border-radius: var(--radius-sm);
    padding: 0.55rem 0.85rem;
    font-size: 0.84rem;
    color: var(--text-primary);
}

.top-navbar .dropdown-item:hover {
    background: var(--cu-blue-10);
    color: var(--cu-blue);
}

.top-navbar .dropdown-item.text-danger:hover {
    background: var(--danger-bg);
    color: var(--danger);
}

.notif-btn {
    position: relative;
    color: var(--text-secondary);
    font-size: 1.2rem;
    padding: 0.4rem;
    border: none;
    background: none;
    border-radius: var(--radius-sm);
    transition: var(--transition-fast);
}

.notif-btn:hover {
    color: var(--cu-blue);
    background: var(--cu-blue-10);
}

.notif-badge {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 18px;
    height: 18px;
    background: var(--danger);
    color: #fff;
    font-size: 0.6rem;
    font-weight: 700;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--card-bg);
    line-height: 1;
}

.user-menu-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.3rem 0.6rem;
    border: 1px solid var(--border-color);
    border-radius: 50px;
    background: var(--card-bg);
    color: var(--text-primary);
    font-size: 0.84rem;
    font-weight: 500;
    transition: var(--transition-fast);
    text-decoration: none;
}

.user-menu-btn:hover {
    border-color: var(--cu-blue);
    color: var(--cu-blue);
    background: var(--cu-blue-10);
    box-shadow: var(--shadow-sm);
}

.user-avatar-sm {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--cu-blue), var(--cu-blue-light));
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.75rem;
    flex-shrink: 0;
}


/* ============================================================
   6. CONTENT WRAPPER & FOOTER
   ============================================================ */
.content-wrapper {
    flex: 1;
    padding: 1.5rem;
}

.main-footer {
    background: var(--card-bg);
    border-top: 1px solid var(--border-color);
    padding: 1rem 1.5rem;
}

.main-footer .text-muted {
    font-size: 0.78rem;
}


/* ============================================================
   7. FLASH MESSAGES
   ============================================================ */
.flash-message-container {
    position: fixed;
    top: 80px;
    right: 1.25rem;
    z-index: 9999;
    width: 380px;
    max-width: calc(100vw - 2rem);
}

.flash-toast {
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    font-size: 0.875rem;
    border: none;
    padding: 0.85rem 1.1rem;
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
}

.flash-toast.alert-success {
    background: linear-gradient(135deg, #ecfdf5, #d1fae5);
    color: #065f46;
    border-left: 4px solid var(--success);
}
.flash-toast.alert-danger {
    background: linear-gradient(135deg, #fef2f2, #fee2e2);
    color: #991b1b;
    border-left: 4px solid var(--danger);
}
.flash-toast.alert-warning {
    background: linear-gradient(135deg, #fffbeb, #fef3c7);
    color: #92400e;
    border-left: 4px solid var(--warning);
}
.flash-toast.alert-info {
    background: linear-gradient(135deg, #ecfeff, #cffafe);
    color: #155e75;
    border-left: 4px solid var(--info);
}

@media (max-width: 575.98px) {
    .flash-message-container {
        top: auto;
        bottom: 1rem;
        right: 1rem;
        left: 1rem;
        width: auto;
    }
}


/* ============================================================
   8. PAGE HEADER
   ============================================================ */
.page-header {
    margin-bottom: 1.5rem;
}

.page-header h4 {
    font-weight: 800;
    color: var(--cu-dark);
    font-size: 1.35rem;
    letter-spacing: -0.02em;
    margin-bottom: 0.3rem;
}

.page-header .breadcrumb {
    font-size: 0.78rem;
    margin-bottom: 0;
    background: none;
    padding: 0;
}

.page-header .breadcrumb-item a {
    color: var(--text-muted);
    font-weight: 500;
}

.page-header .breadcrumb-item a:hover {
    color: var(--cu-blue);
}

.page-header .breadcrumb-item.active {
    color: var(--text-secondary);
    font-weight: 600;
}

.page-header .breadcrumb-item + .breadcrumb-item::before {
    color: var(--text-muted);
    content: "›";
}


/* ============================================================
   9. STAT CARDS
   ============================================================ */
.stat-card {
    border: none;
    border-radius: var(--radius-lg);
    padding: 1.35rem;
    color: #fff;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-md);
    transition: var(--transition);
    cursor: default;
}

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

.stat-card::before {
    content: '';
    position: absolute;
    top: -40%;
    right: -20%;
    width: 140px;
    height: 140px;
    border-radius: 50%;
    background: rgba(255,255,255,0.08);
}

.stat-card::after {
    content: '';
    position: absolute;
    bottom: -30%;
    left: -10%;
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: rgba(255,255,255,0.05);
}

.stat-card .stat-icon {
    width: 52px;
    height: 52px;
    border-radius: var(--radius);
    background: rgba(255,255,255,0.18);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    margin-bottom: 1rem;
    position: relative;
    z-index: 1;
}

.stat-card .stat-value {
    font-size: 1.85rem;
    font-weight: 800;
    line-height: 1;
    position: relative;
    z-index: 1;
    letter-spacing: -0.02em;
}

.stat-card .stat-label {
    font-size: 0.78rem;
    opacity: 0.85;
    margin-top: 0.35rem;
    font-weight: 500;
    position: relative;
    z-index: 1;
}

/* Stat Color Variants */
.stat-card.bg-blue {
    background: linear-gradient(135deg, var(--cu-blue), var(--cu-blue-light));
}
.stat-card.bg-orange {
    background: linear-gradient(135deg, var(--cu-orange-dark), var(--cu-orange));
}
.stat-card.bg-green {
    background: linear-gradient(135deg, #fff000, var(--success));
}
.stat-card.bg-purple {
    background: linear-gradient(135deg, #0207ba, var(--purple));
}
.stat-card.bg-dark {
    background: linear-gradient(135deg, var(--cu-darkest), var(--cu-dark));
}
.stat-card.bg-red {
    background: linear-gradient(135deg, #dc2626, #ef4444);
}
.stat-card.bg-cyan {
    background: linear-gradient(135deg, #0891b2, #06b6d4);
}

@media (max-width: 575.98px) {
    .stat-card {
        padding: 1rem;
    }
    .stat-card .stat-value {
        font-size: 1.4rem;
    }
    .stat-card .stat-icon {
        width: 42px;
        height: 42px;
        font-size: 1.1rem;
    }
}


/* ============================================================
   10. CARDS
   ============================================================ */
.card {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xs);
    transition: var(--transition);
    background: var(--card-bg);
    overflow: hidden;
}

.card:hover {
    box-shadow: var(--shadow-sm);
}

.card-header {
    background: var(--card-bg);
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 1.25rem;
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--text-primary);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-header i {
    color: var(--cu-blue);
}

.card-body {
    padding: 1.25rem;
}

.card-body.p-0 {
    padding: 0;
}


/* ============================================================
   11. TABLES
   ============================================================ */
.table {
    font-size: 0.84rem;
    margin-bottom: 0;
}

.table thead th {
    background: var(--body-bg);
    border-bottom: 2px solid var(--border-color);
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    font-size: 0.68rem;
    letter-spacing: 0.06em;
    padding: 0.8rem 1rem;
    white-space: nowrap;
    position: sticky;
    top: 0;
    z-index: 1;
}

.table tbody td {
    padding: 0.75rem 1rem;
    vertical-align: middle;
    border-bottom: 1px solid var(--border-light);
    color: var(--text-primary);
}

.table tbody tr:last-child td {
    border-bottom: none;
}

.table-hover tbody tr:hover {
    background: var(--cu-blue-10);
}

.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}


/* ============================================================
   12. BADGES
   ============================================================ */
.badge {
    font-weight: 600;
    font-size: 0.7rem;
    padding: 0.3em 0.65em;
    border-radius: 6px;
    letter-spacing: 0.01em;
}

.badge-admin {
    background: var(--cu-blue);
    color: #fff;
}
.badge-leader {
    background: var(--purple);
    color: #fff;
}
.badge-member {
    background: var(--success);
    color: #fff;
}
.badge-associate {
    background: var(--cu-orange);
    color: #fff;
}

.user-type-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.73rem;
    font-weight: 600;
    padding: 0.3rem 0.7rem;
    border-radius: 8px;
    letter-spacing: 0.01em;
}

.user-type-badge.badge-admin {
    background: var(--cu-blue-10);
    color: var(--cu-blue);
}
.user-type-badge.badge-leader {
    background: var(--purple-bg);
    color: var(--purple);
}
.user-type-badge.badge-member {
    background: var(--success-bg);
    color: #059669;
}
.user-type-badge.badge-associate {
    background: var(--cu-orange-10);
    color: var(--cu-orange-dark);
}


/* ============================================================
   13. BUTTONS
   ============================================================ */
.btn {
    border-radius: var(--radius);
    font-size: 0.84rem;
    font-weight: 600;
    padding: 0.55rem 1.15rem;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    border: 2px solid transparent;
    position: relative;
    overflow: hidden;
}

.btn:active {
    transform: scale(0.97);
}

.btn-primary {
    background: var(--cu-blue);
    border-color: var(--cu-blue);
    color: #fff;
}
.btn-primary:hover {
    background: var(--cu-blue-dark);
    border-color: var(--cu-blue-dark);
    color: #fff;
    transform: translateY(-1px);
    box-shadow: var(--shadow-blue);
}
.btn-primary:active {
    transform: translateY(0) scale(0.97);
}

.btn-outline-primary {
    color: var(--cu-blue);
    border-color: var(--cu-blue);
    background: transparent;
}
.btn-outline-primary:hover {
    background: var(--cu-blue);
    border-color: var(--cu-blue);
    color: #fff;
    transform: translateY(-1px);
    box-shadow: var(--shadow-blue);
}

.btn-warning {
    background: var(--cu-orange);
    border-color: var(--cu-orange);
    color: #fff;
}
.btn-warning:hover {
    background: var(--cu-orange-dark);
    border-color: var(--cu-orange-dark);
    color: #fff;
    transform: translateY(-1px);
    box-shadow: var(--shadow-orange);
}

.btn-outline-warning {
    color: var(--cu-orange-dark);
    border-color: var(--cu-orange);
    background: transparent;
}
.btn-outline-warning:hover {
    background: var(--cu-orange);
    border-color: var(--cu-orange);
    color: #fff;
    box-shadow: var(--shadow-orange);
}

.btn-success {
    background: var(--success);
    border-color: var(--success);
    color: #fff;
}
.btn-success:hover {
    background: #059669;
    border-color: #059669;
    color: #fff;
    transform: translateY(-1px);
}

.btn-outline-success {
    color: var(--success);
    border-color: var(--success);
}
.btn-outline-success:hover {
    background: var(--success);
    border-color: var(--success);
    color: #fff;
}

.btn-danger {
    background: var(--danger);
    border-color: var(--danger);
    color: #fff;
}
.btn-danger:hover {
    background: #dc2626;
    border-color: #dc2626;
    color: #fff;
}

.btn-outline-danger {
    color: var(--danger);
    border-color: var(--danger);
}
.btn-outline-danger:hover {
    background: var(--danger);
    border-color: var(--danger);
    color: #fff;
}

.btn-info {
    background: var(--info);
    border-color: var(--info);
    color: #fff;
}
.btn-info:hover {
    background: #0891b2;
    border-color: #0891b2;
    color: #fff;
}

.btn-outline-info {
    color: var(--info);
    border-color: var(--info);
}
.btn-outline-info:hover {
    background: var(--info);
    border-color: var(--info);
    color: #fff;
}

.btn-secondary {
    background: var(--body-bg);
    border-color: var(--border-color);
    color: var(--text-secondary);
}
.btn-secondary:hover {
    background: var(--border-color);
    border-color: var(--border-color);
    color: var(--text-primary);
}

.btn-sm {
    padding: 0.35rem 0.7rem;
    font-size: 0.78rem;
    border-radius: var(--radius-sm);
}

.btn-lg {
    padding: 0.75rem 1.5rem;
    font-size: 0.95rem;
}

.btn-group .btn {
    border-radius: 0;
}
.btn-group .btn:first-child {
    border-top-left-radius: var(--radius-sm);
    border-bottom-left-radius: var(--radius-sm);
}
.btn-group .btn:last-child {
    border-top-right-radius: var(--radius-sm);
    border-bottom-right-radius: var(--radius-sm);
}


/* ============================================================
   14. FORMS
   ============================================================ */
.form-control,
.form-select {
    border: 2px solid var(--border-color);
    border-radius: var(--radius);
    padding: 0.6rem 0.9rem;
    font-size: 0.875rem;
    font-family: var(--font-family);
    color: var(--text-primary);
    background: var(--card-bg);
    transition: var(--transition-fast);
}

.form-control:focus,
.form-select:focus {
    border-color: var(--cu-blue);
    box-shadow: 0 0 0 4px var(--cu-blue-10);
    outline: none;
}

.form-control::placeholder {
    color: var(--text-muted);
}

.form-label {
    font-weight: 600;
    font-size: 0.82rem;
    color: var(--text-secondary);
    margin-bottom: 0.4rem;
}

.form-text {
    font-size: 0.78rem;
    color: var(--text-muted);
}

.input-group-text {
    background: var(--body-bg);
    border: 2px solid var(--border-color);
    color: var(--text-secondary);
    font-weight: 500;
}

.form-check-input:checked {
    background-color: var(--cu-blue);
    border-color: var(--cu-blue);
}

.form-check-input:focus {
    box-shadow: 0 0 0 3px var(--cu-blue-10);
    border-color: var(--cu-blue);
}

.form-select {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%235a607f' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e");
}


/* ============================================================
   15. AVATARS
   ============================================================ */
.avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.82rem;
    flex-shrink: 0;
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.avatar-xs { width: 24px; height: 24px; font-size: 0.6rem; }
.avatar-sm { width: 30px; height: 30px; font-size: 0.7rem; }
.avatar-lg { width: 50px; height: 50px; font-size: 1rem; }
.avatar-xl { width: 64px; height: 64px; font-size: 1.3rem; }

.avatar.bg-cu-blue,
.avatar.badge-admin {
    background: linear-gradient(135deg, var(--cu-blue), var(--cu-blue-light));
}
.avatar.bg-purple,
.avatar.badge-leader {
    background: linear-gradient(135deg, #7c3aed, var(--purple));
}
.avatar.bg-success,
.avatar.badge-member {
    background: linear-gradient(135deg, #059669, var(--success));
}
.avatar.bg-cu-orange,
.avatar.badge-associate {
    background: linear-gradient(135deg, var(--cu-orange-dark), var(--cu-orange));
}


/* ============================================================
   16. ALERTS (Info Banners)
   ============================================================ */
.alert {
    border: none;
    border-radius: var(--radius);
    font-size: 0.875rem;
    padding: 0.85rem 1.15rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.alert-info {
    background: var(--info-bg);
    color: #155e75;
    border-left: 4px solid var(--info);
}

.alert-success {
    background: var(--success-bg);
    color: #065f46;
    border-left: 4px solid var(--success);
}

.alert-warning {
    background: var(--warning-bg);
    color: #92400e;
    border-left: 4px solid var(--warning);
}

.alert-danger {
    background: var(--danger-bg);
    color: #991b1b;
    border-left: 4px solid var(--danger);
}

.alert i {
    font-size: 1.15rem;
    flex-shrink: 0;
}


/* ============================================================
   17. EMPTY STATES
   ============================================================ */
.empty-state {
    text-align: center;
    padding: 3.5rem 1.5rem;
    color: var(--text-muted);
}

.empty-state i {
    font-size: 3.5rem;
    margin-bottom: 1rem;
    opacity: 0.35;
    display: block;
}

.empty-state h5 {
    color: var(--text-secondary);
    font-weight: 700;
    margin-bottom: 0.35rem;
    font-size: 1.05rem;
}

.empty-state p {
    font-size: 0.85rem;
    max-width: 320px;
    margin: 0 auto;
}


/* ============================================================
   18. TABS (Custom styled)
   ============================================================ */
.nav-tabs {
    border-bottom: 2px solid var(--border-color);
    gap: 0.25rem;
}

.nav-tabs .nav-link {
    border: none;
    border-bottom: 3px solid transparent;
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.84rem;
    padding: 0.7rem 1.1rem;
    border-radius: 0;
    transition: var(--transition-fast);
    background: none;
}

.nav-tabs .nav-link:hover {
    color: var(--cu-blue);
    border-bottom-color: var(--cu-blue-20);
    background: var(--cu-blue-10);
}

.nav-tabs .nav-link.active {
    color: var(--cu-blue);
    border-bottom-color: var(--cu-orange);
    background: var(--cu-blue-10);
    font-weight: 700;
}

.nav-tabs .nav-link .badge {
    font-size: 0.62rem;
    vertical-align: middle;
}


/* ============================================================
   19. MODALS
   ============================================================ */
.modal-content {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    overflow: hidden;
}

.modal-header {
    border-bottom: 1px solid var(--border-color);
    padding: 1.15rem 1.5rem;
    background: var(--card-bg);
}

.modal-title {
    font-weight: 700;
    font-size: 1.05rem;
    color: var(--cu-dark);
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    border-top: 1px solid var(--border-color);
    padding: 1rem 1.5rem;
    background: var(--body-bg);
}

.modal-backdrop.show {
    opacity: 0.6;
}


/* ============================================================
   20. PAGINATION
   ============================================================ */
.pagination .page-link {
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.82rem;
    padding: 0.45rem 0.8rem;
    margin: 0 2px;
    border-radius: var(--radius-sm) !important;
    transition: var(--transition-fast);
}

.pagination .page-link:hover {
    background: var(--cu-blue-10);
    color: var(--cu-blue);
    border-color: var(--cu-blue);
}

.pagination .page-item.active .page-link {
    background: var(--cu-blue);
    border-color: var(--cu-blue);
    color: #fff;
}


/* ============================================================
   21. CERTIFICATE PREVIEW
   ============================================================ */
.certificate-preview-frame {
    border: 2px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: #fff;
    box-shadow: var(--shadow-md);
}

.certificate-preview-frame .preview-header {
    background: var(--body-bg);
    padding: 0.85rem 1.25rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    font-weight: 600;
    font-size: 0.85rem;
}

.certificate-preview-frame .preview-body {
    padding: 2rem;
    display: flex;
    justify-content: center;
    background: #f8f9fa;
    min-height: 450px;
    overflow: auto;
}

.certificate-render {
    width: 800px;
    min-height: 600px;
    background: #fff;
    box-shadow: var(--shadow-lg);
    transform-origin: top center;
}

@media (max-width: 900px) {
    .certificate-render {
        transform: scale(0.45);
        margin: -160px 0;
    }
}


/* ============================================================
   22. UTILITIES
   ============================================================ */
.text-cu-blue { color: var(--cu-blue) !important; }
.text-cu-orange { color: var(--cu-orange) !important; }
.text-cu-dark { color: var(--cu-dark) !important; }
.bg-cu-blue { background-color: var(--cu-blue) !important; }
.bg-cu-orange { background-color: var(--cu-orange) !important; }
.bg-cu-dark { background-color: var(--cu-dark) !important; }
.border-cu-blue { border-color: var(--cu-blue) !important; }
.border-cu-orange { border-color: var(--cu-orange) !important; }

.fw-800 { font-weight: 800 !important; }
.ls-tight { letter-spacing: -0.02em !important; }

.bg-glass {
    background: rgba(255,255,255,0.7);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.divider {
    height: 1px;
    background: var(--border-color);
    margin: 1rem 0;
}

.hover-lift {
    transition: var(--transition);
}
.hover-lift:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}


/* ============================================================
   23. ANIMATIONS
   ============================================================ */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(15px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

.content-wrapper > * {
    animation: fadeInUp 0.35s ease forwards;
}

.content-wrapper > *:nth-child(2) { animation-delay: 0.05s; }
.content-wrapper > *:nth-child(3) { animation-delay: 0.1s; }
.content-wrapper > *:nth-child(4) { animation-delay: 0.15s; }

.stat-card {
    animation: fadeInUp 0.4s ease forwards;
}
.stat-card:nth-child(2) { animation-delay: 0.06s; }
.stat-card:nth-child(3) { animation-delay: 0.12s; }
.stat-card:nth-child(4) { animation-delay: 0.18s; }


/* ============================================================
   24. RESPONSIVE BREAKPOINTS
   ============================================================ */

/* --- Tablets & small desktops --- */
@media (max-width: 1199.98px) {
    .content-wrapper {
        padding: 1.25rem;
    }
}

/* --- Tablets portrait --- */
@media (max-width: 991.98px) {
    .content-wrapper {
        padding: 1rem;
    }

    .page-header h4 {
        font-size: 1.2rem;
    }

    .stat-card .stat-value {
        font-size: 1.5rem;
    }

    .top-navbar {
        padding: 0 0.75rem;
    }

    .user-menu-btn .d-md-inline {
        display: none !important;
    }
}

/* --- Large phones --- */
@media (max-width: 767.98px) {
    :root {
        --topbar-height: 56px;
    }

    .content-wrapper {
        padding: 0.85rem;
    }

    .page-header {
        margin-bottom: 1rem;
    }

    .page-header h4 {
        font-size: 1.1rem;
    }

    .stat-card {
        padding: 1rem;
    }

    .stat-card .stat-value {
        font-size: 1.35rem;
    }

    .stat-card .stat-icon {
        width: 40px;
        height: 40px;
        font-size: 1.1rem;
        margin-bottom: 0.75rem;
    }

    .card-header {
        padding: 0.85rem 1rem;
        font-size: 0.84rem;
    }

    .table thead th {
        padding: 0.6rem 0.75rem;
        font-size: 0.64rem;
    }

    .table tbody td {
        padding: 0.6rem 0.75rem;
        font-size: 0.8rem;
    }

    .btn {
        padding: 0.45rem 0.85rem;
        font-size: 0.8rem;
    }

    .modal-body {
        padding: 1rem;
    }

    .modal-header, .modal-footer {
        padding: 0.85rem 1rem;
    }
}

/* --- Small phones --- */
@media (max-width: 575.98px) {
    .content-wrapper {
        padding: 0.75rem;
    }

    .page-header h4 {
        font-size: 1.05rem;
    }

    .page-header .breadcrumb {
        font-size: 0.72rem;
    }

    .stat-card .stat-value {
        font-size: 1.2rem;
    }

    .stat-card .stat-label {
        font-size: 0.72rem;
    }

    .nav-tabs .nav-link {
        font-size: 0.76rem;
        padding: 0.55rem 0.7rem;
    }

    .flash-message-container {
        left: 0.75rem;
        right: 0.75rem;
        width: auto;
    }

    .form-control, .form-select {
        font-size: 16px; /* Prevents iOS zoom */
    }
}

/* --- Very small phones --- */
@media (max-width: 359.98px) {
    .stat-card .stat-value {
        font-size: 1.1rem;
    }

    .stat-card .stat-icon {
        width: 36px;
        height: 36px;
        font-size: 1rem;
    }

    .btn {
        padding: 0.4rem 0.65rem;
        font-size: 0.76rem;
    }
}


/* ============================================================
   25. PRINT STYLES
   ============================================================ */
@media print {
    .sidebar,
    .sidebar-overlay,
    .top-navbar,
    .main-footer,
    .sidebar-toggle,
    .btn,
    .page-header .breadcrumb,
    .flash-message-container {
        display: none !important;
    }

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

    .content-wrapper {
        padding: 0 !important;
    }

    .card {
        border: none !important;
        box-shadow: none !important;
        break-inside: avoid;
    }

    .stat-card {
        border: 1px solid #ddd !important;
        color: #000 !important;
        background: #fff !important;
    }
}


/* ============================================================
   26. SCROLLBAR STYLING (Main Content)
   ============================================================ */
.main-content::-webkit-scrollbar {
    width: 8px;
}

.main-content::-webkit-scrollbar-track {
    background: var(--body-bg);
}

.main-content::-webkit-scrollbar-thumb {
    background: #c5c9d4;
    border-radius: 10px;
}

.main-content::-webkit-scrollbar-thumb:hover {
    background: #a0a5b4;
}


/* ============================================================
   27. DARK MODE SUPPORT (Reserved / Opt-in)
   ============================================================ */
[data-theme="dark"] {
    --body-bg: #0f1117;
    --card-bg: #1a1d2e;
    --text-primary: #e5e7eb;
    --text-secondary: #9ca3af;
    --text-muted: #6b7280;
    --border-color: #2d3148;
    --border-light: #232640;
    --shadow-xs: 0 1px 2px rgba(0,0,0,0.2);
    --shadow-sm: 0 1px 4px rgba(0,0,0,0.25);
    --shadow-md: 0 4px 16px rgba(0,0,0,0.3);
    --shadow-lg: 0 8px 30px rgba(0,0,0,0.35);
}

[data-theme="dark"] .form-control,
[data-theme="dark"] .form-select {
    background: #12141f;
    border-color: var(--border-color);
    color: var(--text-primary);
}

[data-theme="dark"] .table thead th {
    background: #12141f;
    color: var(--text-secondary);
    border-bottom-color: var(--border-color);
}

[data-theme="dark"] .table tbody td {
    border-bottom-color: var(--border-light);
}

[data-theme="dark"] .card {
    border-color: var(--border-color);
}

[data-theme="dark"] .modal-content {
    background: var(--card-bg);
    border-color: var(--border-color);
}

[data-theme="dark"] .top-navbar {
    background: var(--card-bg);
    border-bottom-color: var(--border-color);
}

[data-theme="dark"] .main-footer {
    background: var(--card-bg);
    border-top-color: var(--border-color);
}

[data-theme="dark"] .alert-info {
    background: rgba(6, 182, 212, 0.1);
}
[data-theme="dark"] .alert-success {
    background: rgba(16, 185, 129, 0.1);
}
[data-theme="dark"] .alert-warning {
    background: rgba(245, 158, 11, 0.1);
}
[data-theme="dark"] .alert-danger {
    background: rgba(239, 68, 68, 0.1);
}

/* MUST CU action feedback and confirmation dialogs */
.flash-message-container { position: fixed; top: 82px; right: 22px; z-index: 1090; width: min(440px, calc(100vw - 28px)); }
.flash-toast { display:flex; align-items:center; gap:12px; border:0; border-left:5px solid var(--cu-blue); border-radius:12px; box-shadow:0 14px 38px rgba(12,22,65,.18); animation:mustcuToastIn .38s cubic-bezier(.2,.8,.2,1) both; padding:14px 16px; }
.flash-toast.alert-success { border-left-color:#10b981; }
.flash-toast.alert-danger { border-left-color:#ef4444; }
.flash-toast.alert-warning { border-left-color:#f59e0b; }
.flash-toast > i { font-size:1.25rem; }
.flash-toast > div { flex:1; }
@keyframes mustcuToastIn { from { opacity:0; transform:translate3d(24px,-10px,0) scale(.98); } to { opacity:1; transform:translate3d(0,0,0) scale(1); } }
@keyframes mustcuToastOut { to { opacity:0; transform:translate3d(20px,-8px,0); } }
.flash-toast.is-leaving { animation:mustcuToastOut .28s ease forwards; }
.mustcu-confirm-modal .modal-content { border:0; border-radius:16px; overflow:hidden; box-shadow:0 24px 70px rgba(10,20,70,.25); }
.mustcu-confirm-modal .modal-header { background:#0207ba; color:#fff; border:0; }
.mustcu-confirm-modal .modal-title { font-weight:800; }
.mustcu-confirm-modal .confirm-symbol { width:46px;height:46px;border-radius:50%;display:grid;place-items:center;background:#fff4e8;color:#ff7900;font-size:22px;flex:0 0 auto; }
.mustcu-confirm-modal .btn-confirm-action { background:#0207ba;color:#fff;border:0; }
.mustcu-confirm-modal .btn-confirm-action:hover { background:#0105a0;color:#fff; }

.mustcu-auto-alert { animation:mustcuToastIn .34s ease both; }
