:root {
    --primary-color: #10B981;
    /* Emerald Green */
    --secondary-color: #F59E0B;
    /* Carrot Orange */
    --bg-light: #F3F4F6;
    --text-dark: #1F2937;
    --sidebar-width: 250px;
}

body {
    background-color: var(--bg-light);
    font-family: 'Inter', sans-serif;
    color: var(--text-dark);
    font-size: 0.85rem;
    /* Smaller global font */
    overflow-x: hidden;
    /* Prevent body horizontal scroll */
    min-height: 100vh;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-weight: 600;
}

.table {
    font-size: 0.85rem;
}

.form-control,
.form-select,
.btn {
    font-size: 0.85rem;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: linear-gradient(180deg, #059669 0%, #10B981 100%);
    color: white;
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    padding-top: 20px;
    z-index: 1000;
    transition: transform 0.3s ease-in-out;
    padding-bottom: 150px;
    /* Big padding to ensure user can scroll past the bottom */
    overflow-y: auto;
    overflow-x: hidden;
    display: block;
    /* Ensure it is a block container */
}


/* Custom Scrollbar for Sidebar Nav */
.sidebar .nav::-webkit-scrollbar {
    width: 5px;
}

.sidebar .nav::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar .nav::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 10px;
}

.sidebar .nav::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}

/* Custom Scrollbar for Sidebar */
.sidebar::-webkit-scrollbar {
    width: 5px;
}

.sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 10px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}

/* Scrollable Submenu - as requested */
.sidebar .collapse .nav {
    max-height: none;
    /* Let it expand freely */
    overflow: visible;
    overflow-x: hidden;
    padding-right: 5px;
    /* prevent scrollbar covering text */
}

.sidebar .collapse .nav::-webkit-scrollbar {
    width: 4px;
}

.sidebar .collapse .nav::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar .collapse .nav::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 10px;
}

.sidebar .nav-link {
    color: rgba(255, 255, 255, 0.8);
    padding: 12px 20px;
    font-weight: 500;
    transition: all 0.3s;
    border-radius: 0 25px 25px 0;
    margin-right: 15px;
}

.sidebar .nav-link:hover,
.sidebar .nav-link.active {
    color: var(--primary-color);
    background-color: white;
    padding-left: 25px;
}

.sidebar .nav-link i {
    width: 24px;
    text-align: center;
    margin-right: 10px;
}

.sidebar-brand {
    padding: 10px 20px;
    font-size: 1.5rem;
    font-weight: bold;
    color: white;
    text-decoration: none;
    display: block;
    margin-bottom: 20px;
}

/* Sidebar Overlay */
.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    display: none;
    opacity: 0;
    transition: opacity 0.3s;
}

.sidebar-overlay.active {
    display: block;
    opacity: 1;
}

/* Main Content */
.main-content {
    margin-left: var(--sidebar-width);
    padding: 30px;
    transition: margin-left 0.3s;
}

/* Cards */
.card-stat {
    border: none;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    background: white;
    transition: transform 0.2s;
}

.card-stat:hover {
    transform: translateY(-5px);
}

.icon-box {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    margin-bottom: 10px;
}

.bg-emerald-light {
    background-color: rgba(16, 185, 129, 0.1);
    color: var(--primary-color);
}

.bg-orange-light {
    background-color: rgba(245, 158, 11, 0.1);
    color: var(--secondary-color);
}

/* Buttons */
.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-primary:hover {
    background-color: #059669;
    border-color: #059669;
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.active {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
    }
}