/* ===============================
   SMART BUDGET TRACKER
   =============================== */

*{
    margin:0;
    padding:0;
    box-sizing:border-box;
}

:root{

    --primary:#3B82F6;
    --success:#10B981;
    --danger:#EF4444;

    --bg:#0F172A;
    --card:#1E293B;
    --card2:#273549;

    --text:#F8FAFC;
    --muted:#94A3B8;

    --shadow:0 15px 40px rgba(0,0,0,.25);

}

body{

    font-family:'Poppins',sans-serif;
    background:var(--bg);
    color:var(--text);
    min-height:100vh;

}

/* =========================
NAVBAR
========================= */

.navbar{

    display:flex;
    justify-content:space-between;
    align-items:center;

    padding:20px 8%;
    background:#111827;

    position:sticky;
    top:0;
    z-index:100;

    box-shadow:var(--shadow);

}

.logo{

    display:flex;
    align-items:center;
    gap:12px;

}

.logo i{

    color:var(--primary);
    font-size:32px;

}

.logo h2{

    font-size:24px;

}

.theme-btn{

    width:48px;
    height:48px;

    border:none;

    border-radius:50%;

    background:var(--primary);

    color:white;

    cursor:pointer;

    transition:.3s;

}

.theme-btn:hover{

    transform:rotate(20deg);

}

/* =========================
CONTAINER
========================= */

.container{

    width:90%;
    max-width:1400px;

    margin:40px auto;

}

/* =========================
BALANCE CARD
========================= */

