:root {
    --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --sidebar-gradient: linear-gradient(180deg, #0d1c37 0%, #090b0f 100%);
    --success-color: #00b09b;
    --warning-color: #f09819;
    --danger-color: #e74c3c;
    --bg-body: #f3f4f6;
    --card-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

body {
    background-color: var(--bg-body);
}

#wrapper {
    display: flex;
    width: 100%;
}

#content-wrapper {
    width: 100%;
    overflow-x: hidden;
}

/* --- Cards --- */
.card {
    border: none;
    border-radius: 12px;
    box-shadow: var(--card-shadow);
    transition: transform 0.2s ease-in-out;
}

.card:hover {
    transform: translateY(-3px);
}

.card-header {
    background-color: #fff;
    font-weight: bold;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    border-top-left-radius: 12px;
    border-top-right-radius: 12px;
}

/* --- Buttons --- */
.btn-primary {
    background-image: var(--primary-gradient);
    border: none;
    color: white;
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--card-shadow);
    color: white; /* Ensure text remains white on hover */
}

/* --- Sidebar --- */
#accordionSidebar {
    background-image: var(--sidebar-gradient);
    color: white;
    width: 224px;
    height: 100dvh;
    overflow-y: auto;
    position: sticky;
    top: 0;
    z-index: 1000;
    transition: all 0.3s;
    list-style-type: none; /* Remove list dots */
    padding-left: 0; /* Remove default padding */
}

#accordionSidebar .sidebar-brand {
    padding: 1rem 1rem; /* Reduced padding */
    font-size: 1.1rem; /* Slightly smaller font */
}

#accordionSidebar .nav-item .nav-link {
    color: rgba(255, 255, 255, 0.7);
    padding: 0.7rem 1.5rem; /* Reduced padding */
    transition: all 0.2s ease-in-out;
    border-left: 4px solid transparent; /* Placeholder for active state */
}

#accordionSidebar .nav-item .nav-link:hover {
    color: white;
    background-color: rgba(255, 255, 255, 0.05);
}

#accordionSidebar .nav-item.active .nav-link {
    background-color: rgba(255, 255, 255, 0.1);
    color: white;
    font-weight: 500;
    border-left: 4px solid var(--success-color); /* Modern left-border highlight */
}

#accordionSidebar .sidebar-heading {
    padding: 0.5rem 1.5rem; /* Reduced padding */
    font-size: 0.75rem; /* Smaller font */
    color: rgba(255, 255, 255, 0.4);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: bold;
}

/* --- Utility Classes for Gradients --- */
.bg-primary-gradient {
    background-image: var(--primary-gradient);
    color: white;
}

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

.bg-warning-color {
    background-color: var(--warning-color);
    color: white;
}

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

/* Additional styling for general elements */
.form-control:focus {
    border-color: #764ba2;
    box-shadow: 0 0 0 0.25rem rgba(118, 75, 162, 0.25);
}

.badge {
    padding: 0.5em 0.7em;
    border-radius: 50rem;
    font-weight: normal;
}

.img-profile {
    height: 2.25rem;
    width: 2.25rem;
}

.sidebar-user-block .nav-link {
    display: flex;
    align-items: center;
    padding: 0.7rem 1rem; /* Reduced padding */
}
.sidebar-user-block .img-profile {
    height: 2.5rem; /* Smaller avatar */
    width: 2.5rem;
}
.sidebar-user-block span {
    line-height: 1.2; /* Tighter line height for text */
}
.sidebar-user-block span span {
    color: rgba(255, 255, 255, 0.6);
}
.sidebar-user-block span .fw-bold {
    color: white;
    font-size: 0.9rem; /* Smaller font for name */
}
.sidebar-user-block .dropdown-menu {
    position: absolute !important;
    transform: translate3d(15px, 70px, 0px) !important;
    width: 85%;
}

.sidebar-divider {
    margin: 0.5rem 0; /* Reduced margin for dividers */
}

/* Responsive Sidebar Styles */
@media (max-width: 768px) {
    #wrapper {
        display: block; /* Revert to block layout on mobile */
    }
    #accordionSidebar {
        position: fixed;
        z-index: 1040;
        margin-left: -224px;
        transition: margin 0.3s ease-in-out;
    }
    body.sidebar-toggled #accordionSidebar {
        margin-left: 0;
    }
    #sidebarToggle {
        display: block !important;
        position: fixed;
        top: 15px; /* Increased top padding */
        left: 15px; /* Increased left padding */
        z-index: 1041;
        background-color: rgba(0,0,0,0.2); /* Add a subtle background */
        color: white; /* Ensure visibility */
    }
    .container-fluid {
        padding-top: 60px !important; /* Make space for the fixed toggle button */
    }
    /* Add a backdrop overlay */
    body.sidebar-toggled::after {
        content: '';
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background-color: rgba(0,0,0,0.5);
        z-index: 1039; /* Lower than the sidebar and toggle */
    }
}
