/* ═══════════ TOP BAR (HOME) ═══════════ */
.top-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
}

.user-block {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--gradient-hero);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 18px;
    background-size: cover;
    background-position: center;
}

.user-greeting {
    display: flex;
    flex-direction: column;
}

.greeting-text {
    font-size: 13px;
    color: var(--text-muted);
}

.user-name {
    font-size: 17px;
    font-weight: 600;
    color: var(--text-primary);
}

/* ═══════════ SCREEN HEADER ═══════════ */
.screen-header {
    position: fixed;
    top: var(--safe-top);
    left: 20px;
    right: 20px;
    max-width: 440px;
    margin: 0 auto;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    background: var(--bg-header);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-light);
    border-radius: 24px;
    z-index: 900;
    box-shadow: 0 10px 40px -10px rgba(0,0,0,0.1);
}

@media (max-height: 700px) {
    .screen-header {
        height: 60px;
    }
}

@media (max-height: 600px) {
    .screen-header {
        height: 56px;
        border-radius: 20px;
    }
}

.screen-header h1 {
    font-size: 18px;
    font-weight: 700;
    text-align: center;
    margin: 0;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    pointer-events: none;
}

@media (max-height: 600px) {
    .screen-header h1 {
        font-size: 16px;
    }
}

.btn-back {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    transition: all 0.2s;
}

.btn-back:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

/* ═══════════ ANALYTICS HEADER ═══════════ */
.header-left-group {
    display: flex;
    align-items: center;
    gap: 12px;
}

.screen-header .header-title-static {
    position: static;
    transform: none;
    text-align: left;
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

.select-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.select-glass {
    appearance: none;
    -webkit-appearance: none;
    padding: 8px 36px 8px 16px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    border-radius: 14px;
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    min-width: 120px;
}

.select-glass:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--accent);
}

.select-glass:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.select-arrow {
    position: absolute;
    right: 14px;
    pointer-events: none;
    font-size: 12px;
    color: var(--text-secondary);
}

/* ═══════════ BUTTONS ═══════════ */
.btn-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    background: var(--bg-elevated);
    transition: all 0.2s;
}

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

.btn-icon.small {
    width: 32px;
    height: 32px;
    font-size: 13px;
}

.btn-icon.loading i {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.btn-link {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 14px;
    font-weight: 500;
    color: var(--accent);
    padding: 6px 10px;
    border-radius: var(--radius-sm);
    transition: all 0.2s;
}

.btn-link:hover {
    background: var(--accent-glow);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: var(--radius-md);
    font-size: 15px;
    font-weight: 600;
    transition: all 0.2s;
}

.btn.primary {
    background: var(--gradient-hero);
    color: white;
    box-shadow: var(--shadow-glow);
}

.btn.primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px var(--accent-glow);
}

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

.btn.secondary:hover {
    background: var(--bg-hover);
}

/* ═══════════ HERO BALANCE CARD ═══════════ */
.hero-card {
    margin: 16px;
    padding: 28px 24px;
    background: var(--gradient-hero);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg), var(--shadow-glow);
    position: relative;
    overflow: hidden;
}

.hero-card::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 200px;
    height: 200px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    pointer-events: none;
}

.hero-card::after {
    content: '';
    position: absolute;
    bottom: -30%;
    left: -10%;
    width: 150px;
    height: 150px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 50%;
    pointer-events: none;
}

.hero-label {
    font-size: 14px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 8px;
}

.hero-amount {
    font-size: 42px;
    font-weight: 800;
    color: white;
    letter-spacing: -1px;
    margin-bottom: 8px;
    text-shadow: 0 2px 20px rgba(0, 0, 0, 0.2);
}

.hero-change {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.9);
    background: rgba(255, 255, 255, 0.15);
    padding: 6px 12px;
    border-radius: var(--radius-full);
    backdrop-filter: blur(8px);
}

/* Period Pills */
.period-pills {
    display: flex;
    gap: 8px;
    margin-top: 20px;
    position: relative;
    z-index: 1;
}

.pill {
    flex: 1;
    padding: 10px 12px;
    border-radius: var(--radius-md);
    font-size: 13px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.7);
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(4px);
    transition: all 0.2s;
}

