/* ============================================
   BudgetFlow - Liquid Space Theme
   Design organique, fluide et immersif
   ============================================ */

/* Palette Liquid Space - Dark Mode Only */
:root {
    --primary: #1E9FFF;
    --primary-dark: #6B7CFF;
    --primary-light: #00E5A8;
    --primary-glow: rgba(30, 159, 255, 0.25);
    --success: #00E5A8;
    --success-light: rgba(0, 229, 168, 0.12);
    --success-glow: rgba(0, 229, 168, 0.25);
    --danger: #FF3B6F;
    --danger-light: rgba(255, 59, 111, 0.12);
    --danger-glow: rgba(255, 59, 111, 0.25);
    --warning: #FFD166;
    --warning-light: rgba(255, 209, 102, 0.12);

    --bg-primary: #0B0F14;
    --bg-secondary: #111822;
    --bg-tertiary: #1A2230;
    --bg-card: rgba(17, 24, 34, 0.8);

    --text-primary: #E2E8F0;
    --text-secondary: #7B8FA3;
    --text-tertiary: #4A5A6A;

    --border-color: rgba(255, 255, 255, 0.06);
    --border-light: rgba(255, 255, 255, 0.03);

    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.4);
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    --shadow-md: 0 8px 32px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.6);
    --shadow-glow: 0 0 40px rgba(30, 159, 255, 0.1);

    --radius: 20px;
    --radius-sm: 14px;
    --radius-lg: 28px;
    --nav-height: 72px;

    --gradient-primary: linear-gradient(135deg, #1E9FFF 0%, #6B7CFF 100%);
    --gradient-success: linear-gradient(135deg, #00E5A8 0%, #1E9FFF 100%);
    --gradient-danger: linear-gradient(135deg, #FF3B6F 0%, #FF6B8A 100%);
    --gradient-liquid: linear-gradient(135deg, #00E5A8 0%, #1E9FFF 50%, #6B7CFF 100%);

    --glass-bg: rgba(17, 24, 34, 0.6);
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-blur: 20px;
}

/* Reset */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

/* Grain texture overlay */
body::after {
    content: '';
    position: fixed;
    inset: 0;
    opacity: 0.035;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 512 512' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
    background-size: 256px 256px;
    pointer-events: none;
    z-index: 9999;
}

/* Ambient liquid blobs */
body::before {
    content: '';
    position: fixed;
    top: -20%;
    right: -20%;
    width: 60vw;
    height: 60vw;
    background: radial-gradient(circle, rgba(30, 159, 255, 0.06) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
    animation: ambient-drift 25s ease-in-out infinite alternate;
}

@keyframes ambient-drift {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(-10vw, 15vh) scale(1.2); }
}

/* Second ambient blob */
#app::before {
    content: '';
    position: fixed;
    bottom: -15%;
    left: -15%;
    width: 50vw;
    height: 50vw;
    background: radial-gradient(circle, rgba(0, 229, 168, 0.05) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
    animation: ambient-drift-2 30s ease-in-out infinite alternate;
    z-index: -1;
}

/* Third ambient blob */
#app::after {
    content: '';
    position: fixed;
    top: 40%;
    right: -10%;
    width: 35vw;
    height: 35vw;
    background: radial-gradient(circle, rgba(107, 124, 255, 0.04) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
    animation: ambient-drift-3 22s ease-in-out infinite alternate-reverse;
    z-index: -1;
}

@keyframes ambient-drift-2 {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(8vw, -10vh) scale(1.3); }
}

@keyframes ambient-drift-3 {
    0% { transform: translate(0, 0) scale(1) rotate(0deg); }
    100% { transform: translate(-5vw, 8vh) scale(1.15) rotate(10deg); }
}

/* Utilities */
.hidden { display: none !important; }
.income { color: var(--success) !important; }
.expense { color: var(--danger) !important; }

/* ============================================
   Login Screen
   ============================================ */
#login-screen {
    display: none;
    min-height: 100vh;
}

#login-screen.active {
    display: flex;
    min-height: 100vh;
    align-items: center;
    justify-content: center;
    background: var(--bg-primary);
    padding: 20px;
    position: relative;
    overflow: hidden;
}

#login-screen.active::before {
    content: '';
    position: absolute;
    top: -30%;
    left: -30%;
    width: 160%;
    height: 160%;
    background: radial-gradient(ellipse at 30% 40%, rgba(0, 229, 168, 0.08) 0%, transparent 50%),
                radial-gradient(ellipse at 70% 60%, rgba(30, 159, 255, 0.08) 0%, transparent 50%),
                radial-gradient(ellipse at 50% 80%, rgba(107, 124, 255, 0.06) 0%, transparent 50%);
    animation: login-pulse 20s ease-in-out infinite alternate;
}

@keyframes login-pulse {
    0% { transform: scale(1) rotate(0deg); opacity: 1; }
    100% { transform: scale(1.1) rotate(5deg); opacity: 0.7; }
}

.login-container {
    background: var(--glass-bg);
    backdrop-filter: blur(24px) saturate(1.3);
    -webkit-backdrop-filter: blur(24px) saturate(1.3);
    padding: 56px 36px 48px;
    border-radius: 32px 26px 30px 24px;
    box-shadow: var(--shadow-lg), 0 0 80px rgba(0, 229, 168, 0.05);
    border: 1px solid var(--glass-border);
    width: 100%;
    max-width: 380px;
    position: relative;
    z-index: 1;
}

/* Gradient focus on login inputs */
.login-container input:focus {
    border-color: transparent;
    background: rgba(255, 255, 255, 0.06);
    box-shadow: 0 0 0 2px rgba(0, 229, 168, 0.3), 0 0 0 4px rgba(30, 159, 255, 0.15), 0 0 20px rgba(30, 159, 255, 0.1);
}

/* Login button liquid wave hover */
.login-container .btn-primary {
    position: relative;
    overflow: hidden;
}

.login-container .btn-primary::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.15) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.4s, transform 0.6s;
    transform: scale(0.5);
}

.login-container .btn-primary:hover::after {
    opacity: 1;
    transform: scale(1);
}

.login-logo {
    text-align: center;
    margin-bottom: 40px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Pulsating concentric rings */
.login-logo::before,
.login-logo::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    border: 1px solid rgba(0, 229, 168, 0.15);
    pointer-events: none;
}

