/* RizqTrack Premium Styles */

/* ============================================
   MODERN LOGIN PAGE DESIGN
   ============================================ */

/* Login Page Container */
.um-page-login,
.um-login-form,
.um .um-form {
    animation: fadeInUp 0.6s ease-out;
}

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

/* Login Form Styling */
.um .um-form {
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%) !important;
    border-radius: 20px !important;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.1), 0 0 1px rgba(0, 0, 0, 0.05) !important;
    padding: 40px !important;
    border: none !important;
    max-width: 450px !important;
    margin: 60px auto 100px auto !important; /* Increased bottom margin for footer space */
    position: relative;
    overflow: hidden;
}

.um .um-form::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #0891b2 0%, #06b6d4 50%, #0891b2 100%);
    background-size: 200% 100%;
    animation: shimmer 3s ease-in-out infinite;
}

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

/* Form Header */
.um .um-header {
    text-align: center;
    margin-bottom: 35px !important;
}

.um .um-header::before {
    content: '🌙';
    display: block;
    font-size: 48px;
    margin-bottom: 15px;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.1); opacity: 0.8; }
}

.um .um-header .um-title {
    font-size: 32px !important;
    font-weight: 700 !important;
    background: linear-gradient(135deg, #0891b2 0%, #06b6d4 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 10px !important;
    letter-spacing: -0.5px;
}

/* Input Fields */
.um .um-field-group {
    margin-bottom: 25px !important;
    position: relative;
}

.um .um-field-label {
    font-size: 14px !important;
    font-weight: 600 !important;
    color: #475569 !important;
    margin-bottom: 8px !important;
    display: block;
}

.um input[type="text"],
.um input[type="password"],
.um input[type="email"] {
    width: 100% !important;
    padding: 14px 16px 14px 44px !important;
    border: 2px solid #e2e8f0 !important;
    border-radius: 12px !important;
    font-size: 15px !important;
    color: #1e293b !important;
    background: #ffffff !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    box-sizing: border-box !important;
}

.um input[type="text"]:focus,
.um input[type="password"]:focus,
.um input[type="email"]:focus {
    border-color: #0891b2 !important;
    box-shadow: 0 0 0 4px rgba(8, 145, 178, 0.1), 0 4px 12px rgba(8, 145, 178, 0.15) !important;
    outline: none !important;
    transform: translateY(-2px) scale(1.01);
    background: #fafbfc !important;
}

/* Add icons to inputs */
.um .um-field-group:has(input[type="text"]:not([name*="password"])):before,
.um .um-field-group:has(input[type="email"]):before {
    content: '👤';
    position: absolute;
    left: 16px;
    top: 42px;
    font-size: 18px;
    z-index: 1;
    opacity: 0.6;
    transition: opacity 0.3s ease;
}

.um .um-field-group:has(input[type="password"]):before {
    content: '🔒';
    position: absolute;
    left: 16px;
    top: 42px;
    font-size: 18px;
    z-index: 1;
    opacity: 0.6;
    transition: opacity 0.3s ease;
}

.um .um-field-group:has(input:focus):before {
    opacity: 1;
}

/* Submit Button */
.um button[type="submit"],
.um .um-button {
    width: 100% !important;
    padding: 16px 24px !important;
    background: linear-gradient(135deg, #0891b2 0%, #06b6d4 100%) !important;
    color: white !important;
    border: none !important;
    border-radius: 12px !important;
    font-size: 16px !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1) !important;
    box-shadow: 0 4px 12px rgba(8, 145, 178, 0.3) !important;
    margin-top: 10px !important;
    text-transform: none !important;
    position: relative;
    overflow: hidden;
}

.um button[type="submit"]::before,
.um .um-button::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.um button[type="submit"]:hover::before,
.um .um-button:hover::before {
    width: 300px;
    height: 300px;
}

.um button[type="submit"]:hover,
.um .um-button:hover {
    transform: translateY(-2px) scale(1.02) !important;
    box-shadow: 0 12px 24px rgba(8, 145, 178, 0.5) !important;
}

.um button[type="submit"]:active,
.um .um-button:active {
    transform: translateY(0) scale(0.98) !important;
    box-shadow: 0 4px 12px rgba(8, 145, 178, 0.3) !important;
}

/* Remember Me & Links */
.um .um-field-checkbox label {
    font-size: 14px !important;
    color: #64748b !important;
}

.um .um-forgot-password,
.um a {
    color: #0891b2 !important;
    font-weight: 600 !important;
    text-decoration: none !important;
    transition: color 0.2s ease !important;
}

.um .um-forgot-password:hover,
.um a:hover {
    color: #06b6d4 !important;
    text-decoration: underline !important;
}

/* Error Messages */
.um .um-notice {
    border-radius: 12px !important;
    padding: 14px 18px !important;
    margin-bottom: 20px !important;
    border: none !important;
    animation: shake 0.5s ease;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-10px); }
    75% { transform: translateX(10px); }
}

.um .um-notice.error {
    background: #fef2f2 !important;
    color: #991b1b !important;
    border-left: 4px solid #ef4444 !important;
}

.um .um-notice.success {
    background: #f0fdf4 !important;
    color: #166534 !important;
    border-left: 4px solid #10b981 !important;
}

/* Loading State */
.um button[type="submit"].loading {
    position: relative;
    color: transparent !important;
}

.um button[type="submit"].loading::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    top: 50%;
    left: 50%;
    margin-left: -10px;
    margin-top: -10px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* Login Page Background */
body.um-page-login {
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 50%, #f0f9ff 100%) !important;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow-x: hidden;
    overflow-y: auto;
    padding: 60px 20px 100px 20px; /* Add padding to prevent footer overlap */
}

body.um-page-login::before,
body.um-page-login::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(8, 145, 178, 0.15) 0%, rgba(6, 182, 212, 0.05) 50%, transparent 70%);
    animation: float 25s ease-in-out infinite;
    filter: blur(40px);
}

body.um-page-login::before {
    width: 600px;
    height: 600px;
    top: -300px;
    right: -200px;
    animation-delay: 0s;
}

body.um-page-login::after {
    width: 800px;
    height: 800px;
    bottom: -400px;
    left: -300px;
    animation-delay: 5s;
}

@keyframes float {
    0%, 100% {
        transform: translate(0, 0) scale(1) rotate(0deg);
        opacity: 1;
    }
    33% {
        transform: translate(30px, -30px) scale(1.05) rotate(120deg);
        opacity: 0.8;
    }
    66% {
        transform: translate(-30px, 30px) scale(0.95) rotate(240deg);
        opacity: 0.9;
    }
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .um .um-form {
        padding: 30px 20px !important;
        margin: 30px 15px 80px 15px !important; /* Increased bottom margin for mobile */
        border-radius: 16px !important;
    }

    body.um-page-login {
        padding: 40px 15px 80px 15px !important;
    }

    .um .um-header .um-title {
        font-size: 26px !important;
    }

    .um input[type="text"],
    .um input[type="password"],
    .um input[type="email"] {
        padding: 12px 14px !important;
        font-size: 14px !important;
    }

    .um button[type="submit"],
    .um .um-button {
        padding: 14px 20px !important;
        font-size: 15px !important;
    }

    body.um-page-login::before,
    body.um-page-login::after {
        display: none;
    }
}

/* Tablet View */
@media (max-width: 1024px) and (min-width: 769px) {
    .um .um-form {
        max-width: 400px !important;
    }
}

/* ============================================
   QUICK NAVIGATION BAR
   ============================================ */
