/* === ОСНОВНЫЕ СТИЛИ === */
:root {
    --primary: #6366F1;
    --primary-light: #818CF8;
    --primary-dark: #4F46E5;
    
    --income: #10B981;
    --income-light: #34D399;
    --expense: #EF4444;
    --expense-light: #F87171;
    
    --bg-color: #F5F7FA;
    --card-bg: #FFFFFF;
    --text-primary: #1F2937;
    --text-secondary: #6B7280;
    --text-muted: #9CA3AF;
    --border-color: #E5E7EB;
    
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1);
    
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    
    --safe-bottom: env(safe-area-inset-bottom, 0px);
    --safe-top: env(safe-area-inset-top, 0px);
}

/* Тёмная тема */
[data-theme="dark"] {
    --bg-color: #0F172A;
    --card-bg: #1E293B;
    --text-primary: #F1F5F9;
    --text-secondary: #94A3B8;
    --text-muted: #64748B;
    --border-color: #334155;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-color);
    color: var(--text-primary);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

/* === LOCK SCREEN === */
.lock-screen {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, #6366F1 0%, #4F46E5 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 20px;
}

.lock-content {
    text-align: center;
    color: white;
    padding: 32px;
    background: rgba(255,255,255,0.1);
    border-radius: var(--radius-xl);
    backdrop-filter: blur(10px);
    max-width: 320px;
    width: 100%;
}

.lock-icon {
    font-size: 80px;
    margin-bottom: 24px;
    animation: lockPulse 2s infinite;
}

@keyframes lockPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.lock-title {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 8px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.lock-subtitle {
    font-size: 14px;
    opacity: 0.8;
    margin-bottom: 32px;
}

.lock-dots {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 32px;
}

.lock-dots .dot {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: rgba(255,255,255,0.3);
    border: 2px solid rgba(255,255,255,0.2);
    transition: all 0.3s cubic-bezier(0.4,0,0.2,1);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.lock-dots .dot.filled {
    background: white;
    transform: scale(1.3);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    border-color: white;
}

.lock-keypad {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    max-width: 280px;
    margin: 0 auto;
}

.lock-keypad button {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    border: none;
    background: rgba(255,255,255,0.15);
    color: white;
    font-size: 24px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4,0,0.2,1);
    backdrop-filter: blur(5px);
}

.lock-keypad button:active {
    background: rgba(255,255,255,0.3);
    transform: scale(0.9);
}

.lock-keypad button.biometrics {
    background: rgba(255,255,255,0.25);
    font-size: 14px;
    width: 100%;
    grid-column: 1 / -1;
    padding: 12px;
    border-radius: var(--radius-md);
}

.lock-error {
    margin-top: 24px;
    font-size: 14px;
    opacity: 0;
    transition: opacity 0.3s;
    color: #FECACA;
    min-height: 20px;
}

#app {
    min-height: 100%;
    display: flex;
    flex-direction: column;
    padding-bottom: calc(80px + var(--safe-bottom));
}

/* === HEADER === */
.header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--card-bg);
    border-bottom: 1px solid var(--border-color);
    padding: 16px 20px;
    padding-top: calc(16px + var(--safe-top));
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 600px;
    margin: 0 auto;
}

.header-title {
    font-size: 20px;
    font-weight: 600;
}

.icon-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: var(--bg-color);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    transition: background 0.2s;
}

.icon-btn:active {
    background: var(--border-color);
}

/* === MAIN === */
.main {
    flex: 1;
    max-width: 600px;
    margin: 0 auto;
    padding: 16px;
    width: 100%;
}

.page {
    display: none;
}

.page.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

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

/* === BALANCE CARD === */
.daily-budget-widget {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    border-radius: var(--radius-lg);
    padding: 16px 20px;
    margin-bottom: 16px;
    color: white;
    text-align: center;
}

.daily-budget-label {
    font-size: 13px;
    opacity: 0.9;
}

.daily-budget-amount {
    font-size: 32px;
    font-weight: 700;
    margin: 4px 0;
}

.daily-budget-days {
    font-size: 12px;
    opacity: 0.8;
}

.balance-card {
    background: var(--card-bg);
    border-radius: var(--radius-xl);
    padding: 24px;
    margin-bottom: 20px;
    box-shadow: var(--shadow-md);
    text-align: center;
}