.pill:hover {
    background: rgba(255, 255, 255, 0.15);
    color: white;
}

.pill.active {
    background: white;
    color: var(--accent);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

/* ═══════════ FLOW CARDS (Income/Expense) ═══════════ */
.flow-cards {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    padding: 0 16px;
    margin-top: -8px;
}

.flow-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 18px;
    display: flex;
    align-items: center;
    gap: 14px;
    transition: all 0.2s;
}

.flow-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.flow-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.flow-card.income .flow-icon {
    background: var(--green-soft);
    color: var(--green);
}

.flow-card.expense .flow-icon {
    background: var(--red-soft);
    color: var(--red);
}

.flow-data {
    display: flex;
    flex-direction: column;
}

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

.flow-value {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
}

/* ═══════════ QUICK STATS ═══════════ */
.quick-stats {
    display: flex;
    gap: 8px;
    padding: 16px;
    overflow-x: auto;
    scrollbar-width: none;
}

.quick-stats::-webkit-scrollbar { display: none; }

.stat-chip {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    white-space: nowrap;
    transition: all 0.2s;
}

.stat-chip:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.stat-chip i {
    color: var(--accent);
}

/* ═══════════ TRANSACTION LIST ═══════════ */
.tx-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.tx-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    transition: all 0.2s;
    cursor: pointer;
}

.tx-item:hover {
    transform: translateX(4px);
    border-color: var(--border-light);
    box-shadow: var(--shadow-sm);
}

.tx-icon {
    width: 46px;
    height: 46px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}

.tx-icon.income {
    background: var(--green-soft);
    color: var(--green);
}

.tx-icon.expense {
    background: var(--red-soft);
    color: var(--red);
}

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

.tx-cat {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.tx-desc {
    font-size: 13px;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tx-right {
    text-align: right;
    flex-shrink: 0;
}

.tx-amount {
    font-size: 16px;
    font-weight: 700;
}

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

.tx-date {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 2px;
}

/* ═══════════ CATEGORIES MINI (Home) ═══════════ */
.categories-mini {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.cat-mini {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    transition: all 0.2s;
    cursor: pointer;
}

.cat-mini:hover {
    transform: translateX(4px);
    border-color: var(--accent);
}

.cat-bar {
    width: 4px;
    height: 36px;
    border-radius: 2px;
    flex-shrink: 0;
}

.cat-mini-info {
    flex: 1;
}

.cat-mini-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.cat-mini-amount {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
}

.cat-mini-pct {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-muted);
}

/* ═══════════ KPI ROW (Analytics) ═══════════ */
.kpi-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

.kpi-box {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    transition: all 0.2s;
}

.kpi-box:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.kpi-icon {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
}

.kpi-icon.income { background: var(--green-soft); color: var(--green); }
.kpi-icon.expense { background: var(--red-soft); color: var(--red); }
.kpi-icon.balance { background: var(--blue-soft); color: var(--blue); }
.kpi-icon.rate { background: var(--accent-glow); color: var(--accent); }

.kpi-val {
    font-size: 22px;
    font-weight: 800;
    color: var(--text-primary);
}

.kpi-lbl {
    font-size: 13px;
    color: var(--text-muted);
}

/* ═══════════ CATEGORY LIST (Analytics) ═══════════ */
.cat-list,
#top-categories-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.cat-row,
.category-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
}

.cat-icon,
.category-icon {
    width: 42px;
    height: 42px;
    border-radius: var(--radius-md);
    background: var(--accent-glow);
    color: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
}

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

.cat-name,
.category-name {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.cat-progress,
.category-progress {
    height: 6px;
    background: var(--bg-elevated);
    border-radius: 3px;
    overflow: hidden;
}

.cat-progress-bar,
.category-progress-bar {
    height: 100%;
    background: var(--accent);
    border-radius: 3px;
    transition: width 0.3s ease;
}

.cat-right,
.category-amount {
    text-align: right;
    flex-shrink: 0;
}

.cat-amount,
.category-value {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
}

.cat-pct,
.category-percent {
    font-size: 13px;
    color: var(--text-muted);
}

/* =========== MODALS =========== */
.modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: none;
    align-items: flex-end;
    justify-content: center;
}

.modal.open,
.modal.active {
    display: flex;
}

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

.modal-box {
    position: relative;
    width: 100%;
    max-width: 480px;
    max-height: 90vh;
    background: var(--bg-card);
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    padding: 24px;
    padding-bottom: calc(24px + var(--safe-bottom));
    overflow-y: auto;
    animation: slideUp 0.3s ease;
}

.modal-box.large {
    max-height: 95vh;
}

@keyframes slideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

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

.modal-head h3 {
    font-size: 18px;
    font-weight: 700;
}

.modal-actions {
    display: flex;
    gap: 12px;
    margin-top: 24px;
}

.modal-actions .btn {
    flex: 1;
}

/* =========== FORMS =========== */
.form-field {
    margin-bottom: 18px;
}

.form-field label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.form-field input,
.form-field select,
.form-field textarea {
    width: 100%;
    padding: 14px 16px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 15px;
    transition: all 0.2s;
}

.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.form-field small {
    display: block;
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 6px;
}

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

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

.form-field.checkbox input {
    width: 20px;
    height: 20px;
    accent-color: var(--accent);
}

.toggle-row {
    display: flex;
    gap: 10px;
}

.toggle-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    transition: all 0.2s;
}