.login-logo::before {
    width: 180px;
    height: 180px;
    animation: ring-pulse 3s ease-in-out infinite;
}

.login-logo::after {
    width: 220px;
    height: 220px;
    border-color: rgba(30, 159, 255, 0.1);
    animation: ring-pulse 3s ease-in-out 0.5s infinite;
}

@keyframes ring-pulse {
    0%, 100% { transform: translate(-50%, -50%) scale(1); opacity: 0.5; }
    50% { transform: translate(-50%, -50%) scale(1.08); opacity: 1; }
}

.logo-icon {
    width: 140px;
    height: 140px;
    display: inline-block;
    animation: float 4s ease-in-out infinite;
    border-radius: 32px;
    object-fit: contain;
    filter: drop-shadow(0 0 30px rgba(0, 229, 168, 0.35)) drop-shadow(0 0 60px rgba(30, 159, 255, 0.15));
    position: relative;
    z-index: 1;
}

@keyframes float {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    25% { transform: translateY(-6px) rotate(0.5deg); }
    50% { transform: translateY(-10px) rotate(0deg); }
    75% { transform: translateY(-6px) rotate(-0.5deg); }
}

.setup-section {
    margin-top: 32px;
    padding-top: 32px;
    border-top: 1px solid var(--border-color);
}

.setup-section h3 {
    font-size: 20px;
    margin-bottom: 12px;
    color: var(--text-primary);
}

.setup-section p {
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 24px;
}

/* ============================================
   Forms
   ============================================ */
.form-group {
    margin-bottom: 24px;
}

.form-group label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 12px;
}

input[type="text"],
input[type="password"],
input[type="number"],
input[type="date"],
select,
textarea {
    width: 100%;
    padding: 14px 18px;
    font-size: 16px;
    border: 1px solid var(--border-color);
    border-radius: 14px 12px 14px 10px;
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-primary);
    transition: all 0.3s ease;
    font-family: inherit;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow), 0 0 20px rgba(30, 159, 255, 0.1);
    background: rgba(255, 255, 255, 0.06);
}

input::placeholder {
    color: var(--text-tertiary);
}

