body {
    font-family: 'Inter', sans-serif;
    background-color: #f8f9fa;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.4);
}
[data-bs-theme="dark"] ::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
}
[data-bs-theme="dark"] ::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.4);
}

.wrapper {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

/* Sidebar */
.sidebar {
    width: 250px;
    min-width: 250px;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    display: flex;
    flex-direction: column;
    z-index: 1040;
    box-shadow: 2px 0 10px rgba(0,0,0,0.1);
}

.sidebar .nav-link {
    color: rgba(255, 255, 255, 0.7);
    padding: 12px 15px;
    margin-bottom: 8px;
    cursor: pointer;
    font-weight: 500;
    border-radius: 8px;
    transition: all 0.2s ease-in-out;
    display: flex;
    align-items: center;
}

.sidebar .nav-link i {
    width: 24px;
    transition: transform 0.2s ease;
}

.sidebar .nav-link:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: #fff;
    transform: translateX(4px);
}

.sidebar .nav-link:hover i {
    transform: scale(1.1);
}

.sidebar .nav-link.active {
    border-left: 4px solid #0d6efd;
    background-color: rgba(13, 110, 253, 0.2);
    color: #fff;
    box-shadow: inset 2px 0 5px rgba(0,0,0,0.05);
}

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    background-color: var(--bs-body-bg);
    transition: background-color 0.3s ease;
}

/* Cards UX/UI Effects */
.card {
    transition: transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1), box-shadow 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    border-radius: 12px;
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.08) !important;
}

/* KPI Cards Specific */
.card[class*="-subtle"]:hover {
    filter: brightness(0.95);
}
[data-bs-theme="dark"] .card[class*="-subtle"]:hover {
    filter: brightness(1.1);
}

/* Tables */
.table {
    transition: all 0.3s ease;
}
.table-hover tbody tr {
    transition: background-color 0.2s ease, transform 0.1s ease;
}
.table-hover tbody tr:hover {
    transform: scale(1.01);
    box-shadow: 0 4px 6px rgba(0,0,0,0.04);
    z-index: 1;
    position: relative;
}

/* Buttons & Selects */
.btn {
    transition: all 0.2s ease;
    border-radius: 6px;
}
.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}
.form-select {
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    border-radius: 6px;
}
.form-select:focus {
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.15);
}

/* Page Views & Transitions */
.page-view {
    display: none;
    animation: fadeInUp 0.4s ease-out;
}

.page-view.active {
    display: block;
}

@keyframes fadeInUp {
    from { 
        opacity: 0; 
        transform: translateY(15px);
    }
    to { 
        opacity: 1; 
        transform: translateY(0);
    }
}

/* Header */
header.navbar {
    backdrop-filter: blur(10px);
    background-color: rgba(255, 255, 255, 0.9) !important;
}
[data-bs-theme="dark"] header.navbar {
    background-color: rgba(33, 37, 41, 0.9) !important;
}

/* Loading overlay for charts (future-proof) */
.chart-loading {
    position: relative;
}
.chart-loading::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(255,255,255,0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10;
    backdrop-filter: blur(2px);
}
[data-bs-theme="dark"] .chart-loading::after {
    background: rgba(33,37,41,0.7);
}

/* Mobile Sidebar Toggle */
@media (max-width: 991.98px) {
    .sidebar {
        margin-left: -250px;
        position: fixed;
        height: 100vh;
    }
    .sidebar.active {
        margin-left: 0;
    }
}

.sidebar-backdrop {
    position: fixed;
    top: 0; left: 0; width: 100vw; height: 100vh;
    background: rgba(0,0,0,0.5);
    z-index: 1030;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}
.sidebar-backdrop.show {
    opacity: 1;
    visibility: visible;
}

