:root {
    --sidebar-width: 250px;
    --sidebar-bg: #343a40;
    --content-bg: #f8f9fa;
    --card-shadow: 0 0.125rem 0.5rem rgba(0, 0, 0, 0.08);
    --export-pdf: #f40f02;
    --export-excel: #1d6f42;
    --export-csv: #00a2ed;
}

* { box-sizing: border-box; }

body.dashboard-body {
    margin: 0;
    background: var(--content-bg);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.dashboard-wrapper {
    display: flex;
    min-height: 100vh;
}

.dashboard-sidebar {
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    color: #fff;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 1040;
    transition: transform 0.25s ease;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1.25rem 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.brand-icon {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
}

.sidebar-sync {
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-group-toggle {
    width: 100%;
    border: 0;
    background: transparent;
    color: rgba(255, 255, 255, 0.85);
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.75rem 1rem;
    text-align: left;
    font-size: 0.9rem;
}

.sidebar-group-toggle:hover,
.sidebar-group-toggle:focus {
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
}

.sidebar-submenu {
    list-style: none;
    margin: 0;
    padding: 0 0 0.5rem;
}

.sidebar-submenu a {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.45rem 1rem 0.45rem 2.2rem;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    font-size: 0.85rem;
}

.sidebar-submenu a:hover,
.sidebar-submenu a.active {
    color: #fff;
    background: rgba(255, 255, 255, 0.08);
}

.sidebar-footer {
    padding: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.user-info {
    display: flex;
    gap: 0.6rem;
    align-items: center;
    font-size: 0.85rem;
}

.user-info .bx-user-circle {
    font-size: 1.8rem;
}

.dashboard-content {
    margin-left: var(--sidebar-width);
    flex: 1;
    min-width: 0;
}

.dashboard-topbar {
    min-height: 64px;
}

.dashboard-main {
    min-height: calc(100vh - 64px);
}

.kpi-card {
    border: 0;
    border-radius: 12px;
    box-shadow: var(--card-shadow);
    height: 100%;
}

.kpi-card .card-body {
    padding: 1.25rem;
}

.kpi-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
}

.kpi-value {
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1.2;
}

.chart-card,
.table-card {
    border: 0;
    border-radius: 12px;
    box-shadow: var(--card-shadow);
}

.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
}

.login-card {
    width: 100%;
    max-width: 420px;
    border: 0;
    border-radius: 16px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
}

.menu-tree {
    max-height: 420px;
    overflow: auto;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 1rem;
    background: #fff;
}

.menu-tree-group {
    margin-bottom: 0.75rem;
}

.menu-tree-group > strong {
    display: block;
    margin-bottom: 0.35rem;
}

.menu-tree-item {
    margin-left: 1rem;
}

.sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 1035;
}

.loading-overlay {
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    border-radius: inherit;
}

@media (max-width: 991.98px) {
    .dashboard-sidebar {
        transform: translateX(-100%);
    }

    .dashboard-sidebar.show {
        transform: translateX(0);
    }

    .sidebar-backdrop.show {
        display: block;
    }

    .dashboard-content {
        margin-left: 0;
    }
}