/* Select dropdown options - dark mode */
select option {
    background: var(--bg-primary, #0b0f14);
    color: var(--text-primary, #e8ecf1);
}

select optgroup {
    background: var(--bg-primary, #0b0f14);
    color: var(--text-primary, #e8ecf1);
}

/* Checkbox */
.checkbox-group {
    margin-bottom: 24px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 15px;
    color: var(--text-primary);
}

.checkbox-label input {
    display: none;
}

.checkmark {
    width: 24px;
    height: 24px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    margin-right: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    background: rgba(255, 255, 255, 0.04);
}

.checkbox-label input:checked + .checkmark {
    background: var(--gradient-liquid);
    border-color: transparent;
    box-shadow: 0 0 12px var(--success-glow);
}

.checkbox-label input:checked + .checkmark::after {
    content: '\2713';
    color: white;
    font-size: 14px;
    font-weight: bold;
}

/* Radio */
.radio-group {
    display: flex;
    gap: 24px;
}

.radio-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 15px;
    color: var(--text-primary);
}

.radio-label input {
    display: none;
}

.radio-mark {
    width: 22px;
    height: 22px;
    border: 2px solid var(--border-color);
    border-radius: 50%;
    margin-right: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    background: rgba(255, 255, 255, 0.04);
}

.radio-label input:checked + .radio-mark {
    border-color: var(--primary);
    box-shadow: 0 0 8px var(--primary-glow);
}

.radio-label input:checked + .radio-mark::after {
    content: '';
    width: 12px;
    height: 12px;
    background: var(--gradient-primary);
    border-radius: 50%;
}

/* ============================================
   Buttons
   ============================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 14px 28px;
    font-size: 16px;
    font-weight: 600;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    gap: 8px;
    position: relative;
    overflow: hidden;
}

.btn-primary {
    background: var(--gradient-liquid);
    color: white;
    box-shadow: 0 4px 20px rgba(0, 229, 168, 0.2), 0 0 40px rgba(30, 159, 255, 0.1);
    border-radius: 16px 12px 14px 12px;
}

.btn-primary:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 8px 30px rgba(0, 229, 168, 0.3), 0 0 60px rgba(30, 159, 255, 0.15);
}

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

.btn-secondary {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    backdrop-filter: blur(10px);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(0, 229, 168, 0.4);
    box-shadow: 0 0 0 1px rgba(30, 159, 255, 0.15);
}

.btn-danger {
    background: var(--gradient-danger);
    color: white;
    box-shadow: 0 4px 20px var(--danger-glow);
}

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

.btn-full { width: 100%; }

.btn-small {
    padding: 10px 18px;
    font-size: 14px;
}

.btn-icon {
    background: rgba(255, 255, 255, 0.06);
    border: none;
    font-size: 18px;
    cursor: pointer;
    padding: 10px;
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
    transition: all 0.3s;
}

.btn-icon:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--primary);
}

.btn-back {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    padding: 8px 12px;
    color: var(--text-secondary);
    margin-right: 8px;
    border-radius: var(--radius-sm);
    transition: all 0.3s;
}

.btn-back:hover {
    background: rgba(255, 255, 255, 0.06);
    color: var(--primary-light);
}

/* ============================================
   Navigation - Floating Pill
   ============================================ */
.bottom-nav {
    position: fixed;
    bottom: 16px;
    left: 50%;
    transform: translateX(-50%);
    width: auto;
    max-width: 320px;
    background: rgba(11, 15, 20, 0.82);
    backdrop-filter: blur(28px) saturate(1.4);
    -webkit-backdrop-filter: blur(28px) saturate(1.4);
    display: flex;
    justify-content: center;
    align-items: center;
    height: 56px;
    border-radius: 28px;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.5), 0 0 60px rgba(30, 159, 255, 0.06), inset 0 1px 0 rgba(255, 255, 255, 0.06);
    z-index: 1000;
    padding: 0 6px;
    border: 1px solid var(--glass-border);
    gap: 0px;
    overflow: hidden;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px 10px;
    color: var(--text-tertiary);
    transition: all 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    border-radius: 16px;
    position: relative;
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

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

.nav-item.active {
    color: var(--primary-light);
    background: rgba(0, 229, 168, 0.08);
}

.nav-item.active::after {
    content: '';
    position: absolute;
    bottom: 2px;
    left: 50%;
    transform: translateX(-50%);
    width: 16px;
    height: 2px;
    background: var(--gradient-liquid);
    border-radius: 4px;
    box-shadow: 0 0 8px rgba(0, 229, 168, 0.4);
}

/* FAB should not show the active dot */
.fab.active::after {
    display: none;
}

.nav-icon {
    font-size: 18px;
    margin-bottom: 0;
    line-height: 1;
}

/* Hide nav icons in pill nav (text only), keep for FAB */
.bottom-nav .nav-icon {
    display: none;
}

.nav-label {
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.4px;
}

/* FAB - Floating Action Button */
.fab {
    position: fixed;
    bottom: 24px;
    right: 20px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--gradient-liquid);
    color: white !important;
    box-shadow: 0 4px 30px rgba(0, 229, 168, 0.35), 0 0 60px rgba(30, 159, 255, 0.15);
    z-index: 1001;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    cursor: pointer;
    transition: all 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    flex-direction: column;
    padding: 0;
}

.fab::before {
    content: '';
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    background: var(--gradient-liquid);
    opacity: 0.2;
    filter: blur(12px);
    z-index: -1;
    transition: all 0.35s;
    animation: fab-halo 3s ease-in-out infinite;
}

@keyframes fab-halo {
    0%, 100% { opacity: 0.2; inset: -4px; }
    50% { opacity: 0.35; inset: -8px; }
}

.fab:hover {
    transform: scale(1.12) translateY(-2px);
    box-shadow: 0 6px 40px rgba(0, 229, 168, 0.45), 0 0 80px rgba(30, 159, 255, 0.2);
}

.fab:hover::before {
    opacity: 0.4;
    inset: -8px;
}

.fab .nav-icon {
    font-size: 28px;
    margin: 0;
}

.fab .nav-label {
    display: none;
}

/* ============================================
   Pages
   ============================================ */
#app {
    padding-bottom: 100px;
}

.page {
    display: none;
    padding: 20px;
    padding-top: 0;
    max-width: 800px;
    margin: 0 auto;
}

.page.active {
    display: block;
    animation: page-in 0.4s ease;
}

@keyframes page-in {
    from { opacity: 0; transform: translateY(16px) scale(0.98); filter: blur(4px); }
    to { opacity: 1; transform: translateY(0) scale(1); filter: blur(0); }
}

.page-header {
    position: sticky;
    top: 0;
    background: transparent;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: 20px 0;
    margin-bottom: 24px;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    -webkit-mask-image: linear-gradient(to bottom, black 70%, transparent 100%);
    mask-image: linear-gradient(to bottom, black 70%, transparent 100%);
    padding-bottom: 28px;
}

.page-header h1 {
    font-size: 32px;
    font-weight: 800;
    background: var(--gradient-liquid);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.5px;
}

.page-description {
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 24px;
    line-height: 1.6;
}

/* Dashboard branded header */
.dashboard-header {
    -webkit-mask-image: none;
    mask-image: none;
    padding-bottom: 20px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
}

.brand-name {
    font-size: 22px;
    font-weight: 800;
    background: var(--gradient-liquid);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.5px;
}

/* Header logo */
.header-logo {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    object-fit: contain;
    filter: drop-shadow(0 0 12px rgba(0, 229, 168, 0.3));
    animation: float 6s ease-in-out infinite;
}

/* ============================================
   Cards - Organic Glass
   ============================================ */
.card {
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: 24px 20px 26px 18px;
    padding: 24px;
    margin-bottom: 20px;
    box-shadow: var(--shadow), var(--shadow-glow);
    border: 1px solid var(--glass-border);
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    position: relative;
    overflow: hidden;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent 0%, rgba(0, 229, 168, 0.2) 30%, rgba(30, 159, 255, 0.3) 50%, rgba(107, 124, 255, 0.2) 70%, transparent 100%);
    opacity: 0;
    transition: opacity 0.4s;
    z-index: 1;
}

.card::after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 8px;
    right: 8px;
    height: 40px;
    background: rgba(0, 0, 0, 0.15);
    border-radius: 0 0 24px 24px;
    filter: blur(10px);
    z-index: -1;
    transition: all 0.4s;
}

.card:hover {
    box-shadow: var(--shadow-md), 0 0 50px rgba(30, 159, 255, 0.08);
    border-color: rgba(30, 159, 255, 0.12);
    transform: translateY(-4px) scale(1.005);
}

.card:hover::before {
    opacity: 1;
}

.card:hover::after {
    bottom: -10px;
    filter: blur(16px);
    background: rgba(0, 0, 0, 0.2);
}

.card h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding-left: 12px;
    border-left: 3px solid;
    border-image: var(--gradient-liquid) 1;
}

/* ============================================
   Bento Grid - Dashboard Layout
   ============================================ */
.bento-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.bento-grid .balance-card {
    grid-column: 1 / -1;
}

.bento-grid .forecast-card {
    grid-column: 1 / -1;
}

.bento-grid #pending-reimbursements-card {
    grid-column: 1;
}

.bento-grid .recent-transactions-card {
    grid-column: 2;
}

.bento-grid .category-chart-card {
    grid-column: 1 / -1;
}

/* ============================================
   Balance Card - Liquid Gradient Hero
   ============================================ */
.balance-card {
    background: linear-gradient(135deg, rgba(0, 229, 168, 0.12) 0%, rgba(30, 159, 255, 0.14) 40%, rgba(107, 124, 255, 0.12) 100%);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    color: white;
    border-radius: 32px 24px 28px 22px;
    padding: 40px 32px;
    margin-bottom: 24px;
    text-align: center;
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(0, 229, 168, 0.15);
    box-shadow: 0 8px 40px rgba(0, 229, 168, 0.1), 0 0 80px rgba(30, 159, 255, 0.05);
}

