:root,
[data-theme="dark"] {
    --bg: #0f172a;
    --bg-card: #1e293b;
    --bg-input: #334155;
    --bg-hover: rgba(99, 102, 241, 0.05);
    --border: #334155;
    --text: #f1f5f9;
    --text-muted: #94a3b8;
    --primary: #6366f1;
    --primary-hover: #818cf8;
    --danger: #ef4444;
    --success: #22c55e;
    --warning: #f59e0b;
    --radius: 14px;
    --radius-sm: 10px;
    --shadow: 0 4px 24px rgba(0, 0, 0, 0.25);
    --nav-height: 64px;
    --header-height: 56px;
    --header-bg: rgba(15, 23, 42, 0.85);
    --nav-bg: rgba(30, 41, 59, 0.95);
    --login-bg: linear-gradient(135deg, #0f172a 0%, #1e1b4b 50%, #0f172a 100%);
    --chart-grid: rgba(51, 65, 85, 0.5);
    --chart-text: #94a3b8;
    --tooltip-bg: #1e293b;
    --theme-color: #0f172a;
}

[data-theme="light"] {
    --bg: #f1f5f9;
    --bg-card: #ffffff;
    --bg-input: #f8fafc;
    --bg-hover: rgba(99, 102, 241, 0.06);
    --border: #e2e8f0;
    --text: #0f172a;
    --text-muted: #64748b;
    --primary: #4f46e5;
    --primary-hover: #6366f1;
    --shadow: 0 4px 24px rgba(15, 23, 42, 0.08);
    --header-bg: rgba(255, 255, 255, 0.9);
    --nav-bg: rgba(255, 255, 255, 0.95);
    --login-bg: linear-gradient(135deg, #eef2ff 0%, #f8fafc 50%, #eef2ff 100%);
    --chart-grid: rgba(148, 163, 184, 0.35);
    --chart-text: #64748b;
    --tooltip-bg: #ffffff;
    --theme-color: #f1f5f9;
}

*, *::before, *::after { box-sizing: border-box; }

body {
    margin: 0;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background: var(--bg);
    color: var(--text);
    padding: env(safe-area-inset-top) env(safe-area-inset-right) 0 env(safe-area-inset-left);
    -webkit-font-smoothing: antialiased;
}

.d-none { display: none !important; }

/* Login */
.login-screen {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: var(--login-bg);
}

.login-card {
    width: 100%;
    max-width: 380px;
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 32px 28px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
}

.login-logo {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    background: linear-gradient(135deg, var(--primary), #8b5cf6);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin: 0 auto 20px;
    color: #fff;
}

.login-card h2 {
    text-align: center;
    margin: 0 0 8px;
    font-size: 1.5rem;
    font-weight: 700;
}

.login-subtitle {
    text-align: center;
    color: var(--text-muted);
    margin: 0 0 24px;
    font-size: 0.9rem;
}

/* App shell */
.app-shell {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
}

.app-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--header-bg);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    padding-top: env(safe-area-inset-top);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: var(--header-height);
    padding: 0 16px;
    max-width: 960px;
    margin: 0 auto;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.header-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    font-size: 1.1rem;
}

.header-brand i {
    color: var(--primary);
    font-size: 1.2rem;
}

.app-main {
    flex: 1;
    max-width: 960px;
    margin: 0 auto;
    width: 100%;
    padding: 16px 16px calc(var(--nav-height) + env(safe-area-inset-bottom) + 16px);
}

/* Tabs */
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* Bottom nav */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: calc(var(--nav-height) + env(safe-area-inset-bottom));
    padding-bottom: env(safe-area-inset-bottom);
    background: var(--nav-bg);
    backdrop-filter: blur(12px);
    border-top: 1px solid var(--border);
    display: flex;
    z-index: 100;
}

.nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 0.7rem;
    font-weight: 500;
    cursor: pointer;
    transition: color 0.2s;
    padding: 8px;
}

.nav-item i { font-size: 1.25rem; }

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

.nav-item:active { opacity: 0.7; }

/* Cards */
.panel-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 16px;
    border: 1px solid var(--border);
}