.quick-nav {
    position: sticky;
    top: 32px;
    z-index: 999;
    background: linear-gradient(135deg, #0891b2 0%, #06b6d4 100%);
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(8, 145, 178, 0.3);
    margin-bottom: 20px;
    overflow: hidden;
}

.quick-nav-toggle {
    display: none;
    padding: 14px 20px;
    cursor: pointer;
    color: white;
    font-weight: 600;
    user-select: none;
}

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

.quick-nav-menu {
    display: flex;
    flex-wrap: wrap;
    gap: 0;
    padding: 0;
}

.nav-item {
    flex: 1 1 auto;
    min-width: 100px;
    padding: 12px 14px;
    color: white;
    text-decoration: none !important;
    text-align: center;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.3s ease;
    border-right: 1px solid rgba(255, 255, 255, 0.2);
    white-space: nowrap;
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
}

.nav-item:last-child {
    border-right: none;
}

.nav-item:hover,
.nav-item:focus,
.nav-item:visited {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
    color: white;
    text-decoration: none !important;
}

.nav-item:active {
    transform: translateY(0);
    color: white;
}

/* Floating Action Button */
.fab {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, #0891b2 0%, #06b6d4 100%);
    color: white;
    border: none;
    box-shadow: 0 6px 20px rgba(8, 145, 178, 0.4);
    cursor: pointer;
    z-index: 998;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.fab::before {
    content: '💳 Quick Add';
    position: absolute;
    right: 68px;
    background: rgba(0, 0, 0, 0.85);
    color: white;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

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

.fab:hover {
    transform: scale(1.1);
    box-shadow: 0 8px 25px rgba(8, 145, 178, 0.5);
}

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

/* Section Navigation Arrows */
.section-nav-arrows {
    position: fixed;
    right: 30px;
    bottom: 98px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    z-index: 997;
}

.nav-arrow {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, #0891b2 0%, #06b6d4 100%);
    color: white;
    border: none;
    box-shadow: 0 6px 20px rgba(8, 145, 178, 0.4);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    transition: all 0.3s ease;
}

.nav-arrow:hover {
    transform: scale(1.1);
    box-shadow: 0 8px 25px rgba(8, 145, 178, 0.5);
}

.nav-arrow:active {
    transform: scale(0.95);
}

.nav-arrow span {
    line-height: 1;
    font-weight: bold;
}

.fab-icon {
    font-size: 42px;
    line-height: 1;
    font-weight: 300;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff !important;
    opacity: 1 !important;
    visibility: visible !important;
    -webkit-text-fill-color: #ffffff !important;
    font-family: Arial, sans-serif;
}

/* Mobile Navigation */
@media (max-width: 768px) {
    .quick-nav {
        top: 10px;
    }

    .quick-nav-toggle {
        display: block;
    }

    .quick-nav-menu {
        display: none;
        flex-direction: column;
        flex-wrap: nowrap;
        max-height: 400px;
        overflow-y: auto;
        width: 100%;
    }

    .quick-nav-menu.active {
        display: flex;
    }

    .nav-item {
        flex: none;
        width: 100%;
        border-right: none;
        border-bottom: 1px solid rgba(255, 255, 255, 0.2);
        text-align: left;
        padding: 16px 20px;
        min-width: auto;
        text-decoration: none !important;
        touch-action: manipulation;
        pointer-events: auto !important;
        cursor: pointer;
        position: relative;
        z-index: 1000;
        -webkit-tap-highlight-color: rgba(255, 255, 255, 0.2);
        user-select: none;
        display: block;
    }

    .nav-item:hover,
    .nav-item:focus,
    .nav-item:visited,
    .nav-item:active {
        text-decoration: none !important;
        color: white !important;
        background: rgba(255, 255, 255, 0.15);
        pointer-events: auto !important;
        cursor: pointer;
        transform: none;
    }

    .nav-item:last-child {
        border-bottom: none;
        background: rgba(220, 38, 38, 0.2); /* Highlight logout */
    }

    .nav-item:last-child:hover,
    .nav-item:last-child:active {
        background: rgba(220, 38, 38, 0.3);
    }

    .fab {
        bottom: 25px;
        right: 20px;
        width: 50px;
        height: 50px;
    }

    .fab::before {
        display: none;
    }

    .fab-icon {
        font-size: 32px;
        color: #ffffff !important;
        opacity: 1 !important;
        visibility: visible !important;
        -webkit-text-fill-color: #ffffff !important;
        font-family: Arial, sans-serif;
    }

    .section-nav-arrows {
        right: 20px;
        bottom: 87px;
        gap: 10px;
    }

    .nav-arrow {
        width: 50px;
        height: 50px;
        font-size: 18px;
    }

    /* Compact Transaction Form for Mobile */
    .transaction-form .form-row {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    /* Row 1: Type toggle buttons side by side */
    .transaction-form .form-row:first-child .toggle-buttons {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }

    /* Row 2: Amount + Category side by side */
    .transaction-form .form-row:nth-child(2) {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }

    /* Row 3: Date and Payment side by side */
    .transaction-form .form-row:nth-child(3) {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }

    /* Description textarea */
    .transaction-form textarea {
        font-size: 14px;
    }
}

:root {
    --primary-color: #0891b2;
    --primary-dark: #0e7490;
    --primary-light: #06b6d4;
    --primary-hover: #155e75;
    --success-color: #10b981;
    --success-hover: #059669;
    --danger-color: #ef4444;
    --danger-hover: #dc2626;
    --warning-color: #f59e0b;
    --info-color: #3b82f6;
    --text-dark: #1f2937;
    --text-gray: #6b7280;
    --bg-light: #f9fafb;
    --border-color: #e5e7eb;
    --white: #ffffff;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
    --radius: 10px;
    --radius-sm: 6px;
}

* {
    box-sizing: border-box;
}

/* Frontend Container Wrapper */
.rizqtrack-frontend-wrapper {
    background: var(--bg-light);
    padding: 40px 20px;
    min-height: 100vh;
}

.rizqtrack-frontend-wrapper .rizqtrack-dashboard {
    background: transparent;
    padding: 0;
}

/* Error Message for Non-logged Users */
.rizqtrack-error {
    max-width: 600px;
    margin: 40px auto;
}

.rizqtrack-dashboard {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
    background: var(--bg-light);
}

/* Header */
.rizqtrack-header {
    margin-bottom: 40px;
    text-align: center;
}

.rizqtrack-header h1 {
    font-family: 'Poppins', sans-serif;
    font-size: 42px;
    font-weight: 700;
    color: var(--text-dark);
    margin: 0 0 8px 0;
}

.rizqtrack-header .subtitle {
    font-size: 18px;
    color: var(--text-gray);
    margin: 0;
}

/* Section Titles */
.section-title {
    font-family: 'Poppins', sans-serif;
    font-size: 24px;
    font-weight: 600;
    color: var(--text-dark);
    margin: 0 0 16px 0;
}

/* Motivational Quote Card */
.motivational-quote-card {
    background: linear-gradient(135deg, #0891b2 0%, #06b6d4 100%);
    border-radius: var(--radius);
    padding: 28px 32px;
    margin-bottom: 20px;
    box-shadow: var(--shadow-md);
    display: flex;
    align-items: center;
    gap: 24px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    position: relative;
    overflow: hidden;
}

.motivational-quote-card::before {
    content: '"';
    position: absolute;
    top: -10px;
    left: 15px;
    font-size: 120px;
    color: rgba(255, 255, 255, 0.1);
    font-family: Georgia, serif;
    line-height: 1;
    z-index: 0;
}

.quote-icon {
    font-size: 48px;
    flex-shrink: 0;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
    z-index: 1;
}

.quote-content {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 24px;
    z-index: 1;
}

.quote-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.quote-text {
    color: white;
    font-size: 19px;
    font-weight: 500;
    margin: 0;
    font-style: italic;
    line-height: 1.5;
    letter-spacing: 0.01em;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.quote-source {
    color: rgba(255, 255, 255, 0.75);
    font-size: 13px;
    font-weight: 500;
    margin: 0;
    font-style: normal;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    opacity: 0.9;
}

.btn-refresh-quote {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: #ffffff !important;
    opacity: 1 !important;
    visibility: visible !important;
    -webkit-text-fill-color: #ffffff !important;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    cursor: pointer;
    font-family: Arial, sans-serif;
    font-weight: 400;
    transition: all 0.3s ease;
    font-size: 20px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.btn-refresh-quote:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(180deg);
}

/* Mobile adjustments for quote card */
@media (max-width: 768px) {
    .motivational-quote-card {
        padding: 20px 22px;
        gap: 16px;
    }

    .motivational-quote-card::before {
        font-size: 80px;
        top: -5px;
        left: 10px;
    }

    .quote-icon {
        font-size: 36px;
    }

    .quote-wrapper {
        gap: 6px;
    }

    .quote-text {
        font-size: 16px;
        line-height: 1.5;
    }

    .quote-source {
        font-size: 11px;
    }

    .btn-refresh-quote {
        width: 36px;
        height: 36px;
        font-size: 16px;
        color: #ffffff !important;
        opacity: 1 !important;
        visibility: visible !important;
        -webkit-text-fill-color: #ffffff !important;
        font-family: Arial, sans-serif;
        font-weight: 400;
    }
}

/* KPI Section */
.kpi-section {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 20px;
}

.kpi-card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 18px;
    display: flex;
    align-items: center;
    gap: 14px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
    min-height: 100px;
}

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

.kpi-icon {
    font-size: 28px;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    flex-shrink: 0;
}

.kpi-icon.income {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.kpi-icon.expense {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
}

.kpi-icon.savings {
    background: linear-gradient(135deg, #0891b2 0%, #0e7490 100%);
}

.kpi-icon.top-spend {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
}

.kpi-icon.avg-transaction {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
}

.kpi-icon.transaction-count {
    background: linear-gradient(135deg, #14b8a6 0%, #0d9488 100%);
}

.kpi-icon.frequent-category {
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
}

.kpi-icon.days-no-spend {
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
}

.kpi-icon.busiest-day {
    background: linear-gradient(135deg, #06b6d4 0%, #0891b2 100%);
}

.kpi-icon.avg-income-day {
    background: linear-gradient(135deg, #34d399 0%, #10b981 100%);
}

.kpi-icon.avg-expense-day {
    background: linear-gradient(135deg, #f87171 0%, #ef4444 100%);
}

.kpi-icon.vehicle-mileage {
    background: linear-gradient(135deg, #a78bfa 0%, #8b5cf6 100%);
}

/* Fuel Fields Styling */
.fuel-fields {
    background: #f0fdf4;
    border: 1px solid #86efac;
    border-radius: var(--radius-sm);
    padding: 16px;
    margin-top: 8px;
}

.fuel-fields .form-row {
    margin-bottom: 0;
}

.fuel-info {
    font-size: 0.85em;
    color: #6b7280;
    margin-top: 4px;
    padding: 4px 8px;
    background: #f9fafb;
    border-radius: 4px;
    display: inline-block;
}

/* Checkbox Label Styling */
.checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    padding: 0 !important;
    margin: 0 !important;
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--primary-color);
    margin: 0 !important;
    padding: 0 !important;
    flex-shrink: 0;
    vertical-align: middle;
}

.checkbox-text {
    font-size: 15px;
    color: var(--text-dark);
    user-select: none;
    line-height: 1.5;
    margin: 0;
    padding: 0;
}

.kpi-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
    overflow: hidden;
}

.kpi-label {
    font-size: 11px;
    color: var(--text-gray);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.kpi-value {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-dark);
    font-family: 'Poppins', sans-serif;
    word-break: break-word;
    line-height: 1.2;
}

.kpi-value.small {
    font-size: 14px;
    line-height: 1.3;
}

/* Cards */
.rizqtrack-card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: var(--shadow-sm);
    transition: box-shadow 0.3s ease;
    border: 1px solid var(--border-color);
}

.rizqtrack-card:hover {
    box-shadow: var(--shadow-md);
}

/* Transaction Form */
.transaction-form {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group.full-width {
    grid-column: 1 / -1;
}

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

.required {
    color: var(--danger-color);
}

.form-group input,
.form-group select,
.form-group textarea {
    padding: 12px 16px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 15px;
    font-family: 'Inter', sans-serif;
    color: var(--text-dark) !important;
    background: var(--white) !important;
    transition: all 0.2s ease;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

/* Force select option text to be visible */
.form-group select option {
    color: var(--text-dark) !important;
    background: var(--white) !important;
}

/* Modal form selects */
.modal select,
.modal select option {
    color: var(--text-dark) !important;
    background: var(--white) !important;
}


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

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

/* Checkbox Styling */
.form-group.checkbox-group {
    padding: 0;
    background: transparent;
    border: none;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    margin-bottom: 0 !important;
    user-select: none;
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    padding: 0;
    margin: 0;
    cursor: pointer;
    accent-color: var(--primary-color);
    flex-shrink: 0;
    -webkit-appearance: checkbox;
    -moz-appearance: checkbox;
    appearance: checkbox;
    border: 2px solid #d1d5db;
    border-radius: 3px;
}

.checkbox-text {
    font-size: 14px;
    font-weight: 400;
    color: var(--text-dark);
    line-height: 1.5;
}

.checkbox-label:hover {
    opacity: 0.8;
}

/* Type Toggle */
.type-toggle {
    grid-column: 1 / -1;
}

.toggle-buttons {
    display: flex;
    gap: 12px;
}

.toggle-btn {
    flex: 1;
    padding: 14px 24px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: var(--white);
    color: var(--text-dark);
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.toggle-btn:hover:not(.active) {
    border-color: var(--primary-color);
    background: #ecfeff;
    color: var(--text-dark);
}

.toggle-btn.active {
    background: var(--primary-color);
    color: var(--white);
    border-color: var(--primary-color);
}

.toggle-btn.active:hover {
    background: var(--primary-dark);
    color: var(--white);
}

/* Buttons */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 15px;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

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

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-secondary {
    background: var(--white);
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
}

.btn-secondary:hover {
    background: #eef2ff;
    color: var(--primary-dark);
    border-color: var(--primary-dark);
}

.btn-danger {
    background: var(--danger-color);
    color: var(--white);
}

.btn-danger:hover {
    background: var(--danger-hover);
    transform: translateY(-1px);
}

.btn-text {
    background: transparent;
    color: var(--text-secondary);
    padding: 8px;
    border: none;
    font-size: 18px;
    min-width: auto;
}

.btn-text:hover {
    background: rgba(0, 0, 0, 0.05);
    color: var(--danger-color);
    transform: none;
}

.btn-success {
    background: var(--success-color);
    color: var(--white);
}

.btn-success:hover {
    background: var(--success-hover);
    transform: translateY(-1px);
}

.btn-info {
    background: var(--info-color);
    color: var(--white);
}

.btn-info:hover {
    background: #2563eb;
    transform: translateY(-1px);
}

.btn-sm {
    padding: 8px 16px;
    font-size: 13px;
}

.form-actions {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-top: 8px;
}

/* Visualization Section */
.visualization-section {
    margin-bottom: 32px;
}

/* Unified Filters */
.unified-filters {
    background: var(--white);
    border-radius: var(--radius);
    padding: 20px 24px;
    margin-bottom: 24px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
}

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

.filter-group:last-child {
    margin-bottom: 0;
}

.comparison-filter-group {
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    padding: 16px;
    border-radius: var(--radius-sm);
    border: 2px solid #bae6fd;
}

.filter-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 12px;
}

.chart-filters {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 10px 20px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: var(--white);
    color: var(--text-dark);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.filter-btn:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    background: #ecfeff;
}

.filter-btn.active {
    background: var(--primary-color);
    color: var(--white);
    border-color: var(--primary-color);
}

/* Date Range Filters */
.date-range-filters {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: nowrap;
}

.date-input {
    padding: 8px 12px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: var(--white);
    color: var(--text-dark);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    flex: 1;
    min-width: 120px;
    max-width: 160px;
}

.date-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(6, 182, 212, 0.1);
}

.date-separator {
    color: var(--text-light);
    font-size: 14px;
    font-weight: 500;
}

/* Comparison KPI Cards */
.comparison-kpi-section {
    background: var(--white);
    border-radius: var(--radius);
    padding: 20px 24px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
}

.comparison-kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
}

.comparison-kpi-card {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 16px;
    transition: all 0.3s ease;
}

.comparison-kpi-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary-color);
}

.comparison-kpi-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.comparison-kpi-current {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 8px;
}

.comparison-kpi-change {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
}

.change-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 12px;
    font-weight: 700;
    font-size: 12px;
}

.change-badge.positive {
    background: #dcfce7;
    color: #16a34a;
}

.change-badge.positive::before {
    content: '↑ ';
    font-size: 14px;
}

.change-badge.negative {
    background: #fee2e2;
    color: #dc2626;
}

.change-badge.negative::before {
    content: '↓ ';
    font-size: 14px;
}

.change-badge.neutral {
    background: #f3f4f6;
    color: #6b7280;
}

.change-previous {
    color: var(--text-light);
    font-weight: 500;
}

/* Trend Date Filters */
.trend-date-filters {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    flex-wrap: wrap;
    align-items: center;
}

.trend-date-btn {
    padding: 8px 16px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: var(--white);
    color: var(--text-dark);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.trend-date-btn:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.trend-date-btn.active {
    background: var(--primary-color);
    color: var(--white);
    border-color: var(--primary-color);
}

.trend-custom-dates {
    display: flex;
    gap: 8px;
    align-items: center;
}

.trend-custom-dates input[type="date"] {
    padding: 8px 12px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 13px;
    color: var(--text-dark);
    background: var(--white);
}

.trend-custom-dates input[type="date"]:focus {
    outline: none;
    border-color: var(--primary-color);
}

.charts-container {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

/* Chart Slicer/Filter Controls - Power BI Style */
.chart-slicer {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}

.slicer-chip {
    padding: 6px 14px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: var(--white);
    color: var(--text-dark);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.slicer-chip:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    background: #ecfeff;
}

.slicer-chip.active {
    background: var(--primary-color);
    color: var(--white);
    border-color: var(--primary-color);
}

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

.chart-title-section {
    flex: 1;
}

.chart-controls {
    display: flex;
    gap: 8px;
}

.chart-card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
}

.chart-card h3 {
    font-family: 'Poppins', sans-serif;
    font-size: 18px;
    font-weight: 600;
    color: var(--text-dark);
    margin: 0 0 16px 0;
}

.chart-wrapper {
    position: relative;
    height: 350px;
}

.chart-subtitle {
    font-size: 13px;
    color: var(--text-muted);
    margin: -8px 0 16px 0;
    font-style: italic;
}

/* Treemap Visualization */
.treemap-container {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    min-height: 200px;
    padding: 10px;
}

.treemap-block {
    position: relative;
    min-width: 80px;
    min-height: 80px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.treemap-block:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    z-index: 10;
}

.treemap-content {
    text-align: center;
    color: white;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
    padding: 8px;
}

.treemap-emoji {
    font-size: 28px;
    margin-bottom: 4px;
}

.treemap-label {
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 4px;
    line-height: 1.2;
}

.treemap-value {
    font-size: 16px;
    font-weight: 700;
}

.treemap-tooltip {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 10px 12px;
    border-radius: 6px;
    font-size: 12px;
    line-height: 1.6;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    z-index: 1000;
    margin-bottom: 8px;
}

.treemap-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: rgba(0, 0, 0, 0.9);
}

.treemap-block:hover .treemap-tooltip {
    opacity: 1;
}

@media (max-width: 768px) {
    .treemap-block {
        min-width: 60px;
        min-height: 60px;
    }

    .treemap-emoji {
        font-size: 20px;
    }

    .treemap-label {
        font-size: 10px;
    }

    .treemap-value {
        font-size: 13px;
    }

    .treemap-tooltip {
        font-size: 11px;
    }
}

/* Category Details Section */
.category-details-wrapper {
    margin-top: 16px;
}

.category-details-table-wrapper {
    overflow-x: auto;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
}

.category-details-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.category-details-table thead {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.category-details-table th {
    padding: 12px 16px;
    text-align: left;
    font-weight: 600;
    font-size: 13px;
}

.category-details-table td {
    padding: 10px 16px;
    border-bottom: 1px solid var(--border-color);
}

.category-details-table tbody tr:hover {
    background: var(--bg-light);
}

.category-details-table tbody tr:last-child td {
    border-bottom: none;
}

.description-cell {
    font-weight: 500;
    color: var(--text-dark);
}

.amount-cell {
    font-weight: 600;
    text-align: right;
}

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

.amount-cell.expense {
    color: var(--danger);
}

.type-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.type-badge.income {
    background: #d1fae5;
    color: #065f46;
}

.type-badge.expense {
    background: #fee2e2;
    color: #991b1b;
}

.category-summary {
    padding: 14px 16px;
    background: var(--bg-light);
    border-top: 2px solid var(--border-color);
    font-size: 13px;
    color: var(--text-dark);
    text-align: right;
}

/* Tables */
.table-responsive {
    overflow-x: auto;
}

.rizqtrack-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.rizqtrack-table thead {
    background: var(--bg-light);
}

.rizqtrack-table th {
    padding: 14px 16px;
    text-align: left;
    font-weight: 600;
    color: var(--text-dark);
    border-bottom: 2px solid var(--border-color);
}

.rizqtrack-table td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-dark);
}

.rizqtrack-table tbody tr:hover {
    background: var(--bg-light);
}

.amount-positive {
    color: var(--success-color);
    font-weight: 600;
}

.amount-negative {
    color: var(--danger-color);
    font-weight: 600;
}

.action-btns {
    display: flex;
    gap: 8px;
}

.icon-btn {
    padding: 6px 10px;
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 16px;
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
}

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

.loading-row td {
    text-align: center;
    padding: 32px;
    color: var(--text-gray);
}

/* --- ADDED: Pagination Controls --- */
.pagination-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 24px;
    margin-top: 16px;
    margin-bottom: 24px;
    border-top: 2px solid var(--border-color);
}

.pagination-controls span {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-gray);
}
/* --- END: Pagination Controls --- */

/* Transaction Filter Bar */
.filter-bar {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    align-items: flex-end;
}

.filter-bar .form-group {
    margin-bottom: 0;
    flex: 1;
    min-width: 150px;
}

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

.filter-bar input[type="date"],
.filter-bar select,
.filter-bar input[type="text"] {
    width: 100%;
    padding: 10px 12px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 14px;
}

.filter-search {
    flex: 2;
    min-width: 200px;
}

.filter-actions {
    display: flex;
    gap: 8px;
    align-items: flex-end;
}

.filter-date-group {
    display: flex;
    gap: 12px;
    flex: 2;
}

.filter-date-group .form-group {
    flex: 1;
    min-width: 130px;
}


/* ============================================
    FINANCIAL GOALS - COMPLETE STYLING
    ============================================ */

/* Global Section Spacing */
.goals-section,
.budget-section,
.management-section,
.trash-section {
    margin-top: 32px;
    margin-bottom: 32px;
}

/* Section Header */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 16px;
}

/* Goals Overview Card - Beautiful Gradient */
.goals-overview-card {
    background: linear-gradient(135deg, #0891b2 0%, #0e7490 100%);
    color: white;
    margin-bottom: 32px;
    position: relative;
    overflow: hidden;
    border-radius: 16px;
    padding: 32px;
    box-shadow: 0 10px 40px rgba(8, 145, 178, 0.3);
}

.goals-overview-card::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -10%;
    width: 400px;
    height: 400px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 50%;
    pointer-events: none;
}

/* Overview Header */
.goals-overview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
    position: relative;
    z-index: 1;
    flex-wrap: wrap;
    gap: 20px;
}