.balance-label {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.balance-amount {
    font-size: 36px;
    font-weight: 700;
    margin-bottom: 16px;
}

.balance-amount.hidden {
    filter: blur(8px);
}

.balance-actions {
    display: flex;
    justify-content: center;
    gap: 32px;
}

.balance-stat {
    text-align: center;
}

.stat-label {
    font-size: 12px;
    color: var(--text-muted);
    display: block;
}

.stat-value {
    font-size: 16px;
    font-weight: 600;
}

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

/* === ACCOUNTS === */
.section {
    margin-bottom: 24px;
}

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

.section-title {
    font-size: 18px;
    font-weight: 600;
}

.link-btn {
    background: none;
    border: none;
    color: var(--primary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
}

.accounts-grid {
    display: grid;
    gap: 12px;
}

.account-card {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: var(--shadow-sm);
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.account-card:active {
    transform: scale(0.98);
}

.account-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    flex-shrink: 0;
}

.account-info {
    flex: 1;
}

.account-name {
    font-weight: 500;
    margin-bottom: 2px;
}

.account-owner {
    font-size: 13px;
    color: var(--text-secondary);
}

.account-balance {
    font-size: 18px;
    font-weight: 600;
}

.account-balance.hidden {
    filter: blur(6px);
}

/* === QUICK ACTIONS === */
.quick-actions {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 24px;
}

.quick-action-btn {
    background: var(--card-bg);
    border: none;
    border-radius: var(--radius-lg);
    padding: 16px 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s;
}

.quick-action-btn:active {
    transform: scale(0.95);
}

.action-icon {
    font-size: 24px;
}

.quick-action-btn span:last-child {
    font-size: 12px;
    color: var(--text-secondary);
}

.quick-action-btn.income { border-left: 3px solid var(--income); }
.quick-action-btn.expense { border-left: 3px solid var(--expense); }
.quick-action-btn.transfer { border-left: 3px solid var(--primary); }
.quick-action-btn.scan { border-left: 3px solid #F59E0B; }

/* === TEMPLATES === */
.templates-list {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 8px;
    -webkit-overflow-scrolling: touch;
}

.template-chip {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: 10px 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
    cursor: pointer;
    transition: background 0.2s;
}

.template-chip:active {
    background: var(--bg-color);
}

.template-amount {
    font-weight: 600;
    color: var(--primary);
}

/* === TRANSACTIONS === */
.transactions-list {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.transactions-list.grouped {
    background: transparent;
}

.transaction-group {
    margin-bottom: 16px;
}

.transaction-date {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 8px;
    padding: 0 4px;
}

.transaction-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    transition: background 0.2s;
}

.transaction-item:last-child {
    border-bottom: none;
}

.transaction-item:active {
    background: var(--bg-color);
}

.transaction-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    background: var(--bg-color);
}

.transaction-info {
    flex: 1;
}

.transaction-category {
    font-weight: 500;
    margin-bottom: 2px;
}

.transaction-desc {
    font-size: 13px;
    color: var(--text-secondary);
}

.transaction-amount {
    font-weight: 600;
    font-size: 16px;
}

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

.transaction-account {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 2px;
}

/* === BUDGETS === */
.budgets-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.budget-item {
    background: var(--card-bg);
    border-radius: var(--radius-md);
    padding: 12px 16px;
}

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

.budget-category {
    display: flex;
    align-items: center;
    gap: 8px;
}

.budget-amounts {
    font-size: 13px;
    color: var(--text-secondary);
}

.budget-progress {
    height: 6px;
    background: var(--border-color);
    border-radius: 3px;
    overflow: hidden;
}

.budget-progress-bar {
    height: 100%;
    border-radius: 3px;
    transition: width 0.3s;
}

.budget-progress-bar.green { background: var(--income); }
.budget-progress-bar.yellow { background: #F59E0B; }
.budget-progress-bar.red { background: var(--expense); }

/* === GOALS === */
.goals-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.goal-card {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    padding: 20px;
    position: relative;
    overflow: hidden;
}

.goal-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.goal-icon {
    font-size: 32px;
}

.goal-info {
    flex: 1;
}

.goal-name {
    font-weight: 600;
    font-size: 18px;
}

.goal-deadline {
    font-size: 13px;
    color: var(--text-secondary);
}

.goal-progress {
    margin-bottom: 12px;
}

.goal-progress-bar {
    height: 8px;
    background: var(--border-color);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 8px;
}

.goal-progress-fill {
    height: 100%;
    background: var(--primary);
    border-radius: 4px;
    transition: width 0.3s;
}

.goal-stats {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
}

.goal-current {
    font-weight: 600;
    color: var(--primary);
}

.goal-target {
    color: var(--text-secondary);
}

.goal-actions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
}

/* === STATISTICS === */
.stats-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

.stats-tab {
    flex: 1;
    padding: 10px;
    border: none;
    border-radius: var(--radius-md);
    background: var(--card-bg);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.stats-tab.active {
    background: var(--primary);
    color: white;
}

.stats-summary {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 24px;
}

.stats-card {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    padding: 16px;
    text-align: center;
}

.stats-card-label {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.stats-card-value {
    font-size: 24px;
    font-weight: 700;
}

.chart-container {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    padding: 16px;
    margin-bottom: 24px;
}

.chart-container h3 {
    font-size: 16px;
    margin-bottom: 16px;
}

.pie-chart {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
}

.pie-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: var(--bg-color);
    border-radius: var(--radius-xl);
    font-size: 13px;
}

.chart-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
}

.legend-color {
    width: 12px;
    height: 12px;
    border-radius: 3px;
}

.account-stats {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.account-stat-item {
    background: var(--card-bg);
    border-radius: var(--radius-md);
    padding: 12px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.line-chart {
    height: 200px;
    display: flex;
    align-items: flex-end;
    gap: 8px;
    padding: 16px 0;
}

.chart-bar {
    flex: 1;
    background: var(--primary-light);
    border-radius: 4px 4px 0 0;
    min-height: 4px;
    position: relative;
}

.chart-bar::after {
    content: attr(data-label);
    position: absolute;
    bottom: -24px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 11px;
    color: var(--text-muted);
}

/* === FILTERS === */
.filters-bar {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
    overflow-x: auto;
    padding-bottom: 8px;
}

.filter-select {
    padding: 8px 16px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--card-bg);
    color: var(--text-primary);
    font-size: 14px;
    cursor: pointer;
}

.export-btn {
    width: 100%;
    padding: 12px;
    margin-top: 16px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--card-bg);
    font-size: 14px;
    cursor: pointer;
}

/* === PROFILE === */
.profile-card {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    border-radius: var(--radius-xl);
    padding: 32px;
    text-align: center;
    color: white;
    margin-bottom: 24px;
}

.profile-avatar {
    width: 80px;
    height: 80px;
    background: rgba(255,255,255,0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    margin: 0 auto 12px;
}

.profile-name {
    font-size: 20px;
    font-weight: 600;
}

.settings-list {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.settings-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
}

.settings-item:last-child {
    border-bottom: none;
}

.settings-icon {
    font-size: 20px;
}

.settings-item span:nth-child(2) {
    flex: 1;
}

.settings-arrow {
    color: var(--text-muted);
}

/* === TOGGLE SWITCH === */
.toggle-switch {
    position: relative;
    width: 48px;
    height: 28px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--border-color);
    border-radius: 14px;
    cursor: pointer;
    transition: 0.3s;
}

.toggle-slider::before {
    content: '';
    position: absolute;
    width: 22px;
    height: 22px;
    left: 3px;
    bottom: 3px;
    background: white;
    border-radius: 50%;
    transition: 0.3s;
}

.toggle-switch input:checked + .toggle-slider {
    background: var(--primary);
}

.toggle-switch input:checked + .toggle-slider::before {
    transform: translateX(20px);
}

/* === BOTTOM NAV === */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--card-bg);
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: space-around;
    padding: 8px 0;
    padding-bottom: calc(8px + var(--safe-bottom));
    z-index: 100;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 8px 16px;
    border: none;
    background: none;
    color: var(--text-muted);
    cursor: pointer;
    transition: color 0.2s;
}

