:root {
    --bs-primary: #1d4ed8; /* Blue default, can be overridden by settings */
    --bs-primary-rgb: 29, 78, 216;
}

body {
    background-color: #f8f9fa;
    font-family: 'Inter', sans-serif; /* You can include Google Fonts if desired */
}

/* Make table stripes a much lighter gray */
.table-striped > tbody > tr:nth-of-type(odd) > * {
    --bs-table-accent-bg: #f8f9fc;
}

/* Sidebar Styling */
#wrapper {
    display: flex;
    width: 100%;
    align-items: stretch;
    min-height: 100vh;
}

#sidebar {
    min-width: 250px;
    max-width: 250px;
    background: #ffffff;
    color: #5a5c69;
    transition: margin-left 0.3s ease, margin-right 0.3s ease, left 0.3s ease, right 0.3s ease;
    box-shadow: 0 0.15rem 1.75rem 0 rgba(58, 59, 69, 0.15);
    z-index: 1000;
    overflow-y: auto;
}

#sidebar .sidebar-heading {
    padding: 1rem;
    font-size: 1.2rem;
    font-weight: 800;
    text-transform: uppercase;
    border-bottom: 1px solid #e9ecef;
}

#sidebar .sidebar-heading img {
    max-height: 45px;
    max-width: 200px;
    object-fit: contain;
}

#sidebar .list-group-item {
    border: none;
    padding: 1rem 1.5rem;
    color: #5a5c69;
    background: transparent;
}

#sidebar .list-group-item:hover,
#sidebar .list-group-item.active {
    color: var(--bs-primary);
    background-color: rgba(var(--bs-primary-rgb), 0.1);
    border-right: 4px solid var(--bs-primary);
}

#sidebar .list-group-item i {
    margin-right: 10px;
    width: 20px;
    text-align: center;
}

/* Page Content Wrapper */
#page-content-wrapper {
    flex-grow: 1;
    min-width: 0;
    padding-top: 56px; /* Space for fixed navbar */
    overflow-x: hidden;
}

/* Responsive Sidebar Rules */
@media (min-width: 768px) {
    #wrapper.toggled #sidebar {
        margin-left: -250px;
    }
    body.rtl #wrapper.toggled #sidebar {
        margin-left: 0;
        margin-right: -250px;
    }
}

@media (max-width: 767.98px) {
    #sidebar {
        margin-left: 0;
        margin-right: 0;
        position: fixed;
        height: 100vh;
        top: 0;
        bottom: 0;
        left: -250px;
        padding-top: 56px;
        z-index: 1050;
        min-width: 0;
        max-width: 250px;
        width: 250px;
        overflow-y: auto;
    }
    body.rtl #sidebar {
        left: auto;
        right: -250px;
    }
    #wrapper.toggled #sidebar {
        left: 0;
    }
    body.rtl #wrapper.toggled #sidebar {
        right: 0;
    }
    
    #wrapper.toggled #page-content-wrapper::before {
        content: "";
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.4);
        z-index: 1040;
        transition: all 0.3s;
    }
}

/* Navbar overrides */
.navbar-light .navbar-nav .nav-link {
    color: #858796;
}

/* Toast container positioning */
.swal2-container {
    z-index: 1060 !important; /* Above bootstrap modal */
}

/* Dashboard metric cards hover animation */
.dashboard-stat-card {
    display: block;
    transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.dashboard-stat-card:hover {
    transform: translateY(-4px);
}

.dashboard-stat-card:hover .card {
    box-shadow: 0 0.5rem 2rem rgba(0, 0, 0, 0.12) !important;
}
