/* ExpenseTrack UI */

:root {
    --bg:#f4f6f9; --surface:#fff; --soft:#f8fafc; --text:#172033;
    --muted:#718096; --border:#e5e9f0; --primary:#2563eb;
    --primary-dark:#1d4ed8; --success:#16a34a; --danger:#dc2626;
    --sidebar:#111827; --shadow:0 8px 30px rgba(15,23,42,.06);
    --radius:14px; --transition:.25s ease;
}
body.dark {
    --bg:#0f172a; --surface:#111827; --soft:#1e293b; --text:#f1f5f9;
    --muted:#94a3b8; --border:#263449; --sidebar:#020617;
    --shadow:0 8px 30px rgba(0,0,0,.25);
}
*{margin:0;padding:0;box-sizing:border-box}
html{scroll-behavior:smooth}
body{font-family:Inter,Arial,sans-serif;background:var(--bg);color:var(--text);min-height:100vh;transition:.25s}
button,input,select{font:inherit}button{cursor:pointer}a{color:inherit;text-decoration:none}

.app-container{min-height:100vh;display:flex}
.sidebar{width:250px;min-height:100vh;background:var(--sidebar);color:#cbd5e1;padding:25px 16px;display:flex;flex-direction:column;position:fixed;inset:0 auto 0 0;z-index:100}
.brand{display:flex;align-items:center;gap:12px;padding:4px 10px 35px}
.brand-icon{width:42px;height:42px;border-radius:11px;display:flex;align-items:center;justify-content:center;background:var(--primary);color:#fff;font-size:20px;font-weight:800}
.brand h2{color:#fff;font-size:17px}.brand h2 span{color:#60a5fa}.brand small{display:block;margin-top:3px;font-size:10px;color:#64748b}
.navigation{display:flex;flex-direction:column;gap:7px}
.nav-link{display:flex;align-items:center;gap:13px;padding:12px 14px;border-radius:9px;color:#cbd5e1;font-size:13px;font-weight:500;transition:.25s}
.nav-link span{width:20px;text-align:center;font-size:17px}.nav-link:hover{background:rgba(255,255,255,.06);color:#fff}.nav-link.active{background:var(--primary);color:#fff}
.sidebar-bottom{margin-top:auto;display:flex;flex-direction:column;gap:8px;border-top:1px solid rgba(255,255,255,.07);padding-top:18px}
.sidebar-action{background:transparent;color:#94a3b8;border:0;text-align:left;padding:10px 14px;border-radius:8px;font-size:12px}.sidebar-action:hover{background:rgba(255,255,255,.06);color:#fff}

.main-content{width:calc(100% - 250px);margin-left:250px;padding:30px 35px;min-height:100vh}
.top-header{display:flex;justify-content:space-between;align-items:center;margin-bottom:30px}
.header-left{display:flex;align-items:center;gap:15px}.welcome-text{font-size:11px;text-transform:uppercase;letter-spacing:1px;color:var(--muted);margin-bottom:4px}
.top-header h1{font-size:25px;letter-spacing:-.5px}.header-actions{display:flex;align-items:center;gap:18px}
.icon-button{width:38px;height:38px;border:1px solid var(--border);background:var(--surface);color:var(--text);border-radius:9px}.icon-button:hover{border-color:var(--primary);color:var(--primary)}
.profile{display:flex;align-items:center;gap:9px}.profile-avatar{width:38px;height:38px;border-radius:50%;display:flex;align-items:center;justify-content:center;background:#dbeafe;color:#1d4ed8;font-size:12px;font-weight:700}
.profile-info strong{display:block;font-size:12px}.profile-info span{display:block;font-size:10px;color:var(--muted);margin-top:2px}
.mobile-menu{display:none;width:38px;height:38px;border:1px solid var(--border);background:var(--surface);color:var(--text);border-radius:8px}

.page-section{display:none}.page-section.active-section{display:block}
.summary-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:16px;margin-bottom:20px}
.summary-card{background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);padding:20px;box-shadow:var(--shadow);transition:.25s}
.summary-card:hover{transform:translateY(-2px)}.card-top{display:flex;align-items:flex-start;justify-content:space-between}
.card-label{display:block;color:var(--muted);font-size:11px;margin-bottom:9px}.summary-card h2{font-size:22px}
.card-icon{width:36px;height:36px;border-radius:9px;display:flex;align-items:center;justify-content:center;background:#eff6ff;color:var(--primary);font-weight:700}
.income-icon{background:#ecfdf3;color:var(--success)}.expense-icon{background:#fef2f2;color:var(--danger)}
.card-footer{display:flex;justify-content:space-between;gap:8px;margin-top:15px;font-size:10px;color:var(--muted)}.positive{color:var(--success)}

.quick-action{display:flex;align-items:center;justify-content:space-between;gap:20px;padding:22px 25px;border-radius:var(--radius);margin-bottom:20px;background:linear-gradient(110deg,#172033,#263a63);color:#fff}
.quick-action h2{font-size:18px;margin:3px 0 5px}.quick-action p{color:#b8c4d6;font-size:11px}
.section-kicker{display:block;font-size:9px;font-weight:700;letter-spacing:1.3px;color:var(--primary)}.quick-action .section-kicker{color:#93c5fd}

.primary-button,.secondary-button,.danger-button{border:0;border-radius:8px;padding:11px 17px;font-size:12px;font-weight:600;transition:.25s}
.primary-button{background:var(--primary);color:#fff}.primary-button:hover{background:var(--primary-dark);transform:translateY(-1px)}
.secondary-button{background:var(--soft);border:1px solid var(--border);color:var(--text)}.secondary-button:hover{border-color:var(--primary);color:var(--primary)}
.danger-button{background:var(--danger);color:#fff}.text-button{border:0;background:transparent;color:var(--primary);font-size:11px;font-weight:600}
.close-button{width:30px;height:30px;border:0;background:var(--soft);color:var(--muted);border-radius:7px;font-size:20px}

.panel{background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);box-shadow:var(--shadow)}
.panel-header{display:flex;justify-content:space-between;align-items:center;gap:15px;padding-bottom:18px}.panel-header h2{font-size:16px;margin-top:4px}
.panel-header select{width:auto}

.transaction-form-panel{padding:25px;margin-bottom:20px;display:none}.transaction-form-panel.show{display:block}
.form-grid{display:grid;grid-template-columns:repeat(2,1fr);gap:17px}.form-group{display:flex;flex-direction:column;gap:7px}
.form-group label{font-size:11px;font-weight:600}.form-group input,.form-group select,.filters-panel input,.filters-panel select,.panel-header select{width:100%;height:40px;border:1px solid var(--border);border-radius:8px;outline:0;padding:0 12px;background:var(--surface);color:var(--text);font-size:11px}
.form-group input:focus,.form-group select:focus,.filters-panel input:focus,.filters-panel select:focus{border-color:var(--primary);box-shadow:0 0 0 3px rgba(37,99,235,.08)}
.amount-input{position:relative}.amount-input span{position:absolute;left:12px;top:12px;font-size:12px;color:var(--muted)}.amount-input input{padding-left:28px}
.form-actions{display:flex;justify-content:flex-end;gap:10px;margin-top:20px}

.dashboard-grid{display:grid;grid-template-columns:1.5fr 1fr;gap:20px;margin-bottom:20px}.chart-panel,.category-panel,.recent-panel{padding:25px}
.chart-container{min-height:260px;display:flex;align-items:center;justify-content:center;position:relative}
.empty-chart{text-align:center;color:var(--muted)}.empty-chart-icon{width:55px;height:55px;display:flex;align-items:center;justify-content:center;margin:0 auto 12px;border-radius:50%;background:var(--soft);color:var(--primary);font-size:25px}
.empty-chart h3{color:var(--text);font-size:13px;margin-bottom:5px}.empty-chart p{font-size:10px}

.category-list{display:flex;flex-direction:column;gap:15px}.category-item{display:grid;grid-template-columns:35px 1fr auto;gap:10px;align-items:center}
.category-icon{width:32px;height:32px;display:flex;align-items:center;justify-content:center;border-radius:8px;background:var(--soft);color:var(--primary)}
.category-name{font-size:11px;font-weight:600}.category-progress{height:5px;background:var(--soft);border-radius:10px;overflow:hidden;margin-top:6px}
.category-progress span{display:block;height:100%;background:var(--primary);border-radius:inherit;width:0;transition:width .5s}.category-value{font-size:11px;font-weight:600}
.empty-state{min-height:160px;display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;color:var(--muted);gap:8px}.empty-state span,.empty-icon{font-size:28px;color:#94a3b8}.empty-state p{max-width:220px;font-size:10px;line-height:1.6}

.recent-panel{margin-bottom:25px}.recent-transactions{min-height:120px}.recent-item{display:flex;align-items:center;justify-content:space-between;padding:13px 0;border-bottom:1px solid var(--border)}
.recent-item:last-child{border-bottom:0}.recent-left{display:flex;align-items:center;gap:11px}.recent-icon{width:34px;height:34px;display:flex;align-items:center;justify-content:center;border-radius:8px;background:var(--soft);font-size:13px}
.recent-name{font-size:11px;font-weight:600}.recent-date{display:block;font-size:9px;color:var(--muted);margin-top:3px}.recent-amount{font-size:11px;font-weight:700}
.amount-income{color:var(--success)}.amount-expense{color:var(--danger)}

.page-heading{display:flex;justify-content:space-between;align-items:flex-end;gap:20px;margin-bottom:22px}.page-heading h2{font-size:24px;margin:4px 0 7px}.page-heading p{font-size:11px;color:var(--muted)}
.filters-panel{padding:15px;display:grid;grid-template-columns:1.7fr 1fr 1fr auto;gap:10px;margin-bottom:18px}.search-wrapper{position:relative}.search-wrapper span{position:absolute;left:12px;top:11px;color:var(--muted)}.search-wrapper input{padding-left:32px!important}

.table-panel{overflow:hidden}.table-wrapper{width:100%;overflow-x:auto}table{width:100%;border-collapse:collapse;min-width:700px}thead{background:var(--soft)}
th{padding:13px 18px;text-align:left;font-size:9px;text-transform:uppercase;letter-spacing:.6px;color:var(--muted)}td{padding:15px 18px;border-top:1px solid var(--border);font-size:11px}td:first-child{font-weight:600}
.type-badge{display:inline-block;padding:5px 8px;border-radius:20px;font-size:9px;font-weight:600}.type-income{background:#ecfdf3;color:#15803d}.type-expense{background:#fef2f2;color:#b91c1c}
.table-delete{border:0;background:transparent;color:var(--danger);font-size:14px}.table-empty{display:none;padding:60px 20px;text-align:center;color:var(--muted)}.table-empty div{font-size:35px;margin-bottom:10px}.table-empty h3{color:var(--text);font-size:14px;margin-bottom:5px}.table-empty p{font-size:10px}

.analytics-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:15px;margin-bottom:20px}.analytics-card{padding:22px}.analytics-card span{display:block;color:var(--muted);font-size:10px;margin-bottom:12px}.analytics-card strong{display:block;font-size:23px;margin-bottom:7px}.analytics-card small{color:var(--muted);font-size:9px}
.insights-panel{padding:25px}.insight-item{display:flex;align-items:flex-start;gap:12px;padding:14px 0;border-bottom:1px solid var(--border)}.insight-item:last-child{border-bottom:0}
.insight-icon{width:34px;height:34px;border-radius:8px;background:#eff6ff;color:var(--primary);display:flex;align-items:center;justify-content:center}.insight-item h4{font-size:11px;margin-bottom:4px}.insight-item p{color:var(--muted);font-size:10px;line-height:1.5}

.category-cards{display:grid;grid-template-columns:repeat(3,1fr);gap:16px}.category-card{background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);padding:20px;box-shadow:var(--shadow)}
.category-card-top{display:flex;align-items:center;justify-content:space-between}.category-card h3{font-size:13px;margin-top:12px}.category-card strong{display:block;margin-top:6px;font-size:20px}.category-card small{display:block;color:var(--muted);margin-top:5px;font-size:9px}

.app-footer{border-top:1px solid var(--border);margin-top:35px;padding:20px 0;display:flex;justify-content:space-between;color:var(--muted);font-size:9px}.app-footer strong{color:var(--text);margin-right:8px}
.toast{position:fixed;right:25px;bottom:25px;min-width:260px;padding:13px 16px;background:#111827;color:#fff;border-radius:9px;display:flex;align-items:center;gap:10px;box-shadow:0 15px 40px rgba(0,0,0,.2);transform:translateY(120px);opacity:0;pointer-events:none;transition:.3s;z-index:1000}
.toast.show{transform:translateY(0);opacity:1}.toast span{width:25px;height:25px;border-radius:50%;display:flex;align-items:center;justify-content:center;background:var(--success)}.toast p{font-size:11px}
.modal-overlay{position:fixed;inset:0;background:rgba(15,23,42,.55);display:none;align-items:center;justify-content:center;z-index:2000;padding:20px}.modal-overlay.show{display:flex}
.modal{width:100%;max-width:390px;background:var(--surface);color:var(--text);border-radius:15px;padding:30px;text-align:center;box-shadow:0 20px 70px rgba(0,0,0,.25)}
.modal-icon{width:48px;height:48px;border-radius:50%;margin:0 auto 15px;display:flex;align-items:center;justify-content:center;background:#fef2f2;color:var(--danger);font-weight:800}
.modal h2{font-size:17px;margin-bottom:8px}.modal p{font-size:11px;line-height:1.6;color:var(--muted)}.modal-actions{display:flex;justify-content:center;gap:10px;margin-top:22px}

@media(max-width:1150px){.summary-grid{grid-template-columns:repeat(2,1fr)}.analytics-grid{grid-template-columns:repeat(2,1fr)}.dashboard-grid{grid-template-columns:1fr}.category-cards{grid-template-columns:repeat(2,1fr)}}
@media(max-width:850px){.sidebar{width:220px;transform:translateX(-100%);transition:transform .3s}.sidebar.open{transform:translateX(0)}.main-content{width:100%;margin-left:0;padding:25px 20px}.mobile-menu{display:block}.filters-panel{grid-template-columns:1fr 1fr}.form-grid{grid-template-columns:1fr}}
@media(max-width:600px){.main-content{padding:20px 13px}.top-header{align-items:flex-start}.top-header h1{font-size:20px}.header-actions{gap:7px}.profile-info{display:none}.summary-grid,.analytics-grid,.category-cards{grid-template-columns:1fr}.quick-action{align-items:flex-start;flex-direction:column}.quick-action .primary-button,.page-heading .primary-button{width:100%}.filters-panel{grid-template-columns:1fr}.page-heading{align-items:flex-start;flex-direction:column}.app-footer{flex-direction:column;gap:8px}.transaction-form-panel,.chart-panel,.category-panel,.recent-panel,.insights-panel{padding:18px}.toast{left:13px;right:13px;bottom:15px;min-width:auto}}
@media(max-width:400px){.summary-card{padding:16px}.summary-card h2{font-size:19px}.profile{display:none}.form-actions{flex-direction:column}.form-actions button{width:100%}}
