:root {
    --sidebar-width: 260px;
}

body {
    background-color: #f8f9fa;
}

.sidebar {
    width: var(--sidebar-width);
    height: 100vh;
    position: fixed;
    left: 0;
    top: 0;
    background: #fff;
    border-right: 1px solid #e9ecef;
    display: flex;
    flex-direction: column;
}

.sidebar-header {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid #e9ecef;
}

.sidebar-brand {
    font-weight: 700;
    font-size: 1.1rem;
    color: #111;
    text-decoration: none;
}

.sidebar-user {
    padding: 1rem 1.25rem;
    font-size: 0.75rem;
    color: #6c757d;
    border-bottom: 1px solid #e9ecef;
}

.sidebar-user strong {
    display: block;
    color: #111;
    font-size: 0.8rem;
    margin-bottom: 0.5rem;
}

.sidebar-select {
    padding: 0 1rem 1rem;
}

.sidebar-select label {
    font-size: 0.7rem;
    color: #6c757d;
    text-transform: uppercase;
    margin-bottom: 0.25rem;
}

.sidebar-select select {
    font-size: 0.85rem;
}

.sidebar-nav {
    flex: 1;
    padding: 0.5rem 0;
    overflow-y: auto;
}

.sidebar-nav .nav-link {
    color: #495057;
    padding: 0.6rem 1.25rem;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.sidebar-nav .nav-link:hover {
    background: #f8f9fa;
}

.sidebar-nav .nav-link.active {
    color: #10b981;
    background: #ecfdf5;
}

.sidebar-footer {
    padding: 1rem 1.25rem;
    border-top: 1px solid #e9ecef;
    font-size: 0.8rem;
}

.sidebar-footer .brand-icon {
    width: 32px;
    height: 32px;
    background: #10b981;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 700;
    font-size: 0.75rem;
}

.main-content {
    margin-left: var(--sidebar-width);
    padding: 1.5rem 2rem;
}

@media (max-width: 991.98px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        z-index: 1050;
        height: 100%;
        min-height: 100dvh;
    }
    .sidebar.show {
        transform: translateX(0);
    }
    .sidebar-backdrop {
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,0.5);
        z-index: 1040;
        display: none;
    }
    .sidebar-backdrop.show {
        display: block;
    }
    .main-content {
        margin-left: 0;
        padding: 1rem;
    }
    .mobile-header {
        display: flex !important;
    }
}

.mobile-header {
    display: none;
    position: sticky;
    top: 0;
    background: #fff;
    border-bottom: 1px solid #e9ecef;
    padding: 0.75rem 1rem;
    z-index: 1030;
    margin: -1rem;
    margin-bottom: 1rem;
    width: calc(100% + 2rem);
}


[data-theme="dark"] body {
    background-color: #1a1a1a;
}

[data-theme="dark"] .sidebar {
    background: #212529;
    border-color: #343a40;
}

[data-theme="dark"] .sidebar-header,
[data-theme="dark"] .sidebar-footer,
[data-theme="dark"] .sidebar-user {
    border-color: #343a40;
}

[data-theme="dark"] .sidebar-brand,
[data-theme="dark"] .sidebar-user strong {
    color: #fff;
}

[data-theme="dark"] .sidebar-user {
    color: #6c757d;
}

[data-theme="dark"] .sidebar-nav .nav-link {
    color: #adb5bd;
}

[data-theme="dark"] .sidebar-nav .nav-link:hover {
    background: #343a40;
}

[data-theme="dark"] .sidebar-nav .nav-link.active {
    color: #10b981;
    background: rgba(16, 185, 129, 0.1);
}

[data-theme="dark"] .card {
    background: #212529;
    color: #fff;
}

[data-theme="dark"] .form-select,
[data-theme="dark"] .mobile-header {
    background: #212529;
    color: #fff;
    border-color: #343a40;
}

[data-theme="dark"] .text-muted {
    color: #adb5bd !important;
}

[data-theme="dark"] h2,
[data-theme="dark"] h3,
[data-theme="dark"] h4,
[data-theme="dark"] h5,
[data-theme="dark"] label {
    color: #fff;
}

[data-theme="dark"] .btn-outline-secondary {
    color: #adb5bd;
    border-color: #495057;
}

[data-theme="dark"] .btn-outline-secondary:hover {
    background: #343a40;
    color: #fff;
}

[data-theme="dark"] .dropdown-menu {
    background: #212529;
    border-color: #343a40;
}

[data-theme="dark"] .dropdown-item {
    color: #adb5bd;
}

[data-theme="dark"] .dropdown-item:hover {
    background: #343a40;
    color: #fff;
}
