@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=Outfit:wght@400;500;600;700;800&display=swap');

*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

:root {
    --bg-primary: #06080f;
    --bg-secondary: #0c1019;
    --bg-card: rgba(255, 255, 255, 0.04);
    --bg-card-hover: rgba(255, 255, 255, 0.07);
    --bg-input: rgba(255, 255, 255, 0.06);
    --bg-nav: rgba(10, 14, 26, 0.85);

    --accent-1: #00e59b;
    --accent-2: #00c4ff;
    --accent-gradient: linear-gradient(135deg, #00e59b, #00c4ff);
    --accent-gradient-r: linear-gradient(135deg, #00c4ff, #00e59b);

    --income: #00e59b;
    --expense: #f43f5e;
    --cash-wd: #f59e0b;

    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.55);
    --text-tertiary: rgba(255, 255, 255, 0.3);

    --border: rgba(255, 255, 255, 0.06);
    --border-light: rgba(255, 255, 255, 0.1);

    --radius-sm: 10px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --radius-xl: 28px;

    --nav-height: 72px;
    --shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    --shadow-glow: 0 0 60px rgba(0, 229, 155, 0.1);
}

html { scroll-behavior: smooth; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4 { font-family: 'Outfit', sans-serif; }

::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 4px; }

/* ===== APP SHELL ===== */
.app {
    max-width: 480px;
    margin: 0 auto;
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
}

.bg-orb {
    position: fixed;
    border-radius: 50%;
    filter: blur(100px);
    pointer-events: none;
    z-index: 0;
}
.bg-orb-1 { width: 300px; height: 300px; background: #00e59b; top: -100px; left: -80px; opacity: 0.08; }
.bg-orb-2 { width: 250px; height: 250px; background: #00c4ff; bottom: 50px; right: -60px; opacity: 0.06; }
.bg-orb-3 { width: 200px; height: 200px; background: #7c3aed; top: 40%; left: 50%; opacity: 0.04; }

/* ===== VIEWS ===== */
.views-container {
    position: relative;
    z-index: 1;
    padding-bottom: calc(var(--nav-height) + 30px);
}

.view {
    display: none;
    padding: 0 20px 20px;
    min-height: 100vh;
}
.view.active {
    display: block;
    animation: viewFadeIn 0.35s ease;
}

/* ===== BOTTOM NAV ===== */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 480px;
    height: var(--nav-height);
    background: var(--bg-nav);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-around;
    z-index: 100;
    padding: 0 8px;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    background: none;
    border: none;
    color: var(--text-tertiary);
    font-size: 0.65rem;
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    transition: all 0.25s ease;
    position: relative;
}
.nav-item i { font-size: 1.2rem; transition: all 0.25s ease; }
.nav-item.active { color: var(--accent-1); }
.nav-item.active::before {
    content: '';
    position: absolute;
    top: -1px;
    left: 50%;
    transform: translateX(-50%);
    width: 20px;
    height: 3px;
    background: var(--accent-gradient);
    border-radius: 0 0 4px 4px;
}
.nav-item:hover { color: var(--text-secondary); }

/* ===== FAB ===== */
.fab {
    position: fixed;
    bottom: calc(var(--nav-height) + 16px);
    right: calc(50% - 210px);
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: none;
    background: var(--accent-gradient);
    color: #06080f;
    font-size: 1.6rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 8px 30px rgba(0, 229, 155, 0.35);
    z-index: 99;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
}
.fab:hover { transform: scale(1.1); box-shadow: 0 12px 40px rgba(0, 229, 155, 0.45); }
.fab:active { transform: scale(0.95); }

@media (max-width: 480px) {
    .fab { right: 20px; }
}

/* ===== GLASS CARD ===== */
.glass-card {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    transition: all 0.3s ease;
}
.glass-card:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-light);
}

/* ===== GRADIENT TEXT ===== */
.gradient-text {
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ===== ONBOARDING ===== */
.onboarding-overlay {
    position: fixed;
    inset: 0;
    background: var(--bg-primary);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: viewFadeIn 0.5s ease;
}
.onboarding-overlay.hidden { display: none; }

.onboarding-card {
    width: 100%;
    max-width: 400px;
    text-align: center;
}
.onboarding-logo {
    font-family: 'Outfit', sans-serif;
    font-size: 4rem;
    font-weight: 800;
    letter-spacing: -2px;
    margin-bottom: 8px;
}
.onboarding-tagline {
    color: var(--text-secondary);
    font-size: 1.1rem;
    margin-bottom: 48px;
    font-weight: 300;
}
.onboarding-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
    text-align: left;
}
.onboarding-form label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-weight: 500;
    margin-bottom: -8px;
}
.onboarding-form input,
.onboarding-form select {
    width: 100%;
    padding: 14px 18px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 1rem;
    font-family: 'Inter', sans-serif;
    outline: none;
    transition: border-color 0.25s ease;
}
.onboarding-form input:focus,
.onboarding-form select:focus {
    border-color: var(--accent-1);
}
.onboarding-form select option { background: #1a1f2e; }

.btn-primary {
    width: 100%;
    padding: 16px;
    background: var(--accent-gradient);
    border: none;
    border-radius: var(--radius-md);
    color: #06080f;
    font-size: 1rem;
    font-weight: 700;
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    margin-top: 12px;
    transition: all 0.3s ease;
    letter-spacing: 0.5px;
}
.btn-primary:hover { opacity: 0.9; transform: translateY(-1px); box-shadow: 0 8px 30px rgba(0,229,155,0.3); }
.btn-primary:active { transform: scale(0.98); }

/* ===== DASHBOARD ===== */
.dash-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 50px 0 20px;
}
.dash-greeting { font-size: 0.9rem; color: var(--text-secondary); }
.dash-greeting strong { color: var(--text-primary); font-family: 'Outfit', sans-serif; font-size: 1.3rem; display: block; margin-top: 2px; }
.dash-date { font-size: 0.75rem; color: var(--text-tertiary); text-align: right; }
.dash-logo {
    font-family: 'Outfit', sans-serif;
    font-weight: 800;
    font-size: 1.3rem;
    letter-spacing: -1px;
}

