:root {
    --primary-blue: #3498db;
    --sidebar-bg: #1f3660;
    --page-bg: #f8f9fa;
    --card-shadow: 0 0.15rem 1.75rem 0 rgba(58, 59, 69, 0.15);
    --border-color: #e3e6f0;
    --text-muted: #6c757d;
}

body {
    font-family: 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--page-bg);
    overflow-x: hidden;
}

#wrapper {
    display: flex;
    width: 100%;
    min-height: 100vh;
}

/* =========================================
   SIDEBAR LOGO STYLING
   ========================================= */
.sidebar-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 1.5rem 1.25rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    text-decoration: none;
}

.sidebar-logo img {
    max-width: 45px;
    height: auto;
    object-fit: contain;
}

.sidebar-logo .brand-name {
    color: #fff;
    font-size: 1.3rem;
    font-weight: 700;
    margin: 0;
}

/* =========================================
   SIDEBAR STYLING - UNIVERSAL
   ========================================= */
#sidebar {
    width: 250px;
    height: 100vh;
    position: fixed;
    top: 0;
    background: var(--sidebar-bg);
    color: #fff;
    overflow-y: auto;
    overflow-x: hidden;
    transition: transform 0.3s ease;
    z-index: 1050;
}

#sidebar::-webkit-scrollbar {
    width: 6px;
}

#sidebar::-webkit-scrollbar-thumb {
    background-color: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
}

#sidebar .navbar-brand {
    color: #fff;
    padding: 1.5rem 1.25rem;
    font-size: 1.5rem;
    font-weight: 700;
    text-align: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: block;
    text-decoration: none;
}

#sidebar .nav-link {
    padding: 1rem 1.5rem;
    color: rgba(255, 255, 255, 0.7) !important;
    font-size: 1rem;
    display: flex;
    align-items: center;
    transition: all 0.2s ease;
    text-decoration: none;
}

#sidebar .nav-link:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff !important;
}

#sidebar .nav-link.active {
    background: rgba(255, 255, 255, 0.2);
    color: #fff !important;
    font-weight: bold;
    border-right: 4px solid var(--primary-blue);
}

#sidebar .nav-link i.fa-fw {
    margin-right: 15px;
    width: 20px;
    text-align: center;
    color: inherit;
}

/* =========================================
   MAIN CONTENT AREA
   ========================================= */
#page-content-wrapper {
    flex: 1;
    min-height: 100vh;
    transition: all 0.3s ease;
}

/* =========================================
   DESKTOP STYLES (768px and above)
   ========================================= */
@media (min-width: 768px) {
    #sidebar {
        left: 0;
        transform: translateX(0);
    }

    #page-content-wrapper {
        margin-left: 250px;
        padding: 2rem;
    }

    /* Hide mobile toggle button on desktop */
    #sidebarToggle {
        display: none !important;
    }

    /* Hide overlay on desktop */
    .overlay {
        display: none !important;
    }
}

/* =========================================
   MOBILE STYLES (below 768px)
   ========================================= */
@media (max-width: 767.98px) {
    /* Hide sidebar by default on mobile */
    #sidebar {
        left: 0;
        transform: translateX(-100%);
    }

    /* Show sidebar when active */
    #sidebar.active {
        transform: translateX(0);
    }

    /* Full width content on mobile */
    #page-content-wrapper {
        width: 100%;
        margin-left: 0;
        padding: 1rem;
        padding-top: 70px;
    }

    /* Mobile toggle button */
    #sidebarToggle {
        position: fixed;
        top: 10px;
        left: 10px;
        z-index: 1060;
        box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    }

    /* Overlay */
    .overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.5);
        display: none;
        z-index: 1040;
    }

    .overlay.active {
        display: block;
    }
}

/* =========================================
   WELCOME HEADER
   ========================================= */
.welcome-header {
    background-color: var(--primary-blue);
    color: #fff;
    border-radius: 8px;
    padding: 30px;
    margin-bottom: 2rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.welcome-banner p {
    font-size: 2.5rem;
    font-weight: 700;
    margin: 0;
}

/* =========================================
   STAT CARDS
   ========================================= */
.stat-card {
    background-color: #ffffff !important;
    border: none;
    border-radius: 0.75rem;
    box-shadow: 0 4px 6px rgba(58, 59, 69, 0.15) !important;
    height: 100%;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    text-align: center;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15) !important;
}

.stat-card .card-body {
    padding: 2rem 1.5rem;
}

.stat-card .card-body i {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: var(--primary-blue);
}

.stat-card .card-title {
    font-size: 1.1rem;
    color: var(--text-muted);
}

.stat-card .display-4 {
    font-size: 3.5rem;
    font-weight: 700;
    color: #212529;
}

/* =========================================
   STATUS BADGES
   ========================================= */
