/* ============================================================
 * DASHBOARD LAYOUT — Sidebar + Content Grid
 * ============================================================ */
.dash-layout {
    display: grid;
    grid-template-columns: 260px 1fr;
    margin-top: 0;
}

/* ============================================================
 * SIDEBAR
 * ============================================================ */
.dash-sidebar {
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-primary);
    padding: 1.5rem 0;
    position: sticky;
    top: 56px;
    max-height: calc(100vh - 56px);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 50;
}

.dash-sidebar::-webkit-scrollbar {
    width: 4px;
}

.dash-sidebar::-webkit-scrollbar-thumb {
    background: var(--border-primary);
    border-radius: 4px;
}

/* Thẻ người dùng thanh bên */
.sidebar-user {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0 1.25rem 1.25rem;
    margin-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-primary);
}

.sidebar-avatar {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-full);
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-secondary) 100%);
    color: var(--btn-hover-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1rem;
    flex-shrink: 0;
}

.sidebar-user-info {
    overflow: hidden;
}

.sidebar-user-name {
    display: block;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-user-role {
    display: block;
    font-size: 0.72rem;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 500;
}

/* Widget số dư thanh bên */
.sidebar-balance-widget {
    display: block;
    margin: 0.75rem 1rem;
    padding: 0.75rem 1rem;
    background: linear-gradient(135deg, #0d9373, #0a6e57);
    border-radius: var(--radius-lg);
    text-decoration: none;
    color: #fff;
    transition: opacity var(--transition-fast);
}

.sidebar-balance-widget:hover {
    opacity: 0.9;
    text-decoration: none;
    color: #fff;
}

.sidebar-balance-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.25rem;
}

.sidebar-balance-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    opacity: 0.85;
    font-weight: 500;
}

.sidebar-balance-arrow {
    font-size: 0.65rem;
    opacity: 0.6;
    transition: transform var(--transition-fast);
}

.sidebar-balance-widget:hover .sidebar-balance-arrow {
    transform: translateX(2px);
    opacity: 1;
}

.sidebar-balance-amount {
    font-size: 1.15rem;
    font-weight: 700;
    line-height: 1;
}

.sidebar-balance-amount small {
    font-size: 0.7rem;
    font-weight: 600;
    opacity: 0.8;
    margin-left: 0.15rem;
}

/* Điều hướng thanh bên */
.dash-nav-group {
    padding: 0.75rem 1.25rem 0.4rem;
}

.dash-nav-label {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-tertiary);
    margin-bottom: 0.4rem;
    display: block;
}

.dash-nav-item {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.6rem 1.25rem;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: 0;
    transition: color 0.2s ease, background 0.2s ease, border-left-color 0.2s ease;
    border-left: 3px solid transparent;
    position: relative;
}

.dash-nav-item:hover {
    color: var(--text-primary);
    background: var(--bg-tertiary);
    border-left-color: var(--border-secondary);
}

.dash-nav-item.active {
    color: var(--color-secondary);
    background: rgba(255, 193, 7, 0.08);
    border-left-color: var(--color-primary);
    font-weight: 600;
}

.dash-nav-item i {
    width: 1.2rem;
    text-align: center;
    font-size: 0.95rem;
    color: var(--text-tertiary);
    transition: color 0.2s ease;
}

.dash-nav-item:hover i {
    color: var(--text-primary);
}

.dash-nav-item.active i {
    color: var(--color-secondary);
}

/* Chân thanh bên */
.sidebar-footer {
    margin-top: auto;
    padding: 1rem 1.25rem;
    border-top: 1px solid var(--border-primary);
}

.sidebar-footer .btn-logout-sidebar {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    width: 100%;
    padding: 0.6rem 0.75rem;
    font-size: 0.85rem;
    color: var(--text-tertiary);
    text-decoration: none;
    border-radius: var(--radius-md);
    transition: color var(--transition-fast), background var(--transition-fast);
    border: none;
    background: none;
    cursor: pointer;
}

.sidebar-footer .btn-logout-sidebar:hover {
    color: var(--color-error);
    background: rgba(239, 68, 68, 0.06);
}

/* Nút toggle thanh bên — ẩn vĩnh viễn (dùng user-menu thay thế) */
.sidebar-toggle {
    display: none;
}

/* Overlay thanh bên — ẩn vĩnh viễn */
.sidebar-overlay {
    display: none;
}


/* ============================================================
 * MAIN CONTENT AREA
 * ============================================================ */
.dash-main {
    padding: 2rem 2.5rem;
    min-width: 0;
    max-width: 100%;
    overflow-x: clip;
}

.tab-content>h2 {
    margin-top: 1rem;
    margin-bottom: 1rem;
}

/* ============================================================
 * PAGE HEADER (Title + Action Button)
 * ============================================================ */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 0.5rem;
    margin-bottom: 1.75rem;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.page-header h2 {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.page-header .btn-sm .badge {
    padding: 2px 6px;
    font-size: 10px;
}

/* ============================================================
 * RESPONSIVE — Dashboard Layout
 * ============================================================ */
@media (max-width: 900px) {
    .dash-layout {
        display: block;
    }

    .dash-sidebar {
        position: fixed;
        top: 0;
        left: 0;
        width: 280px;
        height: 100%;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        transform: translateX(-100%);
        box-shadow: var(--shadow-xl);
        z-index: 1030;
        background: var(--bg-secondary);
        display: block;
    }

    .dash-sidebar.active {
        transform: translateX(0);
    }

    .dash-main {
        padding: 1.25rem 1rem;
    }

    .page-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .page-header .btn-sm.btn-primary {
        width: 100%;
        justify-content: center;
    }

    .overview-top-grid {
        grid-template-columns: 1fr;
    }
}