.toggle-btn:hover {
    border-color: var(--accent);
}

.toggle-btn.active {
    background: var(--accent-glow);
    border-color: var(--accent);
    color: var(--accent);
}

.emoji-grid {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 8px;
}

.emoji {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    font-size: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-elevated);
    border: 2px solid transparent;
    transition: all 0.2s;
}

.emoji:hover {
    transform: scale(1.1);
}

.emoji.selected {
    border-color: var(--accent);
    background: var(--accent-glow);
}

/* =========== EMPTY STATES =========== */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px 24px;
    text-align: center;
}

.empty-state i {
    font-size: 48px;
    color: var(--text-muted);
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-state h3 {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.empty-state p {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 20px;
}

.empty-mini {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 32px;
    color: var(--text-muted);
    font-size: 14px;
}

.empty-mini i {
    font-size: 24px;
    opacity: 0.5;
}

.empty-msg {
    text-align: center;
    padding: 24px;
    color: var(--text-muted);
    font-size: 14px;
}

/* =========== LOADING =========== */
.loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
}

.loading-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.loading-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    color: white;
}

.spinner,
.spinner-large {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 255, 255, 0.2);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.spinner-small {
    width: 20px;
    height: 20px;
    border: 2px solid var(--accent-glow);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.loading-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px 24px;
    gap: 16px;
    min-height: 200px;
}

