
html { 
    scroll-behavior: smooth; 
}

* { 
    box-sizing: border-box; 
}

body {
    font-family: 'Poppins', sans-serif;
    background-color: #eaecee;
    color: #3c3e41;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    width: 100%;
}

.gradient-text {
    background-image: linear-gradient(-45deg, #D000F7, #24BAE3);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.neo-card {
    background-color: #eaecee;
    border-radius: 15px;
    box-shadow: 5px 5px 15px #c1c8d3, -5px -5px 15px #fff;
    padding: 20px;
    transition: all 0.3s ease;
    margin-bottom: 10px;
    width: 100%;
    animation: fadeUp 0.5s ease 0.1s both;
}

#pageTitle {
    font-family: 'Syne', sans-serif;
    font-weight: 700;
    font-size: 26px;
    padding: 6px 0 0 0;
}
.neo-btn {
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 10px;
    box-shadow: 5px 5px 15px #c1c8d3, -5px -5px 15px #fff;
    padding: 5px;
    background-image: linear-gradient(-45deg, #D000F7, #24BAE3);
    color: #fff;
    border: none;
}
.neo-card:hover, .insight-bottom-card:hover {
    transform: translateY(-6px);
    box-shadow: 10px 10px 25px #b0b8c5, -10px -10px 25px #ffffff;
}

.nav-item {
    padding: 10px;
    border-radius: 10px;
    cursor: pointer;
}

.nav-item:hover {
    background: #dfe4ea;
}


/* Sidebar */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: 230px;
    height: 100vh;
    background: #eaecee;
    z-index: 1000;
    transition: transform 0.3s ease;
    box-shadow: 5px 5px 15px #c1c8d3, -5px -5px 15px #fff;
    border-top-right-radius: 15px;
    border-bottom-right-radius: 15px;
    display: flex;
    flex-direction: column;
    padding: 15px 10px;
}

.neo-select {
    background: #eaecee;
    border-radius: 8px;
    border: 1px solid #a1a2a4;
    padding: 5px;
    outline: none;
    cursor: pointer;
    box-shadow: 5px 5px 15px #c1c8d3, -5px -5px 15px #fff;
}

.top-bar {
    display: flex;
    justify-content: center;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 999;
    margin-left: 240px;
    background: #eaecee;
    padding: 15px;
    box-shadow: 5px 5px 15px #c1c8d3, -5px -5px 15px #fff;
    border-radius: 0 0 15px 15px;
    width: calc(100% - 240px);
}

/* Main Page */
.main-content {
    margin-left: 230px;
    width: calc(100% - 230px);
    padding: 15px;
}

.sidebar h4 {
    padding: 12px;
}
.sidebar hr {
    margin: 10px 0;
    width: 100%;
    max-width: 230px;
    border: none;
    height: 1px;
    background: #a1a2a4;
}

/* Role toggle */
.sidebar p {
    margin-left: 8px;
}
.role-toggle {
    display: flex;
    background: #dfe4ea;
    border-radius: 8px;
    padding: 5px;
    
}

.role-toggle button {
    flex: 1;
    border: none;
    padding: 8px;
    border-radius: 8px;
    background: transparent;
}

.role-toggle .active {
    background: linear-gradient(-45deg, #D000F7, #24BAE3);
    color: white;
}

/* Cards colors */
#income { 
    color: #029f70df;
    font-family: 'Syne', sans-serif;
    font-weight: 700;
    font-size: 28px;
}
#expense {
    color: #ff0000; 
    font-family: 'Syne', sans-serif;
    font-weight: 700;
    font-size: 28px;
}
#balance { 
    background-image: linear-gradient(-45deg, #D000F7, #24BAE3);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-family: 'Syne', sans-serif;
    font-weight: 700;
    font-size: 28px; 
}
#savings { 
    color: #24BAE3;
    font-family: 'Syne', sans-serif;
    font-weight: 700;
    font-size: 28px; 
}