.nav-item.active {
    color: var(--primary);
}

.nav-icon {
    font-size: 20px;
}

.nav-label {
    font-size: 11px;
    font-weight: 500;
}

/* === FAB === */
.fab {
    position: fixed;
    bottom: calc(96px + var(--safe-bottom));
    right: 20px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    border: none;
    font-size: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-lg);
    cursor: pointer;
    transition: transform 0.2s;
    z-index: 99;
}

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

/* === MODALS === */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
    z-index: 200;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--card-bg);
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    padding: 20px;
    padding-bottom: calc(20px + var(--safe-bottom));
    max-height: 90vh;
    overflow-y: auto;
    transform: translateY(100%);
    transition: transform 0.3s;
    z-index: 201;
}

.modal.active {
    transform: translateY(0);
}

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

.modal-header h3 {
    font-size: 20px;
    font-weight: 600;
}

.modal-close {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: var(--bg-color);
    font-size: 20px;
    cursor: pointer;
}

/* === FORMS === */
.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 6px;
    color: var(--text-secondary);
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--bg-color);
    color: var(--text-primary);
    font-size: 16px;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary);
}

.form-group.checkbox label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.form-group.checkbox input {
    width: 18px;
    height: 18px;
}

.btn-primary {
    width: 100%;
    padding: 14px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-primary:active {
    background: var(--primary-dark);
}

.btn-secondary {
    width: 100%;
    padding: 14px;
    background: var(--bg-color);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 16px;
    cursor: pointer;
}

/* === CATEGORIES GRID === */
.categories-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}