.panel-title {
    margin: 0 0 16px;
    font-size: 1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.panel-title i { color: var(--primary); font-size: 0.95rem; }

.panel-badge {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-muted);
    background: var(--bg-input);
    padding: 2px 8px;
    border-radius: 20px;
    margin-left: auto;
}

/* Forms */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group label {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-muted);
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}

@media (min-width: 768px) {
    .form-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    .form-group-action {
        grid-column: span 3;
    }
}

.input, select.input {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-input);
    color: var(--text);
    font-size: 16px;
    font-family: inherit;
    transition: border-color 0.2s;
    appearance: none;
}

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

.input::placeholder { color: #64748b; }

select.input {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%2394a3b8' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10l-5 5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 20px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
}

.btn:active { transform: scale(0.98); }

.btn-primary {
    background: linear-gradient(135deg, var(--primary), #8b5cf6);
    color: #fff;
}

.btn-primary:hover { background: linear-gradient(135deg, var(--primary-hover), #a78bfa); }

.btn-secondary {
    background: var(--bg-input);
    color: var(--text);
    border: 1px solid var(--border);
}

.btn-secondary:hover { background: #475569; }

.btn-block { width: 100%; }

.btn-icon {
    width: 40px;
    height: 40px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-input);
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.btn-icon:hover { color: var(--text); border-color: var(--primary); }

.btn-danger {
    background: transparent;
    border: 1px solid var(--danger);
    color: var(--danger);
    width: 36px;
    height: 36px;
    border-radius: 8px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
}

.btn-danger:hover { background: rgba(239, 68, 68, 0.15); }

.alert {
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    margin-bottom: 12px;
}

.alert-error {
    background: rgba(239, 68, 68, 0.15);
    color: #fca5a5;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

/* Category row */
.category-row {
    display: grid;
    grid-template-columns: 1fr auto auto auto;
    gap: 8px;
    align-items: stretch;
}

.category-submit-btn {
    white-space: nowrap;
    padding: 0 16px;
    height: 100%;
    min-height: 48px;
}

.icon-picker-btn {
    width: 48px;
    min-height: 48px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-input);
    color: var(--text);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    transition: border-color 0.2s;
}

.icon-picker-btn:hover, .icon-picker-btn.active {
    border-color: var(--primary);
    color: var(--primary);
}

.input-color {
    width: 48px;
    min-height: 48px;
    padding: 4px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-input);
    cursor: pointer;
}

.icon-picker-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(44px, 1fr));
    gap: 8px;
    margin-top: 12px;
    padding: 12px;
    background: var(--bg);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
}

.icon-option {
    width: 44px;
    height: 44px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg-input);
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    transition: all 0.15s;
}

.icon-option:hover { color: var(--text); border-color: var(--primary); }

.icon-option.selected {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

@media (max-width: 430px) {
    .category-row {
        grid-template-columns: 1fr auto auto;
        grid-template-rows: auto auto;
    }
    .category-row .input:first-child { grid-column: 1 / -1; }
    .category-submit-btn {
        grid-column: 1 / -1;
        width: 100%;
    }
}

/* Stats */
.stats-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    margin-bottom: 16px;
}

@media (min-width: 768px) {
    .stats-grid { grid-template-columns: repeat(3, 1fr); }
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px;
    text-align: center;
}

.stat-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 6px;
    font-weight: 500;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
}

.stat-value.expense { color: var(--danger); }
.stat-value.income { color: var(--success); }
.stat-value.net-positive { color: var(--primary); }
.stat-value.net-negative { color: var(--warning); }

/* Month selector */
.month-selector {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
}

.month-select {
    flex: 1;
    text-align: center;
    font-weight: 600;
}