.neo-card h6 {
    background-image: linear-gradient(-45deg, #D000F7, #24BAE3);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-family: 'Syne', sans-serif;
    font-weight: 700;
    font-size: 18px; 
}

.chart-card {
    height: 380px;
    animation: fadeUp 0.5s ease 0.1s both;
}

.chart-card canvas {
    width: 100%;
    height: 100%;
    max-height: 300px;  
}


/* Bar chart */
#barChart {
    max-height: 300px;
}
.no-data-msg {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #777;
    font-size: 14px;
    text-align: center;
    width: 100%;
}

.menu-btn {
    display: none;
}

#menuToggle, #closeSidebar {
    width: 50px;
    height: 50px;
    font-size: 16px;
    border-radius: 50%;
    box-shadow: 5px 5px 15px #c1c8d3, -5px -5px 15px #fff;
    background: #eaecee;
    background-image: linear-gradient(-45deg, #D000F7, #24BAE3);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}


/* Transaction section */
.filters-card {
    display: flex;
    flex-direction: column;
    box-shadow: 5px 5px 15px #c1c8d3, -5px -5px 15px #fff;
    background: #eaecee;
    border-radius: 15px;
    padding: 10px;
    transition: all 0.3s ease;
    margin-bottom: 10px;
}
.transactionsControls {
    display: flex;
    flex-direction: row;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    padding: 5px;
}

.form-control {
    padding: 8px 12px;
    flex: 1;
    outline: none;
    min-width: 180px;
    border: 1px solid #ced0d3;
    background: #eaecee;
    box-shadow: inset 1px 1px 3px #c1c8d3;
    font-family: 'DM Sans', sans-serif;
    font-weight: 500;
    font-size: 13px;
    border-radius: 8px;
}

.form-control:focus {
    outline: none;
    border: 1px solid #ced0d3;
    background: #eaecee;
    box-shadow: inset 1px 1px 3px #c1c8d3;
}

.txn-sort {
    background: #eaecee;
    border-radius: 6px;
    border: 1px solid #a1a2a4;
    padding: 5px;
    outline: none;
    cursor: pointer;
    box-shadow: 5px 5px 15px #c1c8d3, -5px -5px 15px #fff;
    font-size: 12px;
    transform: all 0.3s ease;
}


.add-btn {
    border: none;
    background: linear-gradient(-45deg, #D000F7, #24BAE3);
    color: #fff;
    font-size: 15px;
    font-family: 'DM Sans', sans-serif;
    font-weight: 500;
    padding: 12px 8px;
    border-radius: 8px;
    box-shadow: 5px 5px 15px #c1c8d3, -5px -5px 15px #fff;
}

.add-btn:active {
    box-shadow: inset 4px 4px 10px #c1c8d3,
                inset -4px -4px 10px #ffffff;
    transform: scale(0.97);
}

.table-anim {
    animation: fadeUp 0.5s ease 0.1s both;
}

.table-wrap {
    background-color: #eaecee;
    border-radius: 15px;
    box-shadow: 5px 5px 15px #c1c8d3, -5px -5px 15px #fff;
    padding: 15px;
    margin-bottom: 10px;
    overflow: auto;
    -webkit-overflow-scrolling: touch; 
}

@keyframes fadeUp {
    from { 
        opacity: 0; 
        transform: translateY(16px); 
    }
    to {
        opacity: 1; 
        transform: translateY(0); 
    }
}

table {
    width: 100%;
    min-width: 600px;
    border-collapse: separate;
    border-spacing: 0;
    border: 1px solid #6c757d; 
    border-radius: 10px;       
    overflow: hidden;
}


thead th {
    padding: 14px 18px;
    text-align: left;
    font-size: 11px;
    font-weight: 600;
    background-image: linear-gradient(-45deg, #D000F7, #24BAE3);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    cursor: pointer;
    user-select: none;
    transition: color 0.2s;
    border-bottom: 1px solid #6c757d;
}

tbody tr:hover {
    background: rgba(107, 57, 195, 0.05); 
}

tbody tr {
    border-top: 1px solid #6c757d;
    animation: fadeUp 0.3s ease both;
    
}

tbody td {
    padding: 14px 18px;
    font-size: 12px;
    border-bottom: 1px solid #6c757d;
}

tbody tr:last-child td {
    border-bottom: none;
}

.edit-btn, .delete-btn {
    border: 1px solid #6c757d; 
    font-size: 12px;
    padding: 2px 4px;
    border-radius: 5px;
    color: #777;
    font-weight: 500;
    cursor: pointer;
}

.edit-btn:hover, .delete-btn:hover {
    background: linear-gradient(-45deg, #D000F7, #24BAE3);
    color: #fff;
    border: none;
    padding: 2px 4px;
}

.add-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: none;
}

.edit-btn:disabled,
.delete-btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
    pointer-events: none;
}

/* Add & Edit Card */
.txn-card-bg {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.25);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fade-in 0.2s ease;
}

.add-transaction-box {
    background: #eaecee;
    border-radius: 20px;
    box-shadow: 5px 5px 15px #c1c8d3, -5px -5px 15px #fff;
    padding: 28px;
    width: 100%;
    max-width: 420px;
    animation: slide-up 0.3s ease;
}

.box-heading {
    font-family: 'Syne', sans-serif;
    font-weight: 700;
    font-size: 20px;
    background-image: linear-gradient(-45deg, #D000F7, #24BAE3);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 20px;
}

.txn-input-section {
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin-bottom: 14px;
}

.txn-input-section label {
    font-size: 11px;
    font-weight: 600;
    color: #777;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.data-input {
    background: #eaecee;
    border: 1px solid #ced0d3;
    border-radius: 10px;
    padding: 10px 14px;
    font-size: 13px;
    font-family: 'DM Sans', sans-serif;
    box-shadow: inset 2px 2px 5px #c1c8d3, inset -2px -2px 5px #fff;
    outline: none;
    transition: box-shadow 0.2s ease;
}


.action-btn {
    display: flex;
    gap: 12px;
    margin-top: 20px;
}

.cancel-btn {
    flex: 1;
    padding: 12px;
    border-radius: 10px;
    background: #eaecee;
    color: #777;
    font-size: 14px;
    font-family: 'DM Sans', sans-serif;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 4px 4px 10px #c1c8d3, -4px -4px 10px #fff;
    text-align: center;
    transition: all 0.2s ease;
    user-select: none;
    border: none;
}

.cancel-btn:active {
    transform: scale(0.97);
}

.save-btn {
    flex: 1;
    padding: 12px;
    border-radius: 10px;
    background: linear-gradient(-45deg, #D000F7, #24BAE3);
    color: #fff;
    font-size: 14px;
    font-family: 'DM Sans', sans-serif;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 4px 4px 10px #c1c8d3, -4px -4px 10px #fff;
    text-align: center;
    transition: all 0.2s ease;
    user-select: none;
    border: none;
}

.save-btn:active {
    transform: scale(0.97);
}

.data-input.error {
    box-shadow: inset 2px 2px 5px #ffb3b3, inset -2px -2px 5px #fff;
    border-color: #e84040;
}

.error-msg {
    font-size: 11px;
    color: #e84040;
    margin-top: 3px;
    display: none;
}

.error-msg.show {
    display: block;
}

/* Insights */
.insights-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 16px;
}

.insight-card {
    display: flex;
    flex-direction: column;
    min-height: 160px;
}

.insight-card h6 {
    text-align: start;
    font-size: 15px;
    font-weight: 700;
    font-family: 'Syne', sans-serif;
    letter-spacing: 0.08em;
    background-image: linear-gradient(-45deg, #D000F7, #24BAE3);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 10px;
}

.insight-bottom-card {
    background-color: #eaecee;
    border-radius: 15px;
    box-shadow: 5px 5px 15px #c1c8d3, -5px -5px 15px #fff;
    padding: 20px;
    transition: all 0.3s ease;
    margin-bottom: 10px;
    width: 57%;
    min-width: 200px;
    animation: fadeUp 0.5s ease 0.1s both;
}

.insight-big {
    font-family: 'Syne', sans-serif;
    font-weight: 800;
    font-size: 36px;
    margin-bottom: 8px;
}

.insight-sub {
    font-size: 12px;
    color: #888;
    margin: 0;
}

.spend-card {
    min-height: 160px;
    grid-column: 1 / -1;
}

.spend-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.spend-top {
    display: flex;
    justify-content: space-between;
    margin-bottom: 4px;
}

.spend-cat {
    font-size: 13px;
    font-weight: 600;
}

.spend-amt {
    font-size: 12px;
    color: #888;
}

.spend-bar-bg {
    width: 100%;
    height: 6px;
    background: #d8dce0;
    border-radius: 10px;
    overflow: hidden;
}

.spend-bar-fill {
    height: 100%;
    border-radius: 10px;
    transition: width 0.6s ease;
}

.month-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 10px;
}

.month-row {
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 13px;
    padding: 8px 0;
    border-bottom: 1px solid #d8dce0;
}

.month-row:last-child {
    border-bottom: none;
}

.month-label {
    color: #555;
    font-weight: 500;
    flex: 1;
}

.month-income {
    color: #10B981;
    margin-right: 10px;
    font-weight: 600;
    text-align: right;
}

.month-expense {
    color: #e84040;
    margin-right: 10px;
    font-weight: 600;
    text-align: right;
}

.month-net {
    font-weight: 700;
    text-align: right;
}

/* Responsiveness */
@media (min-width: 1200px) {
    .insights-grid {
        grid-template-columns: 1fr 1fr 1.5fr;
    }
    .spend-card {
        grid-column: auto;
    }
}

@media (max-width: 768px) {
    .insights-grid {
        grid-template-columns: 1fr;
    }
    
    .spend-card {
        grid-column: auto;
    }
    .month-row {
        font-size: 11px;
        gap: 4px;
    }
}


@media (max-width: 768px) {
    body {
        overflow-x: hidden;
    }
    .sidebar {
        transform: translateX(-100%);
        position: fixed;
        width: 230px;
        height: 100%;
        z-index: 1000;
    }
    .sidebar.active {
        transform: translateX(0);
    }
    .main-content {
        margin-left: 0;
        width: 100%;
        padding: 10px;
    }
    .top-bar{
        margin-left: 0;
        right: 0;
        width: 100%;
    }
    .menu-btn {
        display: flex;
        align-items: center;
        justify-content: center;
    }
    .edit-btn {
        margin-bottom: 4px;
    }
}

@media (max-width: 1024px) {
    .insight-bottom-card {
        width: 100%;
    }
}
@media (max-width: 576px){
    .neo-select {
        font-size: 10px;
        border-radius: 6px;
        width: 70px;
        height: 25px;
    }
    .neo-btn {
        width: 50px;
        height: 25px;
        border-radius: 6px;
        font-size: 10px;
        padding: -15px -10px;
        margin-left: -5px;
    }
    .top-bar {
        display: flex;
        justify-content: center;
        align-items: center;
    }
    .neo-select {
        width: 75px;
    }
    #pageTitle {
    font-family: 'Syne', sans-serif;
    font-weight: 700;
    font-size: 20px;
    }

}

@media (max-width: 480px) {
    .add-transaction-box {
        margin: 0 14px;
        padding: 20px;
    }
}

/* Dark Theme btn*/
.theme-btn {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border: none;
    border-radius: 10px;
    background: #eaecee;
    box-shadow: 4px 4px 10px #c1c8d3, -4px -4px 10px #fff;
    cursor: pointer;
    font-size: 13px;
    font-family: 'DM Sans', sans-serif;
    font-weight: 500;
    color: #555;
    transition: all 0.2s ease;
}

.theme-btn:active {
    box-shadow: inset 3px 3px 8px #c1c8d3, inset -3px -3px 8px #fff;
}

.theme-btn i {
    background: linear-gradient(-45deg, #D000F7, #24BAE3);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-size: 15px;
}

body.dark .theme-btn {
    background: #1e2025;
    color: #aaa;
    box-shadow: 4px 4px 10px #13151a, -4px -4px 10px #292d36;
}

body.dark .theme-btn:active {
    box-shadow: inset 3px 3px 8px #13151a, inset -3px -3px 8px #292d36;
}

/* Dark Mode */
body.dark {
    background-color: #1e2025;
    color: #e0e0e0;
}

/* cards, sidebar, topbar */
body.dark .neo-card,
body.dark .sidebar,
body.dark .top-bar,
body.dark .filters-card,
body.dark .table-wrap,
body.dark .add-transaction-box,
body.dark .chart-card {
    background-color: #1e2025;
    box-shadow: 5px 5px 15px #13151a, -5px -5px 15px #292d36;
}

body.dark .neo-card:hover,
body.dark .chart-card:hover {
    box-shadow: 9px 9px 20px #13151a, -9px -9px 20px #292d36;
}

body.dark .neo-btn {
    background: #1e2025;
    box-shadow: 4px 4px 10px #13151a, -4px -4px 10px #292d36;
}

body.dark .add-btn, body.dark .save-btn, body.dark #roleBadge {
    box-shadow: 4px 4px 10px #13151a, -4px -4px 10px #292d36;
    background: linear-gradient(-45deg, #D000F7, #24BAE3);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}


body.dark #menuToggle,
body.dark #closeSidebar {
    box-shadow: 4px 4px 10px #13151a, -4px -4px 10px #292d36;
}

/* inputs and selects */
body.dark .neo-select,
body.dark .form-control,
body.dark .txn-sort,
body.dark .data-input {
    background-color: #1e2025;
    color: #e0e0e0;
    border-color: #383c45;
    box-shadow: inset 2px 2px 5px #13151a, inset -2px -2px 5px #292d36;
}

body.dark .form-control::placeholder {
    color: #666;
}

body.dark input[type="date"] {
    color: #e0e0e0;
    color-scheme: dark;
}

body.dark .data-input::placeholder {
    color: #666;
}

body.dark .neo-select:focus,
body.dark .form-control:focus,
body.dark .data-input:focus {
    box-shadow: inset 3px 3px 7px #13151a, inset -3px -3px 7px #292d36;
}

/* table */
body.dark table {
    border-color: #383c45;
}

body.dark thead th {
    border-color: #383c45;
}

body.dark tbody td {
    border-color: #383c45;
}

body.dark tbody tr:hover {
    background: rgba(255, 255, 255, 0.03);
}

/* role toggle */
body.dark .role-toggle,
body.dark .role-switcher {
    background: #292d36;
}

body.dark .role-toggle button,
body.dark .role-btn {
    color: #fff;
}

/* cancel btn */
body.dark .cancel-btn {
    background: #1e2025;
    color: #aaa;
    box-shadow: 4px 4px 10px #13151a, -4px -4px 10px #292d36;
}

body.dark .cancel-btn:active {
    box-shadow: inset 3px 3px 8px #13151a, inset -3px -3px 8px #292d36;
}

/* edit/delete btns */
body.dark .edit-btn,
body.dark .delete-btn {
    background: #1e2025;
    color: #aaa;
    border-color: #383c45;
    box-shadow: 3px 3px 7px #13151a, -3px -3px 7px #292d36;
}

body.dark .edit-btn:hover {
    background: linear-gradient(-45deg, #D000F7, #24BAE3);
    color: #fff;
    border-color: transparent;
}

body.dark .delete-btn:hover {
    background: #e84040;
    color: #fff;
    border-color: transparent;
}

/* txn card bg blur */
body.dark .txn-card-bg {
    background: rgba(0, 0, 0, 0.5);
}

body.dark .add-transaction-box {
    background: #1e2025;
    box-shadow: 12px 12px 30px #13151a, -12px -12px 30px #292d36;
}


body.dark .insight-sub {
    color: #888;
}

body.dark .spend-amt {
    color: #888;
}

body.dark .spend-bar-bg {
    background: #292d36;
}

body.dark .month-row {
    border-color: #383c45;
}

body.dark .month-label {
    color: #aaa;
}

/* sidebar text */
body.dark .nav-link:hover,
body.dark .nav-item:hover {
    background: #292d36;
}

body.dark .nav-link.active,
body.dark .nav-item.active {
    background: #292d36;
}

body.dark .sidebar hr,
body.dark .sidebar-line,
body.dark .divider-line {
    background: #383c45;
}

body.dark .role-label,
body.dark .sidebar p {
    color: #888;
}

/* chart legend text */
body.dark .chart-box canvas,
body.dark canvas {
    filter: brightness(0.95);
}

body.dark .insight-bottom-card {
    background-color: #1e2025;
    box-shadow: 5px 5px 15px #13151a, -5px -5px 15px #292d36;
}

body.dark .insight-bottom-card:hover {
    box-shadow: 9px 9px 20px #13151a, -9px -9px 20px #292d36;
}