/* ===== DARK THEME (DEFAULT) ===== */
:root, [data-theme="dark"] {
    --bg-primary: #0a0e1a;
    --bg-secondary: #111827;
    --bg-card: #1a1f35;
    --bg-card-hover: #212845;
    --bg-elevated: rgba(30, 37, 65, 0.92);
    --bg-input: #151b2e;
    --accent-coral: #ff6b6b;
    --accent-coral-light: #ff8787;
    --accent-gradient: linear-gradient(135deg, #ff6b6b 0%, #ff8e53 50%, #feca57 100%);
    --color-success: #10b981;
    --color-success-bg: rgba(16,185,129,0.12);
    --color-danger: #ef4444;
    --color-danger-bg: rgba(239,68,68,0.12);
    --color-warning: #f59e0b;
    --color-info: #6366f1;
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --border-subtle: rgba(148, 163, 184, 0.08);
    --border-light: rgba(148, 163, 184, 0.15);
    --shadow-sm: 0 2px 8px rgba(0,0,0,0.2);
    --shadow-md: 0 4px 16px rgba(0,0,0,0.3);
    --shadow-lg: 0 8px 32px rgba(0,0,0,0.4);
}

/* ===== LIGHT THEME ===== */
[data-theme="light"] {
    --bg-primary: #f8fafc;
    --bg-secondary: #f1f5f9;
    --bg-card: #ffffff;
    --bg-card-hover: #f1f5f9;
    --bg-elevated: rgba(255, 255, 255, 0.95);
    --bg-input: #f1f5f9;
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    --border-subtle: rgba(15, 23, 42, 0.06);
    --border-light: rgba(15, 23, 42, 0.1);
    --shadow-sm: 0 1px 4px rgba(0,0,0,0.06);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
    --shadow-lg: 0 8px 24px rgba(0,0,0,0.1);
}

/* ===== RESET ===== */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { font-size: 16px; -webkit-text-size-adjust: 100%; -webkit-font-smoothing: antialiased; }
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.5;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    transition: background 0.3s ease, color 0.3s ease;
}
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; -webkit-tap-highlight-color: transparent; }
input, select, textarea { font-family: inherit; }

/* ===== APP CONTAINER ===== */
.app-container {
    width: 100%; max-width: 430px; height: 100vh; max-height: 932px;
    position: relative; overflow: hidden; background: var(--bg-primary);
    transition: background 0.3s ease;
}
@media (min-width: 431px) {
    .app-container {
        border-radius: 40px; border: 1px solid var(--border-subtle);
        box-shadow: var(--shadow-lg), 0 0 80px rgba(0,0,0,0.3);
        height: min(100vh - 40px, 932px);
    }
}

/* ===== AUTH SCREEN ===== */
.auth-screen {
    position: absolute; inset: 0; z-index: 500;
    display: none; flex-direction: column; justify-content: center;
    padding: 32px 28px;
    background: var(--bg-primary);
    transition: opacity 0.4s ease;
}
.auth-screen.active { display: flex; }
.auth-container { max-width: 340px; margin: 0 auto; width: 100%; }
.auth-logo { text-align: center; margin-bottom: 40px; }
.auth-logo-icon {
    width: 64px; height: 64px; border-radius: 20px; margin: 0 auto 16px;
    background: var(--accent-gradient);
    display: flex; align-items: center; justify-content: center; color: white;
    box-shadow: 0 8px 24px rgba(255,107,107,0.3);
}
.auth-title { font-size: 28px; font-weight: 800; letter-spacing: -0.5px; }
.auth-subtitle { font-size: 14px; color: var(--text-muted); margin-top: 4px; }
.auth-form { display: none; flex-direction: column; gap: 16px; }
.auth-form.active { display: flex; }
.auth-error {
    text-align: center; color: var(--color-danger); font-size: 13px;
    font-weight: 600; min-height: 20px; margin-top: 8px;
}

/* ===== OTP VERIFICATION ===== */
.otp-form { text-align: center; }
.otp-form.active { display: flex; flex-direction: column; align-items: center; }
.otp-header {
    position: relative; width: 100%; display: flex;
    justify-content: center; align-items: center; margin-bottom: 8px;
}
.otp-back-btn {
    position: absolute; left: 0; top: 0;
    background: var(--bg-input); border: 1px solid var(--border-light);
    border-radius: 10px; padding: 8px; color: var(--text-secondary);
    cursor: pointer; transition: all 0.2s;
}
.otp-back-btn:hover { color: var(--text-primary); border-color: var(--color-primary); }
.otp-icon-wrapper {
    width: 72px; height: 72px; border-radius: 20px;
    background: linear-gradient(135deg, rgba(129,140,248,0.15), rgba(99,102,241,0.1));
    border: 1px solid rgba(129,140,248,0.2);
    display: flex; align-items: center; justify-content: center;
    color: var(--color-primary);
    animation: otpPulse 2s ease-in-out infinite;
}
@keyframes otpPulse {
    0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(129,140,248,0.2); }
    50% { transform: scale(1.05); box-shadow: 0 0 20px 4px rgba(129,140,248,0.15); }
}
.otp-title {
    font-size: 22px; font-weight: 800; color: var(--text-primary);
    margin: 16px 0 4px; letter-spacing: -0.5px;
}
.otp-subtitle {
    font-size: 13px; color: var(--text-secondary);
    margin: 0 0 2px; line-height: 1.4;
}
.otp-email {
    font-size: 14px; font-weight: 700; color: var(--color-primary);
    margin: 0 0 24px; word-break: break-all;
}
.otp-inputs {
    display: flex; gap: 8px; justify-content: center;
    align-items: center; margin-bottom: 8px;
}
.otp-digit {
    width: 48px; height: 58px; text-align: center;
    font-size: 24px; font-weight: 700; font-family: 'Inter', monospace;
    background: var(--bg-input); color: var(--text-primary);
    border: 2px solid var(--border-light); border-radius: 12px;
    outline: none; transition: all 0.2s ease; caret-color: var(--color-primary);
}
.otp-digit:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(129,140,248,0.2);
    transform: translateY(-2px);
}
.otp-digit.filled { border-color: var(--color-primary); background: rgba(129,140,248,0.08); }
.otp-digit.error { border-color: var(--color-danger); animation: otpShake 0.4s ease; }
@keyframes otpShake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-6px); }
    50% { transform: translateX(6px); }
    75% { transform: translateX(-4px); }
}
.otp-separator {
    font-size: 20px; font-weight: 300; color: var(--text-muted);
    padding: 0 2px;
}
.otp-error {
    color: var(--color-danger); font-size: 13px; font-weight: 600;
    min-height: 20px; margin-bottom: 8px; text-align: center;
}
.otp-verify-btn { margin-top: 8px; width: 100%; }
.otp-verify-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.otp-resend {
    display: flex; flex-direction: column; align-items: center;
    gap: 4px; margin-top: 20px;
}
.otp-resend p { font-size: 13px; color: var(--text-secondary); margin: 0; }
.otp-resend-btn {
    background: none; border: none; color: var(--color-primary);
    font-size: 14px; font-weight: 600; cursor: pointer;
    padding: 8px 16px; border-radius: 8px; transition: all 0.2s;
}
.otp-resend-btn:hover:not(:disabled) { background: rgba(129,140,248,0.1); }
.otp-resend-btn:disabled { color: var(--text-muted); cursor: not-allowed; }
.otp-resend-btn span { font-weight: 400; font-size: 12px; }

/* Form Elements */
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group label {
    font-size: 12px; font-weight: 600; color: var(--text-secondary);
    text-transform: uppercase; letter-spacing: 0.5px;
}
.form-group input, .form-group select, .form-group textarea {
    width: 100%; padding: 14px 16px; font-size: 15px; font-weight: 500;
    background: var(--bg-input); color: var(--text-primary);
    border: 1px solid var(--border-light); border-radius: 12px;
    outline: none; transition: all 0.2s ease;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
    border-color: var(--accent-coral); box-shadow: 0 0 0 3px rgba(255,107,107,0.1);
}
.form-group input::placeholder { color: var(--text-muted); }
.form-group textarea { resize: none; min-height: 60px; }

/* Input Icons & Premium Select Category triggers */
.input-with-icon {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
}
.input-with-icon input {
    padding-left: 46px !important;
}
.input-with-icon .input-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 18px !important;
    width: 18px;
    height: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    transition: all 0.2s ease;
}
.input-with-icon input:focus ~ .input-icon {
    color: var(--accent-coral);
    transform: translateY(-50%) scale(1.05);
}
.input-with-icon input[type="date"]::-webkit-calendar-picker-indicator {
    opacity: 0;
    position: absolute;
    right: 12px;
    cursor: pointer;
    width: 20px;
    height: 20px;
}

.select-category-trigger {
    width: 100%;
    padding: 14px 16px 14px 46px !important;
    font-size: 15px;
    font-weight: 500;
    background: var(--bg-input);
    color: var(--text-muted) !important;
    border: 1px solid var(--border-light);
    border-radius: 12px;
    cursor: pointer;
    position: relative;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    box-sizing: border-box;
}
.select-category-trigger:hover {
    border-color: var(--text-muted);
}
.select-category-trigger .select-category-icon-wrapper {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}
.select-category-trigger .select-category-icon-wrapper i,
.select-category-trigger .select-category-icon-wrapper svg {
    color: var(--text-muted) !important;
    stroke: var(--text-muted) !important;
    font-size: 18px !important;
    width: 18px !important;
    height: 18px !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    stroke-width: 2.2px !important;
    transition: all 0.2s ease;
}
.select-category-trigger.has-value {
    color: var(--text-primary) !important;
}
.select-category-trigger.has-value .select-category-icon-wrapper i,
.select-category-trigger.has-value .select-category-icon-wrapper svg {
    color: var(--text-primary) !important;
    stroke: var(--text-primary) !important;
}

.auth-submit-btn {
    width: 100%; padding: 16px; font-size: 16px; font-weight: 700;
    background: var(--accent-gradient); color: white; border-radius: 14px;
    margin-top: 8px; transition: all 0.2s ease;
    box-shadow: 0 4px 16px rgba(255,107,107,0.3);
}
.auth-submit-btn:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(255,107,107,0.4); }
.auth-submit-btn:active { transform: scale(0.98); }
.auth-submit-btn:disabled { opacity: 0.6; pointer-events: none; }
.auth-switch { text-align: center; font-size: 14px; color: var(--text-muted); margin-top: 8px; }
.auth-switch button { color: var(--accent-coral); font-weight: 600; text-decoration: underline; font-size: 14px; }