/* Animated mesh gradient background */
.balance-card {
    background:
        radial-gradient(ellipse at 20% 50%, rgba(0, 229, 168, 0.15) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 20%, rgba(30, 159, 255, 0.18) 0%, transparent 50%),
        radial-gradient(ellipse at 60% 80%, rgba(107, 124, 255, 0.12) 0%, transparent 50%),
        linear-gradient(135deg, rgba(17, 24, 34, 0.9) 0%, rgba(11, 15, 20, 0.95) 100%);
    background-size: 200% 200%, 200% 200%, 200% 200%, 100% 100%;
    animation: mesh-flow 12s ease-in-out infinite alternate;
}

@keyframes mesh-flow {
    0% { background-position: 0% 50%, 100% 0%, 50% 100%, 0% 0%; }
    50% { background-position: 50% 0%, 0% 100%, 100% 50%, 0% 0%; }
    100% { background-position: 100% 50%, 50% 0%, 0% 50%, 0% 0%; }
}

/* Gradient top border via pseudo-element */
.balance-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--gradient-liquid);
    z-index: 2;
    opacity: 1;
}

.balance-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 10%;
    right: 10%;
    height: 1px;
    background: var(--gradient-liquid);
    filter: blur(8px);
    opacity: 0.6;
    z-index: 2;
}

.balance-label {
    font-size: 12px;
    opacity: 0.8;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    font-weight: 500;
    position: relative;
    z-index: 1;
}

.balance-amount {
    font-size: 48px;
    font-weight: 800;
    margin-bottom: 24px;
    letter-spacing: -2px;
    position: relative;
    z-index: 1;
    text-shadow: 0 0 40px rgba(0, 229, 168, 0.3);
}

.balance-amount.negative {
    color: #FF8A9F;
    text-shadow: 0 0 40px rgba(255, 59, 111, 0.3);
}

.balance-details {
    display: flex;
    justify-content: center;
    gap: 12px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
    z-index: 1;
}

.balance-item {
    display: flex;
    flex-direction: column;
    background: rgba(255, 255, 255, 0.06);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    padding: 10px 16px;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.balance-item .label {
    font-size: 11px;
    opacity: 0.7;
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.balance-item .value {
    font-size: 18px;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.85);
}

.balance-item.income .value {
    color: var(--success);
    text-shadow: 0 0 20px var(--success-glow);
}

.balance-item.expense .value {
    color: #FF8A9F;
    text-shadow: 0 0 20px var(--danger-glow);
}

/* ============================================
   Info / Explanations
   ============================================ */
.info-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-secondary);
    border-radius: 50%;
    font-size: 12px;
    cursor: help;
    margin-left: 8px;
    transition: all 0.3s;
}

.info-icon:hover {
    background: var(--primary);
    color: white;
    box-shadow: 0 0 12px var(--primary-glow);
}

.info-icon.info-icon-light {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.info-icon.info-icon-light:hover {
    background: rgba(255, 255, 255, 0.35);
}

.explanation-box {
    background: rgba(30, 159, 255, 0.06);
    border-radius: var(--radius-sm);
    padding: 16px;
    margin-top: 12px;
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.7;
    border-left: 3px solid var(--primary);
}

.explanation-box strong {
    color: var(--text-primary);
}

.explanation-box ul {
    margin: 8px 0 0 20px;
}

.explanation-box li {
    margin-bottom: 4px;
}

.calc-detail {
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
    padding: 12px 16px;
    margin-top: 8px;
    font-size: 13px;
    border: 1px dashed var(--border-color);
}

.calc-row {
    display: flex;
    justify-content: space-between;
    padding: 4px 0;
    color: var(--text-secondary);
}

.calc-row.total {
    border-top: 1px solid var(--border-color);
    margin-top: 8px;
    padding-top: 8px;
    font-weight: 600;
    color: var(--text-primary);
}

/* ============================================
   Forecasts
   ============================================ */
.forecast-grid {
    display: flex;
    overflow-x: auto;
    gap: 12px;
    margin-bottom: 20px;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 8px;
    scrollbar-width: none;
}

.forecast-grid::-webkit-scrollbar {
    display: none;
}

.forecast-item {
    text-align: center;
    padding: 16px 20px;
    min-width: 120px;
    flex-shrink: 0;
    scroll-snap-align: start;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 20px;
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    border: 1px solid transparent;
    animation: forecast-appear 0.6s ease both;
}

.forecast-item:nth-child(1) { animation-delay: 0.1s; }
.forecast-item:nth-child(2) { animation-delay: 0.2s; }
.forecast-item:nth-child(3) { animation-delay: 0.3s; }

@keyframes forecast-appear {
    from { opacity: 0; filter: blur(4px); transform: translateY(8px); }
    to { opacity: 1; filter: blur(0); transform: translateY(0); }
}

.forecast-item:hover {
    transform: translateY(-3px);
    background: rgba(255, 255, 255, 0.06);
}

.forecast-month {
    display: block;
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 500;
}

.forecast-value {
    display: block;
    font-size: 18px;
    font-weight: 700;
}

.forecast-item.danger {
    background: var(--danger-light);
    border-color: rgba(255, 59, 111, 0.2);
}

.forecast-item.danger .forecast-value {
    color: var(--danger);
    text-shadow: 0 0 16px var(--danger-glow);
}

.forecast-item.warning {
    background: var(--warning-light);
    border-color: rgba(255, 209, 102, 0.2);
}

.forecast-item.warning .forecast-value {
    color: var(--warning);
}

.forecast-list {
    margin-top: 20px;
}

.forecast-list-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    background: var(--bg-card);
    border-radius: 20px;
    margin-bottom: 12px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--glass-border);
    transition: all 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    position: relative;
    overflow: hidden;
}

.forecast-list-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
}

.forecast-list-item:hover {
    transform: translateX(6px) scale(1.01);
    box-shadow: var(--shadow);
}

.forecast-list-item.danger::before { background: var(--gradient-danger); }
.forecast-list-item.warning::before { background: linear-gradient(to bottom, var(--warning), #FF9F43); }
.forecast-list-item.safe::before { background: var(--gradient-success); }

.forecast-month-name {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 16px;
}

.forecast-details {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 4px;
}

.forecast-balance {
    font-size: 20px;
    font-weight: 700;
}

/* ============================================
   Transactions
   ============================================ */
.month-selector {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.04);
    padding: 4px 6px;
    border-radius: 20px;
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(10px);
}

#selected-month,
#current-month-header {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    min-width: 140px;
    text-align: center;
}

