:root {
    --dark-bg: #1a1a1a;
    --darker-bg: #141414;
    --nav-bg: #0f0f0f;
    --border-color: #2d2d2d;
    --text-color: #e0e0e0;
    --text-muted: #888;
    --hover-bg: #2a2a2a;
    --card-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --blue-accent: #0071e3;
    --main-content-bg: var(--dark-bg);
    --sidebar-width: 280px;
}

:root[data-theme="light"] {
    --dark-bg: #f5f5f7;
    --darker-bg: #ffffff;
    --nav-bg: #ffffff;
    --border-color: #e5e5e5;
    --text-color: #1d1d1f;
    --text-muted: #86868b;
    --hover-bg: #f5f5f7;
    --card-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    --blue-accent: #0071e3;
    --main-content-bg: #f5f5f7;
    --sidebar-width: 280px;
}

body {
    background-color: var(--main-content-bg);
    color: var(--text-color);
    transition: background-color 0.3s ease, color 0.3s ease;
    min-height: 100vh;
}

.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: var(--sidebar-width);
    background: var(--nav-bg);
    border-right: 1px solid var(--border-color);
    transition: all 0.3s ease;
    z-index: 1000;
    padding-top: 1rem;
    overflow-y: auto;
}

.sidebar.collapsed {
    width: 80px;
}

[data-theme="light"] .sidebar {
    background: #ffffff;
}

[data-theme="dark"] .sidebar {
    background: var(--darker-bg);
}

.main-content {
    margin-left: var(--sidebar-width);
    padding: 2rem;
    transition: all 0.3s ease;
    min-height: 100vh;
    background: var(--main-content-bg);
}

.main-content.expanded {
    margin-left: 80px;
}

.sidebar-header {
    padding: 1.5rem 2rem;
    text-align: center;
    margin-bottom: 1rem;
}

[data-theme="light"] .sidebar-header {
    background: #ffffff;
}

[data-theme="dark"] .sidebar-header {
    background: var(--darker-bg);
}

.logo-img {
    width: 120px;
    height: auto;
    margin-bottom: 1rem;
}

.brand-name {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
    background: linear-gradient(45deg, var(--blue-accent), #00a3ff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.nav-link {
    display: flex;
    align-items: center;
    padding: 0.75rem 2rem;
    color: var(--text-muted);
    text-decoration: none;
    transition: all 0.3s ease;
    margin: 0.25rem 0;
}

.nav {
    display: flex;
    flex-wrap: wrap;
    padding: 1rem;
    gap: 0.5rem;
}

.nav-link i {
    font-size: 1.25rem;
    width: 35px;
    text-align: center;
    margin-right: 1.5rem;
}

.nav-link span {
    font-size: 1rem;
    font-weight: 500;
}

.nav-link:hover,
.nav-link.active {
    color: var(--text-color);
    background: var(--hover-bg);
}

.nav-link.active {
    border-right: 3px solid var(--blue-accent);
}

[data-theme="light"] .stats-card,
[data-theme="light"] .table-container,
[data-theme="light"] .form-control,
[data-theme="light"] .form-select,
[data-theme="light"] .theme-toggle,
[data-theme="light"] .sidebar-toggle {
    background: #ffffff;
    border: 1px solid var(--border-color);
    box-shadow: var(--card-shadow);
}

.stats-card {
    background: var(--darker-bg);
    border: 1px solid var(--border-color);
    border-radius: 15px;
    padding: 1.5rem;
    height: 100%;
    transition: transform 0.2s, box-shadow 0.2s;
}

.stats-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.table-container {
    background: var(--darker-bg);
    border-radius: 15px;
    padding: 1.5rem;
    margin-top: 2rem;
    border: 1px solid var(--border-color);
}

.theme-toggle {
    position: fixed;
    right: 20px;
    top: 20px;
    z-index: 1000;
    background: var(--darker-bg);
    border: 1px solid var(--border-color);
    color: var(--text-color);
    padding: 10px;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.theme-toggle:hover {
    transform: scale(1.1);
}

.sidebar-toggle {
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 1001;
    background: var(--darker-bg);
    border: 1px solid var(--border-color);
    color: var(--text-color);
    padding: 10px;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.sidebar-toggle:hover {
    transform: scale(1.1);
}

.filter-dropdown {
    background: var(--darker-bg);
    border: 1px solid var(--border-color);
    color: var(--text-color);
    border-radius: 10px;
    padding: 0.7rem 1rem;
    transition: all 0.2s ease;
}

.filter-dropdown:hover,
.filter-dropdown:focus {
    border-color: var(--blue-accent);
    box-shadow: 0 0 0 2px rgba(0, 113, 227, 0.1);
}

.mobile-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 999;
}

.mobile-overlay.active {
    display: block;
}

.sidebar.collapsed .brand-name,
.sidebar.collapsed .nav-link span {
    display: none;
}

.sidebar.collapsed .nav-link {
    justify-content: center;
    padding-left: 0.5rem;
    padding-right: 0.5rem;
}

.sidebar.collapsed .nav-link i {
    margin-right: 0;
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.collapsed {
        transform: translateX(-100%);
        width: var(--sidebar-width);
    }

    .sidebar.mobile-open {
        transform: translateX(0);
        width: var(--sidebar-width);
    }

    .main-content {
        margin-left: 0;
    }

    .main-content.expanded {
        margin-left: 0;
    }

    .main-content.with-overlay {
        filter: blur(1px);
        pointer-events: none;
    }
}