.goals-overview-header h3 {
    font-family: 'Poppins', sans-serif;
    font-size: 28px;
    font-weight: 700;
    margin: 0;
    color: white;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

/* Stats Badges */
.goals-stats-badges {
    display: flex;
    gap: 16px;
}

.stat-badge {
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    padding: 16px 24px;
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    min-width: 120px;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.stat-badge:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.stat-badge.success {
    background: rgba(16, 185, 129, 0.25);
    border-color: rgba(16, 185, 129, 0.4);
}

.badge-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    opacity: 0.95;
    font-weight: 600;
}

.badge-value {
    font-size: 32px;
    font-weight: 800;
    font-family: 'Poppins', sans-serif;
    line-height: 1;
}

/* Overall Progress Section */
.overall-progress-section {
    background: rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    padding: 32px;
    margin-bottom: 28px;
    position: relative;
    z-index: 1;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Progress Header */
.progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 28px;
    flex-wrap: wrap;
    gap: 20px;
}

.progress-amounts {
    display: flex;
    align-items: center;
    gap: 24px;
    flex-wrap: wrap;
}

.amount-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.amount-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    opacity: 0.85;
    font-weight: 600;
}

.amount-value {
    font-size: 32px;
    font-weight: 800;
    font-family: 'Poppins', sans-serif;
    line-height: 1;
}

