@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@500;600;700&family=Outfit:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
    --bg-base: #f7f8fc;
    --bg-panel: #ffffff;
    --bg-card: #ffffff;
    --bg-card-alt: #f5f6fa;
    --bg-table-head: #f8f9fd;
    --bg-table-hover: #f4f5fb;
    --bg-input: #f8f9fd;
    --bg-nav: rgba(255,255,255,0.96);
    --bg-modal: rgba(15,15,30,0.5);

    --text-primary: #0d0f1a;
    --text-secondary: #4a4e6a;
    --text-muted: #9196b0;
    --text-placeholder: #b8bbcc;
    --text-inverse: #ffffff;

    --border: #e8eaf4;
    --border-focus: #1e3a8a;
    --border-strong: #d0d4e8;

    --accent: #1e3a8a;
    --accent-2: #2563eb;
    --accent-light: #eff4ff;
    --accent-hover: #1e40af;
    --accent-soft: #eff4ff;
    --accent-gradient: linear-gradient(135deg, #1e3a8a 0%, #2563eb 100%);

    --income: #0d9461;
    --income-bg: #ecfdf5;
    --income-border: #a7f3d0;
    --expense: #dc2626;
    --expense-bg: #fff1f2;
    --expense-border: #fecdd3;

    --balance-bg: linear-gradient(135deg, #0d0f1a 0%, #1e3a8a 100%);
    --balance-text: #ffffff;

    --shadow-xs: 0 1px 3px rgba(30,58,138,0.06);
    --shadow-sm: 0 2px 12px rgba(30,58,138,0.08);
    --shadow-md: 0 6px 24px rgba(30,58,138,0.10);
    --shadow-lg: 0 16px 48px rgba(30,58,138,0.12);
    --shadow-glow: 0 4px 20px rgba(37,99,235,0.18);

    --radius-sm: 10px;
    --radius-md: 16px;
    --radius-lg: 22px;
    --radius-xl: 28px;

    --font-display: 'Playfair Display', Georgia, serif;
    --font-body: 'Outfit', system-ui, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
}

body.dark-mode {
    --bg-base: #090b14;
    --bg-panel: #0f1220;
    --bg-card: #141828;
    --bg-card-alt: #0f1220;
    --bg-table-head: #0f1220;
    --bg-table-hover: #1a1f35;
    --bg-input: #0f1220;
    --bg-nav: rgba(14,17,32,0.97);
    --bg-modal: rgba(0,0,0,0.75);

    --text-primary: #e8eaf4;
    --text-secondary: #8890b0;
    --text-muted: #525870;
    --text-placeholder: #363b55;
    --text-inverse: #0d0f1a;

    --border: #1e2440;
    --border-focus: #60a5fa;
    --border-strong: #252c48;

    --accent: #60a5fa;
    --accent-2: #3b82f6;
    --accent-light: #1a2240;
    --accent-hover: #93c5fd;
    --accent-soft: #1a2240;
    --accent-gradient: linear-gradient(135deg, #1e3a8a 0%, #3b82f6 100%);

    --income: #10b981;
    --income-bg: #052e1c;
    --income-border: #065f46;
    --expense: #f87171;
    --expense-bg: #2d0a0a;
    --expense-border: #7f1d1d;

    --balance-bg: linear-gradient(135deg, #1e3a8a 0%, #2563eb 100%);
    --balance-text: #ffffff;

    --shadow-xs: 0 1px 3px rgba(0,0,0,0.3);
    --shadow-sm: 0 2px 12px rgba(0,0,0,0.35);
    --shadow-md: 0 6px 24px rgba(0,0,0,0.4);
    --shadow-lg: 0 16px 48px rgba(0,0,0,0.5);
    --shadow-glow: 0 4px 20px rgba(59,130,246,0.25);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: var(--font-body);
    background: var(--bg-base);
    color: var(--text-primary);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    transition: background 0.3s ease, color 0.3s ease;
    background-image: radial-gradient(ellipse at 80% 10%, rgba(37,99,235,0.04) 0%, transparent 60%),
                      radial-gradient(ellipse at 10% 90%, rgba(14,165,233,0.03) 0%, transparent 60%);
}

.app-container {
    max-width: 820px;
    margin: 0 auto;
    padding: 28px 20px 96px;
    position: relative;
}

.main-panel {
    background: var(--bg-panel);
    border-radius: var(--radius-xl);
    padding: 32px;
    margin-bottom: 20px;
    min-height: 70vh;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border);
    transition: background 0.3s ease, border-color 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes modalSlideIn {
    from { transform: translateY(-30px); opacity: 0; }
    to   { transform: translateY(0); opacity: 1; }
}
@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50%       { transform: scale(1.02); }
}

.view { display: none; animation: fadeIn 0.3s ease; }
.view.active-view { display: block; }

.view-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 28px;
    flex-wrap: wrap;
    gap: 14px;
}
.view-header h2 {
    font-family: var(--font-display);
    font-size: 1.65rem;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: -0.01em;
    display: flex;
    align-items: center;
    gap: 10px;
}
.view-header h2 i { color: var(--accent-2); font-size: 1.3rem; }

.dashboard-header { margin-bottom: 24px; }
.dashboard-header h2 {
    font-family: var(--font-display);
    font-size: 1.65rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    display: flex;
    align-items: center;
    gap: 10px;
}
.dashboard-header h2 i { color: var(--accent-2); }
.greeting {
    font-size: 0.88rem;
    color: var(--text-muted);
    margin-top: 4px;
    font-weight: 400;
}

.glass-card,
.stat-card,
.form-card,
.chart-box,
.profile-card,
.recent-section,
.table-wrapper {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    transition: background 0.3s ease, border-color 0.3s ease, box-shadow 0.2s ease;
}
.glass-card { padding: 22px; }

.stats-row {
    display: grid;
    grid-template-columns: 1fr 200px;
    gap: 16px;
    margin-bottom: 20px;
    align-items: stretch;
}
.balance-card {
    background: var(--balance-bg);
    color: var(--balance-text);
    border-color: transparent;
    padding: 28px 26px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-glow);
    position: relative;
    overflow: hidden;
}
.balance-card::before {
    content: '';
    position: absolute;
    top: -30px; right: -30px;
    width: 140px; height: 140px;
    border-radius: 50%;
    background: rgba(255,255,255,0.06);
    pointer-events: none;
}
.balance-card::after {
    content: '';
    position: absolute;
    bottom: -50px; left: 40px;
    width: 180px; height: 180px;
    border-radius: 50%;
    background: rgba(255,255,255,0.04);
    pointer-events: none;
}
.balance-info .balance-label {
    font-size: 0.72rem;
    opacity: 0.65;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-weight: 600;
}
.balance-info h1 {
    font-family: var(--font-display);
    font-size: 2.4rem;
    font-weight: 700;
    margin: 6px 0 10px;
    letter-spacing: -0.02em;
}
.change-indicator {
    font-size: 0.82rem;
    opacity: 0.85;
    display: flex;
    align-items: center;
    gap: 5px;
    font-weight: 500;
}
.pie-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 14px;
}
.pie-card canvas { max-width: 170px !important; max-height: 170px !important; }

