/* ============================================================
   MY PROJECT — Expense Tracker
   Mobile-first responsive · Dark/Light themes
   ============================================================ */

/* ---------- Design Tokens ---------- */
:root {
    /* Light theme (default) */
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --secondary: #a855f7;
    --accent: #22d3ee;

    --bg: #f1f5f9;
    --surface: #ffffff;
    --surface-2: #f8fafc;
    --card: #ffffff;
    --text: #1e293b;
    --text-muted: #64748b;
    --border: #e2e8f0;

    --income: #10b981;
    --expense: #ef4444;
    --income-soft: rgba(16, 185, 129, 0.12);
    --expense-soft: rgba(239, 68, 68, 0.12);

    --gradient-main: linear-gradient(135deg, #6366f1 0%, #a855f7 100%);
    --gradient-hero: linear-gradient(160deg, #4f46e5 0%, #7c3aed 60%, #a855f7 100%);
    --gradient-balance: linear-gradient(135deg, #6366f1 0%, #a855f7 100%);

    --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.08);
    --shadow-md: 0 6px 20px rgba(15, 23, 42, 0.10);
    --shadow-lg: 0 16px 40px rgba(15, 23, 42, 0.16);

    --radius-sm: 10px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --radius-full: 999px;

    --font-sans: 'Segoe UI', system-ui, -apple-system, sans-serif;
    --container: 1140px;
    --nav-height: 60px;
    --section-pad: clamp(24px, 4vw, 40px);

    --navbar-bg: rgba(255, 255, 255, 0.85);
    --navbar-text: #1e293b;
    --nav-link-color: rgba(30, 41, 59, 0.7);
    --nav-border: rgba(30, 41, 59, 0.08);

    color-scheme: light;
}

/* Dark theme */
[data-theme="dark"] {
    --bg: #0f172a;
    --surface: #1e293b;
    --surface-2: #16213e;
    --card: #1e293b;
    --text: #e2e8f0;
    --text-muted: #94a3b8;
    --border: #334155;

    --income-soft: rgba(16, 185, 129, 0.16);
    --expense-soft: rgba(239, 68, 68, 0.16);

    --gradient-hero: linear-gradient(160deg, #1e1b4b 0%, #312e81 55%, #4c1d95 100%);

    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 6px 20px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.5);

    --navbar-bg: rgba(15, 23, 42, 0.85);
    --navbar-text: #e2e8f0;
    --nav-link-color: rgba(226, 232, 240, 0.7);
    --nav-border: rgba(255, 255, 255, 0.08);

    color-scheme: dark;
}

/* ---------- Reset & Base ---------- */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: var(--nav-height);
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-sans);
    color: var(--text);
    background: var(--bg);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
    transition: background 0.3s ease, color 0.3s ease;
}

img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, select, textarea { font-family: inherit; font-size: 1rem; color: var(--text); }

.container {
    width: 100%;
    max-width: var(--container);
    margin-inline: auto;
    padding-inline: clamp(16px, 4vw, 24px);
}

/* ---------- Typography Helpers ---------- */
.gradient-text {
    background: var(--gradient-main);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.section-title-sm {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 16px;
}

.section-head-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}

.section-head-row .section-title-sm { margin-bottom: 0; }

.results-count {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-muted);
    background: var(--surface-2);
    border: 1px solid var(--border);
    padding: 4px 12px;
    border-radius: var(--radius-full);
    white-space: nowrap;
}

/* ============================================================
   NAVBAR
   ============================================================ */
.navbar {
    position: sticky;
    top: 0;
    z-index: 1000;
    height: var(--nav-height);
    display: flex;
    align-items: center;
    background: var(--navbar-bg);
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--nav-border);
    transition: background 0.3s ease;
}

.nav-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo-mark { width: 32px; height: 32px; }

.logo-text {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--navbar-text);
    letter-spacing: -0.02em;
}

.logo-text span { color: var(--primary); }

/* Theme toggle */
.theme-toggle {
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-full);
    background: var(--surface-2);
    border: 1px solid var(--border);
    transition: background 0.25s ease, transform 0.25s ease;
}

.theme-toggle:hover {
    transform: rotate(15deg);
    background: var(--surface);
}

.theme-toggle svg {
    width: 20px;
    height: 20px;
}

.icon-sun { display: none; }
.icon-moon { display: block; }

[data-theme="dark"] .icon-sun { display: block; }
[data-theme="dark"] .icon-moon { display: none; }