.status-badge {
    padding: 0.4em 0.8em;
    font-size: 0.9rem;
    font-weight: 600;
    border-radius: 0.5rem;
}

.badge {
    padding: 5px 10px;
    border-radius: 15px;
    font-size: 12px;
    font-weight: 500;
    display: inline-block;
}

.badge-warning {
    background-color: #ffc107;
    color: #212529;
    border: 1px solid #ffca2c;
}

.badge-success {
    background-color: #28a745;
    color: #ffffff;
    border: 1px solid #34ce57;
}

.badge-danger {
    background-color: #dc3545;
    color: #ffffff;
    border: 1px solid #e4606d;
}

.badge-secondary {
    background-color: #6c757d;
    color: #ffffff;
    border: 1px solid #7c8185;
}

.bg-success { background-color: #28a745; color: #fff; }
.bg-warning { background-color: #ffc107; color: #333; }
.text-primary { color: #007bff !important; }
.text-warning { color: #ffc107 !important; }
.text-success { color: #28a745 !important; }

/* =========================================
   QUICK LINKS
   ========================================= */
.quick-link-item {
    background-color: #fff;
    border: 1px solid #dee2e6;
    border-radius: 0.75rem;
    padding: 1.5rem;
    text-decoration: none;
    color: #495057;
    font-weight: 600;
    display: flex;
    align-items: center;
    transition: all 0.3s ease;
}

.quick-link-item:hover {
    background-color: #f1f4f8;
    color: var(--primary-blue);
    transform: translateY(-3px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
}

.quick-link-item i {
    font-size: 1.5rem;
    margin-right: 1rem;
    color: var(--primary-blue);
    opacity: 0.8;
}

/* =========================================
   TABLE STYLING
   ========================================= */
.table {
    margin-bottom: 1rem;
    color: #212529;
    border-collapse: collapse;
}

.table th {
    background-color: #f8f9fa;
    border-top: none;
    font-weight: 600;
    padding: 12px;
    vertical-align: middle;
}

.table td {
    padding: 12px;
    vertical-align: middle;
    border-top: 1px solid #dee2e6;
}

.table-bordered {
    border: 1px solid #dee2e6;
}

.table-bordered th,
.table-bordered td {
    border: 1px solid #dee2e6;
}

.table-responsive {
    overflow-x: auto;
    min-height: 0.01%;
}

/* =========================================
   CARD STYLING
   ========================================= */
.card {
    position: relative;
    display: flex;
    flex-direction: column;
    min-width: 0;
    background-color: #fff;
    border: 1px solid #dee2e6;
    border-radius: 0.25rem;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
}

.card-header {
    padding: 0.75rem 1.25rem;
    margin-bottom: 0;
    background-color: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
    border-top-left-radius: 0.25rem;
    border-top-right-radius: 0.25rem;
}

.card-body {
    flex: 1 1 auto;
    padding: 1.25rem;
}

.card-header h3 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 500;
    color: #495057;
}

/* =========================================
   BUTTON STYLING
   ========================================= */
.btn {
    display: inline-block;
    font-weight: 400;
    text-align: center;
    white-space: nowrap;
    vertical-align: middle;
    user-select: none;
    border: 1px solid transparent;
    padding: 0.375rem 0.75rem;
    font-size: 1rem;
    line-height: 1.5;
    border-radius: 0.25rem;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.15s ease-in-out;
}

.btn-sm {
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
    line-height: 1.5;
    border-radius: 0.2rem;
}

.btn-info {
    color: #fff;
    background-color: #17a2b8;
    border-color: #17a2b8;
}

.btn-info:hover {
    color: #fff;
    background-color: #138496;
    border-color: #117a8b;
}

.btn-info:focus {
    box-shadow: 0 0 0 0.2rem rgba(23, 162, 184, 0.5);
}

/* =========================================
   UTILITY CLASSES
   ========================================= */
.mb-4 { margin-bottom: 1.5rem !important; }
.mt-3 { margin-top: 1rem !important; }
.my-3 { margin-top: 1rem !important; margin-bottom: 1rem !important; }
.mb-0 { margin-bottom: 0 !important; }
.text-center { text-align: center; }

/* =========================================
   MOBILE RESPONSIVE ADJUSTMENTS
   ========================================= */
@media (max-width: 768px) {
    .welcome-banner p {
        font-size: 1.8rem;
    }

    .stat-card .display-4 {
        font-size: 2.5rem;
    }

    .table-responsive {
        border: none;
    }

    .card-body {
        padding: 1rem;
    }

    .badge {
        font-size: 11px;
        padding: 4px 8px;
    }

    .sidebar-logo img {
        max-width: 40px;
    }

    .sidebar-logo .brand-name {
        font-size: 1.1rem;
    }
}