.loading-state .loading-spinner {
    width: 36px;
    height: 36px;
    border: 3px solid var(--border-color, rgba(128, 128, 128, 0.2));
    border-top-color: var(--accent-primary, #6366f1);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    padding: 0;
}

.loading-state .loading-spinner::before {
    display: none;
}

.loading-state p {
    color: var(--text-muted);
    font-size: 14px;
    margin: 0;
}

.skeleton-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.skeleton-row {
    height: 76px;
    background: linear-gradient(90deg, var(--bg-card) 25%, var(--bg-elevated) 50%, var(--bg-card) 75%);
    background-size: 200% 100%;
    border-radius: var(--radius-lg);
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* =========== TOAST =========== */
#toast-container {
    position: fixed;
    top: var(--safe-top);
    left: 50%;
    transform: translateX(-50%);
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 90%;
    max-width: 400px;
}

.toast {
    padding: 14px 20px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 500;
    text-align: center;
    box-shadow: var(--shadow-lg);
    animation: toastIn 0.3s ease;
}

.toast.success {
    background: var(--green);
    border-color: var(--green);
    color: white;
}

.toast.error {
    background: var(--red);
    border-color: var(--red);
    color: white;
}

@keyframes toastIn {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Achievement Toast */
.toast.achievement-toast {
    display: flex;
    align-items: center;
    gap: 12px;
    background: linear-gradient(135deg, var(--bg-card), var(--bg-secondary));
    border: 1px solid var(--accent);
    text-align: left;
    padding: 16px 20px;
}

.toast.achievement-toast .toast-icon {
    font-size: 28px;
    flex-shrink: 0;
}

.toast.achievement-toast .toast-content {
    flex: 1;
}

.toast.achievement-toast .toast-title {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.toast.achievement-toast .toast-message {
    font-size: 13px;
    color: var(--accent);
    font-weight: 500;
}

.toast.fade-out {
    animation: toastOut 0.3s ease forwards;
}

@keyframes toastOut {
    from { opacity: 1; transform: translateY(0); }
    to { opacity: 0; transform: translateY(-20px); }
}


/* =========== BOTTOM NAV =========== */
.bottom-nav {
    position: fixed;
    bottom: 20px;
    left: 20px;
    right: 20px;
    max-width: 440px;
    margin: 0 auto;
    height: 72px;
    padding-bottom: 0;
    background: rgba(15, 15, 22, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-light);
    border-radius: 24px;
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding-top: 0;
    padding-bottom: 20px;
    z-index: 900;
    box-shadow: 0 10px 40px -10px rgba(0,0,0,0.5);
}

.nav-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 8px 12px;
    color: var(--text-muted);
    font-size: 10px;
    font-weight: 600;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    border-radius: 12px;
}

.nav-btn i {
    font-size: 20px;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    margin-bottom: 2px;
}

.nav-btn::before {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%) scale(0);
    width: 4px;
    height: 4px;
    background: var(--accent);
    border-radius: 50%;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0;
}

.nav-btn:hover {
    color: var(--text-secondary);
    background: rgba(255,255,255,0.03);
}

.nav-btn.active {
    color: var(--accent-light);
}

.nav-btn.active i {
    transform: translateY(-2px);
    text-shadow: 0 0 15px var(--accent-glow);
}

.nav-btn.active::before {
    transform: translateX(-50%) scale(1);
    opacity: 1;
    bottom: 6px;
}

/* =========== SCROLLBAR =========== */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--border-light);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent);
}

/* --- Modern Transactions List --- */
.tx-item-modern {
    display: flex;
    align-items: center;
    padding: 16px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 16px;
    margin-bottom: 12px;
    transition: all 0.2s ease;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.tx-item-modern:active {
    transform: scale(0.98);
    background: rgba(255, 255, 255, 0.08);
}

.tx-icon-modern {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    margin-right: 16px;
    flex-shrink: 0;
}

.tx-icon-modern.income {
    background: rgba(0, 255, 157, 0.15);
    color: #00ff9d;
}

.tx-icon-modern.expense {
    background: rgba(255, 99, 132, 0.15);
    color: #ff6384;
}

.tx-info-modern {
    flex: 1;
    overflow: hidden;
}

.tx-cat-modern {
    font-weight: 600;
    font-size: 15px;
    color: var(--text-primary);
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tx-desc-modern {
    font-size: 12px;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tx-amount-modern {
    font-weight: 700;
    font-size: 15px;
    margin-left: 12px;
    white-space: nowrap;
}

.tx-amount-modern.income {
    color: #00ff9d;
}

.tx-amount-modern.expense {
    color: var(--text-primary);
}

/* =========== ERROR/SUCCESS TOAST =========== */
.error-toast {
    position: fixed;
    top: var(--safe-top);
    left: 50%;
    transform: translateX(-50%) translateY(-100px);
    padding: 14px 24px;
    background: var(--red);
    color: white;
    border-radius: var(--radius-lg);
    font-size: 14px;
    font-weight: 600;
    text-align: center;
    z-index: 10001;
    opacity: 0;
    transition: all 0.3s ease;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    max-width: 90%;
}

/* =========== EXPORT FORMAT SELECTOR =========== */
.export-format-selector {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 10px;
}

.format-option {
    cursor: pointer;
}

.format-option input {
    display: none;
}

.format-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 16px 12px;
    border: 2px solid var(--border);
    border-radius: var(--radius-md);
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    transition: all 0.2s;
}

.format-label i {
    font-size: 24px;
}

.format-option input:checked + .format-label {
    border-color: var(--accent);
    background: var(--accent-glow);
    color: var(--accent);
}

.date-range-row {
    display: flex;
    gap: 12px;
}

.date-input-group {
    flex: 1;
}

.date-input-group label {
    display: block;
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.date-input-group input[type='date'] {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-elevated);
    color: var(--text-primary);
    font-size: 14px;
}

.export-options {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* =========== HEADER ACTIONS =========== */
.screen-header .header-actions {
    display: flex;
    gap: 8px;
}

.error-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.success-toast {
    position: fixed;
    top: var(--safe-top);
    left: 50%;
    transform: translateX(-50%) translateY(-100px);
    padding: 14px 24px;
    background: var(--green);
    color: white;
    border-radius: var(--radius-lg);
    font-size: 14px;
    font-weight: 600;
    text-align: center;
    z-index: 10001;
    opacity: 0;
    transition: all 0.3s ease;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    max-width: 90%;
}

.success-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ===== LOADING PLACEHOLDERS ===== */
.loading-placeholder {
    padding: 16px;
}

.skeleton-item {
    height: 60px;
    background: linear-gradient(90deg, 
        rgba(255,255,255,0.05) 25%, 
        rgba(255,255,255,0.1) 50%, 
        rgba(255,255,255,0.05) 75%
    );
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    border-radius: var(--radius-md);
    margin-bottom: 12px;
}

.skeleton-item:last-child {
    margin-bottom: 0;
}

@keyframes skeleton-loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

.loading-spinner {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 0;
    width: 100%;
}

.loading-spinner::before {
    content: '';
    width: 32px;
    height: 32px;
    border: 3px solid var(--border-color, rgba(128, 128, 128, 0.2));
    border-top-color: var(--accent-primary, #6366f1);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.loading-spinner i {
    font-size: 24px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* =========== BEAUTIFUL EMPTY STATES =========== */
.empty-state-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 32px 20px;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.05) 0%, rgba(139, 92, 246, 0.05) 100%);
    border: 1px dashed rgba(99, 102, 241, 0.2);
    border-radius: var(--radius-lg);
    text-align: center;
    width: 100%;
    flex: 1;
}

.empty-state-icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.15) 0%, rgba(139, 92, 246, 0.15) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
}