/* ============================================================
   MAIN LAYOUT
   ============================================================ */
.main {
    max-width: var(--container);
    margin-inline: auto;
    padding: 16px clamp(16px, 4vw, 24px) 120px;
}

.section {
    margin-top: 24px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: clamp(18px, 3.5vw, 28px);
    box-shadow: var(--shadow-sm);
}

/* ============================================================
   BALANCE CARD
   ============================================================ */
.balance-card {
    background: var(--gradient-balance);
    border-radius: var(--radius-lg);
    padding: clamp(24px, 5vw, 36px);
    color: #fff;
    box-shadow: 0 16px 40px rgba(99, 102, 241, 0.35);
    position: relative;
    overflow: hidden;
}

.balance-card::before,
.balance-card::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.12);
}

.balance-card::before {
    width: 220px;
    height: 220px;
    top: -90px;
    right: -70px;
}

.balance-card::after {
    width: 160px;
    height: 160px;
    bottom: -70px;
    left: -40px;
}

.balance-label {
    position: relative;
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    opacity: 0.85;
    margin-bottom: 6px;
}

.balance-value {
    position: relative;
    font-size: clamp(2rem, 8vw, 2.8rem);
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.2;
    margin-bottom: 16px;
}

.balance-breakup {
    position: relative;
    display: flex;
    flex-wrap: wrap;
    gap: 12px 24px;
}

.breakup-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.9rem;
    font-weight: 500;
    opacity: 0.92;
}

.breakup-item svg {
    width: 16px;
    height: 16px;
}

.breakup-income { color: #d1fae5; }
.breakup-expense { color: #fee2e2; }

/* ============================================================
   MONTH NAV + SUMMARY
   ============================================================ */
.month-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 20px;
}

.month-btn {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-full);
    background: var(--surface-2);
    border: 1px solid var(--border);
    color: var(--text);
    transition: background 0.25s ease, transform 0.25s ease;
}

.month-btn:hover {
    background: var(--primary);
    color: #fff;
    transform: scale(1.05);
}

.month-btn svg { width: 18px; height: 18px; }

.month-label {
    font-size: clamp(1rem, 3.5vw, 1.2rem);
    font-weight: 700;
    color: var(--text);
    text-align: center;
    flex: 1;
}

.month-context {
    font-size: 0.82rem;
    color: var(--text-muted);
    text-align: center;
    margin: -8px 0 16px;
}

.summary-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.summary-card {
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 14px 10px;
    text-align: center;
    transition: transform 0.25s ease;
}

.summary-card:hover { transform: translateY(-2px); }

.summary-label {
    display: block;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.summary-value {
    font-size: clamp(0.95rem, 3vw, 1.15rem);
    font-weight: 700;
    color: var(--text);
    word-break: break-word;
}

.summary-income { color: var(--income); }
.summary-expense { color: var(--expense); }

.today-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px dashed var(--border);
}

.today-label {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-muted);
}

.today-value {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--expense);
}

/* ============================================================
   CHARTS
   ============================================================ */
.charts-section .section-title-sm { margin-bottom: 0; }

.chart-month {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-muted);
    background: var(--surface-2);
    border: 1px solid var(--border);
    padding: 4px 12px;
    border-radius: var(--radius-full);
    white-space: nowrap;
}

.charts-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    margin-top: 20px;
}

.chart-card {
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 18px;
    text-align: center;
}

.chart-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 14px;
    text-align: left;
}

/* Doughnut wrapper (canvas + tooltip overlay) */
.doughnut-wrap {
    position: relative;
    max-width: 260px;
    margin: 0 auto;
}

#categoryChart {
    width: 100%;
    height: auto;
    display: block;
    cursor: pointer;
}

.chart-tooltip {
    position: absolute;
    pointer-events: none;
    background: rgba(15, 23, 42, 0.92);
    color: #fff;
    font-size: 0.78rem;
    font-weight: 600;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-md);
    white-space: nowrap;
    z-index: 10;
    transform: translate(-50%, -110%);
    transition: opacity 0.15s ease;
}

.chart-tooltip[hidden] { display: none; }

.chart-legend {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px 14px;
    margin-top: 14px;
}

.legend-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text);
}

.legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 3px;
    flex-shrink: 0;
}

.legend-pct {
    color: var(--text-muted);
    font-weight: 600;
}