.amount-value.current {
    color: #fbbf24;
    text-shadow: 0 0 20px rgba(251, 191, 36, 0.6);
    font-weight: 900;
}

.amount-value.target {
    color: white;
}

.amount-divider {
    font-size: 32px;
    opacity: 0.4;
    font-weight: 300;
    margin: 0 8px;
}

.progress-percentage {
    font-size: 56px;
    font-weight: 800;
    font-family: 'Poppins', sans-serif;
    text-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    line-height: 1;
}

/* Overall Progress Bar */
.overall-progress-bar-container {
    margin-bottom: 28px;
    position: relative;
}

.overall-progress-bar {
    background: rgba(255, 255, 255, 0.15);
    height: 48px;
    border-radius: 24px;
    overflow: hidden;
    position: relative;
    box-shadow: inset 0 4px 8px rgba(0, 0, 0, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.progress-bar-fill {
    height: 100%;
    border-radius: 24px;
    background: linear-gradient(90deg, #10b981 0%, #34d399 100%);
    transition: width 1.5s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    box-shadow: 0 4px 20px rgba(16, 185, 129, 0.5),
                inset 0 2px 4px rgba(255, 255, 255, 0.3);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: 20px;
}

.progress-bar-fill::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, 
        transparent, 
        rgba(255, 255, 255, 0.3), 
        transparent
    );
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.progress-bar-fill::after {
    content: '';
    position: absolute;
    top: 50%;
    right: 12px;
    width: 28px;
    height: 28px;
    background: white;
    border-radius: 50%;
    transform: translateY(-50%);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
    z-index: 2;
}

/* Progress Markers */
.progress-markers {
    display: flex;
    justify-content: space-between;
    margin-top: 12px;
    position: relative;
    padding: 0 4px;
}

.marker {
    font-size: 11px;
    opacity: 0.7;
    position: absolute;
    transform: translateX(-50%);
    font-weight: 600;
}

/* Progress Insights */
.progress-insights {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-top: 24px;
}

.insight-item {
    display: flex;
    align-items: center;
    gap: 16px;
    background: rgba(255, 255, 255, 0.08);
    padding: 20px;
    border-radius: 16px;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.insight-item:hover {
    background: rgba(255, 255, 255, 0.12);
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.insight-icon {
    font-size: 36px;
    line-height: 1;
}

.insight-content {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
}

.insight-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    opacity: 0.85;
    font-weight: 600;
}

.insight-value {
    font-size: 24px;
    font-weight: 800;
    font-family: 'Poppins', sans-serif;
    line-height: 1;
}


/* Individual Goals Header */
.individual-goals-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 16px;
}

.individual-goals-header h3 {
    font-family: 'Poppins', sans-serif;
    font-size: 24px;
    font-weight: 700;
    color: var(--text-dark);
    margin: 0;
}

/* Goals Filter Chips */
.goals-filter {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.filter-chip {
    padding: 10px 20px;
    border: 2px solid var(--border-color);
    border-radius: 24px;
    background: var(--white);
    color: var(--text-dark);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    flex-shrink: 0;
    -webkit-tap-highlight-color: transparent;
}

.filter-chip:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    background: #ecfeff;
}

.filter-chip.active {
    background: var(--primary-color);
    color: var(--white);
    border-color: var(--primary-color);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

/* Mobile optimizations */
@media (max-width: 768px) {
    .filter-chip {
        padding: 10px 18px;
        font-size: 13px;
    }

    .subscriptions-search input {
        font-size: 16px; /* Prevents zoom on iOS */
        padding: 14px 16px;
    }
}

/* Goals Grid */
.goals-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 24px;
}

/* Enhanced Goal Cards */
.goal-card {
    background: var(--white);
    border-radius: 16px;
    padding: 28px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border: 2px solid transparent;
    position: relative;
    overflow: hidden;
    opacity: 0;
    animation: fadeInUp 0.6s ease forwards;
}

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

.goal-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 5px;
    background: linear-gradient(90deg, var(--primary-color), var(--primary-light));
    opacity: 0;
    transition: opacity 0.3s ease;
}

.goal-card:hover {
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.12);
    border-color: var(--primary-color);
    transform: translateY(-6px);
}

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