/* Table */
.table-wrap {
    overflow-x: auto;
    max-height: 480px;
    overflow-y: auto;
    border-radius: var(--radius-sm);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.data-table th {
    text-align: left;
    padding: 10px 12px;
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    background: var(--bg-card);
}

.data-table td {
    padding: 12px;
    border-bottom: 1px solid rgba(51, 65, 85, 0.5);
    vertical-align: middle;
}

.data-table tbody tr:hover { background: var(--bg-hover); }
.date-input-wrap {
    position: relative;
    display: flex;
    align-items: stretch;
}

.date-input-wrap .input {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
    border-right: none;
}

.date-picker-btn {
    width: 48px;
    min-height: 48px;
    border: 1px solid var(--border);
    border-top-right-radius: var(--radius-sm);
    border-bottom-right-radius: var(--radius-sm);
    background: var(--bg-input);
    color: var(--primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    transition: background 0.2s, color 0.2s;
}

.date-picker-btn:hover {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

.date-native {
    display: none;
}

/* Modern calendar popup */
.cal-popup {
    position: fixed;
    inset: 0;
    z-index: 1000;
}

.cal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(4px);
}

.cal-panel {
    position: fixed;
    width: 320px;
    max-width: calc(100vw - 24px);
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
    padding: 16px;
    z-index: 1001;
    animation: calIn 0.2s ease;
}

@keyframes calIn {
    from { opacity: 0; transform: translateY(-8px) scale(0.97); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

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

.cal-title {
    font-weight: 700;
    font-size: 1rem;
}

.cal-nav {
    width: 36px;
    height: 36px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--bg-input);
    color: var(--text);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
}

.cal-nav:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.cal-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
    margin-bottom: 8px;
}

.cal-weekdays span {
    text-align: center;
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.cal-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
}

.cal-day {
    aspect-ratio: 1;
    border: none;
    border-radius: 10px;
    background: transparent;
    color: var(--text);
    font-size: 0.9rem;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.15s;
}

.cal-day:hover:not(.cal-empty) {
    background: var(--bg-hover);
}

.cal-day.cal-today {
    box-shadow: inset 0 0 0 2px var(--primary);
    color: var(--primary);
    font-weight: 700;
}

.cal-day.cal-selected {
    background: linear-gradient(135deg, var(--primary), #8b5cf6);
    color: #fff;
    font-weight: 700;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.35);
}

.cal-empty { pointer-events: none; }

.cal-footer {
    display: flex;
    gap: 8px;
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid var(--border);
}

.cal-today-btn,
.cal-close-btn {
    flex: 1;
    padding: 10px;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    border: 1px solid var(--border);
}

.cal-today-btn {
    background: var(--bg-input);
    color: var(--text);
}

.cal-close-btn {
    background: linear-gradient(135deg, var(--primary), #8b5cf6);
    color: #fff;
    border: none;
}

/* Analytics type toggle */
.analytics-type-toggle {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    padding: 4px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.atype-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 8px;
    border: none;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--text-muted);
    font-size: 0.8rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s;
}

.atype-btn.active {
    background: linear-gradient(135deg, var(--primary), #8b5cf6);
    color: #fff;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
}

.atype-btn[data-atype="income"].active {
    background: linear-gradient(135deg, var(--success), #16a34a);
    box-shadow: 0 2px 8px rgba(34, 197, 94, 0.3);
}

.atype-btn[data-atype="all"].active {
    background: linear-gradient(135deg, #6366f1, #22c55e);
}

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

.category-list li.category-clickable {
    cursor: pointer;
    border-radius: var(--radius-sm);
    padding-left: 8px;
    padding-right: 8px;
    margin-left: -8px;
    margin-right: -8px;
    transition: background 0.15s;
}

.category-list li.category-clickable:hover,
.category-list li.category-clickable.selected {
    background: var(--bg-hover);
}

.category-list li.category-clickable.selected {
    box-shadow: inset 0 0 0 2px var(--primary);
}

.category-filter-row {
    margin-bottom: 14px;
}

.category-detail-empty {
    text-align: center;
    padding: 28px 16px;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.category-detail-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}

.category-detail-total {
    font-weight: 700;
    font-size: 1.1rem;
    font-variant-numeric: tabular-nums;
}

.category-detail-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.category-detail-list li {
    display: grid;
    grid-template-columns: 1fr auto auto;
    gap: 12px;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
    font-size: 0.9rem;
}

.category-detail-list li:last-child { border-bottom: none; }

.category-detail-place {
    font-weight: 600;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.category-detail-date {
    color: var(--text-muted);
    font-size: 0.85rem;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.category-detail-amount {
    font-weight: 700;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.category-detail-amount.expense { color: var(--danger); }
.category-detail-amount.income { color: var(--success); }

@media (max-width: 430px) {
    .category-detail-list li {
        grid-template-columns: 1fr auto;
        grid-template-rows: auto auto;
    }
    .category-detail-date {
        grid-column: 1;
        font-size: 0.8rem;
    }
    .category-detail-amount {
        grid-column: 2;
        grid-row: 1 / 3;
        align-self: center;
    }
}

/* Income list */
.income-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.income-item {
    padding: 14px 0;
    border-bottom: 1px solid var(--border);
}

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

.income-item-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 6px;
}

.income-source {
    font-weight: 700;
    font-size: 0.95rem;
}

.income-amount {
    font-weight: 700;
    color: var(--success);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.income-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.income-note {
    margin-top: 8px;
    padding: 8px 12px;
    background: var(--bg);
    border-radius: 8px;
    font-size: 0.85rem;
    color: var(--text);
    border-left: 3px solid var(--success);
}

.income-note-label {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 2px;
}

.note-cell {
    max-width: 160px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--text-muted);
    font-size: 0.85rem;
}

#noteGroup.income-mode #note {
    border-color: var(--success);
}

#noteGroup.income-mode #note:focus {
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.2);
}

/* Charts */
.panel-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}

.panel-title-row .panel-title {
    margin-bottom: 0;
    flex: 1;
    min-width: 0;
}

.btn-toggle-view {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-input);
    color: var(--text-muted);
    font-size: 0.8rem;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s;
}

.btn-toggle-view:hover,
.btn-toggle-view.active {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--bg-hover);
}

/* Category list view */
.category-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.category-list li {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
}

.category-list li:last-child { border-bottom: none; }

.category-list-rank {
    width: 24px;
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 600;
    text-align: center;
}

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

.category-list-name {
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 6px;
}

.category-list-bar-wrap {
    height: 6px;
    background: var(--bg-input);
    border-radius: 3px;
    overflow: hidden;
}

.category-list-bar {
    height: 100%;
    border-radius: 3px;
    transition: width 0.3s ease;
}

.category-list-amounts {
    text-align: right;
    flex-shrink: 0;
}

.category-list-sum {
    font-weight: 700;
    font-size: 0.95rem;
    font-variant-numeric: tabular-nums;
}

.category-list-pct {
    font-size: 0.75rem;
    color: var(--text-muted);
}


.category-list .empty-day {
    text-align: center;
    padding: 24px;
    color: var(--text-muted);
    display: block;
}

.category-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 20px;
    color: #fff;
    font-size: 0.8rem;
    font-weight: 500;
    white-space: nowrap;
}