.empty-state-icon i {
    font-size: 22px;
    color: var(--accent);
    opacity: 0.7;
}

.empty-state-text {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.empty-state-hint {
    font-size: 13px;
    color: var(--text-muted);
    max-width: 200px;
}


/* =========== BOTTOM NAV =========== */
.bottom-nav {
    position: fixed;
    bottom: 20px;
    left: 20px;
    right: 20px;
    max-width: 440px;
    margin: 0 auto;
    height: 72px;
    padding-bottom: 0;
    background: rgba(15, 15, 22, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-light);
    border-radius: 24px;
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding-top: 0;
    padding-bottom: 20px;
    z-index: 900;
    box-shadow: 0 10px 40px -10px rgba(0,0,0,0.5);
}

.nav-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 8px 12px;
    color: var(--text-muted);
    font-size: 10px;
    font-weight: 600;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    border-radius: 12px;
}

.nav-btn i {
    font-size: 20px;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    margin-bottom: 2px;
}

.nav-btn::before {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%) scale(0);
    width: 4px;
    height: 4px;
    background: var(--accent);
    border-radius: 50%;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0;
}

.nav-btn:hover {
    color: var(--text-secondary);
    background: rgba(255,255,255,0.03);
}

.nav-btn.active {
    color: var(--accent-light);
}

.nav-btn.active i {
    transform: translateY(-2px);
    text-shadow: 0 0 15px var(--accent-glow);
}

.nav-btn.active::before {
    transform: translateX(-50%) scale(1);
    opacity: 1;
    bottom: 6px;
}

/* =========== SCROLLBAR =========== */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--border-light);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent);
}