.balance-card {
    background: var(--accent-gradient);
    border-radius: var(--radius-xl);
    padding: 32px 28px;
    margin: 8px 0 20px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 12px 40px rgba(0, 229, 155, 0.2);
}
.balance-card::before {
    content: '';
    position: absolute;
    top: -30px;
    right: -30px;
    width: 120px;
    height: 120px;
    background: rgba(255,255,255,0.1);
    border-radius: 50%;
}
.balance-card::after {
    content: '';
    position: absolute;
    bottom: -20px;
    left: 30%;
    width: 80px;
    height: 80px;
    background: rgba(255,255,255,0.06);
    border-radius: 50%;
}
.balance-label { font-size: 0.85rem; color: rgba(6,8,15,0.6); font-weight: 500; }
.balance-amount {
    font-family: 'Outfit', sans-serif;
    font-size: 2.8rem;
    font-weight: 800;
    color: #06080f;
    margin: 4px 0;
    letter-spacing: -1px;
}
.balance-change { font-size: 0.8rem; color: rgba(6,8,15,0.5); }
.balance-change i { margin-right: 4px; }

.stats-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 24px;
}
.stat-card {
    padding: 20px;
}
.stat-card .stat-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    margin-bottom: 12px;
}
.stat-card .stat-icon.income { background: rgba(0,229,155,0.12); color: var(--income); }
.stat-card .stat-icon.expense { background: rgba(244,63,94,0.12); color: var(--expense); }
.stat-card .stat-label { font-size: 0.75rem; color: var(--text-secondary); margin-bottom: 4px; }
.stat-card .stat-value { font-family: 'Outfit', sans-serif; font-size: 1.4rem; font-weight: 700; }
.stat-card .stat-value.income-val { color: var(--income); }
.stat-card .stat-value.expense-val { color: var(--expense); }

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
}
.section-title {
    font-family: 'Outfit', sans-serif;
    font-size: 1.1rem;
    font-weight: 600;
}
.section-link {
    font-size: 0.8rem;
    color: var(--accent-1);
    background: none;
    border: none;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    font-weight: 500;
}
.section-link:hover { text-decoration: underline; }