.two-col-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin-bottom: 20px;
}
.stat-card {
    padding: 18px 20px;
    display: flex;
    align-items: center;
    gap: 14px;
    border-radius: var(--radius-md);
}
.stat-card i {
    font-size: 1.6rem;
    flex-shrink: 0;
}
.stat-card div { display: flex; flex-direction: column; gap: 3px; }
.stat-card span { font-size: 0.75rem; color: var(--text-muted); font-weight: 500; }
.stat-card strong { font-size: 1.15rem; font-weight: 700; font-family: var(--font-mono); }
.income-card { background: var(--income-bg); border-color: var(--income-border); }
.income-card i { color: var(--income); }
.income-card strong { color: var(--income); }
.expense-card { background: var(--expense-bg); border-color: var(--expense-border); }
.expense-card i { color: var(--expense); }
.expense-card strong { color: var(--expense); }

.recent-section { padding: 20px; }
.recent-section h3 {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}
.recent-section h3 i { color: var(--accent-2); }
.transactions-list { list-style: none; }
.recent-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 11px 0;
    border-bottom: 1px solid var(--border);
    font-size: 0.9rem;
    font-weight: 500;
    transition: background 0.15s;
}
.recent-item:last-child { border-bottom: none; }
.recent-item .amount { font-family: var(--font-mono); font-size: 0.88rem; font-weight: 600; }
.empty-placeholder {
    color: var(--text-muted);
    font-size: 0.88rem;
    padding: 20px 0;
    text-align: center;
}