.password-input-container {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
}
.password-input-container input {
    padding-right: 48px !important;
}
.password-toggle-btn {
    position: absolute;
    right: 14px;
    background: none;
    border: none;
    padding: 0;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s ease;
    height: 100%;
    z-index: 5;
}
.password-toggle-btn:hover {
    color: var(--text-primary);
}

/* Social Login */
.auth-divider {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 8px 0;
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.auth-divider::before, .auth-divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid var(--border-light);
}
.auth-divider::before {
    margin-right: 12px;
}
.auth-divider::after {
    margin-left: 12px;
}
.social-login-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 8px;
    margin-bottom: 8px;
}
.social-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    background: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid var(--border-light);
    transition: all 0.2s;
}
.social-btn:hover {
    background: var(--bg-input);
    border-color: var(--text-muted);
    transform: translateY(-1px);
}
.social-btn:active {
    transform: scale(0.98);
}
.social-btn svg {
    flex-shrink: 0;
}
.google-btn svg {
    color: #ea4335;
}
.facebook-btn svg {
    color: #1877f2;
}

/* Remember Me */
.remember-me-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: -4px 0 4px;
}
.remember-me-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-muted);
    cursor: pointer;
    user-select: none;
}
.remember-me-label input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--color-primary);
    cursor: pointer;
}

/* Forgot Password Link */
.forgot-password-link {
    background: none;
    border: none;
    color: var(--accent-coral);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    padding: 0;
    transition: all 0.2s ease;
    opacity: 0.85;
}
.forgot-password-link:hover {
    opacity: 1;
    text-decoration: underline;
}

/* Biometric Login Button */
.biometric-btn {
    background: linear-gradient(135deg, #10b981, #059669) !important;
    color: #fff !important;
    border: none !important;
    grid-column: 1 / -1;
    font-size: 15px !important;
    padding: 14px !important;
    animation: biometricPulse 2s ease-in-out infinite;
}
.biometric-btn:hover {
    background: linear-gradient(135deg, #059669, #047857) !important;
    color: #fff !important;
}
.biometric-btn svg {
    color: #fff !important;
}
@keyframes biometricPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4); }
    50% { box-shadow: 0 0 0 8px rgba(16, 185, 129, 0); }
}

/* Biometric Settings in Profile */
.biometric-credentials-section {
    max-height: 0px;
    opacity: 0;
    overflow: hidden;
    transition: max-height 0.35s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.35s ease, margin 0.35s ease;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 0 12px;
}

.biometric-credentials-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.biometric-cred-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    border-radius: 12px;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    transition: all 0.2s ease;
}

.biometric-cred-item:hover {
    border-color: var(--border-light);
    transform: translateY(-1px);
}

.biometric-cred-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.biometric-cred-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.biometric-cred-date {
    font-size: 11px;
    color: var(--text-muted);
}

.biometric-cred-delete {
    background: none;
    border: none;
    color: var(--color-danger);
    cursor: pointer;
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 600;
    border-radius: 8px;
    transition: all 0.2s ease;
    border: 1px solid rgba(239, 68, 68, 0.15);
}

.biometric-cred-delete:hover {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.3);
}

.biometric-cred-delete:active {
    transform: scale(0.95);
}

.biometric-register-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    padding: 12px;
    margin-top: 4px;
    border-radius: 12px;
    background: linear-gradient(135deg, #10b981, #059669);
    color: #fff;
    border: none;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.2);
}