/* goals preview */
.goals-preview { margin-bottom: 24px; }
.goal-preview-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 0;
    border-bottom: 1px solid var(--border);
}
.goal-preview-item:last-child { border-bottom: none; }
.goal-preview-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    flex-shrink: 0;
}
.goal-preview-info { flex: 1; }
.goal-preview-name { font-size: 0.85rem; font-weight: 600; margin-bottom: 6px; }
.goal-preview-bar {
    width: 100%;
    height: 5px;
    background: rgba(255,255,255,0.06);
    border-radius: 10px;
    overflow: hidden;
}
.goal-preview-fill {
    height: 100%;
    border-radius: 10px;
    transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}
.goal-preview-pct {
    font-size: 0.75rem;
    font-weight: 600;
    flex-shrink: 0;
    width: 40px;
    text-align: right;
}

/* ===== TRANSACTION LIST ===== */
.tx-list { margin-bottom: 16px; }

.tx-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 0;
    border-bottom: 1px solid var(--border);
    cursor: default;
    transition: background 0.2s ease;
    animation: slideUp 0.3s ease backwards;
}
.tx-item:last-child { border-bottom: none; }

.tx-icon {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
}
.tx-info { flex: 1; min-width: 0; }
.tx-name {
    font-size: 0.9rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.tx-cat { font-size: 0.72rem; color: var(--text-secondary); margin-top: 2px; }
.tx-right { text-align: right; flex-shrink: 0; }
.tx-amount { font-family: 'Outfit', sans-serif; font-size: 0.95rem; font-weight: 700; }
.tx-amount.income { color: var(--income); }
.tx-amount.expense { color: var(--expense); }
.tx-amount.cash_withdrawal { color: var(--cash-wd); }
.tx-time { font-size: 0.68rem; color: var(--text-tertiary); margin-top: 2px; }

.empty-state {
    text-align: center;
    padding: 50px 20px;
    color: var(--text-tertiary);
}
.empty-state i { font-size: 3rem; margin-bottom: 16px; opacity: 0.3; }
.empty-state p { font-size: 0.9rem; }

/* ===== TRANSACTIONS VIEW ===== */
.search-bar {
    display: flex;
    align-items: center;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 0 16px;
    margin-bottom: 16px;
    transition: border-color 0.25s ease;
}
.search-bar:focus-within { border-color: var(--accent-1); }
.search-bar i { color: var(--text-tertiary); font-size: 0.9rem; }
.search-bar input {
    flex: 1;
    background: none;
    border: none;
    outline: none;
    padding: 14px 12px;
    color: var(--text-primary);
    font-size: 0.9rem;
    font-family: 'Inter', sans-serif;
}
.search-bar input::placeholder { color: var(--text-tertiary); }

.filter-chips {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    overflow-x: auto;
    padding-bottom: 4px;
    -ms-overflow-style: none;
    scrollbar-width: none;
}
.filter-chips::-webkit-scrollbar { display: none; }

.chip {
    padding: 8px 16px;
    border-radius: 20px;
    border: 1px solid var(--border);
    background: none;
    color: var(--text-secondary);
    font-size: 0.78rem;
    font-family: 'Inter', sans-serif;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.25s ease;
}
.chip.active {
    background: var(--accent-gradient);
    color: #06080f;
    border-color: transparent;
    font-weight: 600;
}
.chip:hover:not(.active) { border-color: var(--border-light); color: var(--text-primary); }

.tx-date-group {
    font-size: 0.75rem;
    color: var(--text-tertiary);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 16px 0 4px;
}

.tx-actions {
    display: flex;
    gap: 8px;
    margin-left: 8px;
}
.tx-action-btn {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: none;
    background: rgba(255,255,255,0.05);
    color: var(--text-tertiary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    transition: all 0.2s ease;
}
.tx-action-btn:hover { background: rgba(255,255,255,0.1); color: var(--text-primary); }
.tx-action-btn.delete:hover { background: rgba(244,63,94,0.15); color: var(--expense); }

/* ===== MODAL ===== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(6, 8, 15, 0.8);
    backdrop-filter: blur(8px);
    z-index: 200;
    display: none;
    align-items: flex-end;
    justify-content: center;
    animation: overlayIn 0.3s ease;
}
.modal-overlay.active { display: flex; }

.modal-sheet {
    width: 100%;
    max-width: 480px;
    max-height: 92vh;
    background: var(--bg-secondary);
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    padding: 12px 24px 32px;
    overflow-y: auto;
    animation: sheetSlideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}
.modal-handle {
    width: 40px;
    height: 4px;
    background: rgba(255,255,255,0.15);
    border-radius: 4px;
    margin: 0 auto 20px;
}
.modal-title {
    font-family: 'Outfit', sans-serif;
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 24px;
    text-align: center;
}

/* Type Toggle */
.type-toggle {
    display: flex;
    background: var(--bg-input);
    border-radius: var(--radius-md);
    padding: 4px;
    margin-bottom: 24px;
    gap: 4px;
}
.type-btn {
    flex: 1;
    padding: 12px;
    border: none;
    border-radius: 12px;
    background: none;
    color: var(--text-secondary);
    font-size: 0.82rem;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    transition: all 0.25s ease;
}
.type-btn.active { color: #06080f; }
.type-btn.active[data-type="income"] { background: var(--income); }
.type-btn.active[data-type="expense"] { background: var(--expense); }
.type-btn.active[data-type="cash_withdrawal"] { background: var(--cash-wd); }

/* Amount Input */
.amount-display {
    text-align: center;
    margin-bottom: 28px;
}
.amount-display .currency-symbol {
    font-size: 1.5rem;
    color: var(--text-secondary);
    font-weight: 600;
    vertical-align: super;
}
.amount-input {
    background: none;
    border: none;
    outline: none;
    font-family: 'Outfit', sans-serif;
    font-size: 3.5rem;
    font-weight: 800;
    color: var(--text-primary);
    text-align: center;
    width: 100%;
    caret-color: var(--accent-1);
}
.amount-input::placeholder { color: var(--text-tertiary); }

/* Category Grid */
.category-grid-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-weight: 500;
    margin-bottom: 12px;
}
.category-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-bottom: 24px;
}
.cat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 14px 4px;
    border-radius: var(--radius-md);
    border: 1.5px solid transparent;
    background: var(--bg-card);
    cursor: pointer;
    transition: all 0.2s ease;
}
.cat-item:hover { background: var(--bg-card-hover); }
.cat-item.selected {
    border-color: var(--accent-1);
    background: rgba(0, 229, 155, 0.08);
}
.cat-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
}
.cat-name { font-size: 0.65rem; color: var(--text-secondary); text-align: center; font-weight: 500; }

