/* app/static/css/client.css - Phiên bản V5 Final */

/* --- THÊM ĐOẠN NÀY LÊN ĐẦU FILE --- */
html, body {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden !important; /* Chặn tuyệt đối cuộn ngang */
}

:root {
    --sidebar-width: 280px;
    --bs-body-bg: #f3f6fc;
    --primary-color: #ff9f43; /* Cam MoneyTask */
    --text-dark: #2d3436;
}

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background-color: var(--bs-body-bg);
    color: var(--text-dark);
    overflow-x: hidden;
}

/* --- LAYOUT WRAPPER --- */
#wrapper {
    display: flex;
    width: 100%;
    align-items: stretch;
    position: relative;
    overflow-x: hidden; /* Fix layout vỡ do sidebar */
}


/* --- SIDEBAR --- */
#sidebar-wrapper {
    width: var(--sidebar-width);
    min-width: var(--sidebar-width);
    min-height: 100vh;
    background: #ffffff;
    box-shadow: 4px 0 20px rgba(0,0,0,0.03);
    z-index: 1050;
    transition: margin-left 0.3s ease-in-out;
}

#page-content-wrapper {
    width: 100%;
    overflow-x: hidden; /* Đảm bảo nội dung không chọc ra ngoài */
}


/* --- MOBILE RESPONSIVE (< 768px) --- */
@media (max-width: 768px) {
    #sidebar-wrapper {
        margin-left: calc(-1 * var(--sidebar-width));
        position: fixed;
        height: 100%;
        top: 0; left: 0; bottom: 0;
    }

    #wrapper.toggled #sidebar-wrapper {
        margin-left: 0;
    }

    #wrapper.toggled::before {
        content: "";
        position: fixed;
        top: 0; left: 0; right: 0; bottom: 0;
        background: rgba(0,0,0,0.5);
        z-index: 1040;
        backdrop-filter: blur(2px);
    }
}

/* --- MENU ITEMS --- */
.list-group-item {
    border: none;
    padding: 12px 20px;
    margin-bottom: 4px;
    color: #636e72;
    font-weight: 500;
    border-radius: 10px !important;
    transition: all 0.2s;
    display: flex;
    align-items: center;
}

.list-group-item:hover {
    background-color: #fff4e6;
    color: var(--primary-color);
    transform: translateX(5px);
}

.list-group-item.active {
    background-color: #fff4e6 !important;
    color: var(--primary-color) !important;
    font-weight: 700;
    position: relative;
}

.list-group-item.active::before {
    content: '';
    position: absolute;
    left: 0; top: 15%; height: 70%; width: 4px;
    background-color: var(--primary-color);
    border-radius: 0 4px 4px 0;
}

/* --- TOPBAR --- */
.topbar-custom {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.02);
    z-index: 1000;
}

.balance-pill {
    background-color: #f8f9fa;
    border: 1px solid #eee;
    padding: 6px 16px;
    border-radius: 30px;
    display: flex; align-items: center; gap: 8px;
}

/* --- DASHBOARD ICONS --- */
.icon-box {
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}