.type-badge {
    font-size: 0.75rem;
    padding: 3px 8px;
    border-radius: 6px;
    font-weight: 500;
}

.type-badge.expense {
    background: rgba(239, 68, 68, 0.15);
    color: #fca5a5;
}

.type-badge.income {
    background: rgba(34, 197, 94, 0.15);
    color: #86efac;
}

.amount-cell { font-weight: 600; font-variant-numeric: tabular-nums; }

/* Transaction cards (mobile) */
.transaction-card {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 14px;
    margin-bottom: 10px;
}

.transaction-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

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

.transaction-card-place {
    font-weight: 600;
    margin-bottom: 10px;
}

.transaction-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.transaction-amount {
    font-weight: 700;
    font-size: 1.05rem;
}

/* Daily list */
.daily-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.daily-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
    font-size: 0.9rem;
}

.daily-list li:last-child { border-bottom: none; }

.daily-amount {
    font-weight: 600;
    color: var(--primary);
    font-variant-numeric: tabular-nums;
}

.daily-list .empty-day { color: var(--text-muted); }

/* Charts */
.chart-container {
    position: relative;
    height: 280px;
}

.chart-lg { height: 320px; }

@media (max-width: 430px) {
    .input, select.input, .btn { min-height: 48px; font-size: 16px; }
    .btn-danger { min-width: 44px; min-height: 44px; }
    .chart-container { height: 240px; }
    .chart-lg { height: 260px; }
    .app-main { padding-left: 12px; padding-right: 12px; }
}

@media (min-width: 768px) {
    .d-md-block { display: block !important; }
    .d-md-none { display: none !important; }
}