.goal-card.near-complete {
    border-color: #f59e0b;
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.03) 0%, rgba(251, 191, 36, 0.03) 100%);
}

.goal-card.completed {
    border-color: var(--success-color);
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.05) 0%, rgba(52, 211, 153, 0.05) 100%);
}

/* Stagger animation delay */
.goal-card:nth-child(1) { animation-delay: 0.1s; }
.goal-card:nth-child(2) { animation-delay: 0.2s; }
.goal-card:nth-child(3) { animation-delay: 0.3s; }
.goal-card:nth-child(4) { animation-delay: 0.4s; }
.goal-card:nth-child(5) { animation-delay: 0.5s; }
.goal-card:nth-child(6) { animation-delay: 0.6s; }

.goal-card h4 {
    font-family: 'Poppins', sans-serif;
    font-size: 20px;
    font-weight: 700;
    color: var(--text-dark);
    margin: 0 0 16px 0;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

/* Goal Status Badges */
.goal-status-badge {
    display: inline-flex;
    align-items: center;
    padding: 5px 12px;
    border-radius: 14px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.goal-status-badge.on-track {
    background: rgba(16, 185, 129, 0.15);
    color: var(--success-color);
}

.goal-status-badge.needs-attention {
    background: rgba(245, 158, 11, 0.15);
    color: var(--warning-color);
}

.goal-status-badge.complete {
    background: rgba(16, 185, 129, 0.2);
    color: var(--success-color);
}

.goal-amount {
    font-size: 15px;
    color: var(--text-gray);
    margin-bottom: 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.goal-amount strong {
    color: var(--primary-color);
    font-size: 22px;
    font-weight: 800;
    font-family: 'Poppins', sans-serif;
}

.goal-percentage-label {
    font-size: 18px;
    font-weight: 800;
    color: var(--primary-color);
    font-family: 'Poppins', sans-serif;
}

/* Progress Bar for Individual Goals */
.progress-bar-container {
    background: var(--bg-light);
    height: 18px;
    border-radius: 9px;
    overflow: hidden;
    margin-bottom: 18px;
    position: relative;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.06);
}

.progress-bar {
    height: 100%;
    transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 9px;
    position: relative;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.progress-bar.low {
    background: linear-gradient(90deg, #ef4444 0%, #f87171 100%);
}

.progress-bar.medium {
    background: linear-gradient(90deg, #f59e0b 0%, #fbbf24 100%);
}

.progress-bar.high {
    background: linear-gradient(90deg, #3b82f6 0%, #60a5fa 100%);
}

.progress-bar.complete {
    background: linear-gradient(90deg, #10b981 0%, #34d399 100%);
}

.goal-deadline-info {
    font-size: 13px;
    color: var(--text-gray);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
}

.goal-deadline-info.urgent {
    color: var(--danger-color);
    font-weight: 700;
}

.goal-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* Management Section */
.management-section {
    margin-bottom: 32px;
}

.action-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
}

.action-card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 28px;
    box-shadow: var(--shadow-sm);
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
}

.action-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-4px);
}

.action-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.action-card h3 {
    font-family: 'Poppins', sans-serif;
    font-size: 20px;
    font-weight: 600;
    color: var(--text-dark);
    margin: 0 0 8px 0;
}

.action-card p {
    color: var(--text-gray);
    margin: 0 0 20px 0;
    font-size: 14px;
}

/* Trash Section */
.trash-section {
    margin-bottom: 32px;
}

.collapsible-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--white);
    padding: 20px 32px;
    border-radius: var(--radius);
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    transition: all 0.2s ease;
}

.collapsible-header:hover {
    box-shadow: var(--shadow-md);
}

.toggle-icon {
    font-size: 20px;
    transition: transform 0.3s ease;
}

.toggle-icon.open {
    transform: rotate(180deg);
}

.trash-content {
    background: var(--white);
    border-radius: var(--radius);
    padding: 32px;
    margin-top: 16px;
    box-shadow: var(--shadow-sm);
}

/* Modals */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: var(--white);
    border-radius: var(--radius);
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    animation: slideIn 0.3s ease;
}