.balance-card{

    background:linear-gradient(135deg,#3B82F6,#2563EB);

    border-radius:20px;

    padding:35px;

    box-shadow:var(--shadow);

    margin-bottom:35px;

}

.balance-card h3{

    color:#E5E7EB;

    margin-bottom:10px;

}

.balance-card h1{

    font-size:50px;

    margin-bottom:10px;

}

/* =========================
SUMMARY
========================= */

.summary{

    display:grid;

    grid-template-columns:repeat(3,1fr);

    gap:25px;

    margin-bottom:35px;

}

.card{

    background:var(--card);

    border-radius:18px;

    padding:25px;

    display:flex;

    align-items:center;

    gap:18px;

    transition:.3s;

    box-shadow:var(--shadow);

}

.card:hover{

    transform:translateY(-6px);

}

.card i{

    width:65px;

    height:65px;

    border-radius:50%;

    display:flex;

    justify-content:center;

    align-items:center;

    font-size:28px;

    color:white;

}

.income i{

    background:var(--success);

}

.expense i{

    background:var(--danger);

}

.budget i{

    background:var(--primary);

}

.card h4{

    color:var(--muted);

    margin-bottom:6px;

}

/* =========================
MAIN GRID
========================= */

.main-grid{

    display:grid;

    grid-template-columns:1.2fr .8fr;

    gap:30px;

    margin-bottom:40px;

}

/* =========================
FORM
========================= */

.form-section{

    background:var(--card);

    border-radius:20px;

    padding:30px;

    box-shadow:var(--shadow);

}

.form-section h2{

    margin-bottom:25px;

}

.input-group{

    display:flex;

    flex-direction:column;

    margin-bottom:18px;

}

.input-group label{

    margin-bottom:8px;

    color:var(--muted);

}

.input-group input,
.input-group select{

    padding:15px;

    border:none;

    outline:none;

    border-radius:12px;

    background:var(--card2);

    color:white;

    font-size:15px;

}

.input-group input:focus,
.input-group select:focus{

    border:2px solid var(--primary);

}

.add-btn{

    width:100%;

    padding:16px;

    border:none;

    border-radius:12px;

    background:var(--primary);

    color:white;

    font-size:17px;

    cursor:pointer;

    transition:.3s;

}

.add-btn:hover{

    transform:scale(1.02);

}

/* =========================
RIGHT PANEL
========================= */

.right-panel{

    display:flex;

    flex-direction:column;

    gap:25px;

}

.progress-card,
.search-card{

    background:var(--card);

    border-radius:20px;

    padding:25px;

    box-shadow:var(--shadow);

}
.budget-controls{

    display:flex;

    flex-direction:column;

    gap:10px;

    margin-bottom:18px;

}

.budget-controls label{

    color:var(--muted);

    font-size:14px;

}

.budget-controls input{

    padding:12px 14px;

    border:none;

    outline:none;

    border-radius:12px;

    background:var(--card2);

    color:white;

}

.budget-controls button{

    padding:12px 14px;

    border:none;

    border-radius:12px;

    background:var(--primary);

    color:white;

    cursor:pointer;

    font-weight:600;

}
.progress{

    width:100%;

    height:18px;

    background:#334155;

    border-radius:20px;

    overflow:hidden;

    margin:20px 0;

}

.progress-bar{

    width:0%;

    height:100%;

    background:linear-gradient(90deg,#10B981,#3B82F6);

    transition:.5s;

}

.search-card input,
.search-card select{

    width:100%;

    padding:14px;

    border:none;

    outline:none;

    border-radius:12px;

    background:var(--card2);

    color:white;

    margin-bottom:15px;

}

.search-card select,
.input-group select{

    background:#F8FAFC;

    color:#111827;

    border:1px solid #CBD5E1;

    appearance:none;

    -webkit-appearance:none;

    -moz-appearance:none;

}

.search-card select option,
.input-group select option{

    background:#1F2937 !important;

    color:#F8FAFC !important;

}

/* =========================
TABLE
========================= */

.transactions{

    background:var(--card);

    padding:30px;

    border-radius:20px;

    margin-bottom:40px;

    box-shadow:var(--shadow);

}

.title{

    display:flex;

    justify-content:space-between;

    align-items:center;

    margin-bottom:25px;

}

#exportCSV{

    background:var(--primary);

    color:white;

    border:none;

    padding:12px 18px;

    border-radius:10px;

    cursor:pointer;

}

table{

    width:100%;

    border-collapse:collapse;

}

thead{

    background:#111827;

}

th,td{

    padding:18px;

    text-align:left;

}

tbody tr{

    border-bottom:1px solid rgba(255,255,255,.05);

}

tbody tr:hover{

    background:#273549;

}

.delete-btn{

    background:var(--danger);

    color:white;

    border:none;

    width:40px;

    height:40px;

    border-radius:50%;

    cursor:pointer;

}

/* =========================
CHART
========================= */

.chart-section{

    background:var(--card);

    padding:30px;

    border-radius:20px;

    box-shadow:var(--shadow);

}

.chart-section canvas{

    margin-top:30px;

    max-height:400px;

}

/* =========================
RESPONSIVE
========================= */

@media(max-width:1100px){

.summary{

grid-template-columns:repeat(2,1fr);

}

.main-grid{

grid-template-columns:1fr;

}

}

@media(max-width:700px){

.navbar{

padding:20px;

}

.container{

width:95%;

}

.summary{

grid-template-columns:1fr;

}

.balance-card h1{

font-size:36px;

}

.title{

flex-direction:column;

gap:15px;

align-items:flex-start;

}

table{

display:block;

overflow-x:auto;

}

}

:root {
    --primary: #7c3aed;
    --primary-2: #3b82f6;
    --success: #10b981;
    --danger: #ef4444;
    --bg: #07111f;
    --card: rgba(15, 23, 42, 0.78);
    --card-strong: rgba(30, 41, 59, 0.92);
    --text: #f8fafc;
    --muted: #94a3b8;
    --border: rgba(255,255,255,0.12);
    --shadow: 0 20px 45px rgba(2, 8, 23, 0.35);
}

body.light {
    --bg: #f5f7ff;
    --card: rgba(255, 255, 255, 0.75);
    --card-strong: rgba(255, 255, 255, 0.92);
    --text: #111827;
    --muted: #5b6472;
    --border: rgba(15, 23, 42, 0.08);
    --shadow: 0 20px 45px rgba(15, 23, 42, 0.12);
}

body {
    background: radial-gradient(circle at top left, rgba(124,58,237,0.22), transparent 28%), var(--bg);
    transition: background 0.3s ease, color 0.3s ease;
}

button, input, select { font: inherit; }

.navbar {
    padding: 20px 6%;
    background: rgba(17, 24, 39, 0.8);
    backdrop-filter: blur(18px);
    border-bottom: 1px solid var(--border);
}

.theme-btn, .ghost-btn, .primary-btn {
    border: none;
    border-radius: 999px;
    padding: 10px 14px;
    cursor: pointer;
    transition: transform 0.2s ease;
}
.theme-btn:hover, .ghost-btn:hover, .primary-btn:hover { transform: translateY(-2px); }
.theme-btn { background: var(--primary); color: white; }
.ghost-btn { background: rgba(255,255,255,0.08); color: var(--text); }
.primary-btn { background: linear-gradient(90deg, var(--primary), var(--primary-2)); color: white; }

.container, .auth-card { width: min(1280px, 92%); margin: 32px auto 48px; }
.auth-shell {
    display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 24px; padding: 28px; border-radius: 24px;
    background: var(--card); border: 1px solid var(--border); box-shadow: var(--shadow); backdrop-filter: blur(24px);
}
.auth-copy h1 { font-size: clamp(1.8rem, 3vw, 2.7rem); margin: 12px 0; }
.eyebrow { text-transform: uppercase; letter-spacing: 0.3em; font-size: 0.75rem; color: var(--primary); font-weight: 600; }
.subtext { color: var(--muted); max-width: 520px; }
.auth-form-card { background: var(--card-strong); border: 1px solid var(--border); border-radius: 20px; padding: 20px; }
.auth-toggle { display: flex; gap: 10px; margin-bottom: 16px; }
.auth-toggle button { flex: 1; padding: 10px; border: none; border-radius: 999px; background: rgba(255,255,255,0.06); color: var(--text); cursor: pointer; }
.auth-toggle .active { background: linear-gradient(90deg, var(--primary), var(--primary-2)); color: white; }
.auth-form { display: grid; gap: 12px; }
.input-group { display: flex; flex-direction: column; gap: 8px; margin-bottom: 0; }
.input-group label { color: var(--muted); font-size: 0.92rem; }
.input-group input, .input-group select, .search-panel input, .search-panel select, .inline-form input, .inline-form select, .budget-controls input {
    width: 100%; padding: 13px 14px; border: 1px solid var(--border); border-radius: 12px; background: rgba(255,255,255,0.06); color: var(--text); outline: none;
}
.input-group input:focus, .input-group select:focus, .search-panel input:focus, .search-panel select:focus, .inline-form input:focus, .inline-form select:focus, .budget-controls input:focus { border-color: var(--primary); }

.hero-card, .panel, .card { background: var(--card); border: 1px solid var(--border); box-shadow: var(--shadow); backdrop-filter: blur(22px); }
.hero-card { display: flex; justify-content: space-between; align-items: center; gap: 20px; padding: 28px; border-radius: 24px; margin-bottom: 24px; }
.hero-card h1 { font-size: clamp(1.5rem, 2.3vw, 2.2rem); margin: 8px 0; }
.hero-card p { color: var(--muted); }
.hero-metric { text-align: right; }
.hero-metric h3 { color: var(--muted); }
.hero-metric h2 { font-size: 2rem; margin-top: 6px; }

.summary-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-bottom: 24px; }
.card { display: flex; align-items: center; gap: 16px; padding: 22px; border-radius: 22px; }
.card i { width: 50px; height: 50px; display: grid; place-items: center; border-radius: 14px; font-size: 1.25rem; color: white; }
.income i { background: var(--success); }
.expense i { background: var(--danger); }
.budget i { background: linear-gradient(90deg, var(--primary), var(--primary-2)); }
.card h4 { color: var(--muted); margin-bottom: 6px; }