.positive { color: var(--income) !important; }
.negative { color: var(--expense) !important; }

.filter-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}
.month-selector,
.type-filter {
    padding: 9px 14px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-input);
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    outline: none;
    transition: border-color 0.2s, transform 0.15s;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%239196b0' stroke-width='1.8' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 34px;
}
.month-selector:focus, .type-filter:focus {
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
}

.table-wrapper {
    border-radius: var(--radius-md);
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    border: 1px solid var(--border);
}
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.84rem;
}
.data-table thead { background: var(--bg-table-head); }
.data-table th {
    padding: 11px 13px;
    text-align: left;
    font-size: 0.74rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.07em;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}
.data-table th i { margin-right: 5px; color: var(--accent-2); opacity: 0.7; }
.data-table td {
    padding: 11px 13px;
    border-bottom: 1px solid var(--border);
    color: var(--text-primary);
    font-weight: 500;
    vertical-align: middle;
}
.data-table td i { margin-right: 5px; }
.data-table td small { color: var(--text-muted); font-size: 0.72rem; display: block; margin-top: 2px; }
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table tfoot { background: var(--bg-table-head); }
.data-table tfoot td {
    padding: 11px 13px;
    border-top: 2px solid var(--border-strong);
    font-size: 0.84rem;
    font-weight: 600;
    color: var(--text-secondary);
}
.data-table tbody tr:hover td { background: var(--bg-table-hover); }

.form-card {
    padding: 24px;
    border-radius: var(--radius-lg);
    margin-bottom: 24px;
}
.form-group { margin-bottom: 18px; }
.form-group label {
    display: block;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 7px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    display: flex;
    align-items: center;
    gap: 6px;
}
.form-group label i { color: var(--accent-2); font-size: 0.8rem; }
.form-group input,
.form-group select {
    width: 100%;
    padding: 11px 14px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-input);
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 0.95rem;
    font-weight: 500;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    appearance: none;
    -webkit-appearance: none;
}
.form-group input::placeholder { color: var(--text-placeholder); font-weight: 400; }
.form-group input:focus,
.form-group select:focus {
    border-color: var(--border-focus);
    background: var(--bg-panel);
    box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
}
.form-group select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%239196b0' stroke-width='1.8' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
    cursor: pointer;
}

.method-subfields {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}
.method-subfields .form-group { margin-bottom: 0; }
.method-subfields .sub-label {
    font-size: 0.74rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 6px 10px;
    background: var(--bg-card-alt);
    border-radius: 6px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 6px;
}
.method-subfields .sub-label i { font-size: 0.72rem; }

.btn-save {
    width: 100%;
    padding: 13px 24px;
    background: var(--accent-gradient);
    color: #fff;
    border: none;
    border-radius: var(--radius-sm);
    font-family: var(--font-body);
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    letter-spacing: 0.03em;
    transition: opacity 0.2s, transform 0.15s, box-shadow 0.2s;
    box-shadow: var(--shadow-glow);
}
.btn-save:hover { opacity: 0.9; transform: translateY(-1px); box-shadow: 0 8px 28px rgba(37,99,235,0.3); }
.btn-save:active { transform: translateY(0); }

.preview-table-section { margin-top: 28px; }
.preview-table-section h3,
.table-preview-section h3,
.download-section h3 {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-secondary);
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}
.preview-table-section h3 i,
.table-preview-section h3 i,
.download-section h3 i { color: var(--accent-2); }