.chart-empty {
    font-size: 0.9rem;
    color: var(--text-muted);
    padding: 40px 0 10px;
}

/* Bar chart (income vs expense, 7 days) */
.bar-chart {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 6px;
    min-height: 180px;
    padding-top: 20px;
    position: relative;
}

.bar-col {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    min-width: 0;
}

.bar-pair {
    display: flex;
    align-items: flex-end;
    gap: 3px;
    height: 120px;
    flex: 1;
    justify-content: center;
}

.bar-fill {
    width: 100%;
    max-width: 16px;
    border-radius: 4px 4px 2px 2px;
    min-height: 2px;
    transition: height 0.6s ease;
}

.bar-income { background: var(--income); }
.bar-expense { background: var(--expense); }

.bar-value {
    font-size: 0.6rem;
    font-weight: 600;
    color: var(--text-muted);
    white-space: nowrap;
}

.bar-label {
    font-size: 0.68rem;
    font-weight: 500;
    color: var(--text-muted);
    white-space: nowrap;
}

.bar-legend {
    display: flex;
    justify-content: center;
    gap: 18px;
    margin-top: 14px;
}

.bar-legend-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--text-muted);
}

.bar-legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 3px;
}

/* ============================================================
   TOOLBAR (search + filters)
   ============================================================ */
.history-section {
    background: var(--surface-2);
}
.toolbar {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 18px;
}

.search-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.search-wrap svg {
    position: absolute;
    left: 14px;
    width: 18px;
    height: 18px;
    color: var(--text-muted);
    pointer-events: none;
}

.search-wrap input {
    width: 100%;
    padding: 12px 14px 12px 42px;
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
    background: var(--surface-2);
    outline: none;
    transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.search-wrap input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.filter-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.filter-row select {
    width: 100%;
    padding: 11px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface-2);
    outline: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 34px;
    cursor: pointer;
    transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.filter-row select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

/* ============================================================
   TRANSACTION LIST
   ============================================================ */
.txn-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.date-group-label {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    padding: 14px 4px 4px;
}

.txn-item {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 12px 14px;
    animation: slideIn 0.35s ease;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.txn-item:hover {
    transform: translateX(4px);
    box-shadow: var(--shadow-sm);
}

.txn-icon {
    width: 42px;
    height: 42px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    font-size: 1.2rem;
}

.txn-info {
    flex: 1;
    min-width: 0;
}

.txn-note {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
    min-width: 0;
}

.txn-top {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.txn-type-pill {
    flex-shrink: 0;
    font-size: 0.6rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    padding: 3px 8px;
    border-radius: var(--radius-full);
}

.pill-income {
    background: var(--income-soft);
    color: var(--income);
}

.pill-expense {
    background: var(--expense-soft);
    color: var(--expense);
}

.txn-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 2px;
}

.txn-dot {
    color: var(--text-muted);
    font-size: 0.8rem;
    opacity: 0.7;
}

.txn-date {
    font-size: 0.78rem;
    color: var(--text-muted);
}

.txn-income {
    border-left: 3px solid var(--income);
}

.txn-item:not(.txn-income) {
    border-left: 3px solid var(--expense);
}

.txn-category {
    font-size: 0.78rem;
    color: var(--text-muted);
}

.txn-amount {
    font-size: 0.98rem;
    font-weight: 700;
    white-space: nowrap;
}

.amount-expense { color: var(--expense); }
.amount-income { color: var(--income); }

.txn-delete {
    width: 34px;
    height: 34px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    transition: background 0.25s ease, color 0.25s ease;
}

.txn-delete:hover {
    background: var(--expense-soft);
    color: var(--expense);
}

.txn-delete svg { width: 17px; height: 17px; }

/* Empty state */
.empty-state {
    text-align: center;
    padding: 48px 20px;
    color: var(--text-muted);
}

.empty-state svg {
    width: 56px;
    height: 56px;
    margin: 0 auto 14px;
    color: var(--text-muted);
    opacity: 0.5;
}

.empty-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 6px;
}

.empty-text {
    font-size: 0.9rem;
    max-width: 280px;
    margin: 0 auto 18px;
}

.btn-ghost-sm {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 18px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--primary);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
    transition: background 0.25s ease, border-color 0.25s ease;
}

.btn-ghost-sm:hover {
    background: var(--surface-2);
    border-color: var(--primary);
}

/* ============================================================
   FLOATING ACTION BUTTON
   ============================================================ */