.main-grid, .dashboard-grid { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 20px; margin-bottom: 24px; }
.dashboard-grid { grid-template-columns: 1fr 1fr; }
.panel { padding: 22px; border-radius: 22px; }
.panel-header { display: flex; justify-content: space-between; align-items: start; gap: 10px; margin-bottom: 14px; }
.panel-header p { color: var(--muted); font-size: 0.92rem; }
.side-stack { display: grid; gap: 20px; }
.budget-controls { display: grid; gap: 10px; margin-bottom: 14px; }
.budget-controls label { color: var(--muted); }
.progress { width: 100%; height: 14px; background: rgba(255,255,255,0.12); border-radius: 999px; overflow: hidden; margin: 10px 0 8px; }
.progress-bar { height: 100%; width: 0%; background: linear-gradient(90deg, var(--success), var(--primary)); transition: width .3s ease; }

.inline-form { display: grid; gap: 10px; margin-bottom: 12px; }
.insight-list, .goal-list, .recurring-list { display: grid; gap: 10px; }
.insight-card, .goal-card, .recurring-card { padding: 12px 14px; border-radius: 14px; background: rgba(255,255,255,0.05); border: 1px solid var(--border); }
.goal-progress { height: 8px; border-radius: 999px; background: rgba(255,255,255,0.12); overflow: hidden; margin: 8px 0 10px; }
.goal-progress > div { height: 100%; background: linear-gradient(90deg, var(--success), var(--primary)); }
.goal-actions, .recurring-meta { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 8px; }
.goal-actions button, .recurring-card button { padding: 8px 10px; border: none; border-radius: 10px; background: rgba(124,58,237,0.2); color: white; cursor: pointer; }

.transactions { margin-bottom: 30px; }
.title-row { align-items: center; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 14px 8px; text-align: left; border-bottom: 1px solid var(--border); }
.delete-btn { background: rgba(239,68,68,0.2); color: white; border: none; padding: 8px; border-radius: 10px; cursor: pointer; }
canvas { width: 100%; margin-top: 10px; }

@media (max-width: 900px) {
    .summary-grid, .main-grid, .dashboard-grid, .auth-shell { grid-template-columns: 1fr; }
    .hero-card { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 640px) {
    .navbar { padding: 16px 5%; }
    .container, .auth-card { width: min(96%, 1280px); }
    table { display: block; overflow-x: auto; }
    .actions { width: 100%; }
}