.biometric-register-btn:hover {
    background: linear-gradient(135deg, #059669, #047857);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(16, 185, 129, 0.35);
}

.biometric-register-btn:active {
    transform: translateY(0) scale(0.98);
}

.biometric-credentials-section.has-credentials .biometric-register-btn {
    display: none !important;
}

/* Biometric Toggle Switch */
.biometric-toggle {
    position: relative;
    width: 56px;
    height: 30px;
    border-radius: 15px;
    cursor: pointer;
    transition: all 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.25);
    background: linear-gradient(145deg, #1e293b, #334155);
    border: 1px solid rgba(255, 255, 255, 0.06);
    display: inline-block;
    vertical-align: middle;
    flex-shrink: 0;
}
.biometric-toggle:hover { transform: scale(1.06); }
.biometric-toggle:active { transform: scale(0.95); }
.biometric-toggle.active {
    background: linear-gradient(145deg, #059669, #10b981);
    border-color: rgba(16, 185, 129, 0.25);
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.1), 0 0 16px rgba(16,185,129,0.2);
}

/* Biometric Knob */
.biometric-toggle .toggle-knob {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    transition: all 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
    background: linear-gradient(145deg, #64748b, #475569);
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
}
.biometric-toggle.active .toggle-knob {
    left: 29px;
    background: linear-gradient(145deg, #ffffff, #f1f5f9);
    box-shadow: 0 2px 10px rgba(0,0,0,0.15);
}
.biometric-toggle .toggle-knob-icon {
    width: 13px; height: 13px;
    color: #94a3b8;
    transition: all 0.4s ease;
    opacity: 0.7;
}
.biometric-toggle.active .toggle-knob-icon {
    color: #059669;
    opacity: 1;
}

/* Light mode biometric toggle */
[data-theme="light"] .biometric-toggle {
    background: linear-gradient(145deg, #e2e8f0, #cbd5e1);
    border-color: rgba(0,0,0,0.06);
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.08);
}
[data-theme="light"] .biometric-toggle .toggle-knob {
    background: linear-gradient(145deg, #94a3b8, #64748b);
    box-shadow: 0 2px 6px rgba(0,0,0,0.12);
}
[data-theme="light"] .biometric-toggle .toggle-knob-icon { color: #e2e8f0; }
[data-theme="light"] .biometric-toggle.active {
    background: linear-gradient(145deg, #10b981, #34d399);
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.06), 0 0 14px rgba(16,185,129,0.15);
}
[data-theme="light"] .biometric-toggle.active .toggle-knob {
    background: #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* ===== MAIN APP ===== */
.main-app { display: none; height: 100%; position: relative; }
.main-app.active { display: block; }

/* ===== STATUS BAR ===== */
.status-bar {
    display: flex; justify-content: space-between; align-items: center;
    padding: 12px 24px 4px; font-size: 13px; font-weight: 600;
    color: var(--text-primary); position: sticky; top: 0; z-index: 100;
    background: var(--bg-primary);
}
.status-icons { display: flex; gap: 6px; align-items: center; color: var(--text-secondary); }

/* ===== PAGES ===== */
.page {
    position: absolute; top: 0; left: 0; right: 0; bottom: 0;
    overflow-y: auto; overflow-x: hidden;
    padding: 0 20px; padding-top: 40px; padding-bottom: 100px;
    opacity: 0; transform: translateY(8px); pointer-events: none;
    transition: opacity 0.25s ease, transform 0.25s ease;
    -webkit-overflow-scrolling: touch; scrollbar-width: none;
}
.page::-webkit-scrollbar { display: none; }
.page.active { opacity: 1; transform: translateY(0); pointer-events: all; }

/* ===== HEADER ===== */
.header { display: flex; justify-content: space-between; align-items: center; padding: 12px 0 20px; }
.header-left { display: flex; align-items: center; gap: 12px; }
.avatar {
    width: 42px; height: 42px; border-radius: 50%;
    background: var(--accent-gradient);
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 17px; color: white;
    box-shadow: 0 4px 12px rgba(255,107,107,0.25);
}
.greeting-text {
    font-size: 11px; color: var(--text-muted); font-weight: 600;
    text-transform: uppercase; letter-spacing: 0.4px;
}
.user-name { font-size: 18px; font-weight: 700; letter-spacing: -0.3px; }
.icon-btn {
    width: 40px; height: 40px; border-radius: 12px;
    background: var(--bg-card); display: flex; align-items: center; justify-content: center;
    color: var(--text-secondary); border: 1px solid var(--border-subtle);
    transition: all 0.15s ease;
}
.icon-btn:hover { background: var(--bg-card-hover); color: var(--text-primary); }
.icon-btn:active { transform: scale(0.93); }
/* Custom Day/Night Toggle Switch — Premium Redesign */
.day-night-toggle {
    position: relative;
    width: 80px;
    height: 36px;
    border-radius: 18px;
    cursor: pointer;
    overflow: hidden;
    transition: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2), inset 0 -2px 6px rgba(0, 0, 0, 0.15);
    background: linear-gradient(180deg, #0a0e27 0%, #1a1d4e 50%, #2d1b69 100%);
    border: 1px solid rgba(255, 255, 255, 0.06);
    display: inline-block;
    vertical-align: middle;
    flex-shrink: 0;
}
.day-night-toggle:hover {
    transform: scale(1.06);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3), inset 0 -2px 6px rgba(0, 0, 0, 0.15);
}
.day-night-toggle:active { transform: scale(0.95); }

/* Light mode sky */
[data-theme="light"] .day-night-toggle {
    background: linear-gradient(180deg, #38bdf8 0%, #7dd3fc 50%, #bae6fd 100%);
    border-color: rgba(56, 189, 248, 0.2);
    box-shadow: 0 4px 14px rgba(56, 189, 248, 0.25), inset 0 -2px 6px rgba(0, 0, 0, 0.05);
}
[data-theme="light"] .day-night-toggle:hover {
    box-shadow: 0 6px 20px rgba(56, 189, 248, 0.4), inset 0 -2px 6px rgba(0, 0, 0, 0.05);
}

/* Stars container (dark mode) */
.toggle-stars {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    opacity: 1;
    transition: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}
[data-theme="light"] .toggle-stars {
    opacity: 0;
    transform: scale(0.5) translateY(-8px);
}

/* Stars */
.star {
    position: absolute;
    background: #fefce8;
    border-radius: 50%;
    box-shadow: 0 0 3px #fefce8, 0 0 6px rgba(254, 252, 232, 0.3);
}
.star-1 { width: 2px; height: 2px; top: 8px; left: 14px; animation: twinkle 2.5s infinite ease-in-out; }
.star-2 { width: 3px; height: 3px; top: 20px; left: 10px; animation: twinkle 3.5s infinite ease-in-out 0.3s; }
.star-3 { width: 2px; height: 2px; top: 24px; left: 24px; animation: twinkle 2s infinite ease-in-out 0.8s; }
.star-4 { width: 2px; height: 2px; top: 6px; left: 30px; animation: twinkle 4s infinite ease-in-out 1.2s; }
.star-5 { width: 3px; height: 3px; top: 16px; left: 36px; animation: twinkle 3s infinite ease-in-out 0.5s; }

@keyframes twinkle {
    0%, 100% { opacity: 0.2; transform: scale(0.8); }
    50% { opacity: 1; transform: scale(1.2); }
}

/* Shooting star */
.shooting-star {
    position: absolute;
    top: 10px;
    left: 8px;
    width: 12px;
    height: 1.5px;
    background: linear-gradient(90deg, rgba(255,255,255,0.8), transparent);
    border-radius: 1px;
    opacity: 0;
    animation: shootingStar 4s infinite ease-in-out 2s;
}
@keyframes shootingStar {
    0%, 85%, 100% { opacity: 0; transform: translateX(0) translateY(0) scaleX(0); }
    90% { opacity: 1; transform: translateX(20px) translateY(6px) scaleX(1); }
    95% { opacity: 0; transform: translateX(32px) translateY(10px) scaleX(0.3); }
}
[data-theme="light"] .shooting-star { animation: none; opacity: 0; }

/* Clouds container (light mode) */
.toggle-clouds {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    opacity: 0;
    transform: translateY(8px);
    transition: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}
[data-theme="light"] .toggle-clouds {
    opacity: 1;
    transform: translateY(0);
}

/* Clouds */
.cloud {
    position: absolute;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    filter: blur(0.5px);
}
.cloud-1 { width: 20px; height: 12px; bottom: 2px; right: 28px; border-radius: 10px; animation: cloudDrift 6s infinite ease-in-out; }
.cloud-2 { width: 28px; height: 14px; bottom: -2px; right: 8px; border-radius: 10px; animation: cloudDrift 8s infinite ease-in-out 1s; }
.cloud-3 { width: 14px; height: 8px; bottom: 8px; right: 16px; border-radius: 8px; opacity: 0.7; animation: cloudDrift 5s infinite ease-in-out 2s; }

@keyframes cloudDrift {
    0%, 100% { transform: translateX(0); }
    50% { transform: translateX(3px); }
}

/* Sun rays (light mode only) */
.sun-rays {
    position: absolute;
    top: 5px;
    left: 5px;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    opacity: 0;
    transition: opacity 0.5s ease;
    z-index: 1;
    background: transparent;
    box-shadow: 0 0 0 3px rgba(255, 200, 50, 0.15), 0 0 0 7px rgba(255, 200, 50, 0.08), 0 0 0 12px rgba(255, 200, 50, 0.03);
    animation: sunPulse 3s infinite ease-in-out;
}
[data-theme="light"] .sun-rays {
    opacity: 1;
}
@keyframes sunPulse {
    0%, 100% { transform: scale(1); opacity: 0.8; }
    50% { transform: scale(1.1); opacity: 1; }
}

/* The knob — Sun/Moon */
.day-night-toggle .toggle-knob {
    position: absolute;
    top: 4px;
    left: 48px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    transition: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    background: linear-gradient(145deg, #e8e4f0, #c9c3d8);
    box-shadow: inset -3px -2px 4px rgba(0,0,0,0.12), 0 3px 8px rgba(0,0,0,0.3), 0 0 12px rgba(200, 195, 216, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    z-index: 3;
}

/* Sun knob state */
[data-theme="light"] .day-night-toggle .toggle-knob {
    left: 4px;
    background: linear-gradient(145deg, #fde047, #f59e0b);
    box-shadow: inset -2px -2px 4px rgba(0,0,0,0.08), 0 3px 10px rgba(245, 158, 11, 0.5), 0 0 20px rgba(245, 158, 11, 0.2);
}

/* Moon craters */
.day-night-toggle .toggle-knob .crater {
    position: absolute;
    background: rgba(180, 175, 195, 0.6);
    border-radius: 50%;
    box-shadow: inset 1px 1px 2px rgba(0,0,0,0.1);
    opacity: 1;
    transition: all 0.4s ease;
}
.crater-1 { width: 6px; height: 6px; top: 5px; left: 6px; }
.crater-2 { width: 8px; height: 8px; top: 13px; left: 14px; }
.crater-3 { width: 4px; height: 4px; bottom: 5px; left: 7px; }

[data-theme="light"] .day-night-toggle .toggle-knob .crater {
    opacity: 0;
    transform: scale(0);
}
/* ===== BALANCE CARD ===== */
.balance-card {
    position: relative; border-radius: 20px; overflow: hidden; margin-bottom: 20px;
    animation: card-enter 0.5s cubic-bezier(0.34,1.56,0.64,1) forwards;
}
@keyframes card-enter { from { opacity:0; transform:translateY(16px) scale(0.97); } to { opacity:1; transform:translateY(0) scale(1); } }
.balance-card-bg {
    position: absolute; inset: 0;
    background: linear-gradient(135deg, #1e1b4b 0%, #312e81 40%, #4338ca 100%);
}
.balance-card-bg::before {
    content: ''; position: absolute; top: -50%; right: -30%; width: 200%; height: 200%;
    background: radial-gradient(ellipse at center, rgba(255,107,107,0.1) 0%, transparent 60%);
    animation: float-glow 8s ease-in-out infinite;
}
@keyframes float-glow { 0%,100%{transform:translate(0,0)} 50%{transform:translate(10px,-10px)} }
.balance-card-content { position: relative; z-index: 1; padding: 22px; }
.balance-label { display:flex; align-items:center; gap:6px; font-size:12px; color:rgba(255,255,255,0.5); font-weight:500; margin-bottom:6px; }
.balance-amount { display:flex; align-items:baseline; gap:4px; margin-bottom:6px; }
.currency { font-size:16px; font-weight:600; color:rgba(255,255,255,0.6); }
.amount { font-size:30px; font-weight:800; letter-spacing:-1px; color:white; }
.balance-change {
    display:inline-flex; align-items:center; gap:4px; font-size:12px;
    font-weight:600; padding:4px 10px; border-radius:20px; margin-bottom:16px;
}
.balance-change.positive { color:#4ade80; background:rgba(74,222,128,0.12); }
.balance-change.negative { color:var(--accent-coral); background:rgba(255,107,107,0.12); }
.balance-change.neutral { color:rgba(255,255,255,0.4); background:rgba(255,255,255,0.06); }
.balance-actions {
    display:flex; justify-content:space-around; gap:8px;
    padding-top:14px; border-top:1px solid rgba(255,255,255,0.08);
}
.balance-action-btn { display:flex; flex-direction:column; align-items:center; gap:6px; flex:1; padding:6px 0; }
.balance-action-btn span { font-size:11px; color:rgba(255,255,255,0.45); font-weight:500; }
.balance-action-btn:active .action-icon { transform:scale(0.9); }
.action-icon {
    width:40px; height:40px; border-radius:12px;
    display:flex; align-items:center; justify-content:center;
    transition: transform 0.3s cubic-bezier(0.34,1.56,0.64,1);
}
.action-icon.add, .action-icon.send, .action-icon.request, .action-icon.scan {
    background: rgba(255, 255, 255, 0.12) !important;
    color: #ffffff !important;
}
.action-icon svg {
    stroke: #ffffff !important;
    stroke-width: 2.2px !important;
}

/* ===== SECTIONS ===== */
.section { margin-bottom: 20px; }
.section-header { display:flex; justify-content:space-between; align-items:center; margin-bottom:12px; }
.section-header h2 { font-size:16px; font-weight:700; letter-spacing:-0.2px; }

/* ===== SPENDING ===== */
.spending-overview {
    display:flex; align-items:center; gap:20px;
    background:var(--bg-card); border-radius:16px; padding:20px;
    border:1px solid var(--border-subtle); transition: background 0.3s ease;
}
.spending-chart-container { position:relative; width:120px; height:120px; flex-shrink:0; }
.spending-chart-container canvas { width:120px !important; height:120px !important; }
.chart-center { position:absolute; top:50%; left:50%; transform:translate(-50%,-50%); text-align:center; }
.chart-total-label { display:block; font-size:9px; color:var(--text-muted); font-weight:600; text-transform:uppercase; letter-spacing:0.5px; }
.chart-total-amount { display:block; font-size:13px; font-weight:800; letter-spacing:-0.3px; }
.spending-categories { flex:1; display:flex; flex-direction:column; gap:8px; }
.category-item { display:flex; align-items:center; gap:8px; }
.category-dot { width:8px; height:8px; border-radius:50%; flex-shrink:0; }
.category-info { flex:1; min-width:0; }
.category-name { font-size:12px; font-weight:600; display:block; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.category-amount { font-size:11px; color:var(--text-muted); font-weight:500; }

/* ===== TRANSACTIONS ===== */
.transactions-list { display:flex; flex-direction:column; gap:2px; }
.transaction-date-header {
    font-size:11px; font-weight:600; color:var(--text-muted);
    text-transform:uppercase; letter-spacing:0.5px; padding:12px 0 6px;
}
.transaction-item {
    display:flex; align-items:center; gap:12px; padding:12px;
    border-radius:12px; transition: background 0.15s ease; cursor:pointer;
}
.transaction-item:hover { background:var(--bg-card); }
.transaction-item:active { transform:scale(0.98); }
.transaction-icon {
    width:40px; height:40px; border-radius:10px;
    display:flex; align-items:center; justify-content:center; flex-shrink:0; font-size:18px;
}
.transaction-details { flex:1; min-width:0; }
.transaction-name { font-size:14px; font-weight:600; display:block; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.transaction-category { font-size:11px; color:var(--text-muted); font-weight:500; }
.transaction-amount-col { text-align:right; flex-shrink:0; }
.transaction-amount { font-size:14px; font-weight:700; display:block; letter-spacing:-0.3px; }
.transaction-amount.expense { color:var(--text-primary); }
.transaction-amount.income { color:var(--color-success); }
.transaction-time { font-size:10px; color:var(--text-muted); }
.transaction-delete {
    width:28px; height:28px; border-radius:8px; display:flex; align-items:center; justify-content:center;
    color:var(--color-danger); background:var(--color-danger-bg); flex-shrink:0;
    opacity:0; transition: opacity 0.2s ease;
}
.transaction-item:hover .transaction-delete { opacity:1; }

/* ===== PAGE HEADERS ===== */
.page-header { padding:12px 0 16px; }
.page-header h1 { font-size:26px; font-weight:800; letter-spacing:-0.5px; }
.page-header-row { display:flex; justify-content:space-between; align-items:center; }
.add-fab-btn {
    width:38px; height:38px; border-radius:12px;
    background:var(--accent-gradient); color:white;
    display:flex; align-items:center; justify-content:center;
    box-shadow: 0 4px 12px rgba(255,107,107,0.3);
    transition: all 0.2s ease;
}
.add-fab-btn:active { transform:scale(0.9); }

/* Export Report Button */
.export-report-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(129,140,248,0.15), rgba(99,102,241,0.25));
    border: 1px solid rgba(129,140,248,0.4);
    color: #a5b4fc;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
    white-space: nowrap;
}
.export-report-btn:hover {
    background: linear-gradient(135deg, rgba(129,140,248,0.3), rgba(99,102,241,0.4));
    border-color: rgba(129,140,248,0.7);
    color: #c7d2fe;
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(99,102,241,0.3);
}
.export-report-btn:active { transform: scale(0.96); }
.export-report-btn.loading {
    opacity: 0.7;
    pointer-events: none;
    animation: exportPulse 1s ease-in-out infinite;
}
@keyframes exportPulse {
    0%, 100% { opacity: 0.7; }
    50% { opacity: 0.4; }
}



/* Month Navigator */
.month-nav { display:flex; align-items:center; gap:12px; margin-top:8px; }
.month-nav-btn {
    width:32px; height:32px; border-radius:8px; display:flex; align-items:center; justify-content:center;
    background:var(--bg-card); color:var(--text-secondary); border:1px solid var(--border-subtle);
    transition: all 0.15s ease;
}
.month-nav-btn:hover { background:var(--bg-card-hover); }
.month-label { font-size:15px; font-weight:600; min-width:120px; text-align:center; }

/* ===== ANALYTICS ===== */
.analytics-summary { display:flex; gap:12px; margin-bottom:16px; }
.analytics-card {
    flex:1; background:var(--bg-card); border-radius:14px; padding:14px;
    border:1px solid var(--border-subtle); display:flex; flex-direction:column; gap:4px;
    transition: background 0.3s ease;
}
.analytics-card-icon { width:34px; height:34px; border-radius:10px; display:flex; align-items:center; justify-content:center; }
.analytics-card.income .analytics-card-icon { background:var(--color-success-bg); color:var(--color-success); }
.analytics-card.expense .analytics-card-icon { background:var(--color-danger-bg); color:var(--color-danger); }
.analytics-card-label { font-size:11px; color:var(--text-muted); font-weight:500; }
.analytics-card-amount { font-size:15px; font-weight:800; letter-spacing:-0.3px; }
.analytics-card-change { font-size:11px; font-weight:600; }
.analytics-card-change.positive { color:var(--color-success); }
.analytics-card-change.negative { color:var(--color-danger); }

.chart-section {
    background:var(--bg-card); border-radius:16px; padding:16px;
    margin-bottom:16px; border:1px solid var(--border-subtle);
    transition: background 0.3s ease;
}
.chart-section h3 { font-size:14px; font-weight:700; margin-bottom:16px; }
.bar-chart { display:flex; align-items:flex-end; justify-content:space-between; height:140px; gap:4px; overflow-x:auto; }
.bar-col { flex: 0 0 auto; min-width: 28px; display:flex; flex-direction:column; align-items:center; gap:6px; height:100%; justify-content:flex-end; }
.bar-wrapper { width:100%; display:flex; gap:2px; align-items:flex-end; height:100%; justify-content:center; }
.bar { width:10px; border-radius:5px 5px 2px 2px; min-height:3px; transition: height 0.6s cubic-bezier(0.34,1.56,0.64,1); }
.bar.income-bar { background:linear-gradient(180deg, var(--color-success) 0%, rgba(16,185,129,0.3) 100%); }
.bar.expense-bar { background:linear-gradient(180deg, var(--accent-coral) 0%, rgba(255,107,107,0.3) 100%); }
.bar-label { font-size:9px; color:var(--text-muted); font-weight:600; }

/* Top Spending */
.top-spending-list { display:flex; flex-direction:column; gap:12px; }
.top-spending-item { display:flex; align-items:center; gap:10px; }
.top-spending-rank {
    width:22px; height:22px; border-radius:50%; font-size:10px; font-weight:700;
    display:flex; align-items:center; justify-content:center; flex-shrink:0;
}
.top-spending-rank.rank-1 { background:linear-gradient(135deg,#fbbf24,#f59e0b); color:#451a03; }
.top-spending-rank.rank-2 { background:linear-gradient(135deg,#94a3b8,#64748b); color:white; }
.top-spending-rank.rank-3 { background:linear-gradient(135deg,#d97706,#b45309); color:white; }
.top-spending-icon { width:36px; height:36px; border-radius:10px; display:flex; align-items:center; justify-content:center; font-size:16px; flex-shrink:0; }
.top-spending-info { flex:1; min-width:0; }
.top-spending-name { font-size:13px; font-weight:600; display:block; }
.top-spending-bar { height:4px; background:rgba(148,163,184,0.1); border-radius:2px; margin-top:4px; overflow:hidden; }
.top-spending-bar-fill { height:100%; border-radius:2px; transition:width 1s ease-out; }
.top-spending-amount { font-size:13px; font-weight:700; flex-shrink:0; }

/* ===== SAVINGS ===== */
.savings-total-card {
    background:var(--bg-card); border-radius:16px; padding:20px;
    text-align:center; margin-bottom:20px; border:1px solid var(--border-subtle);
    transition: background 0.3s ease;
}
.savings-total-label { font-size:12px; color:var(--text-muted); font-weight:600; text-transform:uppercase; letter-spacing:0.5px; display:block; margin-bottom:4px; }
.savings-total-amount { font-size:26px; font-weight:800; letter-spacing:-0.5px; }

.savings-goals-list { display:flex; flex-direction:column; gap:12px; }
.savings-goal-card {
    background:var(--bg-card); border-radius:14px; padding:16px;
    border:1px solid var(--border-subtle); cursor:pointer;
    transition: all 0.2s ease;
}
.savings-goal-card:hover { background:var(--bg-card-hover); transform:translateY(-1px); }
.savings-goal-top { display:flex; align-items:center; gap:12px; margin-bottom:10px; }
.savings-goal-emoji {
    width:40px; height:40px; border-radius:10px;
    display:flex; align-items:center; justify-content:center; font-size:20px; flex-shrink:0;
}
.savings-goal-info { flex:1; }
.savings-goal-title { font-size:14px; font-weight:600; display:block; }
.savings-goal-amounts { font-size:12px; color:var(--text-muted); font-weight:500; }
.savings-goal-actions { display:flex; gap:8px; flex-shrink:0; }
.savings-goal-actions button {
    width:30px; height:30px; border-radius:8px; display:flex; align-items:center; justify-content:center;
    transition: all 0.15s ease;
}
.savings-action-add { background:var(--color-success-bg); color:var(--color-success); }
.savings-action-delete { background:var(--color-danger-bg); color:var(--color-danger); }
.savings-action-add:active, .savings-action-delete:active { transform:scale(0.9); }
.savings-progress-bar { height:6px; border-radius:3px; background:rgba(148,163,184,0.1); overflow:hidden; margin-bottom:4px; }
.savings-progress-fill { height:100%; border-radius:3px; transition:width 0.8s ease; }
.savings-progress-row { display:flex; justify-content:space-between; align-items:center; }
.savings-progress-text { font-size:11px; font-weight:600; }
.savings-deadline { font-size:10px; color:var(--text-muted); }

/* ===== PROFILE ===== */
.profile-header-card {
    display:flex; flex-direction:column; align-items:center;
    background:var(--bg-card); border-radius:16px; padding:28px 20px 20px;
    margin-bottom:24px; border:1px solid var(--border-subtle);
    position:relative; overflow:hidden; transition: background 0.3s ease;
}
.profile-header-card::before {
    content:''; position:absolute; top:0; left:0; right:0; height:70px;
    background:var(--accent-gradient); opacity:0.1;
}
.profile-avatar {
    width:64px; height:64px; border-radius:50%; background:var(--accent-gradient);
    display:flex; align-items:center; justify-content:center;
    font-size:24px; font-weight:800; color:white; margin-bottom:12px;
    box-shadow:0 6px 20px rgba(255,107,107,0.25); position:relative; z-index:1;
}
.profile-name { font-size:20px; font-weight:800; letter-spacing:-0.3px; margin-bottom:2px; position:relative; z-index:1; }
.profile-email { font-size:13px; color:var(--text-muted); font-weight:500; position:relative; z-index:1; }

.settings-list { display:flex; flex-direction:column; gap:20px; }
.settings-group-title { font-size:11px; font-weight:600; color:var(--text-muted); text-transform:uppercase; letter-spacing:0.5px; padding-left:12px; margin-bottom:6px; }
.settings-item {
    display:flex; align-items:center; gap:12px; padding:12px;
    border-radius:12px; transition:background 0.15s ease; width:100%; text-align:left; cursor:pointer;
}
.settings-item:hover { background:var(--bg-card); }
.settings-item-icon { width:38px; height:38px; border-radius:10px; display:flex; align-items:center; justify-content:center; flex-shrink:0; }
.settings-item-text { flex:1; display:flex; flex-direction:column; gap:1px; }
.settings-item-title { font-size:14px; font-weight:600; }
.settings-item-subtitle { font-size:12px; color:var(--text-muted); }
.logout-btn {
    display:flex; align-items:center; justify-content:center; gap:8px;
    width:100%; padding:14px; margin-top:24px; border-radius:12px;
    background:var(--color-danger-bg); color:var(--color-danger);
    font-size:15px; font-weight:600; transition:all 0.15s ease;
    border:1px solid rgba(239,68,68,0.1);
}
.logout-btn:hover { background:rgba(239,68,68,0.2); }
.logout-btn:active { transform:scale(0.98); }

/* ===== BOTTOM NAV ===== */
.bottom-nav {
    position:absolute; bottom:0; left:0; right:0;
    display:flex; justify-content:space-around; padding:6px 0;
    padding-bottom:max(10px, env(safe-area-inset-bottom));
    background:var(--bg-elevated); backdrop-filter:blur(20px); -webkit-backdrop-filter:blur(20px);
    border-top:1px solid var(--border-subtle); z-index:200;
    transition: background 0.3s ease;
}
.nav-item {
    display:flex; flex-direction:column; align-items:center; gap:3px;
    padding:6px 14px; border-radius:10px; color:var(--text-muted);
    transition:all 0.15s ease; position:relative;
}
.nav-item span { font-size:10px; font-weight:600; }
.nav-item .nav-icon { transition:transform 0.3s cubic-bezier(0.34,1.56,0.64,1); }
.nav-item:active .nav-icon { transform:scale(0.85); }
.nav-item.active { color:var(--accent-coral); }
.nav-item.active .nav-icon { transform:translateY(-1px); }
.nav-item.active::before {
    content:''; position:absolute; top:-6px; width:20px; height:3px; border-radius:2px;
    background:var(--accent-coral); animation:indicator-in 0.3s ease forwards;
}
@keyframes indicator-in { from{width:0;opacity:0} to{width:20px;opacity:1} }

/* ===== MODAL / BOTTOM SHEET ===== */
.modal-overlay {
    position:absolute; inset:0; z-index:400;
    background:rgba(0,0,0,0.5); backdrop-filter:blur(4px);
    display:none; opacity:0; transition:opacity 0.25s ease;
}
.modal-overlay.active { display:flex; opacity:1; align-items:flex-end; }
.modal-sheet {
    width:100%; max-height:85%; background:var(--bg-primary);
    border-radius:20px 20px 0 0; padding:0 20px 24px;
    overflow-y:auto; transform:translateY(100%);
    transition: transform 0.35s cubic-bezier(0.34,1.56,0.64,1), background 0.3s ease;
}
.modal-overlay.active .modal-sheet { transform:translateY(0); }
.modal-handle { width:36px; height:4px; border-radius:2px; background:var(--border-light); margin:10px auto 12px; }
.modal-header { display:flex; justify-content:space-between; align-items:center; margin-bottom:20px; }
.modal-header h2 { font-size:18px; font-weight:700; }
.modal-close { width:32px; height:32px; border-radius:8px; background:var(--bg-card); display:flex; align-items:center; justify-content:center; color:var(--text-muted); }
.modal-close:hover { color:var(--text-primary); }
.modal-body { display:flex; flex-direction:column; gap:14px; }
.modal-submit-btn {
    width:100%; padding:14px; font-size:15px; font-weight:700;
    background:var(--accent-gradient); color:white; border-radius:12px;
    margin-top:6px; transition:all 0.2s ease;
    box-shadow:0 4px 12px rgba(255,107,107,0.25);
}
.modal-submit-btn:active { transform:scale(0.98); }
.modal-submit-btn.success-btn { background:linear-gradient(135deg, #10b981, #34d399); box-shadow:0 4px 12px rgba(16,185,129,0.25); }

/* Category Picker */
.category-picker { display:flex; flex-direction:column; gap:6px; }
.category-parent {
    display:flex; align-items:center; gap:10px; padding:10px 12px;
    border-radius:10px; background:var(--bg-card); cursor:pointer;
    border:1px solid var(--border-subtle); transition:all 0.15s ease;
}
.category-parent:hover { background:var(--bg-card-hover); }
.category-parent.expanded { border-color:var(--accent-coral); }
.category-parent-emoji, .category-child-emoji {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    margin-right: 4px;
    flex-shrink: 0;
    transition: all 0.2s ease;
}
[data-theme="light"] .category-parent-emoji,
[data-theme="light"] .category-child-emoji {
    background: rgba(15, 23, 42, 0.85) !important;
}
.category-parent-emoji i, .category-parent-emoji svg,
.category-child-emoji i, .category-child-emoji svg {
    color: #ffffff !important;
    stroke: #ffffff !important;
    font-size: 14px !important;
    width: 14px !important;
    height: 14px !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    stroke-width: 2.2px !important;
}
.category-parent-name { flex:1; font-size:14px; font-weight:600; }
.category-parent-chevron { color:var(--text-muted); transition:transform 0.2s ease; }
.category-parent.expanded .category-parent-chevron { transform:rotate(90deg); }
.category-children { display:none; padding-left:16px; gap:4px; flex-direction:column; }
.category-children.show { display:flex; }
.category-child {
    display:flex; align-items:center; gap:8px; padding:8px 10px;
    border-radius:8px; cursor:pointer; transition:background 0.15s ease;
}
.category-child:hover { background:var(--bg-card); }
.category-child.selected { background:rgba(255,107,107,0.1); color:var(--accent-coral); }
.category-child-name { font-size:13px; font-weight:500; }

/* Selected Category Icon style */
#selectedCategory i, #selectedCategory svg,
#budgetSelectedCategory i, #budgetSelectedCategory svg {
    color: var(--text-primary) !important;
    vertical-align: middle;
    margin-right: 6px;
    stroke-width: 2.2px;
}

/* Emoji picker for savings */
.emoji-grid { display:grid; grid-template-columns:repeat(6,1fr); gap:6px; }
.icon-option {
    width:100%; aspect-ratio:1; border-radius:10px; background:var(--bg-card);
    display:flex; align-items:center; justify-content:center;
    cursor:pointer; border:2px solid transparent; transition:all 0.15s ease;
}
.icon-option i, .icon-option svg {
    color: var(--text-primary) !important;
    width: 20px !important;
    height: 20px !important;
    stroke-width: 2.2px;
}
.icon-option:hover { background:var(--bg-card-hover); }
.icon-option.selected { border-color:var(--accent-coral); background:rgba(255,107,107,0.1); }
.icon-option.selected i, .icon-option.selected svg {
    color: var(--accent-coral) !important;
}

/* ===== EMPTY STATES ===== */
.empty-state {
    display:flex; flex-direction:column; align-items:center; justify-content:center;
    padding:40px 20px; color:var(--text-muted); text-align:center;
}
.empty-icon { font-size:40px; margin-bottom:12px; opacity:0.5; }
.empty-text { font-size:15px; font-weight:600; margin-bottom:4px; }
.empty-sub { font-size:12px; }
.empty-state-small { text-align:center; padding:16px; font-size:13px; color:var(--text-muted); }

/* ===== TOAST ===== */
.toast {
    position:absolute; bottom:90px; left:50%; transform:translateX(-50%) translateY(20px);
    opacity:0; pointer-events:none; transition:all 0.25s ease; z-index:500;
}
.toast.show { transform:translateX(-50%) translateY(0); opacity:1; }
.toast-content {
    display:flex; align-items:center; gap:8px; background:var(--bg-elevated);
    backdrop-filter:blur(12px); padding:12px 20px; border-radius:14px;
    border:1px solid var(--border-light); box-shadow:var(--shadow-lg);
    color:var(--color-success); font-size:13px; font-weight:600; white-space:nowrap;
}

/* ===== SPACER ===== */
.bottom-spacer { height:30px; }
::-webkit-scrollbar { display:none; }

/* ===== RESPONSIVE ===== */
@media (max-width: 380px) {
    .amount { font-size:26px; }
    .spending-overview { flex-direction:column; }
}

/* ===== SKELETON LOADING ===== */
.skeleton {
    background: var(--bg-card-hover);
    position: relative;
    overflow: hidden;
    border-radius: 8px;
}
.skeleton::after {
    content: '';
    position: absolute;
    top: 0; right: 0; bottom: 0; left: 0;
    transform: translateX(-100%);
    background-image: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0) 0,
        rgba(255, 255, 255, 0.05) 20%,
        rgba(255, 255, 255, 0.1) 60%,
        rgba(255, 255, 255, 0)
    );
    animation: shimmer 1.5s infinite;
}
[data-theme="light"] .skeleton::after {
    background-image: linear-gradient(
        90deg,
        rgba(0, 0, 0, 0) 0,
        rgba(0, 0, 0, 0.02) 20%,
        rgba(0, 0, 0, 0.05) 60%,
        rgba(0, 0, 0, 0)
    );
}
@keyframes shimmer { 100% { transform: translateX(100%); } }

/* Skeleton parts */
.sk-avatar { width: 42px; height: 42px; border-radius: 50%; }
.sk-text { height: 14px; border-radius: 4px; margin-bottom: 6px; }
.sk-text.w-50 { width: 50%; }
.sk-text.w-75 { width: 75%; }
.sk-text.w-30 { width: 30%; }
.sk-card { height: 160px; border-radius: 20px; }
.sk-item { height: 64px; border-radius: 12px; }
.sk-circle { width: 120px; height: 120px; border-radius: 50%; }

/* ===== PULL TO REFRESH ===== */
.ptr-container {
    position: absolute;
    top: 0; left: 0; right: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 60px;
    transform: translateY(-100%);
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 600;
    transition: transform 0.2s ease;
    z-index: 10;
}
.ptr-icon {
    margin-right: 8px;
    transition: transform 0.2s ease;
}
.ptr-icon.spin { animation: spin 1s linear infinite; }
@keyframes spin { 100% { transform: rotate(360deg); } }

/* ===== SWIPE TO DELETE ===== */
.transaction-item {
    position: relative;
    overflow: hidden;
    padding: 0; /* Reset padding for swipe */
    display: block; /* Override display: flex */
}
.transaction-content {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    width: 100%;
    box-sizing: border-box;
    background: var(--bg-primary); /* Hide red background when not swiped */
    border-radius: 12px;
    position: relative;
    z-index: 2;
    transition: transform 0.2s ease-out;
}
.transaction-item:hover .transaction-content {
    background: var(--bg-card);
}
.transaction-delete-bg {
    position: absolute;
    top: 0; right: 0; bottom: 0; left: 0;
    background: var(--color-danger);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: 20px;
    color: white;
    font-size: 14px;
    font-weight: 600;
    z-index: 1;
}
.transaction-item:hover .transaction-delete { opacity: 0; /* Original delete button is hidden, swipe is used */ }

/* ===== ANIMATIONS ===== */
.fade-in-up {
    animation: fadeInUp 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
    opacity: 0;
    transform: translateY(10px);
}
@keyframes fadeInUp {
    to { opacity: 1; transform: translateY(0); }
}
.stagger-1 { animation-delay: 0.05s; }
.stagger-2 { animation-delay: 0.1s; }
.stagger-3 { animation-delay: 0.15s; }
.stagger-4 { animation-delay: 0.2s; }
.stagger-5 { animation-delay: 0.25s; }

/* ===== BUDGETING ===== */
.budget-overview-card {
    background: var(--bg-card);
    border-radius: 16px;
    padding: 20px;
    border: 1px solid var(--border-subtle);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.budget-total-info { display: flex; flex-direction: column; }
.budget-total-label { font-size: 12px; color: var(--text-muted); font-weight: 600; text-transform: uppercase; }
.budget-total-amount { font-size: 24px; font-weight: 800; letter-spacing: -0.5px; }
.budget-total-remain { font-size: 13px; font-weight: 600; margin-top: 4px; }
.budget-total-remain.good { color: var(--color-success); }
.budget-total-remain.warning { color: var(--color-warning); }
.budget-total-remain.danger { color: var(--color-danger); }

.budget-chart-circle {
    position: relative;
    width: 70px; height: 70px;
    display: flex; align-items: center; justify-content: center;
}
.budget-chart-circle svg { transform: rotate(-90deg); width: 100%; height: 100%; }
.budget-chart-circle circle { fill: none; stroke-width: 8; stroke-linecap: round; }
.budget-chart-bg { stroke: var(--bg-input); }
.budget-chart-progress {
    stroke: var(--color-success);
    stroke-dasharray: 175; 
    stroke-dashoffset: 175;
    transition: stroke-dashoffset 1s ease-in-out, stroke 0.3s ease;
}
.budget-chart-text {
    position: absolute; font-size: 13px; font-weight: 700;
}

.budget-list { display: flex; flex-direction: column; gap: 12px; }
.budget-item {
    background: var(--bg-card);
    border-radius: 14px;
    padding: 16px;
    border: 1px solid var(--border-subtle);
    position: relative;
    cursor: pointer;
    transition: all 0.2s ease;
}
.budget-item:hover { background: var(--bg-card-hover); transform: translateY(-1px); }
.budget-item-top { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.budget-item-icon {
    width: 40px; height: 40px; border-radius: 10px;
    display: flex; align-items: center; justify-content: center; font-size: 20px; flex-shrink: 0;
}
.budget-item-info { flex: 1; }
.budget-item-title { font-size: 14px; font-weight: 600; display: block; }
.budget-item-amounts { font-size: 12px; color: var(--text-muted); font-weight: 500; }
.budget-item-delete {
    width: 30px; height: 30px; border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    color: var(--color-danger); background: var(--color-danger-bg);
    opacity: 0; transition: opacity 0.2s ease;
}
.budget-item:hover .budget-item-delete { opacity: 1; }
.budget-item-delete:active { transform: scale(0.9); }

.budget-progress-bar { height: 6px; border-radius: 3px; background: rgba(148,163,184,0.1); overflow: hidden; margin-bottom: 4px; }
.budget-progress-fill { height: 100%; border-radius: 3px; transition: width 0.8s ease, background 0.3s ease; }
.budget-progress-row { display: flex; justify-content: space-between; align-items: center; }
.budget-progress-text { font-size: 11px; font-weight: 600; }
.budget-remain-text { font-size: 11px; color: var(--text-muted); }

/* ===== DASHBOARD ENHANCEMENTS ===== */
.cashflow-container {
    background: var(--bg-card);
    border-radius: 16px;
    padding: 16px;
    margin-bottom: 20px;
    border: 1px solid var(--border-subtle);
}
.cashflow-header {
    display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px;
}
.cashflow-title { font-size: 14px; font-weight: 700; }
.cashflow-legend { display: flex; gap: 12px; font-size: 10px; font-weight: 600; color: var(--text-muted); }
.legend-item { display: flex; align-items: center; gap: 4px; }
.legend-dot { width: 6px; height: 6px; border-radius: 50%; }
.legend-dot.income { background: var(--color-success); }
.legend-dot.expense { background: var(--accent-coral); }
.cashflow-chart-wrap { position: relative; height: 120px; width: 100%; }

.comparison-cards {
    display: flex; flex-direction: column; gap: 10px; margin-bottom: 20px;
}
.comparison-card {
    background: var(--bg-card);
    border-radius: 14px; padding: 14px;
    border: 1px solid var(--border-subtle);
    display: flex; align-items: center; gap: 12px;
}
.comparison-icon {
    width: 36px; height: 36px; border-radius: 10px;
    display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.comparison-icon.income { background: var(--color-success-bg); color: var(--color-success); }
.comparison-icon.expense { background: var(--color-danger-bg); color: var(--color-danger); }
.comparison-info { flex: 1; }
.comparison-label { font-size: 12px; color: var(--text-muted); font-weight: 600; }
.comparison-value { font-size: 15px; font-weight: 700; }
.comparison-bars { width: 80px; display: flex; flex-direction: column; gap: 4px; justify-content: center; }
.comparison-bar-wrap { height: 4px; background: rgba(148,163,184,0.1); border-radius: 2px; }
.comparison-bar-fill { height: 100%; border-radius: 2px; }
.comparison-bar-fill.curr { background: var(--text-primary); }
.comparison-bar-fill.prev { background: var(--text-muted); opacity: 0.5; }
.comparison-month-label { font-size: 9px; color: var(--text-muted); margin-top: 2px; display: flex; justify-content: space-between; }

.trend-container {
    background: var(--bg-card);
    border-radius: 16px; padding: 16px;
    margin-bottom: 20px; border: 1px solid var(--border-subtle);
}
.trend-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.trend-title { font-size: 14px; font-weight: 700; }
.trend-chart-wrap { position: relative; height: 80px; width: 100%; }

/* ===== OFFLINE BANNER ===== */
.offline-banner {
    position: absolute; top: 0; left: 0; right: 0;
    background: var(--color-warning); color: #fff;
    font-size: 12px; font-weight: 600; text-align: center;
    padding: 6px; transform: translateY(-100%);
    transition: transform 0.3s ease;
    z-index: 1000;
}
.offline-banner.show { transform: translateY(0); }

/* Responsive Adjustments */
@media (max-width: 360px) {
    .page-header h1 { font-size: 22px; }
    .amount { font-size: 24px; }
    .action-icon { width: 36px; height: 36px; }
    .budget-total-amount { font-size: 20px; }
    .nav-item { padding: 6px 10px; }
}

@media (min-width: 768px) {
    .app-container { max-width: 430px; margin: 0 auto; }
}

/* ===== ESTETIK & WHITE ICON OVERRIDES FOR TRANSACTIONS, BUDGETS, GOALS & ANALYTICS ===== */
.transaction-icon i, .transaction-icon svg,
.budget-item-icon i, .budget-item-icon svg,
.savings-goal-emoji i, .savings-goal-emoji svg,
.top-spending-icon i, .top-spending-icon svg,
.comparison-icon i, .comparison-icon svg,
.category-name i, .category-name svg {
    color: #ffffff !important;
    stroke: #ffffff !important;
    stroke-width: 2.2px !important;
    filter: drop-shadow(0 1px 2px rgba(0,0,0,0.15));
    transition: all 0.2s ease;
}

/* Increase contrast for icons on both dark and light modes */
.transaction-icon,
.budget-item-icon,
.savings-goal-emoji,
.top-spending-icon,
.comparison-icon {
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.05);
    transition: all 0.2s ease;
}

[data-theme="light"] .transaction-icon,
[data-theme="light"] .budget-item-icon,
[data-theme="light"] .savings-goal-emoji,
[data-theme="light"] .top-spending-icon,
[data-theme="light"] .comparison-icon {
    background-color: rgba(15, 23, 42, 0.85) !important; /* solid/semi-solid dark slate bubble for light theme contrast */
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.05);
}

/* ===== CAMERA OCR SCANNER STYLE ===== */
.scanner-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    padding: 30px 20px;
    border: 2px dashed var(--border-light);
    border-radius: 16px;
    background: var(--bg-card);
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
}
.scanner-container:hover {
    border-color: var(--accent-coral);
    background: var(--bg-card-hover);
}
.scanner-container svg {
    color: var(--text-muted);
    transition: color 0.2s;
}
.scanner-container:hover svg {
    color: var(--accent-coral);
}
.scan-instructions {
    font-size: 13px;
    color: var(--text-secondary);
}
.scan-preview-wrapper {
    position: relative;
    width: 100%;
    max-height: 220px;
    border-radius: 12px;
    overflow: hidden;
    display: none;
    border: 1px solid var(--border-light);
}
.scan-preview {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #000;
}
.scan-preview-wrapper .remove-preview-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(0,0,0,0.6);
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
}
.ocr-loading {
    display: none;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 24px;
    text-align: center;
}
.ocr-loading-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid rgba(255, 107, 107, 0.1);
    border-top: 3px solid var(--accent-coral);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}
.ocr-loading-text {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}
.ocr-loading-subtext {
    font-size: 12px;
    color: var(--text-muted);
}
.ocr-results-container {
    display: none;
    flex-direction: column;
    gap: 14px;
}
.ocr-total-header {
    background: var(--bg-card);
    border-radius: 12px;
    padding: 14px;
    border: 1px solid var(--border-subtle);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.ocr-total-label {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
}
.ocr-total-value {
    font-size: 18px;
    font-weight: 800;
    color: var(--text-primary);
}
.ocr-items-list-header {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    margin-bottom: -4px;
}
.ocr-items-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 260px;
    overflow-y: auto;
    padding-right: 4px;
}
.ocr-item-row {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--bg-card);
    border-radius: 12px;
    padding: 10px 12px;
    border: 1px solid var(--border-subtle);
}
.ocr-item-row .ocr-item-check {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--accent-coral);
    flex-shrink: 0;
}
.ocr-item-row .ocr-item-desc {
    flex: 2;
    min-width: 0;
    font-size: 13px;
    font-weight: 600;
    background: transparent !important;
    border: none !important;
    padding: 4px !important;
    color: var(--text-primary);
}
.ocr-item-row .ocr-item-desc:focus {
    border-bottom: 1px solid var(--accent-coral) !important;
    border-radius: 0 !important;
}
.ocr-item-row .ocr-item-amount {
    flex: 1.2;
    min-width: 0;
    font-size: 13px;
    font-weight: 700;
    background: transparent !important;
    border: none !important;
    padding: 4px !important;
    color: var(--text-primary);
    text-align: right;
}
.ocr-item-row .ocr-item-amount:focus {
    border-bottom: 1px solid var(--accent-coral) !important;
    border-radius: 0 !important;
}
.ocr-item-row .ocr-item-cat {
    width: 110px;
    padding: 6px !important;
    font-size: 12px;
    font-weight: 600;
    background: var(--bg-input) !important;
    border: 1px solid var(--border-light) !important;
    border-radius: 8px !important;
    color: var(--text-primary);
    flex-shrink: 0;
}
.ocr-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 6px;
}

/* ===== 2026 UI POLISH: TACTILE CONTROLS ===== */
:root, [data-theme="dark"] {
    --control-surface: rgba(255, 255, 255, 0.075);
    --control-surface-hover: rgba(255, 255, 255, 0.12);
    --control-border: rgba(255, 255, 255, 0.12);
    --control-border-strong: rgba(255, 255, 255, 0.2);
    --control-shadow: 0 14px 32px rgba(0, 0, 0, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.08);
    --control-shadow-soft: 0 8px 22px rgba(0, 0, 0, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.07);
    --focus-ring: 0 0 0 3px rgba(255, 107, 107, 0.22);
}

[data-theme="light"] {
    --control-surface: rgba(255, 255, 255, 0.82);
    --control-surface-hover: rgba(255, 255, 255, 0.98);
    --control-border: rgba(15, 23, 42, 0.09);
    --control-border-strong: rgba(15, 23, 42, 0.16);
    --control-shadow: 0 14px 30px rgba(15, 23, 42, 0.11), inset 0 1px 0 rgba(255, 255, 255, 0.9);
    --control-shadow-soft: 0 8px 20px rgba(15, 23, 42, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.85);
    --focus-ring: 0 0 0 3px rgba(255, 107, 107, 0.2);
}

button,
.day-night-toggle,
.biometric-toggle,
.remember-me-label input[type="checkbox"] {
    touch-action: manipulation;
}

.auth-screen {
    justify-content: flex-start;
    overflow-y: auto;
}

.auth-container {
    margin: auto auto;
    padding: 12px 0;
}

button:focus-visible,
.day-night-toggle:focus-visible,
.biometric-toggle:focus-visible,
.remember-me-label input[type="checkbox"]:focus-visible,
.form-group input:focus-visible,
.form-group select:focus-visible,
.form-group textarea:focus-visible {
    outline: none;
    box-shadow: var(--focus-ring), var(--control-shadow-soft);
}

.auth-submit-btn,
.modal-submit-btn,
.biometric-register-btn,
.add-fab-btn {
    position: relative;
    isolation: isolate;
    border: 1px solid rgba(255, 255, 255, 0.16);
    background: linear-gradient(135deg, #ff5f73 0%, #ff8a55 54%, #ffd166 100%);
    box-shadow: 0 14px 30px rgba(255, 107, 107, 0.24), inset 0 1px 0 rgba(255, 255, 255, 0.24);
    transform: translateY(0);
    transition: transform 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease;
}

.auth-submit-btn::after,
.modal-submit-btn::after,
.biometric-register-btn::after,
.add-fab-btn::after {
    content: '';
    position: absolute;
    inset: 1px;
    border-radius: inherit;
    background: linear-gradient(180deg, rgba(255,255,255,0.28), rgba(255,255,255,0));
    pointer-events: none;
    z-index: -1;
}

.auth-submit-btn:hover,
.modal-submit-btn:hover,
.add-fab-btn:hover {
    filter: saturate(1.08) brightness(1.04);
    transform: translateY(-2px);
    box-shadow: 0 18px 38px rgba(255, 107, 107, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.28);
}

.auth-submit-btn:active,
.modal-submit-btn:active,
.biometric-register-btn:active,
.add-fab-btn:active {
    transform: translateY(0) scale(0.98);
    filter: saturate(0.98);
}

.modal-submit-btn.success-btn,
.biometric-register-btn {
    background: linear-gradient(135deg, #10b981 0%, #2dd4bf 58%, #86efac 100%);
    box-shadow: 0 14px 30px rgba(16, 185, 129, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.24);
}

.social-btn,
.otp-back-btn,
.otp-resend-btn,
.icon-btn,
.month-nav-btn,
.modal-close,
.logout-btn,
.biometric-cred-delete,
.category-parent,
.icon-option {
    border: 1px solid var(--control-border);
    background: var(--control-surface);
    box-shadow: var(--control-shadow-soft);
    backdrop-filter: blur(18px) saturate(1.18);
    -webkit-backdrop-filter: blur(18px) saturate(1.18);
    transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease, color 0.18s ease;
}

.social-btn:hover,
.otp-back-btn:hover,
.otp-resend-btn:hover:not(:disabled),
.icon-btn:hover,
.month-nav-btn:hover,
.modal-close:hover,
.category-parent:hover,
.icon-option:hover {
    background: var(--control-surface-hover);
    border-color: var(--control-border-strong);
    transform: translateY(-1px);
    box-shadow: var(--control-shadow);
}

.social-btn:active,
.otp-back-btn:active,
.otp-resend-btn:active,
.icon-btn:active,
.month-nav-btn:active,
.modal-close:active,
.category-parent:active,
.icon-option:active {
    transform: translateY(0) scale(0.97);
}

.password-toggle-btn {
    right: 8px;
    width: 36px;
    height: 36px;
    border-radius: 999px;
    color: var(--text-secondary);
    background: transparent;
    transition: background 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.password-toggle-btn:hover {
    background: var(--control-surface);
    color: var(--text-primary);
    transform: scale(1.04);
}

.remember-me-label input[type="checkbox"],
.ocr-item-row .ocr-item-check {
    appearance: none;
    -webkit-appearance: none;
    display: inline-grid;
    place-items: center;
    border: 1px solid var(--control-border-strong);
    border-radius: 6px;
    background: var(--control-surface);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.08);
    transition: background 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}

.remember-me-label input[type="checkbox"]::after,
.ocr-item-row .ocr-item-check::after {
    content: '';
    width: 9px;
    height: 5px;
    border-left: 2px solid white;
    border-bottom: 2px solid white;
    opacity: 0;
    transform: rotate(-45deg) scale(0.65) translateY(-1px);
    transition: opacity 0.18s ease, transform 0.18s ease;
}

.remember-me-label input[type="checkbox"]:checked,
.ocr-item-row .ocr-item-check:checked {
    background: linear-gradient(135deg, #ff5f73, #ff8a55);
    border-color: rgba(255, 255, 255, 0.22);
}

.remember-me-label input[type="checkbox"]:checked::after,
.ocr-item-row .ocr-item-check:checked::after {
    opacity: 1;
    transform: rotate(-45deg) scale(1) translateY(-1px);
}

.remember-me-label input[type="checkbox"]:active,
.ocr-item-row .ocr-item-check:active {
    transform: scale(0.92);
}

.day-night-toggle {
    width: 68px;
    height: 34px;
    border-radius: 999px;
    background: linear-gradient(135deg, #101828 0%, #27304f 100%);
    border: 1px solid var(--control-border);
    box-shadow: var(--control-shadow-soft);
    backdrop-filter: blur(20px) saturate(1.2);
    -webkit-backdrop-filter: blur(20px) saturate(1.2);
}

.day-night-toggle:hover {
    transform: translateY(-1px) scale(1.02);
    box-shadow: var(--control-shadow);
}

.day-night-toggle:active {
    transform: scale(0.97);
}

[data-theme="light"] .day-night-toggle {
    background: linear-gradient(135deg, #f8fafc 0%, #dbeafe 52%, #bae6fd 100%);
    border-color: rgba(14, 165, 233, 0.22);
    box-shadow: 0 12px 26px rgba(14, 165, 233, 0.16), inset 0 1px 0 rgba(255, 255, 255, 0.86);
}

.day-night-toggle .toggle-knob {
    top: 3px;
    left: 35px;
    width: 28px;
    height: 28px;
    background: radial-gradient(circle at 35% 30%, #ffffff 0 12%, #dbe4f0 45%, #a9b4c6 100%);
    box-shadow: 0 7px 16px rgba(0, 0, 0, 0.32), inset 0 1px 0 rgba(255, 255, 255, 0.75);
}

[data-theme="light"] .day-night-toggle .toggle-knob {
    left: 3px;
    background: radial-gradient(circle at 38% 32%, #fff7ad 0 20%, #fbbf24 54%, #f97316 100%);
    box-shadow: 0 7px 18px rgba(245, 158, 11, 0.34), inset 0 1px 0 rgba(255, 255, 255, 0.55);
}

.star,
.shooting-star,
.cloud,
.sun-rays {
    animation-duration: 8s;
}

.shooting-star {
    opacity: 0.45;
}

.biometric-toggle {
    width: 58px;
    height: 32px;
    border-radius: 999px;
    background: linear-gradient(135deg, rgba(100,116,139,0.24), rgba(15,23,42,0.54));
    border: 1px solid var(--control-border);
    box-shadow: var(--control-shadow-soft), inset 0 0 0 1px rgba(255,255,255,0.02);
    overflow: hidden;
}

.biometric-toggle::before {
    content: '';
    position: absolute;
    inset: 3px;
    border-radius: inherit;
    background: linear-gradient(90deg, transparent 0 42%, rgba(255,255,255,0.08) 100%);
    opacity: 0.6;
}

.biometric-toggle:hover {
    transform: translateY(-1px) scale(1.03);
    box-shadow: var(--control-shadow);
}

.biometric-toggle.active {
    background: linear-gradient(135deg, #059669 0%, #14b8a6 58%, #67e8f9 100%);
    border-color: rgba(45, 212, 191, 0.42);
    box-shadow: 0 12px 28px rgba(20, 184, 166, 0.24), inset 0 1px 0 rgba(255,255,255,0.18);
}

.biometric-toggle .toggle-knob {
    top: 3px;
    left: 3px;
    width: 26px;
    height: 26px;
    background: linear-gradient(145deg, #f8fafc, #cbd5e1);
    box-shadow: 0 7px 16px rgba(0, 0, 0, 0.24), inset 0 1px 0 rgba(255,255,255,0.8);
}

.biometric-toggle.active .toggle-knob {
    left: 29px;
    background: #ffffff;
    box-shadow: 0 7px 16px rgba(0,0,0,0.2), inset 0 1px 0 rgba(255,255,255,0.9);
}

.bottom-nav {
    padding-top: 8px;
    border-top: 1px solid var(--control-border);
    box-shadow: 0 -16px 34px rgba(0, 0, 0, 0.18);
}

.nav-item {
    min-width: 56px;
    min-height: 48px;
    border-radius: 14px;
    transition: transform 0.18s ease, background 0.18s ease, color 0.18s ease;
}

.nav-item:hover {
    background: var(--control-surface);
    color: var(--text-secondary);
}

.nav-item.active {
    color: #fff;
    background: linear-gradient(135deg, rgba(255, 95, 115, 0.95), rgba(255, 138, 85, 0.95));
    box-shadow: 0 10px 24px rgba(255, 107, 107, 0.22), inset 0 1px 0 rgba(255,255,255,0.22);
}

.nav-item.active::before {
    display: none;
}

.balance-action-btn {
    border-radius: 14px;
    transition: background 0.18s ease, transform 0.18s ease;
}

.balance-action-btn:hover {
    background: rgba(255, 255, 255, 0.08);
}

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

.action-icon {
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.11);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.12), 0 8px 18px rgba(0,0,0,0.16);
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
    }
}

/* ===================================================
   UPGRADE PREMIUM MODAL
   =================================================== */

/* Overlay */
.upgrade-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    align-items: center;
    justify-content: center;
    padding: 16px;
    animation: fadeIn 0.25s ease;
}
.upgrade-overlay.active {
    display: flex;
}

/* Modal container */
.upgrade-modal {
    position: relative;
    background: var(--bg-secondary);
    border: 1px solid rgba(129, 140, 248, 0.25);
    border-radius: 24px;
    width: 100%;
    max-width: 960px;
    max-height: 92vh;
    overflow-y: auto;
    padding: 32px 28px 28px;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(129,140,248,0.1);
    animation: slideUpModal 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    scrollbar-width: thin;
    scrollbar-color: rgba(129,140,248,0.3) transparent;
}
.upgrade-modal::-webkit-scrollbar { width: 4px; }
.upgrade-modal::-webkit-scrollbar-thumb { background: rgba(129,140,248,0.3); border-radius: 4px; }

@keyframes slideUpModal {
    from { transform: translateY(40px) scale(0.96); opacity: 0; }
    to   { transform: translateY(0)    scale(1);    opacity: 1; }
}

/* Close button */
.upgrade-close-btn {
    position: absolute;
    top: 16px;
    right: 16px;
    background: rgba(255,255,255,0.08);
    border: none;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-muted);
    transition: background 0.2s, color 0.2s;
}
.upgrade-close-btn:hover { background: rgba(255,255,255,0.15); color: var(--text-primary); }

/* Header */
.upgrade-header { text-align: center; margin-bottom: 20px; }
.upgrade-crown {
    font-size: 48px;
    display: inline-block;
    animation: crownBounce 2s ease-in-out infinite;
    filter: drop-shadow(0 0 20px rgba(245,158,11,0.5));
}
@keyframes crownBounce {
    0%, 100% { transform: translateY(0) rotate(-3deg); }
    50%       { transform: translateY(-8px) rotate(3deg); }
}
.upgrade-title {
    font-size: 22px;
    font-weight: 800;
    background: linear-gradient(135deg, #f59e0b, #818cf8, #ec4899);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 8px 0 6px;
}
.upgrade-subtitle { font-size: 13px; color: var(--text-muted); }

/* Current plan badge */
.current-plan-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--border-light);
    border-radius: 50px;
    padding: 6px 16px;
    width: fit-content;
    margin: 0 auto 18px;
    font-size: 13px;
    color: var(--text-secondary);
}
.plan-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}
.free-dot    { background: #94a3b8; }
.premium-dot { background: #818cf8; box-shadow: 0 0 6px rgba(129,140,248,0.6); }
.pro-dot     { background: #f59e0b; box-shadow: 0 0 6px rgba(245,158,11,0.6); }

/* Billing toggle */
.billing-toggle-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 24px;
}
.billing-label { font-size: 13px; color: var(--text-secondary); display: flex; align-items: center; gap: 6px; }
.billing-label.active { color: var(--text-primary); font-weight: 600; }
.billing-toggle {
    width: 44px;
    height: 24px;
    background: rgba(129,140,248,0.3);
    border-radius: 50px;
    cursor: pointer;
    position: relative;
    transition: background 0.25s;
}
.billing-toggle.yearly { background: rgba(129,140,248,0.7); }
.billing-knob {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 18px;
    height: 18px;
    background: #fff;
    border-radius: 50%;
    transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}
.billing-toggle.yearly .billing-knob { transform: translateX(20px); }
.save-badge {
    background: linear-gradient(135deg, #10b981, #34d399);
    color: #fff;
    padding: 2px 8px;
    border-radius: 50px;
    font-size: 10px;
    font-weight: 700;
}

/* Pricing cards grid */
.pricing-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
    margin-bottom: 18px;
}
@media (max-width: 680px) {
    .pricing-cards { grid-template-columns: 1fr; }
}

/* Individual pricing card */
.pricing-card {
    position: relative;
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: 16px;
    padding: 18px 16px;
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.pricing-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }

/* Premium card special styling */
.pricing-card.premium-card {
    border-color: rgba(129, 140, 248, 0.6);
    background: linear-gradient(145deg, rgba(129,140,248,0.07) 0%, var(--bg-card) 100%);
    box-shadow: 0 0 30px rgba(129, 140, 248, 0.12);
}

/* Pro card */
.pricing-card.pro-card {
    border-color: rgba(245,158,11,0.4);
    background: linear-gradient(145deg, rgba(245,158,11,0.05) 0%, var(--bg-card) 100%);
}

/* Recommended badge */
.recommended-badge {
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, #818cf8, #6366f1);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    padding: 4px 14px;
    border-radius: 50px;
    white-space: nowrap;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

/* Card header */
.pricing-card-header {
    display: flex;
    align-items: center;
    gap: 10px;
}
.plan-emoji { font-size: 26px; }
.plan-name  { font-size: 16px; font-weight: 700; color: var(--text-primary); margin: 0; }
.plan-tagline { font-size: 11px; color: var(--text-muted); margin: 2px 0 0; }

/* Price */
.plan-price { display: flex; align-items: baseline; gap: 4px; }
.price-amount { font-size: 22px; font-weight: 800; color: var(--text-primary); }
.price-period { font-size: 12px; color: var(--text-muted); }

/* Features list */
.plan-features {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 7px;
    flex: 1;
}
.feature-item {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 12px;
    color: var(--text-secondary);
}
.feature-item.feat-no { color: var(--text-muted); opacity: 0.6; }
.feat-check { color: #10b981; font-size: 13px; flex-shrink: 0; }
.feat-x     { color: #ef4444; font-size: 13px; flex-shrink: 0; }

/* Plan buttons */
.plan-btn {
    width: 100%;
    padding: 10px 16px;
    border-radius: 10px;
    border: none;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: auto;
}
.free-btn {
    background: rgba(255,255,255,0.06);
    color: var(--text-muted);
    border: 1px solid var(--border-light);
}
.current-plan-btn { cursor: default; opacity: 0.6; }
.premium-btn {
    background: linear-gradient(135deg, #818cf8, #6366f1);
    color: #fff;
    box-shadow: 0 4px 16px rgba(99,102,241,0.4);
}
.premium-btn:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 6px 24px rgba(99,102,241,0.5); }
.premium-btn.loading { opacity: 0.7; pointer-events: none; }
.pro-btn {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: #fff;
    box-shadow: 0 4px 16px rgba(245,158,11,0.35);
}
.pro-btn:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 6px 24px rgba(245,158,11,0.45); }

/* Payment notice */
.payment-notice {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 4px;
}

/* Payment step (step 2) */
.payment-step { display: flex; flex-direction: column; gap: 16px; }
.back-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 13px;
    cursor: pointer;
    padding: 4px 0;
    transition: color 0.2s;
}
.back-btn:hover { color: var(--text-primary); }

.payment-summary {
    background: rgba(129,140,248,0.08);
    border: 1px solid rgba(129,140,248,0.25);
    border-radius: 12px;
    padding: 16px;
    font-size: 14px;
    color: var(--text-secondary);
}
.payment-summary .summary-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 6px;
}
.payment-summary .summary-row:last-child {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--border-light);
    font-weight: 700;
    color: var(--text-primary);
    font-size: 15px;
}

.payment-methods h4 {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 10px;
}
.payment-method-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}
.payment-method-option input { display: none; }
.method-card {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    background: var(--bg-card);
    border: 1.5px solid var(--border-light);
    border-radius: 10px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
    color: var(--text-secondary);
    font-weight: 500;
}
.payment-method-option input:checked + .method-card {
    border-color: #818cf8;
    background: rgba(129,140,248,0.1);
    color: var(--text-primary);
    box-shadow: 0 0 0 1px rgba(129,140,248,0.3);
}

/* ===================================================
   SUBSCRIPTION STATUS CARD (Profile Page)
   =================================================== */
.subscription-status-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(135deg, rgba(129,140,248,0.1), rgba(99,102,241,0.05));
    border: 1px solid rgba(129,140,248,0.3);
    border-radius: 14px;
    padding: 14px 16px;
    cursor: default;
    gap: 12px;
}
.sub-status-left { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; }
.sub-status-icon { font-size: 28px; flex-shrink: 0; }
.sub-status-name {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 2px;
}
.sub-status-desc { font-size: 12px; color: var(--text-muted); }

/* Premium/Pro subscription status */
.subscription-status-card.is-premium {
    background: linear-gradient(135deg, rgba(99,102,241,0.15), rgba(129,140,248,0.05));
    border-color: rgba(99,102,241,0.4);
}
.subscription-status-card.is-pro {
    background: linear-gradient(135deg, rgba(245,158,11,0.12), rgba(217,119,6,0.05));
    border-color: rgba(245,158,11,0.4);
}

.upgrade-cta-btn {
    display: flex;
    align-items: center;
    gap: 5px;
    background: linear-gradient(135deg, #818cf8, #6366f1);
    color: #fff;
    border: none;
    border-radius: 50px;
    padding: 8px 16px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s;
    box-shadow: 0 3px 12px rgba(99,102,241,0.4);
    flex-shrink: 0;
}
.upgrade-cta-btn:hover { transform: translateY(-2px); box-shadow: 0 5px 18px rgba(99,102,241,0.5); }
.upgrade-cta-btn.is-active { background: rgba(255,255,255,0.1); box-shadow: none; cursor: default; }