.fab {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 900;
    width: 58px;
    height: 58px;
    border-radius: var(--radius-full);
    background: var(--gradient-main);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 28px rgba(99, 102, 241, 0.45);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.fab:hover {
    transform: translateY(-3px) scale(1.04);
    box-shadow: 0 14px 34px rgba(99, 102, 241, 0.55);
}

.fab:active { transform: scale(0.96); }

.fab svg { width: 26px; height: 26px; }

/* ============================================================
   MODAL
   ============================================================ */
.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 1100;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    background: rgba(15, 23, 42, 0.55);
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
    animation: fadeIn 0.25s ease;
}

.modal-overlay[hidden] { display: none; }

.modal {
    width: 100%;
    max-width: 560px;
    background: var(--surface);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    padding: 24px 20px calc(24px + env(safe-area-inset-bottom));
    animation: slideUp 0.35s cubic-bezier(0.22, 1, 0.36, 1);
    max-height: 92svh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.modal-header h3 {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text);
}

.modal-close {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-full);
    background: var(--surface-2);
    border: 1px solid var(--border);
    color: var(--text-muted);
    transition: background 0.25s ease, color 0.25s ease;
}

.modal-close:hover {
    background: var(--expense-soft);
    color: var(--expense);
}

.modal-close svg { width: 18px; height: 18px; }

/* Type toggle */
.type-toggle {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    padding: 5px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
    margin-bottom: 20px;
}

.type-btn {
    padding: 11px 0;
    border-radius: var(--radius-full);
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-muted);
    transition: background 0.25s ease, color 0.25s ease, box-shadow 0.25s ease;
}

.type-btn.active {
    color: #fff;
    box-shadow: var(--shadow-sm);
}

.type-expense.active { background: var(--expense); }
.type-income.active { background: var(--income); }

/* Form fields */
.form-field {
    margin-bottom: 16px;
}

.form-field label {
    display: block;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.form-field input,
.form-field select {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface-2);
    outline: none;
    transition: border-color 0.25s ease, box-shadow 0.25s ease;
    appearance: none;
}

.form-field select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 34px;
    cursor: pointer;
}

.form-field input:focus,
.form-field select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.form-error {
    min-height: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--expense);
    margin-bottom: 10px;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 13px 28px;
    font-size: 0.98rem;
    font-weight: 600;
    border-radius: var(--radius-full);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.btn-primary {
    background: var(--gradient-main);
    color: #fff;
    box-shadow: 0 8px 20px rgba(99, 102, 241, 0.35);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 28px rgba(99, 102, 241, 0.5);
}

.btn-block {
    width: 100%;
    padding: 14px;
    margin-top: 4px;
}

/* ============================================================
   FOOTER
   ============================================================ */
.footer {
    background: var(--surface);
    border-top: 1px solid var(--border);
    color: var(--text-muted);
    padding: 20px 0 calc(20px + env(safe-area-inset-bottom));
    font-size: 0.85rem;
}

.footer-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    text-align: center;
}

.footer-note { font-size: 0.78rem; opacity: 0.85; }

/* ============================================================
   ANIMATIONS
   ============================================================ */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from { transform: translateY(60px); opacity: 0.6; }
    to { transform: translateY(0); opacity: 1; }
}

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

.reveal {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ============================================================
   RESPONSIVE — Mobile-first
   ============================================================ */

/* Tablet (≥768px) */
@media (min-width: 768px) {
    .charts-grid {
        grid-template-columns: 1fr 1fr;
    }

    .modal {
        border-radius: var(--radius-lg);
        margin-bottom: 24px;
        padding: 28px;
    }
}

/* Desktop (≥1024px) */
@media (min-width: 1024px) {
    .main {
        padding-top: 28px;
    }

    .toolbar {
        flex-direction: row;
        align-items: center;
        gap: 14px;
    }

    .search-wrap { flex: 1; }

    .filter-row {
        grid-template-columns: auto auto;
        gap: 10px;
    }

    .filter-row select { width: auto; min-width: 150px; }
}

/* ============================================================
   REDUCED MOTION
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .reveal {
        opacity: 1;
        transform: none;
    }
}
.txn-edit {
    width: 34px;
    height: 34px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    transition: background 0.25s ease, color 0.25s ease;
}

.txn-edit:hover {
    background: var(--surface-2);
    color: var(--text);
}

.txn-edit svg { width: 17px; height: 17px; }
