/* ROOT COLOR SYSTEM (CONSISTENT) */
:root {
    --pink-main: #FF3F86;
    --pink-soft: #FF6FA3;
    --navy-dark: #162447;
    --navy-soft: #1E3A8A;
    --teal-green: #4CB29B;
    --yellow-gold: #FFC107;
    --bg-light: #F7F9FC;
    --text-light: #E5E7EB;
}

/* RESET & BASE */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    width: 100%;
    height: 100%;
    font-family: 'Poppins', 'Segoe UI', sans-serif;
    background: linear-gradient(
        135deg,
        var(--pink-main),
        var(--pink-soft),
        var(--teal-green)
    );
    overflow-x: hidden;
}

.stat-card {
    color: white;
    border-radius: 24px;
    padding: 24px;
    position: relative;
    overflow: hidden;
}

.stat-card i {
    font-size: 42px;
    opacity: 0.25;
    position: absolute;
    right: 20px;
    bottom: 20px;
}

.stat-income {
    background: linear-gradient(135deg, #4CB29B, #2E8B7E);
}

.stat-expense {
    background: linear-gradient(135deg, #ff005d, #ff3c83);
}

.stat-balance {
    background: linear-gradient(135deg, #162447, #1E3A8A);
}

.btn-custom {
    background: var(--pink-main);
    color: white;
    border: none;
    border-radius: 14px;
    padding: 10px 20px;
    transition: 0.3s;
}

.btn-custom:hover {
    background: var(--pink-soft);
    transform: scale(1.05);
}

.preview-img {
    width: 100%;
    border-radius: 16px;
    margin-top: 10px;
    box-shadow: 0 8px 20px rgba(0,0,0,0.25);
}

.form-select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' fill='%23666' viewBox='0 0 16 16'%3E%3Cpath d='M1.5 5.5l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 14px;
    padding-right: 40px;
}

/* SIDEBAR */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 260px;
    height: 100vh;
    padding: 20px;
    background: linear-gradient(
        180deg,
        var(--navy-dark),
        #0F172A
    );
    z-index: 2000;
    transition: transform 0.3s ease;
}

.sidebar img {
    width: 130px;
    margin-bottom: 30px;
}

.sidebar a {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-light);
    text-decoration: none;
    padding: 14px 16px;
    border-radius: 14px;
    margin-bottom: 8px;
    transition: 0.3s ease;
}

.sidebar a i {
    font-size: 18px;
}

.sidebar a:hover,
.sidebar a.active {
    background: var(--pink-main);
    color: #fff;
    transform: translateX(6px);
}

/* TOPBAR & BURGER (MOBILE) */
.topbar {
    height: 60px;
    background: linear-gradient(
        135deg,
        var(--pink-main),
        var(--pink-soft)
    );
    display: flex;
    align-items: center;
    padding: 0 16px;
    color: #fff;
    position: sticky;
    top: 0;
    z-index: 3000;
    transition: transform 0.3s ease;
}

.brand {
    margin-left: 14px;
    font-size: 18px;
    font-weight: 600;
    transition: transform 0.3s ease;
}

/* BURGER BUTTON */
.burger-btn {
    width: 46px;
    height: 46px;
    background: rgba(255,255,255,0.18);
    border: none;
    border-radius: 14px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 7px;
    padding: 9px;
    cursor: pointer;
    z-index: 3100;
    transition: transform 0.3s ease;
}

.burger-btn span {
    height: 4px;
    width: 100%;
    background: #fff;
    border-radius: 8px;
}

/* MAIN CONTENT */
.main-content {
    min-height: 100vh;
    padding: 24px;
    position: relative;
    z-index: 1;
}

/* CARD & TABLE */
.card-custom {
    background: #fff;
    border-radius: 22px;
    padding: 24px;
    box-shadow: 0 16px 35px rgba(0,0,0,0.15);
    margin-bottom: 20px;
}

.table {
    background: #fff;
    border-radius: 18px;
    overflow: hidden;
}

.table thead {
    background: linear-gradient(
        135deg,
        var(--navy-dark),
        var(--navy-soft)
    );
    color: #fff;
}

.table th,
.table td {
    padding: 14px;
}

/* OVERLAY */
.overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.35);
    z-index: 1500;
    display: none;
}

.overlay.active {
    display: block;
}

/* DESKTOP LAYOUT */
@media (min-width: 992px) {

    .sidebar {
        transform: translateX(0);
    }

    .sidebar a.active {
        background: var(--pink-main) !important;
        color: #fff !important;
        transform: none;
        box-shadow: 0 8px 18px rgba(255, 63, 134, 0.45);
    }

    .sidebar a.active i {
        color: #fff !important;
    }

    .sidebar a.active:hover {
        background: var(--pink-main);
    }
    .main-content {
        margin-left: 260px;
    }

    .topbar {
        display: none;
    }

    .overlay {
        display: none !important;
    }
}

/* MOBILE LAYOUT */
@media (max-width: 991px) {

    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.active {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
        width: 100vw;
        max-width: 100vw;
        padding: 16px;
    }

    body.sidebar-open .topbar {
        transform: translateX(260px);
    }
}