.cashflow-advice {
    margin-top: 18px;
    padding: 18px 20px;
    background: var(--accent-light);
    border: 1px solid rgba(37,99,235,0.15);
    border-radius: var(--radius-md);
    font-size: 0.88rem;
    font-weight: 500;
    color: var(--text-secondary);
    line-height: 1.6;
}
.cashflow-advice i { color: var(--accent-2); margin-right: 5px; }
#cashflow-value {
    font-family: var(--font-mono);
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-left: 6px;
}

.report-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 20px;
}
.chart-box {
    padding: 18px;
    border-radius: var(--radius-md);
    min-height: 260px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.insight-text {
    padding: 14px 18px;
    background: var(--accent-light);
    border: 1px solid rgba(37,99,235,0.15);
    border-radius: var(--radius-md);
    font-size: 0.88rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.download-section { margin-bottom: 24px; }
.download-buttons-group {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}
.download-btn {
    padding: 10px 20px;
    border: 1.5px solid var(--border-strong);
    border-radius: var(--radius-sm);
    background: var(--bg-card);
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 0.86rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 7px;
    transition: all 0.2s;
}
.download-btn:hover {
    background: var(--accent-light);
    border-color: var(--accent-2);
    color: var(--accent-2);
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}
.download-btn i { font-size: 0.88rem; }
.install-btn {
    padding: 10px 20px;
    border: 1.5px solid var(--accent-2);
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--accent-2);
    font-family: var(--font-body);
    font-size: 0.86rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 7px;
    transition: all 0.2s;
}
.install-btn:hover { background: var(--accent-light); }

.profile-card { padding: 28px; border-radius: var(--radius-lg); }
.profile-avatar {
    display: flex;
    justify-content: center;
    margin-bottom: 24px;
    position: relative;
    width: fit-content;
    margin-left: auto;
    margin-right: auto;
}
.profile-avatar i { font-size: 96px; color: var(--accent-2); }
.avatar-badge {
    position: absolute;
    bottom: 4px;
    right: 0;
    width: 30px;
    height: 30px;
    background: var(--accent-2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border: 2px solid var(--bg-panel);
    transition: background 0.2s;
}
.avatar-badge:hover { background: var(--accent-hover); }
.avatar-badge i { font-size: 13px; color: #fff; }

.field-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 0;
    border-bottom: 1px solid var(--border);
    gap: 12px;
}
.field-row:last-of-type { border-bottom: none; }
.field-row label {
    font-size: 0.84rem;
    font-weight: 600;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}
.field-row label i { color: var(--accent-2); width: 16px; text-align: center; }
.field-value-group {
    display: flex;
    align-items: center;
    gap: 10px;
}
.field-value-group span {
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--text-primary);
}
.edit-btn,
.view-balance-btn {
    width: 30px;
    height: 30px;
    border: 1.5px solid var(--border);
    border-radius: 8px;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.78rem;
    transition: all 0.2s;
    flex-shrink: 0;
}
.edit-btn:hover, .view-balance-btn:hover {
    background: var(--accent-light);
    border-color: var(--accent-2);
    color: var(--accent-2);
}

.currency-selector,
.language-selector {
    padding: 8px 34px 8px 12px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-input);
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 0.88rem;
    font-weight: 500;
    outline: none;
    cursor: pointer;
    transition: border-color 0.2s;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%239196b0' stroke-width='1.8' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
}
.currency-selector:focus, .language-selector:focus {
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
}

.toggle-btn {
    padding: 8px 16px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 0.86rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 7px;
    transition: all 0.2s;
}
.toggle-btn:hover { background: var(--accent-light); border-color: var(--accent-2); color: var(--accent-2); }

.switch { position: relative; display: inline-block; width: 44px; height: 24px; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider {
    position: absolute; cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background: var(--border-strong);
    border-radius: 24px;
    transition: 0.3s;
}
.slider::before {
    position: absolute; content: '';
    height: 18px; width: 18px;
    left: 3px; bottom: 3px;
    background: white;
    border-radius: 50%;
    transition: 0.3s;
}
input:checked + .slider { background: var(--accent-2); }
input:checked + .slider::before { transform: translateX(20px); }

.stats-summary {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}
.stats-summary h3 {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 7px;
}
.stats-summary h3 i { color: var(--accent-2); }
.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}
.stat-item {
    padding: 14px;
    background: var(--bg-card-alt);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    display: flex;
    flex-direction: column;
    gap: 5px;
}
.stat-label { font-size: 0.72rem; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.07em; }
.stat-value { font-size: 1.05rem; font-weight: 700; color: var(--text-primary); font-family: var(--font-mono); }