.filters-bar {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
}

.filters-bar select {
    flex: 1;
    padding: 12px 16px;
    font-size: 14px;
}

.transactions-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    position: relative;
    padding-left: 24px;
}

/* Timeline vertical line */
.transactions-list::before {
    content: '';
    position: absolute;
    top: 0;
    left: 8px;
    bottom: 0;
    width: 2px;
    background: linear-gradient(to bottom, var(--primary-light), var(--primary), var(--primary-dark), transparent);
    border-radius: 2px;
    opacity: 0.3;
}

.date-header {
    font-size: 11px;
    color: var(--text-tertiary);
    margin: 20px 0 8px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    background: rgba(30, 159, 255, 0.08);
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    position: relative;
}

.transaction-item {
    display: flex;
    align-items: center;
    padding: 18px;
    background: var(--bg-card);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-radius: 16px 14px 16px 12px;
    box-shadow: var(--shadow-sm);
    cursor: pointer;
    transition: all 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    border: 1px solid var(--glass-border);
    position: relative;
}

/* Timeline dot on each transaction */
.transactions-list > .transaction-item::before {
    content: '';
    position: absolute;
    left: -20px;
    top: 50%;
    transform: translateY(-50%);
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--text-tertiary);
    box-shadow: 0 0 6px rgba(30, 159, 255, 0.3);
}

.transaction-item:hover {
    transform: translateX(6px) scale(1.01);
    box-shadow: var(--shadow), 0 0 24px rgba(30, 159, 255, 0.06);
    border-color: rgba(30, 159, 255, 0.15);
    background: rgba(17, 24, 34, 0.9);
}

.transaction-icon {
    width: 48px;
    height: 48px;
    border-radius: 18px 14px 16px 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    margin-right: 16px;
    flex-shrink: 0;
    transition: all 0.35s ease;
}

.transaction-icon.expense {
    background: var(--danger-light);
    box-shadow: inset 0 0 20px rgba(255, 59, 111, 0.1), 0 0 0 0 transparent;
}

.transaction-icon.income {
    background: var(--success-light);
    box-shadow: inset 0 0 20px rgba(0, 229, 168, 0.1), 0 0 0 0 transparent;
}

.transaction-item:hover .transaction-icon.expense {
    box-shadow: inset 0 0 20px rgba(255, 59, 111, 0.1), 0 0 16px rgba(255, 59, 111, 0.15);
}

.transaction-item:hover .transaction-icon.income {
    box-shadow: inset 0 0 20px rgba(0, 229, 168, 0.1), 0 0 16px rgba(0, 229, 168, 0.15);
}

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

.transaction-description {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

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

.transaction-amount {
    font-weight: 700;
    font-size: 17px;
    text-align: right;
}

.transaction-date {
    font-size: 12px;
    color: var(--text-tertiary);
    text-align: right;
    margin-top: 4px;
}

/* Badges */
.recurring-badge {
    font-size: 10px;
    background: rgba(30, 159, 255, 0.15);
    color: var(--primary);
    padding: 3px 10px;
    border-radius: 12px;
    margin-left: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.auto-recurring-badge {
    font-size: 10px;
    background: var(--success-light);
    color: var(--success);
    padding: 3px 10px;
    border-radius: 12px;
    margin-left: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.recurring-status-badge {
    font-size: 10px;
    padding: 3px 10px;
    border-radius: 12px;
    margin-left: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.recurring-status-badge.done {
    background: var(--success-light);
    color: var(--success);
}

.recurring-status-badge.pending {
    background: var(--warning-light);
    color: var(--warning);
}

.recurring-status-badge.paused {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-tertiary);
}

/* ============================================
   Add Transaction
   ============================================ */
.add-type-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 28px;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 20px;
    padding: 4px;
    border: 1px solid var(--glass-border);
}

.tab-btn {
    flex: 1;
    padding: 12px;
    border: none;
    background: transparent;
    border-radius: 16px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-tertiary);
    cursor: pointer;
    transition: all 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    font-family: inherit;
}

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

.tab-btn.active {
    background: var(--gradient-liquid);
    color: white;
    box-shadow: 0 4px 20px rgba(0, 229, 168, 0.25);
}

.add-form {
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 28px;
    border-radius: 24px;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--glass-border);
    position: relative;
    overflow: hidden;
}

.add-form::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: var(--gradient-liquid);
    opacity: 0.5;
}

/* ============================================
   Statistics
   ============================================ */
.stats-period-selector {
    display: flex;
    gap: 4px;
    margin-bottom: 24px;
    overflow-x: auto;
    padding: 4px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 20px;
    border: 1px solid var(--glass-border);
    scrollbar-width: none;
}

.stats-period-selector::-webkit-scrollbar { display: none; }

.period-btn {
    padding: 10px 18px;
    border: none;
    background: transparent;
    border-radius: 16px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-tertiary);
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.3s;
    font-family: inherit;
}

.period-btn:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.04);
}

.period-btn.active {
    background: var(--gradient-liquid);
    color: white;
    box-shadow: 0 4px 20px rgba(0, 229, 168, 0.25);
}

.stats-summary {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
    margin-bottom: 24px;
}

.stat-box {
    background: var(--bg-card);
    padding: 20px;
    border-radius: 20px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--glass-border);
    transition: all 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    position: relative;
    overflow: hidden;
}

.stat-box::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--gradient-liquid);
    opacity: 0.4;
}

.stat-box:nth-child(1)::before { background: var(--gradient-success); }
.stat-box:nth-child(2)::before { background: var(--gradient-danger); }

.stat-box:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: var(--shadow), 0 0 20px rgba(30, 159, 255, 0.06);
}

.stat-box:hover::before {
    opacity: 1;
}

.stat-label {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 500;
}

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

.chart-container {
    position: relative;
    height: 220px;
    margin-bottom: 16px;
}

.chart-container.chart-large {
    height: 300px;
}

.category-breakdown {
    margin-top: 20px;
}

.category-row {
    display: flex;
    align-items: center;
    padding: 14px 0;
    border-bottom: 1px solid var(--border-color);
}

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

.category-color {
    width: 14px;
    height: 14px;
    border-radius: 4px;
    margin-right: 14px;
}