.category-btn {
    padding: 12px 8px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--bg-color);
    font-size: 12px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    transition: all 0.2s;
}

.category-btn.selected {
    border-color: var(--primary);
    background: var(--primary);
    color: white;
}

.category-btn span:first-child {
    font-size: 20px;
}

/* === ICONS & COLORS GRID === */
.icons-grid, .colors-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.icon-btn-select, .color-btn-select {
    width: 44px;
    height: 44px;
    border: 2px solid transparent;
    border-radius: var(--radius-md);
    background: var(--bg-color);
    font-size: 20px;
    cursor: pointer;
    transition: all 0.2s;
}

.icon-btn-select.selected, .color-btn-select.selected {
    border-color: var(--primary);
}

/* === TRANSFER ARROW === */
.transfer-arrow {
    text-align: center;
    font-size: 24px;
    color: var(--text-muted);
    margin: 8px 0;
}

/* === APP INFO === */
.app-info {
    text-align: center;
    padding: 24px;
    color: var(--text-muted);
    font-size: 13px;
}

/* === EMPTY STATE === */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-secondary);
}

.empty-state-icon {
    font-size: 48px;
    margin-bottom: 12px;
}

/* === ANIMATIONS === */
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.loading {
    animation: pulse 1.5s infinite;
}

/* === RESPONSIVE === */
@media (min-width: 768px) {
    .main {
        padding: 24px;
    }
    
    .accounts-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}
/* === ДОПОЛНИТЕЛЬНЫЕ СТИЛИ === */

/* Currency Settings */
.currency-settings {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.currency-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
    gap: 12px;
}

.currency-item:last-child {
    border-bottom: none;
}

.currency-item input {
    width: 80px;
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: var(--bg-color);
    color: var(--text-primary);
    text-align: right;
}

.currency-base {
    color: var(--primary);
    font-size: 12px;
    font-weight: 500;
}

/* Profile Accounts */
.profile-accounts {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.profile-account-item {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    padding: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.account-main {
    display: flex;
    align-items: center;
    gap: 12px;
}

.account-icon-large {
    font-size: 32px;
}

.account-details {
    flex: 1;
}

.account-name-large {
    font-weight: 600;
    font-size: 16px;
}

.account-owner-small {
    font-size: 13px;
    color: var(--text-secondary);
}

.account-actions {
    display: flex;
    gap: 8px;
}

.btn-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: var(--bg-color);
    cursor: pointer;
    font-size: 16px;
}

.btn-icon.danger {
    background: #FEE2E2;
}

/* Amount Input */
.amount-input-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
}

.amount-input-wrapper input {
    flex: 1;
}

.currency-badge {
    background: var(--primary);
    color: white;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    font-weight: 500;
}

/* Comparison Chart */
.comparison-chart {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    padding: 16px;
}

.comparison-bars {
    display: flex;
    justify-content: space-around;
    align-items: flex-end;
    height: 200px;
    gap: 8px;
}

.comparison-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    flex: 1;
}

.comparison-bar-container {
    height: 150px;
    display: flex;
    align-items: flex-end;
}

.comparison-bar {
    width: 24px;
    border-radius: 4px 4px 0 0;
    min-height: 4px;
}

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

.comparison-label {
    font-size: 12px;
    color: var(--text-secondary);
}

.comparison-values {
    text-align: center;
}

.expense-value {
    font-size: 11px;
    color: var(--expense);
    font-weight: 500;
}

.diff {
    font-size: 10px;
    font-weight: 600;
}

.diff.negative { color: var(--expense); }
.diff.positive { color: var(--income); }

/* Merchants */
.merchants-list {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.merchant-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
}

.merchant-item:last-child {
    border-bottom: none;
}

.merchant-rank {
    width: 24px;
    height: 24px;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
}

.merchant-info {
    flex: 1;
}

.merchant-name {
    font-weight: 500;
}

.merchant-count {
    font-size: 12px;
    color: var(--text-secondary);
}

.merchant-amount {
    text-align: right;
}

.merchant-total {
    font-weight: 600;
}

.merchant-percent {
    font-size: 12px;
    color: var(--text-secondary);
}