.credit-footer {
    margin-top: 20px;
    text-align: center;
    font-size: 0.76rem;
    color: var(--text-muted);
    padding-top: 16px;
    border-top: 1px solid var(--border);
}
.credit-footer a { color: var(--accent-2); text-decoration: none; font-weight: 600; }
.credit-footer a:hover { text-decoration: underline; }

.modal {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: var(--bg-modal);
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
}
.modal-content {
    background: var(--bg-panel);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    width: 90%;
    max-width: 420px;
    animation: modalSlideIn 0.25s ease;
    border: 1px solid var(--border);
}
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
}
.modal-header h3 { font-size: 1.05rem; font-weight: 700; color: var(--text-primary); }
.modal-close {
    cursor: pointer;
    font-size: 1.3rem;
    color: var(--text-muted);
    line-height: 1;
    transition: color 0.2s;
}
.modal-close:hover { color: var(--text-primary); }
.modal-body { padding: 20px 24px; }
.modal-body input {
    width: 100%;
    padding: 11px 14px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-input);
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 0.95rem;
    outline: none;
    transition: border-color 0.2s;
}
.modal-body input:focus { border-color: var(--border-focus); box-shadow: 0 0 0 3px rgba(37,99,235,0.1); }
.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border);
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}
.modal-cancel-btn {
    padding: 9px 18px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--text-secondary);
    font-family: var(--font-body);
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}
.modal-cancel-btn:hover { background: var(--bg-card-alt); }
.modal-save-btn {
    padding: 9px 18px;
    border: none;
    border-radius: var(--radius-sm);
    background: var(--accent-gradient);
    color: #fff;
    font-family: var(--font-body);
    font-size: 0.88rem;
    font-weight: 700;
    cursor: pointer;
    transition: opacity 0.2s;
}
.modal-save-btn:hover { opacity: 0.88; }

.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 820px;
    background: var(--bg-nav);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 10px 16px;
    box-shadow: 0 -1px 0 var(--border), 0 -8px 32px rgba(30,58,138,0.08);
    z-index: 100;
    border-top: 1px solid var(--border);
}
.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    cursor: pointer;
    color: var(--text-muted);
    padding: 6px 14px;
    border-radius: var(--radius-sm);
    transition: color 0.2s, background 0.2s, transform 0.15s;
    text-decoration: none;
}
.nav-item i { font-size: 1.25rem; transition: transform 0.15s; }
.nav-item span { font-size: 0.64rem; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; }
.nav-item:hover { color: var(--accent-2); transform: translateY(-2px); }
.nav-item.active-nav {
    color: var(--accent-2);
    background: var(--accent-light);
}

.nav-item.nav-add-btn i {
    font-size: 2.2rem; 
    color: var(--accent-2); 
    transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.nav-item.nav-add-btn:hover i {
    transform: scale(1.15);
}

.nav-item.nav-add-btn {
    padding: 2px 10px;
    margin-top: -10px; 
}

.brand-credit {
    text-align: center;
    font-size: 0.68rem;
    color: var(--text-muted);
    padding: 10px 0 2px;
    margin-top: 6px;
    position: relative;
    z-index: 101;
}
.brand-credit a { color: var(--accent-2); text-decoration: none; font-weight: 600; }
.brand-credit a:hover { text-decoration: underline; }

#total-amount-display, #summary-net {
    font-size: 0.85rem;
    font-weight: 600;
    font-family: var(--font-mono);
}
#total-amount-display strong, #summary-net strong { font-size: 0.96rem; }
#total-amount-display small, #summary-net small { font-size: 0.68rem; color: var(--text-muted); font-weight: 400; }