.form-group {
    margin-bottom: 16px;
}
.form-group label {
    display: block;
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-weight: 500;
    margin-bottom: 8px;
}
.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 14px 16px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 0.9rem;
    font-family: 'Inter', sans-serif;
    outline: none;
    transition: border-color 0.25s;
    resize: none;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus { border-color: var(--accent-1); }
.form-group select option { background: #1a1f2e; }

/* ===== GOALS VIEW ===== */
.period-tabs {
    display: flex;
    gap: 6px;
    margin-bottom: 20px;
    background: var(--bg-input);
    border-radius: var(--radius-md);
    padding: 4px;
}
.period-tab {
    flex: 1;
    padding: 10px;
    border: none;
    border-radius: 12px;
    background: none;
    color: var(--text-secondary);
    font-size: 0.78rem;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    transition: all 0.25s ease;
}
.period-tab.active {
    background: var(--accent-gradient);
    color: #06080f;
}

.goal-card {
    margin-bottom: 14px;
    padding: 20px;
    position: relative;
}
.goal-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 14px;
}
.goal-name { font-weight: 600; font-size: 0.95rem; }
.goal-period-badge {
    font-size: 0.65rem;
    padding: 4px 10px;
    border-radius: 20px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.goal-amounts {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 10px;
}
.goal-amounts .spent { font-weight: 600; color: var(--text-primary); }
.goal-bar {
    width: 100%;
    height: 8px;
    background: rgba(255,255,255,0.06);
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 8px;
}
.goal-bar-fill {
    height: 100%;
    border-radius: 10px;
    transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}
.goal-bar-fill.safe { background: var(--income); }
.goal-bar-fill.warning { background: var(--cash-wd); }
.goal-bar-fill.danger { background: var(--expense); }

.goal-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.goal-pct { font-size: 0.8rem; font-weight: 700; }
.goal-remaining { font-size: 0.72rem; color: var(--text-secondary); }
.goal-delete-btn {
    background: none;
    border: none;
    color: var(--text-tertiary);
    cursor: pointer;
    font-size: 0.8rem;
    padding: 4px 8px;
    border-radius: 6px;
    transition: all 0.2s;
}
.goal-delete-btn:hover { color: var(--expense); background: rgba(244,63,94,0.1); }

.add-goal-btn {
    width: 100%;
    padding: 16px;
    border: 2px dashed var(--border-light);
    border-radius: var(--radius-lg);
    background: none;
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-family: 'Inter', sans-serif;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.25s ease;
    margin-top: 8px;
}
.add-goal-btn:hover { border-color: var(--accent-1); color: var(--accent-1); background: rgba(0,229,155,0.04); }
.add-goal-btn i { margin-right: 8px; }

/* ===== ANALYTICS VIEW ===== */
.analytics-period-selector {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
}
.analytics-period-btn {
    padding: 8px 18px;
    border: 1px solid var(--border);
    border-radius: 20px;
    background: none;
    color: var(--text-secondary);
    font-size: 0.8rem;
    font-family: 'Inter', sans-serif;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.25s ease;
}
.analytics-period-btn.active {
    background: var(--accent-gradient);
    color: #06080f;
    border-color: transparent;
    font-weight: 600;
}

.analytics-summary {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 10px;
    margin-bottom: 24px;
}
.analytics-stat {
    padding: 16px 12px;
    text-align: center;
}
.analytics-stat .label { font-size: 0.7rem; color: var(--text-secondary); margin-bottom: 6px; }
.analytics-stat .value { font-family: 'Outfit', sans-serif; font-size: 1.1rem; font-weight: 700; }

.chart-container {
    margin-bottom: 24px;
    padding: 20px;
}
.chart-title {
    font-family: 'Outfit', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 20px;
}
.chart-canvas-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}
.chart-canvas-wrap canvas { max-width: 100%; }