/* Cashflow Chart */
.cashflow-chart {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    padding: 16px;
}

.cashflow-graph {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    height: 140px;
    gap: 4px;
}

.cashflow-day {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.cashflow-bars {
    display: flex;
    gap: 2px;
    height: 120px;
    align-items: flex-end;
}

.cashflow-bar {
    width: 8px;
    border-radius: 2px 2px 0 0;
    min-height: 2px;
}

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

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

.cashflow-label {
    font-size: 10px;
    color: var(--text-muted);
}

.cashflow-legend {
    display: flex;
    justify-content: center;
    gap: 24px;
    margin-top: 12px;
    font-size: 12px;
}

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

/* Reminders */
.reminders-list {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.reminder-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
}

.reminder-item:last-child {
    border-bottom: none;
}

.reminder-title {
    font-weight: 500;
}

.reminder-date {
    font-size: 12px;
    color: var(--text-secondary);
}

.reminder-amount {
    font-weight: 600;
    color: var(--expense);
}

/* Profile Card */
.profile-family {
    font-size: 14px;
    opacity: 0.8;
}

/* Responsive */
@media (max-width: 400px) {
    .comparison-bars {
        gap: 4px;
    }
    
    .comparison-bar {
        width: 16px;
    }
    
    .cashflow-bar {
        width: 6px;
    }
}

/* === ROUND STATS === */
.round-stat {
.scan-options {
    display: flex;
    gap: 16px;
    padding: 16px;
}

.scan-option {
    flex: 1;
    background: var(--bg-color);
    border: none;
    border-radius: var(--radius-lg);
    padding: 24px 16px;
    cursor: pointer;
    text-align: center;
    transition: all 0.2s;
}

.scan-option:active {
    transform: scale(0.98);
}

.scan-icon {
    font-size: 48px;
    display: block;
    margin-bottom: 12px;
}

.scan-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    display: block;
    margin-bottom: 4px;
}

.scan-desc {
    font-size: 12px;
    color: var(--text-secondary);
}

/* === CATEGORIES MANAGE === */
.categories-manage {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.category-manage-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
}

.category-manage-item:last-child {
    border-bottom: none;
}

.category-manage-icon {
    font-size: 24px;
}

.category-manage-info {
    flex: 1;
}

.category-manage-name {
    font-weight: 500;
}

.category-manage-type {
    font-size: 12px;
    color: var(--text-secondary);
}

/* === PIE CHART === */
.pie-chart-wrapper {
    display: flex;
    justify-content: center;
    padding: 16px;
}

#pieChart {
    max-width: 200px;
    max-height: 200px;
}

/* === FORM ACTIONS === */
.form-actions {
    display: flex;
    gap: 12px;
    margin-top: 16px;
}

.form-actions .btn-primary {
    flex: 2;
}

.form-actions .btn-danger {
    flex: 1;
    background: var(--expense);
    color: white;
    padding: 14px;
    border: none;
    border-radius: var(--radius-md);
    font-size: 14px;
    cursor: pointer;
}

/* === BUTTON DANGER === */
.btn-danger {
    background: var(--expense) !important;
}

/* === CHART LEGEND ENHANCED === */
.chart-legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: var(--bg-color);
    border-radius: var(--radius-xl);
    font-size: 13px;
}

.chart-legend-item .legend-color {
    width: 14px;
    height: 14px;
    border-radius: 3px;
}

.chart-legend-item .legend-emoji {
    font-size: 16px;
}

.chart-legend-item .legend-value {
    margin-left: auto;
    font-weight: 600;
    color: var(--text-primary);
}

.chart-legend-item .legend-percent {
    font-size: 12px;
    color: var(--text-secondary);
}

/* === ROUND STATS === */
.round-stat {
    background: var(--card-bg);
    border-radius: 50%;
    width: 100px;
    height: 100px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-md);
}

.round-stat .stat-main {
    font-size: 20px;
    font-weight: 700;
    color: var(--primary);
}

.round-stat .stat-sub {
    font-size: 11px;
    color: var(--text-secondary);
}

/* === TOP CATEGORIES === */
.categories-spending-chart {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    padding: 16px;
    margin-top: 8px;
}

.category-bar-item {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.category-bar-emoji {
    font-size: 20px;
    width: 32px;
    text-align: center;
}

.category-bar-info {
    flex: 1;
}

.category-bar-name {
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 4px;
}

.category-bar-progress {
    height: 8px;
    background: var(--border-color);
    border-radius: 4px;
    overflow: hidden;
}

.category-bar-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.4s;
}