.category-name {
    flex: 1;
    font-size: 14px;
    color: var(--text-primary);
    font-weight: 500;
}

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

.category-percent {
    font-size: 13px;
    color: var(--text-secondary);
    margin-left: 12px;
    min-width: 50px;
    text-align: right;
}

.comparison-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.comparison-item {
    text-align: center;
    padding: 16px;
    background: rgba(255, 255, 255, 0.04);
    border-radius: var(--radius-sm);
}

.comparison-label {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

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

.comparison-change {
    font-size: 13px;
    margin-top: 6px;
    font-weight: 600;
}

.comparison-change.positive { color: var(--success); }
.comparison-change.negative { color: var(--danger); }

.top-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.top-item {
    display: flex;
    align-items: center;
    padding: 16px;
    background: rgba(255, 255, 255, 0.04);
    border-radius: var(--radius-sm);
    transition: all 0.3s;
}

.top-item:hover {
    transform: translateX(4px);
}

.top-item-rank {
    width: 28px;
    height: 28px;
    background: var(--gradient-liquid);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
    margin-right: 14px;
}

.top-item-info { flex: 1; }

.top-item-name {
    font-weight: 600;
    color: var(--text-primary);
}

.top-item-detail {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 2px;
}

.top-item-amount {
    font-weight: 700;
    font-size: 16px;
    color: var(--danger);
}

/* ============================================
   Reimbursements
   ============================================ */
.reimbursement-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 24px;
}

.reimbursement-summary {
    display: flex;
    gap: 14px;
    margin-bottom: 24px;
}

.summary-item {
    flex: 1;
    padding: 20px;
    background: var(--bg-card);
    border-radius: 20px;
    box-shadow: var(--shadow-sm);
    text-align: center;
    border: 1px solid var(--glass-border);
    position: relative;
    overflow: hidden;
}

.summary-item.income::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 2px;
    background: var(--gradient-success);
}

.summary-item.expense::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 2px;
    background: var(--gradient-danger);
}

.summary-item .label {
    display: block;
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 500;
}

.summary-item .value {
    font-size: 22px;
    font-weight: 700;
}

.reimbursements-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.reimbursement-item {
    display: flex;
    align-items: center;
    padding: 18px;
    background: var(--bg-card);
    border-radius: 18px;
    box-shadow: var(--shadow-sm);
    cursor: pointer;
    border: 1px solid var(--glass-border);
    transition: all 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    position: relative;
    overflow: hidden;
}

.reimbursement-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
}

.reimbursement-item:hover {
    transform: translateX(6px) scale(1.01);
    box-shadow: var(--shadow);
}

.reimbursement-item.to-receive::before { background: var(--gradient-success); }
.reimbursement-item.to-pay::before { background: var(--gradient-danger); }
.reimbursement-item.completed { opacity: 0.5; }

.reimb-icon {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    margin-right: 16px;
}

.reimb-icon.to-receive { background: var(--success-light); }
.reimb-icon.to-pay { background: var(--danger-light); }

.reimb-info { flex: 1; }

.reimb-person {
    font-weight: 600;
    color: var(--text-primary);
}

.reimb-description {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 2px;
}

.reimb-amount {
    font-weight: 700;
    font-size: 17px;
}

.reimb-date {
    font-size: 12px;
    color: var(--text-tertiary);
    margin-top: 4px;
    text-align: right;
}

/* ============================================
   Recurring
   ============================================ */
.recurring-summary {
    display: flex;
    gap: 14px;
    margin-bottom: 24px;
}

/* ============================================
   Categories
   ============================================ */
.category-type-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 24px;
}

.categories-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 24px;
}

.category-item {
    display: flex;
    align-items: center;
    padding: 16px 20px;
    background: var(--bg-card);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--glass-border);
}

.category-item-icon {
    font-size: 22px;
    margin-right: 14px;
}

.category-item-name {
    flex: 1;
    font-weight: 600;
    color: var(--text-primary);
}

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

.add-category-form {
    display: flex;
    gap: 12px;
    background: var(--bg-card);
    padding: 20px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid var(--glass-border);
}

.add-category-form input {
    flex: 1;
}

/* ============================================
   Settings
   ============================================ */
.settings-menu {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 28px;
}

.menu-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 24px 16px;
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    cursor: pointer;
    text-align: center;
    transition: all 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    color: var(--text-primary);
    box-shadow: var(--shadow-sm);
    gap: 8px;
}

.menu-item:hover {
    background: rgba(30, 159, 255, 0.06);
    border-color: rgba(30, 159, 255, 0.15);
    transform: translateY(-3px);
    box-shadow: var(--shadow), 0 0 20px rgba(30, 159, 255, 0.06);
}

.menu-icon {
    font-size: 28px;
}

.menu-text {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
}

.menu-arrow {
    display: none;
}

.settings-section {
    margin-bottom: 28px;
}

.settings-section h3 {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 14px;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
}

.settings-section .btn {
    margin-bottom: 12px;
}

.danger-zone {
    margin-top: 48px;
    padding-top: 24px;
    border-top: 2px solid var(--danger-light);
}

.danger-zone h3 {
    color: var(--danger);
}

/* ============================================
   Modal
   ============================================ */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 2000;
    display: flex;
    align-items: flex-end;
    justify-content: center;
}

.modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(12px) saturate(0.8);
    -webkit-backdrop-filter: blur(12px) saturate(0.8);
}

.modal-content {
    position: relative;
    background: var(--bg-secondary);
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    border-radius: 30px 26px 0 0;
    overflow: hidden;
    animation: slideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    border: 1px solid var(--glass-border);
    border-bottom: none;
    box-shadow: 0 -8px 40px rgba(0, 0, 0, 0.4);
}

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

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 24px;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h2 {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
}

.btn-close {
    background: rgba(255, 255, 255, 0.06);
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--text-secondary);
    padding: 8px 12px;
    line-height: 1;
    border-radius: var(--radius-sm);
    transition: all 0.3s;
}

.btn-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

#modal-body {
    padding: 24px;
    max-height: calc(90vh - 80px);
    overflow-y: auto;
}

.type-display {
    padding: 14px 16px;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 12px 10px 12px 8px;
    font-weight: 500;
    color: var(--text-primary);
}

.type-display.income {
    background: var(--success-light);
    color: var(--success);
}