.chart-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 16px;
}
.legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.75rem;
    color: var(--text-secondary);
}
.legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.top-categories { margin-bottom: 16px; }
.top-cat-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
}
.top-cat-item:last-child { border-bottom: none; }
.top-cat-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    flex-shrink: 0;
}
.top-cat-info { flex: 1; }
.top-cat-name { font-size: 0.85rem; font-weight: 600; }
.top-cat-bar {
    height: 4px;
    background: rgba(255,255,255,0.06);
    border-radius: 4px;
    margin-top: 6px;
    overflow: hidden;
}
.top-cat-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.6s ease;
}
.top-cat-amount {
    font-family: 'Outfit', sans-serif;
    font-size: 0.9rem;
    font-weight: 700;
    flex-shrink: 0;
}

/* ===== SETTINGS VIEW ===== */
.settings-section {
    margin-bottom: 24px;
}
.settings-section-title {
    font-size: 0.72rem;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
    margin-bottom: 12px;
    padding-left: 4px;
}
.settings-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px;
    margin-bottom: 6px;
    cursor: pointer;
    transition: background 0.2s;
}
.settings-item:hover { background: var(--bg-card-hover); }

.settings-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    flex-shrink: 0;
}
.settings-item-info { flex: 1; }
.settings-item-label { font-size: 0.9rem; font-weight: 500; }
.settings-item-desc { font-size: 0.72rem; color: var(--text-secondary); margin-top: 2px; }
.settings-item-value {
    font-size: 0.8rem;
    color: var(--text-secondary);
    flex-shrink: 0;
}
.settings-item .badge-soon {
    font-size: 0.6rem;
    padding: 3px 8px;
    border-radius: 12px;
    background: rgba(124, 58, 237, 0.15);
    color: #a78bfa;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.settings-item select {
    padding: 8px 12px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    font-size: 0.8rem;
    outline: none;
}
.settings-item select option { background: #1a1f2e; }

.btn-danger {
    width: 100%;
    padding: 14px;
    background: rgba(244, 63, 94, 0.1);
    border: 1px solid rgba(244, 63, 94, 0.2);
    border-radius: var(--radius-md);
    color: var(--expense);
    font-size: 0.9rem;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    transition: all 0.25s;
}
.btn-danger:hover { background: rgba(244, 63, 94, 0.18); }

.btn-outline {
    width: 100%;
    padding: 14px;
    background: none;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 0.9rem;
    font-weight: 500;
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    transition: all 0.25s;
}
.btn-outline:hover { background: var(--bg-card); border-color: var(--accent-1); color: var(--accent-1); }

.app-about {
    text-align: center;
    padding: 30px 20px;
    color: var(--text-tertiary);
}
.app-about .about-logo {
    font-family: 'Outfit', sans-serif;
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 4px;
}
.app-about .about-tagline { font-size: 0.85rem; margin-bottom: 4px; }
.app-about .about-version { font-size: 0.7rem; }

/* ===== TOAST ===== */
.toast-container {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 300;
    width: 100%;
    max-width: 400px;
    padding: 0 20px;
    pointer-events: none;
}
.toast {
    background: rgba(30, 40, 60, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: 14px 20px;
    font-size: 0.85rem;
    font-weight: 500;
    text-align: center;
    animation: toastIn 0.35s ease, toastOut 0.35s ease 2.5s forwards;
    pointer-events: auto;
}
.toast.success { border-color: rgba(0,229,155,0.3); color: var(--income); }
.toast.error { border-color: rgba(244,63,94,0.3); color: var(--expense); }
.toast.info { border-color: rgba(0,196,255,0.3); color: var(--accent-2); }

/* ===== ANIMATIONS ===== */
@keyframes viewFadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes sheetSlideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}
@keyframes overlayIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
@keyframes slideUp {
    from { opacity: 0; transform: translateY(16px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes toastIn {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes toastOut {
    from { opacity: 1; transform: translateY(0); }
    to { opacity: 0; transform: translateY(-20px); }
}
@keyframes pulse {
    0%, 100% { box-shadow: 0 8px 30px rgba(0, 229, 155, 0.35); }
    50% { box-shadow: 0 8px 50px rgba(0, 229, 155, 0.55); }
}
@keyframes countUp {
    from { opacity: 0; transform: scale(0.8); }
    to { opacity: 1; transform: scale(1); }
}

.fab { animation: pulse 3s ease infinite; }

/* ===== VIEW HEADERS ===== */
.view-header {
    padding: 50px 0 20px;
}
.view-header h1 {
    font-size: 1.6rem;
    font-weight: 700;
}

/* ===== RESPONSIVE ===== */
@media (min-width: 481px) {
    body { background: #030408; }
    .app {
        border-left: 1px solid var(--border);
        border-right: 1px solid var(--border);
        background: var(--bg-primary);
    }
}

@media (max-width: 380px) {
    .category-grid { grid-template-columns: repeat(3, 1fr); }
    .balance-amount { font-size: 2.2rem; }
    .amount-input { font-size: 2.8rem; }
    .analytics-summary { grid-template-columns: 1fr; gap: 8px; }
}