/* --- Modern Transactions List --- */
.tx-item-modern {
    display: flex;
    align-items: center;
    padding: 16px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 16px;
    margin-bottom: 12px;
    transition: all 0.2s ease;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.tx-item-modern:active {
    transform: scale(0.98);
    background: rgba(255, 255, 255, 0.08);
}

.tx-icon-modern {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    margin-right: 16px;
    flex-shrink: 0;
}

.tx-icon-modern.income {
    background: rgba(0, 255, 157, 0.15);
    color: #00ff9d;
}

.tx-icon-modern.expense {
    background: rgba(255, 99, 132, 0.15);
    color: #ff6384;
}

.tx-info-modern {
    flex: 1;
    overflow: hidden;
}

.tx-cat-modern {
    font-weight: 600;
    font-size: 15px;
    color: var(--text-primary);
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tx-desc-modern {
    font-size: 12px;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tx-amount-modern {
    font-weight: 700;
    font-size: 15px;
    margin-left: 12px;
    white-space: nowrap;
}

.tx-amount-modern.income {
    color: #00ff9d;
}

.tx-amount-modern.expense {
    color: var(--text-primary);
}

/* =========== ERROR/SUCCESS TOAST =========== */
.error-toast {
    position: fixed;
    top: var(--safe-top);
    left: 50%;
    transform: translateX(-50%) translateY(-100px);
    padding: 14px 24px;
    background: var(--red);
    color: white;
    border-radius: var(--radius-lg);
    font-size: 14px;
    font-weight: 600;
    text-align: center;
    z-index: 10001;
    opacity: 0;
    transition: all 0.3s ease;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    max-width: 90%;
}


/* =========== EXPORT FORMAT SELECTOR =========== */
.export-format-selector {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 10px;
}

.format-option {
    cursor: pointer;
}

.format-option input {
    display: none;
}

.format-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 16px 12px;
    border: 2px solid var(--border);
    border-radius: var(--radius-md);
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    transition: all 0.2s;
}

.format-label i {
    font-size: 24px;
}

.format-option input:checked + .format-label {
    border-color: var(--accent);
    background: var(--accent-glow);
    color: var(--accent);
}

.date-range-row {
    display: flex;
    gap: 12px;
}

.date-input-group {
    flex: 1;
}

.date-input-group label {
    display: block;
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.date-input-group input[type='date'] {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-elevated);
    color: var(--text-primary);
    font-size: 14px;
}

.export-options {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* =========== HEADER ACTIONS =========== */
.screen-header .header-actions {
    display: flex;
    gap: 8px;
}

.error-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.success-toast {
    position: fixed;
    top: var(--safe-top);
    left: 50%;
    transform: translateX(-50%) translateY(-100px);
    padding: 14px 24px;
    background: var(--green);
    color: white;
    border-radius: var(--radius-lg);
    font-size: 14px;
    font-weight: 600;
    text-align: center;
    z-index: 10001;
    opacity: 0;
    transition: all 0.3s ease;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    max-width: 90%;
}

.success-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ===== LOADING PLACEHOLDERS ===== */
.loading-placeholder {
    padding: 16px;
}

.skeleton-item {
    height: 60px;
    background: linear-gradient(90deg, 
        rgba(255,255,255,0.05) 25%, 
        rgba(255,255,255,0.1) 50%, 
        rgba(255,255,255,0.05) 75%
    );
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    border-radius: var(--radius-md);
    margin-bottom: 12px;
}

.skeleton-item:last-child {
    margin-bottom: 0;
}

@keyframes skeleton-loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

.loading-spinner {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 0;
    width: 100%;
}

.loading-spinner::before {
    content: '';
    width: 32px;
    height: 32px;
    border: 3px solid var(--border-color, rgba(128, 128, 128, 0.2));
    border-top-color: var(--accent-primary, #6366f1);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.loading-spinner i {
    font-size: 24px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* =========== BEAUTIFUL EMPTY STATES =========== */
.empty-state-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 32px 20px;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.05) 0%, rgba(139, 92, 246, 0.05) 100%);
    border: 1px dashed rgba(99, 102, 241, 0.2);
    border-radius: var(--radius-lg);
    text-align: center;
    width: 100%;
    flex: 1;
}

.empty-state-icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.15) 0%, rgba(139, 92, 246, 0.15) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
}

.empty-state-icon i {
    font-size: 22px;
    color: var(--accent);
    opacity: 0.7;
}

.empty-state-text {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.empty-state-hint {
    font-size: 13px;
    color: var(--text-muted);
    max-width: 200px;
}