.type-display.expense {
    background: var(--danger-light);
    color: var(--danger);
}

/* Balance detail modal */
.balance-detail-modal .calc-section {
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-color);
}

.balance-detail-modal .calc-section:last-of-type {
    border-bottom: none;
}

.balance-detail-modal .calc-section.final {
    background: rgba(0, 229, 168, 0.06);
    margin: 0 -24px -24px;
    padding: 20px 24px;
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

.balance-detail-modal h4 {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.balance-detail-modal .calc-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    font-size: 14px;
    color: var(--text-secondary);
}

.balance-detail-modal .calc-row.total {
    padding-top: 12px;
    margin-top: 8px;
    border-top: 1px dashed var(--border-color);
    color: var(--text-primary);
    font-size: 15px;
}

.balance-detail-modal .calc-section.final .calc-row.total {
    border-top: none;
    font-size: 18px;
}

/* ============================================
   Toast
   ============================================ */
#toast-container {
    position: fixed;
    top: 24px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10001;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.toast {
    background: var(--bg-secondary);
    color: var(--text-primary);
    padding: 16px 28px;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lg);
    animation: toastIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    max-width: 90vw;
    font-weight: 500;
    border: 1px solid var(--glass-border);
}

.toast.success {
    background: rgba(0, 229, 168, 0.15);
    color: var(--success);
    border-color: rgba(0, 229, 168, 0.2);
    box-shadow: var(--shadow-lg), 0 0 30px var(--success-glow);
}

.toast.error {
    background: rgba(255, 59, 111, 0.15);
    color: var(--danger);
    border-color: rgba(255, 59, 111, 0.2);
    box-shadow: var(--shadow-lg), 0 0 30px var(--danger-glow);
}

.toast.warning {
    background: rgba(255, 209, 102, 0.15);
    color: var(--warning);
    border-color: rgba(255, 209, 102, 0.2);
}

@keyframes toastIn {
    0% { opacity: 0; transform: translateY(-30px) scale(0.8); filter: blur(4px); }
    50% { filter: blur(0); }
    100% { opacity: 1; transform: translateY(0) scale(1); filter: blur(0); }
}

/* ============================================
   Alerts
   ============================================ */
#alerts-container {
    padding: 0 0 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.alert {
    display: flex;
    align-items: center;
    padding: 12px 18px;
    border-radius: 50px;
    font-size: 13px;
    font-weight: 500;
    backdrop-filter: blur(10px);
}

.alert-icon {
    font-size: 20px;
    margin-right: 14px;
}

.alert-danger {
    background: var(--danger-light);
    color: var(--danger);
    border: 1px solid rgba(255, 59, 111, 0.2);
}

.alert-warning {
    background: var(--warning-light);
    color: var(--warning);
    border: 1px solid rgba(255, 209, 102, 0.2);
}

.alert-info {
    background: rgba(30, 159, 255, 0.1);
    color: var(--primary);
    border: 1px solid rgba(30, 159, 255, 0.2);
}

/* ============================================
   Liquid Animations
   ============================================ */

/* Ripple wave for expense */
@keyframes ripple-out {
    0% {
        box-shadow: 0 0 0 0 var(--danger-glow);
        transform: translateX(0);
    }
    20% { transform: translateX(-3px); }
    40% { transform: translateX(3px); }
    60% { transform: translateX(-2px); }
    70% { box-shadow: 0 0 0 14px transparent; }
    80% { transform: translateX(1px); }
    100% {
        box-shadow: 0 0 0 0 transparent;
        transform: translateX(0);
    }
}

/* Luminous pulse for income */
@keyframes glow-in {
    0% {
        box-shadow: 0 0 0 0 var(--success-glow);
        filter: brightness(1);
    }
    30% {
        box-shadow: 0 0 30px 6px var(--success-glow);
        filter: brightness(1.15);
    }
    60% {
        box-shadow: 0 0 15px 2px var(--success-glow);
        filter: brightness(1.05);
    }
    100% {
        box-shadow: 0 0 0 0 transparent;
        filter: brightness(1);
    }
}