.modal-content.modal-large {
    max-width: 800px;
}

.modal-content.modal-small {
    max-width: 400px;
}

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

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

.modal-header h2 {
    font-family: 'Poppins', sans-serif;
    font-size: 24px;
    font-weight: 600;
    color: var(--text-dark);
    margin: 0;
}

.close {
    font-size: 32px;
    font-weight: 700;
    color: var(--text-dark);
    cursor: pointer;
    transition: all 0.2s ease;
    line-height: 1;
    padding: 0 8px;
    border-radius: 4px;
}

.close:hover {
    color: var(--danger-color);
    background: rgba(239, 68, 68, 0.1);
}

.modal-body {
    padding: 32px;
}

.modal form {
    padding: 32px;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 24px;
    padding-top: 24px;
    border-top: 2px solid var(--border-color);
    flex-wrap: wrap;
}

.modal-actions .btn {
    min-width: 140px;
    padding: 12px 20px;
    font-size: 15px;
    font-weight: 600;
    white-space: nowrap;
}

.modal-actions .btn-secondary {
    order: 1;
}

.modal-actions .btn-primary {
    order: 3;
}

.modal-actions .btn-success {
    order: 2;
}

/* Categories List */
.add-category-section {
    margin-bottom: 32px;
    padding-bottom: 32px;
    border-bottom: 2px solid var(--border-color);
}

.add-category-section h3 {
    font-family: 'Poppins', sans-serif;
    font-size: 18px;
    font-weight: 600;
    color: var(--text-dark);
    margin: 0 0 16px 0;
}

.inline-form .form-row {
    display: flex;
    gap: 12px;
    align-items: center;
}

.inline-form input,
.inline-form select {
    flex: 1;
    padding: 10px 14px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 14px;
}

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

.categories-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: 500px;
    overflow-y: auto;
    padding-right: 8px;
}

.category-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 20px;
    background: var(--white);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04);
}

.category-item:hover {
    background: #fafafa;
    border-color: var(--primary-color);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.08);
    transform: translateY(-2px);
}

.category-info {
    display: flex;
    align-items: center;
    gap: 16px;
    flex: 1;
}

