:root {
    --brand-primary: #c47c2b; /* Bronze Gold */
    --brand-primary-light: #e5a55d;
    --bg-base: #fcfcfc;
    --bg-sidebar: #0f1115; /* Midnight Charcoal */
    --bg-card: #ffffff;
    --bg-card-alt: #f8f9fa;
    --text-primary: #1a1c20;
    --text-secondary: #4a4d55;
    --text-muted: #8e929b;
    --border: #eceef1;
    --color-expense: #ef4444;
    --color-income: #10b981;
    --shadow-sm: 0 2px 8px rgba(0,0,0,0.04);
    --shadow-md: 0 10px 30px rgba(0,0,0,0.08);
    --radius-md: 20px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg-base: #0f1115;
        --bg-card: #1a1c20;
        --bg-card-alt: #24272d;
        --text-primary: #fcfcfc;
        --text-secondary: #d1d5db;
        --text-muted: #9ca3af;
        --border: #2d3139;
        --shadow-sm: 0 4px 15px rgba(0,0,0,0.4);
        --shadow-md: 0 15px 40px rgba(0,0,0,0.6);
    }
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-font-smoothing: antialiased; }
body { font-family: 'Plus Jakarta Sans', sans-serif; background-color: var(--bg-base); color: var(--text-primary); line-height: 1.6; overflow-x: hidden; }

/* Typography */
.display-title { font-family: 'Playfair Display', serif; font-weight: 700; color: var(--text-primary); }
.nominal { font-family: 'Playfair Display', serif; font-weight: 700; letter-spacing: -1px; }

/* Layout */
#app-layout { display: flex; min-height: 100vh; }
#sidebar { width: 280px; background: var(--bg-sidebar); color: white; padding: 40px 24px; display: flex; flex-direction: column; position: fixed; height: 100vh; z-index: 1000; transition: var(--transition); }
#main-content { flex: 1; margin-left: 280px; padding: 60px; min-width: 0; }

/* Sidebar Premium Style */
.sidebar-logo { display: flex; align-items: center; gap: 15px; margin-bottom: 60px; padding: 0 10px; text-decoration: none; }
.sidebar-logo i { font-size: 1.5rem; color: var(--brand-primary); }
.sidebar-nav { display: flex; flex-direction: column; gap: 8px; }
.nav-item { 
    display: flex; align-items: center; gap: 14px; padding: 14px 18px; 
    border-radius: 14px; color: rgba(255,255,255,0.5); text-decoration: none; 
    font-weight: 600; font-size: 0.9rem; transition: var(--transition);
}
.nav-item i { width: 20px; transition: var(--transition); }
.nav-item:hover, .nav-item.active { color: white; background: rgba(255,255,255,0.05); }
.nav-item.active { background: var(--brand-primary); color: white; box-shadow: 0 10px 20px rgba(196,124,43,0.2); }
.nav-item.active i { transform: scale(1.1); }

/* Main Cards & Sections */
.section-card { background: var(--bg-card); border-radius: var(--radius-md); padding: 32px; border: 1px solid var(--border); box-shadow: var(--shadow-sm); transition: var(--transition); }
.section-card:hover { border-color: var(--brand-primary-light); box-shadow: var(--shadow-md); }
.section-title { font-size: 0.75rem; font-weight: 800; color: var(--brand-primary); letter-spacing: 2px; text-transform: uppercase; margin-bottom: 24px; display: flex; align-items: center; gap: 10px; }

/* Grid System */
.desktop-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(350px, 1fr)); gap: 32px; }

/* Dashboard Header */
.dashboard-header { background: var(--bg-sidebar); padding: 80px 60px 120px 60px; color: white; border-radius: 0 0 60px 60px; margin-bottom: 40px; text-align: center; }

/* Transaction Item */
.transaction-item { display: flex; align-items: center; gap: 20px; padding: 18px; border-radius: 18px; border: 1px solid transparent; transition: var(--transition); }
.transaction-item:hover { background: var(--bg-card-alt); border-color: var(--border); }
.cat-icon-wrapper { width: 48px; height: 48px; border-radius: 14px; display: flex; align-items: center; justify-content: center; font-size: 1.25rem; flex-shrink: 0; }

/* Forms */
.form-group label { display: block; font-size: 0.65rem; font-weight: 800; color: var(--text-muted); letter-spacing: 1.5px; text-transform: uppercase; margin-bottom: 10px; }
.form-control { width: 100%; padding: 16px 20px; border-radius: 16px; border: 1px solid var(--border); background: var(--bg-card-alt); font-family: inherit; font-weight: 600; font-size: 0.95rem; transition: var(--transition); }
.form-control:focus { outline: none; border-color: var(--brand-primary); background: white; box-shadow: 0 0 0 4px rgba(196,124,43,0.05); }

/* Buttons */
.btn-primary { background: var(--brand-primary); color: white; border: none; padding: 18px 32px; border-radius: 18px; font-weight: 800; font-size: 0.85rem; cursor: pointer; transition: var(--transition); display: flex; align-items: center; gap: 10px; justify-content: center; letter-spacing: 1px; text-transform: uppercase; }
.btn-primary:hover { background: var(--brand-primary-light); transform: translateY(-3px); box-shadow: 0 10px 20px rgba(196,124,43,0.2); }

/* Mobile Navigation Premium */
#mobile-nav { 
    display: none; position: fixed; bottom: 0; left: 0; right: 0; 
    background: white; border-top: 1px solid var(--border); 
    padding: 10px 15px 30px 15px; z-index: 2000; justify-content: space-around; align-items: center;
    box-shadow: 0 -10px 30px rgba(0,0,0,0.05);
}
.mobile-nav-item { 
    text-decoration: none; color: var(--text-muted); display: flex; flex-direction: column; 
    align-items: center; gap: 5px; transition: var(--transition); flex: 1;
}
.mobile-nav-item i { width: 22px; height: 22px; }
.mobile-nav-item span { font-size: 0.65rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.5px; }
.mobile-nav-item.active { color: var(--brand-primary); }
.mobile-nav-item.active i { transform: translateY(-3px); }

.mobile-fab-container { position: relative; width: 60px; height: 60px; margin-top: -45px; }
.mobile-fab { 
    background: var(--brand-primary); color: white; width: 60px; height: 60px; 
    border-radius: 50%; display: flex; align-items: center; justify-content: center; 
    box-shadow: 0 8px 25px rgba(196,124,43,0.4); border: 4px solid white; transition: var(--transition);
    text-decoration: none;
}
.mobile-fab:active { transform: scale(0.9) translateY(2px); }

/* Responsive */
@media (max-width: 1024px) {
    #sidebar { display: none; }
    #main-content { margin-left: 0; padding: 30px 20px 100px 20px; }
    #mobile-nav { display: flex; }
    .desktop-grid { grid-template-columns: 1fr; }
    .dashboard-header { padding: 60px 20px 100px 20px; }
}

/* Animations */
.fade-in { animation: fadeIn 0.8s ease-out forwards; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* Toast */
#toast-container { position: fixed; top: 30px; right: 30px; z-index: 9999; display: flex; flex-direction: column; gap: 10px; }
.toast { background: white; padding: 16px 24px; border-radius: 16px; box-shadow: var(--shadow-md); display: flex; align-items: center; gap: 12px; border-left: 4px solid var(--brand-primary); transform: translateX(100px); opacity: 0; transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55); }
.toast.show { transform: translateX(0); opacity: 1; }
.toast.success { border-left-color: var(--color-income); }
.toast.error { border-left-color: var(--color-expense); }