/* Slide-in stagger for transaction lists */
@keyframes liquid-slide-in {
    from {
        opacity: 0;
        transform: translateX(-20px);
        filter: blur(3px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
        filter: blur(0);
    }
}

.transaction-item {
    animation: liquid-slide-in 0.4s ease both;
}

.transaction-item:nth-child(1) { animation-delay: 0.02s; }
.transaction-item:nth-child(2) { animation-delay: 0.04s; }
.transaction-item:nth-child(3) { animation-delay: 0.06s; }
.transaction-item:nth-child(4) { animation-delay: 0.08s; }
.transaction-item:nth-child(5) { animation-delay: 0.10s; }
.transaction-item:nth-child(6) { animation-delay: 0.12s; }
.transaction-item:nth-child(7) { animation-delay: 0.14s; }
.transaction-item:nth-child(8) { animation-delay: 0.16s; }

.transaction-item.anim-expense {
    animation: ripple-out 0.8s ease-out;
}

.transaction-item.anim-income {
    animation: glow-in 1s ease-out;
}

/* Card entrance animations */
@keyframes card-float-in {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.card {
    animation: card-float-in 0.5s ease both;
}

.page.active .card:nth-child(1) { animation-delay: 0.05s; }
.page.active .card:nth-child(2) { animation-delay: 0.10s; }
.page.active .card:nth-child(3) { animation-delay: 0.15s; }
.page.active .card:nth-child(4) { animation-delay: 0.20s; }
.page.active .card:nth-child(5) { animation-delay: 0.25s; }

/* Balance card breathing glow */
@keyframes balance-breathe {
    0%, 100% { box-shadow: 0 8px 40px rgba(0, 229, 168, 0.1), 0 0 80px rgba(30, 159, 255, 0.05); }
    50% { box-shadow: 0 12px 60px rgba(0, 229, 168, 0.2), 0 0 120px rgba(30, 159, 255, 0.12); }
}

/* Liquid morphing for chart canvas */
.chart-container canvas {
    border-radius: var(--radius-sm);
}

/* Smooth number transitions */
.balance-amount,
.stat-value,
.forecast-value {
    transition: all 0.4s ease;
}

/* Stat boxes stagger animation */
@keyframes stat-pop-in {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(10px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.stat-box {
    animation: stat-pop-in 0.4s ease both;
}

.stat-box:nth-child(1) { animation-delay: 0.05s; }
.stat-box:nth-child(2) { animation-delay: 0.10s; }
.stat-box:nth-child(3) { animation-delay: 0.15s; }
.stat-box:nth-child(4) { animation-delay: 0.20s; }

/* Toast liquid entrance */
@keyframes toast-liquid-in {
    0% {
        opacity: 0;
        transform: translateY(-30px) scale(0.8);
        filter: blur(4px);
    }
    50% {
        filter: blur(0);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
        filter: blur(0);
    }
}

/* FAB pulse */
@keyframes nav-pulse {
    0%, 100% { box-shadow: 0 4px 30px rgba(0, 229, 168, 0.3), 0 0 60px rgba(30, 159, 255, 0.15); }
    50% { box-shadow: 0 4px 40px rgba(0, 229, 168, 0.45), 0 0 80px rgba(30, 159, 255, 0.25); }
}

.fab {
    animation: nav-pulse 3s ease-in-out infinite;
}

/* ============================================
   Responsive - Desktop
   ============================================ */
@media (min-width: 768px) {
    .bottom-nav {
        max-width: 400px;
        bottom: 20px;
        height: 60px;
    }

    .nav-item {
        flex-direction: row;
        gap: 8px;
        padding: 8px 16px;
    }

    .nav-icon { margin-bottom: 0; }

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

    .fab {
        width: 60px;
        height: 60px;
        bottom: 28px;
        right: 32px;
    }

    #app {
        padding-top: 24px;
        padding-bottom: 100px;
    }

    .page { padding: 0 40px; }

    .stats-summary { grid-template-columns: repeat(4, 1fr); }
    .comparison-grid { grid-template-columns: repeat(4, 1fr); }

    .modal-content {
        border-radius: 30px 26px 28px 24px;
        margin: auto;
        border-bottom: 1px solid var(--glass-border);
    }
}

/* ============================================
   PWA Standalone
   ============================================ */
@media (display-mode: standalone) {
    body {
        padding-top: env(safe-area-inset-top);
    }
}

/* ============================================
   Responsive - Mobile
   ============================================ */
@media (max-width: 480px) {
    html { font-size: 14px; }
    .page { padding: 0 14px; }
    .page-header h1 { font-size: 24px; }

    .balance-card {
        padding: 28px 16px;
        border-radius: 26px 20px 22px 18px;
    }

    .balance-amount { font-size: 36px; }

    .balance-details {
        gap: 8px;
        flex-wrap: wrap;
        justify-content: center;
    }

    .balance-item {
        min-width: 80px;
        text-align: center;
        padding: 8px 12px;
    }

    .balance-item .value { font-size: 14px; }

    /* Bento grid stacks on small mobile */
    .bento-grid {
        grid-template-columns: 1fr;
    }

    .bento-grid #pending-reimbursements-card,
    .bento-grid .recent-transactions-card {
        grid-column: 1;
    }

    .stats-summary {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }

    .stat-value { font-size: 18px; }
    .stat-label { font-size: 11px; }

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

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

    input[type="text"],
    input[type="password"],
    input[type="number"],
    input[type="date"],
    select,
    textarea {
        padding: 12px 14px;
        font-size: 16px;
    }

    .btn {
        padding: 12px 20px;
        font-size: 15px;
    }

    .transaction-item { padding: 14px; }
    .transaction-icon { width: 40px; height: 40px; font-size: 18px; }
    .transaction-amount { font-size: 15px; }

    /* Keep floating pill on mobile - just compact it */
    .bottom-nav {
        bottom: 12px;
        height: 50px;
        max-width: 280px;
        padding: 0 4px;
        gap: 0;
    }
    .nav-item { padding: 4px 8px; flex: 1; min-width: 0; }
    .nav-icon { font-size: 16px; }
    .nav-label { font-size: 7px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

    .fab { width: 50px; height: 50px; bottom: 18px; right: 16px; }
    .fab .nav-icon { font-size: 24px; }

    .card {
        padding: 18px;
        border-radius: 20px 16px 18px 14px;
    }

    .modal-content { max-height: 85vh; }
    .modal-header { padding: 16px; }
    .modal-header h2 { font-size: 16px; }
    #modal-body { padding: 16px; }

    .balance-detail-modal .calc-row { font-size: 13px; }
    .balance-detail-modal .calc-section.final .calc-row.total { font-size: 16px; }

    .alert { padding: 12px 14px; font-size: 13px; }

    .login-container { padding: 40px 24px 36px; }
    .logo-icon { width: 100px; height: 100px; }
    .login-logo::before { width: 140px; height: 140px; }
    .login-logo::after { width: 170px; height: 170px; }

    .tab-btn { padding: 10px 12px; font-size: 13px; }

    .chart-container { height: 200px; }
    .chart-container.chart-large { height: 260px; }

    /* Timeline adjustments for mobile */
    .transactions-list { padding-left: 20px; }
    .transactions-list::before { left: 6px; }
    .transactions-list > .transaction-item::before { left: -16px; width: 6px; height: 6px; }
}

@media (max-width: 360px) {
    html { font-size: 13px; }
    .balance-amount { font-size: 30px; }
    .balance-details { flex-direction: column; gap: 8px; }
    .stats-summary { grid-template-columns: 1fr; }
    .bottom-nav { max-width: 240px; padding: 0 2px; }
    .nav-item { padding: 4px 6px; }
    .nav-label { display: none; }
}

/* ============================================
   Scrollbar - Liquid Gradient
   ============================================ */
::-webkit-scrollbar {
    width: 6px;
}

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

::-webkit-scrollbar-thumb {
    background: linear-gradient(to bottom, rgba(0, 229, 168, 0.3), rgba(30, 159, 255, 0.3), rgba(107, 124, 255, 0.3));
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(to bottom, rgba(0, 229, 168, 0.5), rgba(30, 159, 255, 0.5), rgba(107, 124, 255, 0.5));
}

/* Text selection */
::selection {
    background: rgba(30, 159, 255, 0.3);
    color: var(--text-primary);
}

::-moz-selection {
    background: rgba(30, 159, 255, 0.3);
    color: var(--text-primary);
}