.category-emoji {
    font-size: 28px;
    line-height: 1;
    min-width: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.category-details {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
}

.category-name-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.category-name {
    font-weight: 600;
    font-size: 16px;
    color: var(--text-dark);
    line-height: 1.2;
}

.category-badge {
    display: inline-flex;
    align-items: center;
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: white;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    box-shadow: 0 2px 4px rgba(245, 158, 11, 0.3);
}

.category-type {
    font-size: 13px;
    color: var(--text-gray);
    text-transform: capitalize;
    font-weight: 500;
}

.category-actions {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-shrink: 0;
}

.category-actions .btn {
    min-width: 100px;
    white-space: nowrap;
}

/* Loading and Messages */
.loading-message {
    text-align: center;
    padding: 32px;
    color: var(--text-gray);
}

.goal-name-display {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 20px;
    padding: 16px;
    background: var(--bg-light);
    border-radius: var(--radius-sm);
    text-align: center;
}

.info-box {
    background: #ecfeff;
    border-left: 4px solid var(--primary-color);
    padding: 16px;
    border-radius: var(--radius-sm);
    margin-top: 20px;
}

.info-box strong {
    color: var(--primary-dark);
    display: block;
    margin-bottom: 8px;
}

.info-box ul {
    margin: 0;
    padding-left: 20px;
}

.info-box li {
    color: var(--text-dark);
    margin-bottom: 4px;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .goals-grid {
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    }

    .kpi-section {
        grid-template-columns: repeat(2, 1fr);
    }

    .subscriptions-overview-content {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .rizqtrack-dashboard {
        padding: 12px;
    }

    .rizqtrack-header h1 {
        font-size: 28px;
    }

    .section-title {
        font-size: 18px;
        margin-bottom: 12px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .rizqtrack-card {
        padding: 16px;
        margin-bottom: 16px;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .charts-container {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .chart-wrapper {
        height: 280px;
    }

    .action-cards {
        grid-template-columns: 1fr;
    }

    .kpi-section {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .unified-filters {
        padding: 16px;
    }

    .filter-label {
        font-size: 13px;
        margin-bottom: 10px;
    }

    .kpi-card {
        padding: 14px;
    }

    .kpi-value {
        font-size: 18px;
    }

    .kpi-icon {
        width: 44px;
        height: 44px;
        font-size: 24px;
    }

    .chart-card {
        padding: 16px;
    }

    .chart-card h3 {
        font-size: 16px;
    }

    /* Filter Bar Mobile */
    .filter-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .filter-bar .form-group {
        width: 100%;
        min-width: 100%;
        flex: none;
    }

    .filter-search {
        width: 100%;
        min-width: 100%;
        flex: none;
    }

    .filter-date-group {
        width: 100%;
        flex: none;
    }

    .filter-date-group .form-group {
        min-width: 0;
        flex: 1;
    }

    .filter-actions {
        width: 100%;
        justify-content: space-between;
    }

    .filter-actions button {
        flex: 1;
    }

    .section-header {
        flex-direction: column;
        gap: 16px;
        align-items: flex-start;
    }

    .toggle-buttons {
        flex-direction: column;
    }

    .chart-filters {
        justify-content: flex-start;
    }

    /* Mobile date range filters - keep side by side */
    .date-range-filters {
        gap: 4px;
    }

    .date-input {
        padding: 6px 8px;
        font-size: 12px;
        min-width: 100px;
        max-width: 140px;
    }

    .date-separator {
        font-size: 12px;
    }

    /* Compact category filters for mobile */
    .chart-slicer {
        gap: 4px;
        max-height: 80px;
        overflow-y: auto;
    }

    .slicer-chip {
        padding: 4px 8px;
        font-size: 11px;
        white-space: nowrap;
    }

    .modal-content {
        width: 95%;
        max-height: 95vh;
    }

    .modal form,
    .modal-body {
        padding: 20px;
    }

    .inline-form .form-row {
        flex-direction: column;
    }
    
    .goals-overview-card {
        padding: 24px 20px;
    }

    .goals-overview-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .goals-stats-badges {
        width: 100%;
        justify-content: space-between;
    }

    .stat-badge {
        flex: 1;
        min-width: auto;
        padding: 14px 16px;
    }

    .badge-value {
        font-size: 28px;
    }

    .overall-progress-section {
        padding: 24px 20px;
    }

    .progress-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .progress-percentage {
        font-size: 44px;
    }

    .amount-value {
        font-size: 24px;
    }

    .progress-insights {
        grid-template-columns: 1fr;
    }

    .individual-goals-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .goals-filter {
        width: 100%;
        overflow-x: auto;
        padding-bottom: 8px;
    }
    
    .goals-grid {
        grid-template-columns: 1fr;
    }

    .goals-mini-chart {
        height: 220px;
    }

    /* Goal action buttons - keep side by side on mobile */
    .goal-actions {
        flex-wrap: nowrap;
        gap: 6px;
    }

    .goal-actions .btn-sm {
        padding: 6px 10px;
        font-size: 11px;
        white-space: nowrap;
    }

    /* Responsive Pagination - keep side by side on mobile */
    .pagination-controls {
        flex-direction: row;
        gap: 8px;
        padding-top: 16px;
        margin-top: 12px;
        margin-bottom: 16px;
    }

    .pagination-controls .btn {
        padding: 8px 16px;
        font-size: 13px;
    }

    .pagination-controls span {
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    .progress-amounts {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }

    .amount-divider {
        display: none;
    }

    .progress-percentage {
        font-size: 36px;
    }

    .overall-progress-bar {
        height: 40px;
    }

    .badge-value {
        font-size: 24px;
    }

    .category-item {
        padding: 14px 16px;
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .category-info {
        width: 100%;
    }

    .category-actions {
        width: 100%;
        justify-content: flex-end;
    }

    .category-actions .btn {
        min-width: auto;
        width: auto;
        padding: 8px 16px;
        font-size: 13px;
    }
}


/* Utility Classes */
.text-center {
    text-align: center;
}

.mb-0 {
    margin-bottom: 0;
}

.mt-2 {
    margin-top: 16px;
}

.hidden {
    display: none !important;
}

/* Theme Override Fixes */
.rizqtrack-dashboard select {
    color: #1f2937 !important;
    background-color: #ffffff !important;
}

.rizqtrack-dashboard select option {
    color: #1f2937 !important;
    background-color: #ffffff !important;
}

.modal select {
    color: #1f2937 !important;
    background-color: #ffffff !important;
}

.modal select option {
    color: #1f2937 !important;
    background-color: #ffffff !important;
}

.rizqtrack-dashboard input[type="text"],
.rizqtrack-dashboard input[type="number"],
.rizqtrack-dashboard input[type="date"],
.rizqtrack-dashboard textarea {
    color: #1f2937 !important;
}

/* Fix select dropdown text being cut off */
.rizqtrack-dashboard select,
.modal select {
    color: #1f2937 !important;
    background-color: #ffffff !important;
    padding: 12px 16px !important;
    line-height: 1.5 !important;
    height: auto !important;
    min-height: 45px !important;
}

/* Ensure full text visibility in options */
.rizqtrack-dashboard select option,
.modal select option {
    color: #1f2937 !important;
    background-color: #ffffff !important;
    padding: 8px 12px !important;
}

/* ============================================
   BUDGET MANAGEMENT SECTION
   ============================================ */
/* Budget Management Section */
.budget-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 16px;
    margin-top: 20px;
}

.budget-card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow-sm);
    border: 2px solid var(--border-color);
    transition: all 0.3s ease;
}

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

.budget-card.warning {
    border-color: #f59e0b;
    background: linear-gradient(135deg, #fef3c7 0%, #ffffff 100%);
}

.budget-card.danger {
    border-color: var(--danger-color);
    background: linear-gradient(135deg, #fee2e2 0%, #ffffff 100%);
}

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

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

.budget-category-emoji {
    font-size: 24px;
}

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

.budget-period {
    font-size: 12px;
    color: var(--text-secondary);
    text-transform: capitalize;
}

.budget-amounts {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 12px;
}

.budget-spent {
    font-size: 20px;
    font-weight: 700;
    color: var(--primary-color);
}

.budget-card.warning .budget-spent {
    color: #f59e0b;
}

.budget-card.danger .budget-spent {
    color: var(--danger-color);
}

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

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

.budget-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color) 0%, var(--primary-light) 100%);
    transition: width 0.5s ease;
}

.budget-card.warning .budget-progress-fill {
    background: linear-gradient(90deg, #f59e0b 0%, #fbbf24 100%);
}

.budget-card.danger .budget-progress-fill {
    background: linear-gradient(90deg, var(--danger-color) 0%, #f87171 100%);
}

.budget-stats {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    margin-bottom: 12px;
}

.budget-remaining {
    color: var(--success-color);
    font-weight: 600;
}

.budget-card.danger .budget-remaining {
    color: var(--danger-color);
}

.budget-percentage {
    color: var(--text-secondary);
    font-weight: 600;
}

.budget-actions {
    display: flex;
    gap: 8px;
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px solid var(--border-color);
}

.budget-actions button {
    flex: 1;
    font-size: 13px;
    padding: 6px 12px;
}

.budget-alerts {
    background: #fee2e2;
    border: 2px solid #ef4444;
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 20px;
}

.budget-alert-title {
    font-size: 16px;
    font-weight: 700;
    color: #991b1b;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.budget-alert-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.budget-alert-item {
    padding: 8px 12px;
    background: white;
    border-radius: 6px;
    margin-bottom: 8px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
}

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

.budget-alert-category {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    color: var(--text-primary);
    flex: 1;
}

.budget-alert-status {
    font-size: 13px;
    color: #991b1b;
    font-weight: 600;
    white-space: nowrap;
    flex-shrink: 0;
}

/* Mobile responsiveness for budget */
@media (max-width: 768px) {
    .budget-grid {
        grid-template-columns: 1fr;
    }

    .budget-alert-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .budget-alert-category {
        width: 100%;
    }

    .budget-alert-status {
        width: 100%;
        text-align: left;
    }
}

/* ============================================
   CHECKBOX ALIGNMENT FIX FOR BUDGET ROLLOVER
   ============================================ */
.checkbox-group .checkbox-label {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    user-select: none;
}

.checkbox-group .checkbox-label input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
    flex-shrink: 0;
    margin: 0;
}

.checkbox-group .checkbox-text {
    font-size: 15px;
    color: var(--text-dark);
    line-height: 1.5;
}

/* ============================================
   SUBSCRIPTION MANAGEMENT SECTION
   ============================================ */
.subscriptions-section {
    margin: 32px 0;
}

.subscriptions-overview-card {
    background: linear-gradient(135deg, rgba(8, 145, 178, 0.05) 0%, rgba(6, 182, 212, 0.05) 100%);
    border: 2px solid rgba(8, 145, 178, 0.1);
    border-radius: 16px;
    padding: 32px;
    margin-bottom: 32px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.subscriptions-overview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 16px;
}

.subscriptions-overview-header h3 {
    font-family: 'Poppins', sans-serif;
    font-size: 22px;
    font-weight: 700;
    color: var(--text-dark);
    margin: 0;
}

.subscriptions-stats-badges {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.subscriptions-overview-content {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

.overview-main-stats {
    display: contents;
}

.overview-insights {
    display: contents;
}

.main-stat-item,
.overview-insights .insight-item {
    background: var(--white);
    padding: 24px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    display: flex;
    flex-direction: column;
    gap: 12px;
    transition: all 0.2s ease;
    border: 2px solid transparent;
}

.main-stat-item:hover,
.overview-insights .insight-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border-color: var(--primary-color);
}

.main-stat-label,
.overview-insights .insight-label {
    font-size: 13px;
    color: var(--text-gray);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    line-height: 1.4;
    white-space: nowrap;
}

.main-stat-value,
.overview-insights .insight-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--primary-color);
    line-height: 1.2;
}

.overview-insights .insight-content {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
}

.individual-subscriptions-header {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 24px;
}

.individual-subscriptions-header h3 {
    font-family: 'Poppins', sans-serif;
    font-size: 20px;
    font-weight: 600;
    color: var(--text-dark);
    margin: 0;
}

.subscriptions-controls {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
}

.subscriptions-search {
    width: 100%;
}

.subscriptions-search input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    font-size: 15px;
    font-family: 'Inter', sans-serif;
    transition: all 0.2s ease;
    background: white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.subscriptions-search input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(74, 144, 226, 0.15), 0 2px 8px rgba(0, 0, 0, 0.1);
}

.subscriptions-search input::placeholder {
    color: #999;
}

.subscriptions-filter {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 4px;
}

.subscriptions-filter::-webkit-scrollbar {
    display: none;
}

.subscriptions-filter::-webkit-scrollbar {
    height: 4px;
}

.subscriptions-filter::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

/* Subscription Cards Grid */
.subscriptions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 24px;
}

/* Subscription Card Styles */
.subscription-card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
    border: 2px solid var(--border-color);
    position: relative;
    opacity: 0;
    animation: fadeInUp 0.6s ease forwards;
}

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

/* Color coding for subscription status */
.subscription-card.active {
    border-color: var(--success-color);
}

.subscription-card.inactive {
    border-color: var(--danger-color);
    background: linear-gradient(135deg, #fee2e2 0%, #ffffff 100%);
}

.subscription-card.expiring-soon {
    border-color: var(--warning-color);
    background: linear-gradient(135deg, #fef3c7 0%, #ffffff 100%);
}

/* Stagger animation delay */
.subscription-card:nth-child(1) { animation-delay: 0.1s; }
.subscription-card:nth-child(2) { animation-delay: 0.2s; }
.subscription-card:nth-child(3) { animation-delay: 0.3s; }
.subscription-card:nth-child(4) { animation-delay: 0.4s; }
.subscription-card:nth-child(5) { animation-delay: 0.5s; }
.subscription-card:nth-child(6) { animation-delay: 0.6s; }

.subscription-card-header {
    margin-bottom: 12px;
}

.subscription-header-content {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.subscription-card h4 {
    font-family: 'Poppins', sans-serif;
    font-size: 18px;
    font-weight: 600;
    color: var(--text-dark);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.subscription-name {
    word-break: break-word;
    -webkit-text-size-adjust: none;
}

/* Prevent phone number auto-linking */
.subscription-card h4 a,
.subscription-card a[href^="tel:"] {
    color: inherit !important;
    text-decoration: none !important;
    pointer-events: none;
    cursor: default;
}

.subscription-status-badge {
    display: inline-flex;
    align-items: center;
    align-self: flex-start;
    padding: 5px 12px;
    border-radius: 14px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.subscription-status-badge.active {
    background: rgba(16, 185, 129, 0.15);
    color: var(--success-color);
}

.subscription-status-badge.inactive {
    background: rgba(239, 68, 68, 0.15);
    color: var(--danger-color);
}

.subscription-status-badge.expiring-soon {
    background: rgba(245, 158, 11, 0.15);
    color: var(--warning-color);
}

.subscription-amount {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.subscription-amount strong {
    color: var(--primary-color);
    font-size: 22px;
    font-weight: 700;
}

.subscription-cycle {
    font-size: 13px;
    color: var(--text-secondary);
    margin-left: 4px;
}

.subscription-details {
    margin-bottom: 12px;
}

.subscription-detail-item {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 6px;
    font-size: 13px;
    color: var(--text-secondary);
}

.subscription-detail-item span:first-child {
    font-weight: 600;
    color: var(--text-dark);
    min-width: 80px;
    flex-shrink: 0;
}

.subscription-detail-item span:last-child {
    flex: 1;
    text-align: right;
}

.subscription-billing-date {
    font-size: 13px;
    padding: 10px 12px;
    background: rgba(8, 145, 178, 0.08);
    border-radius: var(--radius);
    margin-bottom: 12px;
    display: flex;
    gap: 12px;
    align-items: center;
}

.billing-date-label {
    font-weight: 600;
    color: var(--text-dark);
}

.billing-date-value {
    color: var(--primary-color);
    font-weight: 700;
}

.days-indicator {
    font-size: 12px;
    font-weight: 600;
    padding: 6px 12px;
    border-radius: var(--radius);
    display: inline-block;
    margin-bottom: 12px;
}

.days-indicator.success {
    background: rgba(16, 185, 129, 0.15);
    color: var(--success-color);
}

.days-indicator.warning {
    background: rgba(245, 158, 11, 0.15);
    color: var(--warning-color);
}

.days-indicator.danger {
    background: rgba(239, 68, 68, 0.15);
    color: var(--danger-color);
}

.subscription-progress-bar {
    height: 8px;
    background: rgba(8, 145, 178, 0.1);
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 16px;
}

.subscription-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--primary-light));
    border-radius: 10px;
    transition: width 0.6s ease;
}

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

.subscription-actions .btn {
    flex: 1;
    padding: 8px 12px;
    font-size: 12px;
    font-weight: 600;
    border-radius: var(--radius);
}

.subscription-actions .btn-success {
    background: var(--success-color);
    color: var(--white);
}

.subscription-actions .btn-success:hover {
    background: #059669;
}

.subscription-actions .btn-warning {
    background: var(--warning-color);
    color: var(--white);
}

.subscription-actions .btn-warning:hover {
    background: #d97706;
}

.auto-renew-indicator {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    color: var(--success-color);
    background: rgba(16, 185, 129, 0.15);
    padding: 6px 10px;
    border-radius: var(--radius);
    margin-bottom: 8px;
    font-weight: 600;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .subscriptions-overview-card {
        padding: 20px 16px;
    }

    .subscriptions-overview-header h3 {
        font-size: 18px;
        white-space: nowrap;
    }

    .subscriptions-stats-badges {
        width: 100%;
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
    }

    .stat-badge {
        min-width: auto;
        padding: 10px 6px;
    }

    .badge-label {
        font-size: 9px;
        text-align: center;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .badge-value {
        font-size: 26px;
    }

    .subscriptions-overview-content {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .main-stat-item,
    .overview-insights .insight-item {
        padding: 18px;
    }

    .main-stat-label,
    .overview-insights .insight-label {
        font-size: 12px;
    }

    .main-stat-value,
    .overview-insights .insight-value {
        font-size: 24px;
    }

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

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

    .insight-value {
        font-size: 20px;
    }

    .subscriptions-grid {
        grid-template-columns: 1fr;
    }

    .subscription-card {
        padding: 16px;
    }

    .subscription-card h4 {
        font-size: 16px;
    }

    .subscription-amount strong {
        font-size: 20px;
    }

    .subscription-actions .btn {
        font-size: 11px;
        padding: 8px 10px;
    }

    .individual-subscriptions-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .subscriptions-filter {
        width: 100%;
        justify-content: flex-start;
    }

    .modal-actions {
        flex-direction: column-reverse;
        gap: 10px;
    }

    .modal-actions .btn {
        width: 100%;
        min-width: auto;
    }
}

@media (max-width: 480px) {
    .subscriptions-overview-card {
        padding: 20px;
    }

    .main-stat-value {
        font-size: 22px;
    }

    .subscription-amount strong {
        font-size: 20px;
    }
}


/* Cache bust: 1762778015 - Version 1.6.0 with login spacing fix and network-first caching */
