/* CSS Variables for Theme System */
:root {
    /* Light Theme (Default) */
    --sidebar-bg: linear-gradient(135deg, #f5f0eb 0%, #e8e2db 100%);
    --sidebar-text: #2c2825;
    --sidebar-text-muted: #5a524c;
    --sidebar-border: rgba(0, 0, 0, 0.1);
    --sidebar-hover: rgba(139, 69, 19, 0.1);
    --sidebar-active: rgba(139, 69, 19, 0.2);
    --sidebar-active-border: #8B4513;
    
    --top-banner-bg: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    --top-banner-text: #2c3e50;
    --top-banner-border: rgba(0, 0, 0, 0.1);
    
    --main-bg: #e8e2db;
    --card-bg: #fdfaf8;
    --text-primary: #2c2825;
    --text-secondary: #5a524c;
    --border-color: #c0b8af;
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
    
    /* Footer Theme Variables */
    --footer-bg: #f8f9fa;
    --footer-text: #2c3e50;
    --footer-text-muted: #6c757d;
    --footer-link-bg: transparent;
    --footer-link-border: #8B4513;
    --footer-link-hover-bg: #8B4513;
    --footer-link-hover-text: #ffffff;

    /* General purpose */
    --primary-color: #8B4513;
    --hover-bg: rgba(0, 0, 0, 0.04);
}

[data-theme="dark"] {
    /* Dark Theme */
    --sidebar-bg: linear-gradient(135deg, #1a1510 0%, #261e18 100%);
    --sidebar-text: #f0ece8;
    --sidebar-text-muted: #a89f98;
    --sidebar-border: rgba(255, 255, 255, 0.08);
    --sidebar-hover: rgba(255, 255, 255, 0.05);
    --sidebar-active: rgba(139, 69, 19, 0.25);
    --sidebar-active-border: #D2691E;
    
    --top-banner-bg: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
    --top-banner-text: #e0e0e0;
    --top-banner-border: rgba(255, 255, 255, 0.08);
    
    --main-bg: #0d0b0a;
    --card-bg: #1f1c1a;
    --text-primary: #f0ece8;
    --text-secondary: #a89f98;
    --border-color: #362e28;
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.6);
    
    /* Footer Theme Variables - Dark */
    --footer-bg: #1a1a1a;
    --footer-text: #e0e0e0;
    --footer-text-muted: #a0a0a0;
    --footer-link-bg: transparent;
    --footer-link-border: #D2691E;
    --footer-link-hover-bg: #D2691E;
    --footer-link-hover-text: #ffffff;

    /* General purpose */
    --primary-color: #D2691E;
    --hover-bg: rgba(255, 255, 255, 0.05);
}

/* Dark mode: ensure all inputs/selects/textareas are readable */
[data-theme="dark"] input,
[data-theme="dark"] select,
[data-theme="dark"] textarea {
    background: var(--card-bg) !important;
    color: var(--text-primary) !important;
    border-color: var(--border-color) !important;
}

[data-theme="dark"] input::placeholder,
[data-theme="dark"] textarea::placeholder {
    color: var(--text-secondary) !important;
}

[data-theme="dark"] label {
    color: var(--text-primary);
}

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background: var(--main-bg);
    min-height: 100vh;
    margin: 0;
    padding: 0;
}

/* Landing Page Styles */
.landing-page {
    background: linear-gradient(135deg,rgb(236, 207, 186) 0%,rgb(243, 233, 225) 50%,rgb(247, 238, 230) 100%);
    min-height: 100vh;
    position: relative;
}

/* Top Ribbon */
.top-ribbon {
    background: linear-gradient(135deg, #8B4513 0%, #A0522D 100%);
    color: white;
    padding: 0.75rem 0;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.ribbon-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 2rem;
}

.ribbon-left .ribbon-text {
    font-weight: 500;
    font-size: 1rem;
}

.ribbon-right {
    display: flex;
    gap: 1rem;
    margin-left: auto;
    justify-content: flex-end;
}

.ribbon-btn {
    background: transparent;
    border: 2px solid white;
    color: white;
    padding: 0.5rem 1.5rem;
    border-radius: 25px;
    cursor: pointer;
    font-weight: 500;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    text-decoration: none;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.ribbon-btn:hover {
    background: white;
    color: var(--sidebar-text);
    transform: translateY(-2px);
}

.ribbon-signup {
    background: white;
    color: var(--sidebar-text);
}

.ribbon-signup:hover {
    background: #f8f9fa;
    color: #6B3E0A;
}

/* Features Section Styles */
.features {
    padding: 3rem 0 5rem 0;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    position: relative;
    overflow: hidden;
}

.features::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="25" cy="25" r="1" fill="%23ffffff" opacity="0.1"/><circle cx="75" cy="75" r="1" fill="%23ffffff" opacity="0.1"/><circle cx="50" cy="10" r="0.5" fill="%23ffffff" opacity="0.1"/><circle cx="10" cy="60" r="0.5" fill="%23ffffff" opacity="0.1"/><circle cx="90" cy="40" r="0.5" fill="%23ffffff" opacity="0.1"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
    pointer-events: none;
}

.features .container {
    position: relative;
    z-index: 1;
}

.section-title {
    text-align: center;
    font-size: 2.5rem;
    font-weight: 700;
    margin: 0 0 3rem 0;
    background: linear-gradient(135deg, #8B4513 0%, #D2691E 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    position: relative;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -1rem;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background: linear-gradient(90deg, #8B4513 0%, #D2691E 100%);
    border-radius: 2px;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2.5rem;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

.feature-card {
    background: var(--card-bg);
    border-radius: 20px;
    padding: 2.5rem 2rem;
    text-align: center;
    box-shadow: var(--shadow);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.feature-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #8B4513 0%, #D2691E 100%);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.feature-card:hover::before {
    transform: scaleX(1);
}

.feature-card:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: 0 20px 40px rgba(139, 69, 19, 0.15);
    border-color: rgba(139, 69, 19, 0.2);
}

.feature-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 1.5rem;
    background: linear-gradient(135deg, #8B4513 0%, #D2691E 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.feature-icon::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.2) 0%, transparent 100%);
    border-radius: 50%;
    transition: all 0.3s ease;
}

.feature-card:hover .feature-icon {
    transform: scale(1.1) rotate(5deg);
    box-shadow: 0 10px 25px rgba(139, 69, 19, 0.3);
}

.feature-card:hover .feature-icon::before {
    transform: rotate(180deg);
}

.feature-icon i {
    font-size: 2rem;
    color: white;
    z-index: 1;
    position: relative;
    transition: all 0.3s ease;
}

.feature-card:hover .feature-icon i {
    transform: scale(1.1);
}

.feature-card h3 {
    font-size: 1.4rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 1rem 0;
    transition: color 0.3s ease;
}

.feature-card:hover h3 {
    color: var(--sidebar-text);
}

.feature-card p {
    color: var(--text-secondary);
    line-height: 1.6;
    margin: 0;
    font-size: 1rem;
    transition: color 0.3s ease;
}

.feature-card:hover p {
    color: #555;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .features {
        padding: 3rem 0;
    }
    
    .section-title {
        font-size: 2rem;
        margin-bottom: 2rem;
    }
    
    .features-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
        padding: 0 1rem;
    }
    
    .feature-card {
        padding: 2rem 1.5rem;
    }
    
    .feature-icon {
        width: 70px;
        height: 70px;
    }
    
    .feature-icon i {
        font-size: 1.8rem;
    }
    
    .feature-card h3 {
        font-size: 1.2rem;
    }
    
    .feature-card p {
        font-size: 0.95rem;
    }
}

@media (max-width: 480px) {
    .features {
        padding: 2rem 0;
    }
    
    .section-title {
        font-size: 1.8rem;
        margin-bottom: 1.5rem;
    }
    
    .banner-content {
        padding: 0 0.75rem;
    }
    
    .container {
        padding: 0 0.75rem;
        max-width: 100%;
        overflow-x: hidden;
        overflow-y: visible;
    }
    
    /* Extra constraints for very small screens */
    .overview-cards {
        gap: 0.25rem;
    }
    
    .overview-card.compact {
        padding: 0.375rem;
        min-width: 0;
    }
    
    .overview-card.compact .card-title h3 {
        font-size: 0.75rem;
    }
    
    .overview-card.compact .card-title p {
        font-size: 0.6rem;
    }
    
    .overview-card.compact .card-value .value {
        font-size: 1rem;
    }
    
    /* Income page extra small mobile optimizations */
    .income-layout {
        display: grid !important;
        grid-template-columns: 1fr !important;
        gap: 0.75rem !important;
    }
    
    .income-sources-section,
    .balance-form-section {
        padding: 0.75rem;
    }
    
    .balance-form {
        gap: 0.75rem;
    }
    
    .balance-form .form-group {
        margin-bottom: 0.5rem;
    }
    
    .balance-form input[type="number"] {
        font-size: 0.9rem;
        padding: 0.5rem;
    }
    
    .balance-amount {
        font-size: 1.1rem;
    }
    
    .income-source-item {
        padding: 0.75rem;
        margin-bottom: 0.5rem;
    }
    
    .income-source-item .source-name {
        font-size: 0.9rem;
    }
    
    .income-source-item .source-amount {
        font-size: 0.9rem;
    }
    
    .features-grid {
        gap: 1.5rem;
    }
    
    .feature-card {
        padding: 1.5rem 1rem;
    }
    
    .feature-icon {
        width: 60px;
        height: 60px;
    }
    
    .feature-icon i {
        font-size: 1.5rem;
    }
}

.hero {
    padding: 0;
    text-align: center;
    color: white;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    position: relative;
    z-index: 5;
}

.landing-page::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 50%;
    height: 100vh;
    background-image: url('/static/images/wall2.png');
    background-size: cover;
    background-position: left center;
    background-repeat: no-repeat;
    opacity: 1;
    z-index: 1;
}

.hero-content {
    max-width: 600px;
    margin: 0 auto;
    position: absolute;
    top: 60%;
    left: 75%;
    transform: translate(-50%, -50%);
    z-index: 50;
    text-align: center;
    color: white;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    width: 50%;
    box-sizing: border-box;
}

/* Mobile landing page optimization */
@media (max-width: 768px) {
    .ribbon-left {
        display: none;
    }
    
    .ribbon-btn {
        padding: 0.3rem 0.8rem;
        font-size: 0.75rem;
    }
    
    .landing-page::before {
        display: none;
    }
    
    .hero {
        height: 100vh;
        background: none;
        position: relative;
        overflow: hidden;
    }
    
    .hero::after {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background-image: url('/static/images/wall2.png');
        background-size: cover;
        background-position: center center;
        background-repeat: no-repeat;
        z-index: 1;
    }
    
    .hero::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(236, 207, 186, 0.6);
        z-index: 2;
    }
    
    .hero-content {
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        width: 70%;
        max-width: 280px;
        background: white;
        padding: 1.5rem;
        border-radius: 15px;
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
        z-index: 20;
        text-align: center;
    }
    
    .hero-title {
        font-size: 0;
        width: 100%;
        height: 80px;
        background-image: url('../images/title.png?v=3');
        background-size: contain;
        background-repeat: no-repeat;
        background-position: center;
        margin-bottom: 0.5rem;
        display: block;
        color: transparent;
        text-indent: -9999px;
        overflow: hidden;
    }
    
    .hero-subtitle {
        font-size: 1rem;
        color: var(--text-secondary);
        text-shadow: none;
        margin-top: 0.2rem;
        margin-bottom: 1.5rem;
        line-height: 1.6;
        font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
        font-weight: 400;
        position: relative;
    }
    
    .hero-subtitle::after {
        content: '';
        position: absolute;
        top: -10px;
        left: -20px;
        right: -20px;
        bottom: -10px;
        background: white;
        border-radius: 10px;
        z-index: -1;
    }
    
    .hero-actions {
        margin-top: 1rem;
        display: flex;
        flex-direction: column;
        gap: 0.75rem;
        align-items: center;
    }
    
    
    .btn-modern {
        background: linear-gradient(135deg, rgb(1, 35, 15) 0%, rgb(3, 53, 25) 100%);
        color: white;
        border: none;
        padding: 0.6rem 1.2rem;
        border-radius: 6px;
        font-size: 0.8rem;
        font-weight: 400;
        text-transform: capitalize;
        box-shadow: 0 3px 12px rgba(0, 0, 0, 0.2);
        transition: all 0.3s ease;
    }
    
    .btn-modern:hover {
        transform: translateY(-2px);
        box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
    }

    .btn-install {
        background: linear-gradient(135deg, #8B4513 0%, #D2691E 100%) !important;
    }
}

@media (max-width: 480px) {
    .hero-content {
        width: 85%;
        padding: 1.5rem;
        border-radius: 12px;
        background: white;
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
        z-index: 20;
    }
    
    .hero-title {
        font-size: 0;
        width: 100%;
        height: 50px;
        background-image: url('../images/title.png?v=3');
        background-size: contain;
        background-repeat: no-repeat;
        background-position: center;
        margin-bottom: 0.5rem;
        display: block;
        color: transparent;
        text-indent: -9999px;
        overflow: hidden;
    }
    
    
    .hero-subtitle {
        font-size: 0.8rem;
        margin-top: 0.1rem;
        margin-bottom: 1rem;
        color: #333 !important;
        text-shadow: none;
        font-family: 'Calibri', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif !important;
        font-weight: 50;
    }
    
    
    .btn-modern {
        padding: 0.5rem 1rem;
        font-size: 0.75rem;
    }
    
    /* Prevent mobile zoom on all input fields */
    input[type="text"],
    input[type="number"],
    input[type="email"],
    input[type="password"],
    input[type="tel"],
    input[type="url"],
    input[type="search"],
    textarea,
    select {
        font-size: 16px !important;
    }
}

.hero-title {
    font-size: 0;
    width: 80%;
    height: 120px;
    background-image: url('../images/title.png?v=3');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    margin-bottom: 2rem;
    display: block;
    color: transparent;
    text-indent: -9999px;
    overflow: hidden;
}

/* Landscape orientation - reduce title image size */
@media (orientation: landscape) and (max-height: 600px) {
    .hero-title {
        height: 60px !important; /* Further reduce from 60px to 35px */
    }
}

@media (orientation: landscape) and (max-width: 768px) {
    .hero-title {
        height: 60px !important; /* Increase from 35px to 50px */
    }
    
    .hero-subtitle {
        font-size: 0.8rem !important; /* Reduce subtitle text size */
        margin-top: 0.2rem !important;
        margin-bottom: 1rem !important;
    }
}

@media (orientation: landscape) and (max-width: 480px) {
    .hero-title {
        height: 60px !important; 
    }
    
    .hero-subtitle {
        font-size: 0.7rem !important; /* Reduce subtitle text size */
        margin-top: 0.1rem !important;
        margin-bottom: 0.8rem !important;
    }
}

/* Desktop hero-subtitle styles */
@media (min-width: 769px) {
    .hero-subtitle {
        font-size: 0.9rem;
        margin-top: 0;
        margin-bottom: 2rem;
        font-weight: 400 !important;
        text-align: center;
        color: #161212 !important;
        font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
        font-display: swap;
        letter-spacing: 0;
        line-height: 1.4;
        text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
        position: relative;
        z-index: 10;
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
    }
}

.hero-subtitle::after {
    content: '';
    position: absolute;
    top: -10px;
    left: -20px;
    right: -20px;
    bottom: -10px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(8px);
    border-radius: 10px;
    z-index: -1;
}

/* Blur background behind subtitle */

.hero-actions {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    justify-content: center;
    align-items: center;
    margin-top: 0;
}

.btn-modern {
    background: linear-gradient(135deg, rgb(1, 35, 15) 0%, rgb(3, 53, 25) 100%);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 30px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    box-shadow: 0 4px 15px rgba(3, 53, 25, 0.3);
    position: relative;
    overflow: hidden;
}

.btn-modern::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.btn-modern:hover::before {
    left: 100%;
}

.btn-modern:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(3, 53, 25, 0.4);
}

.btn-modern:active {
    transform: translateY(-1px);
}

.btn {
    display: inline-flex;
    align-items: center;
    padding: 0.75rem 2rem;
    border: none;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 140px;
    text-align: center;
    text-transform: capitalize;
}

.btn-primary {
    background: #8B4513 !important;
    color: white !important;
    border: none !important;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3) !important;
}

.btn-secondary {
    background: #8B4513 !important;
    color: white !important;
    border: none !important;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3) !important;
}

/* How It Works Modal Styles */
.steps {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    margin-top: 1rem;
}

.step {
    display: flex;
    align-items: flex-start;
    gap: 1.5rem;
    padding: 1.5rem;
    background: #f8f9fa;
    border-radius: 12px;
    border-left: 4px solid #8B4513;
    transition: all 0.3s ease;
}

.step:hover {
    background: #e9ecef;
    transform: translateX(5px);
    box-shadow: 0 4px 12px rgba(139, 69, 19, 0.1);
}

.step-number {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #8B4513 0%, #D2691E 100%);
    color: white;
    font-size: 1.5rem;
    font-weight: 700;
    border-radius: 50%;
    flex-shrink: 0;
    box-shadow: 0 4px 8px rgba(139, 69, 19, 0.3);
}

.step-content {
    flex: 1;
}

.step-content h3 {
    font-size: 1.25rem;
    color: #2c3e50;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.step-content p {
    color: #6c757d;
    line-height: 1.6;
    margin: 0;
}

/* Mobile Responsive for Steps */
@media (max-width: 768px) {
    .steps {
        gap: 1.5rem;
    }
    
    .step {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
        padding: 1rem;
    }
    
    .step-number {
        width: 40px;
        height: 40px;
        font-size: 1.25rem;
        margin: 0 auto;
    }
    
    .step-content h3 {
        font-size: 1.1rem;
    }
    
    .step-content p {
        font-size: 0.9rem;
    }
}

/* Roadmap Modal Styles */
.roadmap-modal {
    border-radius: 0 !important;
    background: var(--card-bg) !important;
    max-width: 800px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
}

.roadmap-modal .modal-header {
    position: sticky;
    top: 0;
    background: var(--card-bg);
    padding: 1.5rem 2rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 10;
}

.roadmap-modal .modal-header h2 {
    margin: 0;
    color: var(--text-primary);
    font-size: 1.5rem;
    font-weight: 600;
}

.roadmap-modal .modal-header .close-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.5rem;
    line-height: 1;
    transition: color 0.3s ease;
}

.roadmap-modal .modal-header .close-btn:hover {
    color: var(--sidebar-text);
}

.roadmap-modal .modal-body {
    padding: 2rem;
}

.roadmap-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    padding: 1rem 0;
}

.roadmap-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 1.5rem;
    background: #f8f9fa;
    border-radius: 12px;
    border: 2px solid #e9ecef;
    transition: all 0.3s ease;
    position: relative;
}

.roadmap-step:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(139, 69, 19, 0.15);
    border-color: #8B4513;
}

.step-number {
    position: absolute;
    top: -12px;
    left: 20px;
    background: #8B4513;
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 0.9rem;
    box-shadow: 0 2px 8px rgba(139, 69, 19, 0.3);
}

.step-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #8B4513 0%, #A0522D 100%);
    color: white;
    border-radius: 50%;
    font-size: 1.3rem;
    margin-bottom: 1rem;
    box-shadow: 0 4px 12px rgba(139, 69, 19, 0.3);
}

.step-content {
    flex: 1;
}

.step-content h3 {
    font-size: 1.2rem;
    color: #2c3e50;
    margin-bottom: 0.75rem;
    font-weight: 600;
}

.step-content p {
    color: #6c757d;
    line-height: 1.5;
    margin: 0;
    font-size: 0.95rem;
}

.roadmap-footer {
    text-align: center;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 2px solid #e9ecef;
}

.roadmap-footer .get-started-btn {
    background: linear-gradient(135deg, #8B4513 0%, #A0522D 100%);
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(139, 69, 19, 0.3);
}

.roadmap-footer .get-started-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(139, 69, 19, 0.4);
}

/* Mobile Responsive for Roadmap */
@media (max-width: 768px) {
    .roadmap-modal {
        width: 95%;
        margin: 2.5% auto;
        max-height: calc(90vh - 62px - env(safe-area-inset-bottom, 0px));
    }
    
    .roadmap-modal .modal-body {
        padding: 1.5rem;
    }
    
    .roadmap-container {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .roadmap-step {
        padding: 1.25rem;
    }
    
    .step-icon {
        width: 45px;
        height: 45px;
        font-size: 1.2rem;
    }
    
    .step-content h3 {
        font-size: 1.1rem;
    }
    
    .step-content p {
        font-size: 0.9rem;
    }
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    right: 0;
    bottom: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0,0,0,0.5);
    overflow-y: auto;
}

/* Prevent body scroll when modal is open */
body.modal-open {
    overflow: hidden;
    position: fixed;
    width: 100%;
}

.modal-content {
    background: var(--card-bg);
    margin: 0;
    padding: 0;
    border-radius: 15px;
    width: 90%;
    max-width: 500px;
    max-height: 90dvh;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    animation: modalSlideIn 0.3s ease;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 2002;
    display: flex;
    flex-direction: column;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translate(-50%, -40%);
        scale: 0.9;
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%);
        scale: 1;
    }
}

.modal-header {
    padding: 1.5rem 2rem;
    background: linear-gradient(135deg, #8B4513 0%, #D2691E 100%);
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 15px 15px 0 0;
}

.modal-header h2 {
    font-size: 1.5rem;
    font-weight: 600;
}

.close-btn {
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 4px;
    transition: background 0.3s ease;
}

.close-btn:hover {
    background: rgba(255,255,255,0.2);
}

.modal-body {
    padding: 2rem;
    overflow-y: auto;
    flex: 1;
    min-height: 0;
}

.auth-tabs {
    display: flex;
    margin-bottom: 2rem;
    border-bottom: 2px solid #e9ecef;
}

.tab-btn {
    background: none;
    border: none;
    padding: 1rem 2rem;
    cursor: pointer;
    font-size: 1rem;
    color: #6c757d;
    border-bottom: 2px solid transparent;
    transition: all 0.3s ease;
}

.tab-btn.active {
    color: #667eea;
    border-bottom-color: #667eea;
}

.auth-form {
    display: block;
}

/* Enhanced Form Styles */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-primary);
    font-size: 0.9rem;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: var(--card-bg);
    color: var(--text-primary);
    box-sizing: border-box;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #8B4513;
    box-shadow: 0 0 0 3px rgba(139, 69, 19, 0.1);
    transform: translateY(-1px);
    background: var(--card-bg) !important;
    color: var(--text-primary) !important;
}

.form-group input:hover,
.form-group select:hover {
    border-color: #8B4513;
}

.btn-full {
    width: 100%;
    justify-content: center;
    margin-top: 1rem;
    padding: 0.875rem 1.5rem;
    font-size: 0.9rem;
    font-weight: 600;
    text-transform: capitalize;
}

/* Enhanced Auth Tabs */
.auth-tabs {
    display: flex;
    margin-bottom: 2rem;
    border-bottom: 2px solid #e9ecef;
    background: #f8f9fa;
    border-radius: 8px;
    padding: 0.25rem;
}

.tab-btn {
    background: none;
    border: none;
    padding: 0.75rem 1.5rem;
    cursor: pointer;
    font-size: 1rem;
    color: #6c757d;
    border-radius: 6px;
    transition: all 0.3s ease;
    flex: 1;
    text-align: center;
    font-weight: 500;
}

.tab-btn.active {
    color: var(--sidebar-text);
    background: white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.tab-btn:hover:not(.active) {
    color: var(--sidebar-text);
    background: rgba(139, 69, 19, 0.05);
}

/* Form Validation Styles */
.form-group input.error {
    border-color: #e74c3c;
    box-shadow: 0 0 0 3px rgba(231, 76, 60, 0.1);
}

/* Onboarding specific error styling */
.onboarding-form input.error,
.onboarding-form select.error {
    border-color: #e53e3e !important;
    box-shadow: 0 0 0 3px rgba(229, 62, 62, 0.1) !important;
}

.form-group input.success {
    border-color: #27ae60;
    box-shadow: 0 0 0 3px rgba(39, 174, 96, 0.1);
}

.error-message {
    color: #e74c3c;
    font-size: 0.8rem;
    margin-top: 0.25rem;
    display: none;
}

.success-message {
    color: #27ae60;
    font-size: 0.8rem;
    margin-top: 0.25rem;
    display: none;
}

/* Loading State */
.btn.loading {
    position: relative;
    color: transparent;
}

.btn.loading::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    top: 50%;
    left: 50%;
    margin-left: -8px;
    margin-top: -8px;
    border: 2px solid transparent;
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Enhanced Modal Header */
.modal-header {
    padding: 2rem 2rem 1.5rem 2rem;
    background: linear-gradient(135deg, #8B4513 0%, #D2691E 100%);
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 15px 15px 0 0;
    position: relative;
}

.modal-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, rgba(255,255,255,0.3) 0%, rgba(255,255,255,0.1) 100%);
}

.modal-header h2 {
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0;
}

/* Enhanced Modal Body */
.modal-body {
    padding: 2rem;
    background: var(--card-bg);
    overflow-y: auto;
    flex: 1;
}

/* Login and Signup Modal Styles */
#loginModal .modal-content,
#signupModal .modal-content {
    border-radius: 0;
    background: var(--card-bg);
}

#loginModal .modal-header,
#signupModal .modal-header {
    background: var(--card-bg);
    color: var(--text-primary);
    border-radius: 0;
    border-bottom: 1px solid #e9ecef;
    padding: 1.5rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header-content {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.modal-header-logo {
    height: 40px;
    width: auto;
    object-fit: contain;
}

#loginModal .modal-header h2,
#signupModal .modal-header h2 {
    color: #2c3e50;
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0;
}

#loginModal .close-btn,
#signupModal .close-btn {
    background: none;
    border: none;
    color: #6c757d;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 4px;
    transition: all 0.3s ease;
}

#loginModal .close-btn:hover,
#signupModal .close-btn:hover {
    background: #f8f9fa;
    color: #2c3e50;
}

#loginModal .modal-body,
#signupModal .modal-body {
    background: var(--card-bg);
    padding: 1.5rem;
}


/* Compact Login Modal */
#loginModal .modal-content {
    max-height: 90vh;
    overflow-y: auto;
}

#loginModal .welcome-message {
    margin-bottom: 1rem;
}

#loginModal .welcome-message p {
    font-size: 0.9rem;
    margin: 0;
}

#loginModal .form-group {
    margin-bottom: 0.75rem;
}

#loginModal .form-group label {
    font-size: 0.85rem;
    margin-bottom: 0.25rem;
}

#loginModal .form-group input {
    padding: 0.75rem;
    font-size: 0.9rem;
}

#loginModal .btn {
    padding: 0.75rem;
    font-size: 0.9rem;
}

/* Remember Me Checkbox */
.remember-me-group {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.remember-me-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 0.9rem;
    color: #2c3e50;
    margin: 0;
    white-space: nowrap;
}

.remember-me-checkbox {
    display: none;
}

.checkmark {
    width: 18px;
    height: 18px;
    border: 2px solid #e9ecef;
    border-radius: 4px;
    margin-right: 8px;
    position: relative;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.remember-me-checkbox:checked + .checkmark {
    background: #8B4513;
    border-color: #8B4513;
}

.remember-me-checkbox:checked + .checkmark::after {
    content: '✓';
    color: white;
    font-size: 12px;
    font-weight: bold;
}

.forgot-password-link {
    color: var(--sidebar-text);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.3s ease;
}

.forgot-password-link:hover {
    color: #6B3E0A;
    text-decoration: underline;
}

/* Welcome Message */
.welcome-message {
    text-align: center;
    margin-bottom: 2rem;
    color: #6c757d;
    font-size: 0.9rem;
    line-height: 1.5;
}

/* Form Row for Side-by-Side Fields */
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

/* Mobile Responsive Forms */
@media (max-width: 768px) {
    .form-row {
        grid-template-columns: 1fr;
        gap: 0;
    }
    
    .auth-tabs {
        flex-direction: column;
        gap: 0.25rem;
    }
    
    .tab-btn {
        padding: 0.75rem 1rem;
    }
    
    .modal-body {
        padding: 1.5rem;
    }
    
    .form-group input,
    .form-group select {
        padding: 0.875rem 1rem;
        font-size: 16px; /* Prevents zoom on iOS */
    }
}

/* Mobile Modal Styles */
@media (max-width: 768px) {
    .modal-form .form-row {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }

    .modal-form .form-actions {
        flex-direction: column;
    }
}

/* ========================================
   DASHBOARD & NAVIGATION STYLES
   ======================================== */

/* Skip Link for Accessibility */
.skip-link {
    position: absolute;
    top: -40px;
    left: 6px;
    background: #8B4513;
    color: white;
    padding: 8px;
    text-decoration: none;
    border-radius: 4px;
    z-index: 1000;
}

.skip-link:focus {
    top: 6px;
}

/* Navigation Bar */
.navbar {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(139, 69, 19, 0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 70px;
}

.nav-brand {
    display: flex;
    align-items: center;
}

.nav-brand .logo-link {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: var(--sidebar-text);
    font-weight: 700;
    font-size: 1.5rem;
}

.nav-logo {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: var(--sidebar-text);
    font-weight: 700;
    font-size: 1.5rem;
}

.logo-image {
    height: 40px;
}

.logo-img {
    height: 40px;
    width: auto;
    max-width: 40px;
    object-fit: contain;
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-menu .nav-links {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    text-decoration: none;
    color: #2c3e50;
    border-radius: 8px;
    transition: all 0.3s ease;
    font-weight: 500;
    position: relative;
}

.nav-link:hover {
    background: rgba(139, 69, 19, 0.1);
    color: var(--sidebar-text);
    transform: translateY(-1px);
}

.nav-link.active {
    background: rgba(139, 69, 19, 0.15);
    color: var(--sidebar-text);
    font-weight: 600;
}

.nav-link i {
    font-size: 1.1rem;
    width: 20px;
    text-align: center;
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-left: 1rem;
}

.nav-action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: none;
    background: rgba(139, 69, 19, 0.1);
    color: var(--sidebar-text);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1.1rem;
}

.nav-action-btn:hover {
    background: rgba(139, 69, 19, 0.2);
    transform: translateY(-1px);
}

.logout-btn:hover {
    background: rgba(220, 53, 69, 0.1);
    color: #dc3545;
}

/* Dropdown Menu */
.nav-dropdown {
    position: relative;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background: white;
    border: 1px solid rgba(139, 69, 19, 0.1);
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    min-width: 200px;
    z-index: 1001;
    display: none;
    overflow: hidden;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    text-decoration: none;
    color: #2c3e50;
    transition: all 0.3s ease;
    border-bottom: 1px solid rgba(139, 69, 19, 0.05);
}

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

.dropdown-item:hover {
    background: rgba(139, 69, 19, 0.1);
    color: var(--sidebar-text);
}

.dropdown-item i {
    width: 16px;
    text-align: center;
    font-size: 0.9rem;
}

/* Mobile Navigation Toggle */
.nav-toggle {
    display: none;
    flex-direction: column;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    gap: 4px;
}

.bar {
    width: 25px;
    height: 3px;
    background: #8B4513;
    border-radius: 2px;
    transition: all 0.3s ease;
}

/* Sidebar Styles */
.sidebar {
    position: fixed;
    top: 0;
    left: 0; /* Visible by default */
    width: 200px;
    height: 100vh;
    background: var(--sidebar-bg);
    color: var(--sidebar-text);
    z-index: 1000;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
}

.sidebar.pinned {
    left: 0;
}

.sidebar:not(.pinned) {
    left: -200px;
}

.sidebar.collapsed {
    width: 60px;
}

.sidebar.mobile {
    left: -200px;
}

.sidebar.mobile.active {
    left: 0;
}



.sidebar-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--sidebar-text);
    font-size: 0.9rem;
    cursor: pointer;
    padding: 0.4rem;
    border-radius: 4px;
    transition: all 0.3s ease;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sidebar-toggle:hover {
    background: rgba(139, 69, 19, 0.1);
    color: #D2691E;
}

.sidebar-header {
    padding: 0.65rem 0.75rem;
    border-bottom: 1px solid var(--sidebar-border);
    display: flex;
    align-items: center;
    min-height: 64px;
}

.sidebar-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: var(--sidebar-text);
    gap: 0.5rem;
    width: 100%;
}

.sidebar-logo-img {
    width: 36px;
    height: 36px;
    object-fit: contain;
}

.sidebar-logo-text {
    font-size: 0.72rem;
    font-weight: 500;
    color: var(--sidebar-text);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.sidebar-title-img {
    width: 85%;
    max-height: 48px;
    height: auto;
    object-fit: contain;
}

/* Show light title by default, dark title when dark theme is active */
.sidebar-title-dark { display: none; }
[data-theme="dark"] .sidebar-title-light { display: none; }
[data-theme="dark"] .sidebar-title-dark { display: block; }

.sidebar-nav {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    padding: 0.5rem 0;
    overflow-y: auto;
}

.sidebar-link {
    display: flex;
    align-items: center;
    padding: 0.65rem 0.85rem;
    margin: 0.1rem 0.5rem;
    border-radius: 8px;
    color: var(--sidebar-text-muted);
    text-decoration: none;
    transition: background 0.15s, color 0.15s;
    gap: 0.7rem;
    font-size: 0.82rem;
    font-weight: 400;
}

.sidebar-link i,
.sidebar-link svg {
    width: 1.25rem;
    height: 1.25rem;
    text-align: center;
    font-size: 1.25rem;
    flex-shrink: 0;
    stroke-width: 1.5;
}

.sidebar-link:hover {
    background: var(--sidebar-hover);
    color: var(--sidebar-text);
}

.sidebar-link.active {
    background: var(--sidebar-active);
    color: var(--sidebar-active-border);
    font-weight: 600;
}


.sidebar-link-text {
    transition: opacity 0.3s ease;
}

.sidebar.collapsed .sidebar-link-text {
    opacity: 0;
    width: 0;
    overflow: hidden;
}

.sidebar-footer {
    border-top: 1px solid var(--sidebar-border);
    position: relative;
}

/* Profile trigger button — matches .sidebar-link style */
.sidebar-profile {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    width: 100%;
    padding: 0.75rem 1rem;
    background: none;
    border: none;
    border-left: 3px solid transparent;
    cursor: pointer;
    color: var(--sidebar-text-muted);
    transition: background 0.15s, color 0.15s, border-color 0.15s;
    text-align: left;
    font-size: 0.82rem;
    font-weight: 400;
}
.sidebar-profile:hover {
    background: var(--sidebar-hover);
    color: var(--sidebar-text);
    border-left-color: var(--sidebar-active-border);
}
.sidebar-profile-avatar-icon {
    width: 1.25rem;
    height: 1.25rem;
    stroke-width: 1.5;
    flex-shrink: 0;
}
.sidebar-profile-name {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.sidebar-profile-chevron {
    width: 1rem;
    height: 1rem;
    transition: transform 0.2s;
    flex-shrink: 0;
}
.sidebar-profile-chevron.rotated {
    transform: rotate(180deg);
}

/* Profile popup menu (opens above the footer) */
.sidebar-profile-menu {
    display: none;
    position: absolute;
    bottom: 100%;
    left: 0;
    right: 0;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-bottom: none;
    border-radius: 8px 8px 0 0;
    box-shadow: 0 -4px 16px rgba(0,0,0,0.25);
    overflow: hidden;
    z-index: 200;
}
.sidebar-profile-menu.open {
    display: block;
}
.sidebar-profile-item {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.5rem 0.85rem;
    color: var(--text-primary);
    text-decoration: none;
    font-size: 0.78rem;
    background: none;
    border: none;
    width: 100%;
    text-align: left;
    cursor: pointer;
    transition: background 0.15s;
}
.sidebar-profile-item:hover {
    background: var(--sidebar-hover);
}
.sidebar-profile-item i,
.sidebar-profile-item svg {
    width: 14px;
    height: 14px;
    text-align: center;
    color: var(--text-secondary);
    flex-shrink: 0;
    font-size: 0.78rem;
    stroke-width: 1.5;
}
.sidebar-profile-divider {
    height: 1px;
    background: var(--border-color);
    margin: 0.2rem 0;
}
.sidebar-profile-logout {
    color: #dc3545 !important;
}
.sidebar-profile-logout i {
    color: #dc3545 !important;
}
.sidebar-profile-logout:hover {
    background: rgba(220, 53, 69, 0.08) !important;
}

.sidebar-action-text {
    transition: opacity 0.3s ease;
}

.sidebar.collapsed .sidebar-action-text {
    opacity: 0;
    width: 0;
    overflow: hidden;
}

.sidebar-dropdown {
    position: relative;
}

.sidebar-dropdown .dropdown-menu {
    position: fixed;
    background: var(--card-bg);
    border-radius: 4px;
    box-shadow: var(--shadow);
    display: none;
    z-index: 1001;
    margin-bottom: 0.5rem;
    min-width: 200px;
}

.sidebar-dropdown .dropdown-item {
    display: flex;
    align-items: center;
    padding: 0.75rem;
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.3s ease;
    gap: 0.75rem;
}

.sidebar-dropdown .dropdown-item:hover {
    background: var(--sidebar-hover);
    color: var(--text-primary);
}

.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    display: none;
    transition: all 0.3s ease;
}

.sidebar-overlay.active {
    display: block;
}

/* Top Banner — removed, kept hidden for safety */
.top-banner {
    display: none;
}

.banner-content {
    position: relative;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    height: 100%;
    padding: 0 2rem;
    max-width: 100%;
}



.banner-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.banner-logout-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.25rem 0.5rem;
    background: none;
    border: none;
    color: var(--top-banner-text);
    font-size: 0.75rem;
    font-weight: 400;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    text-transform: uppercase !important;
}

.banner-logout-btn:hover {
    color: var(--top-banner-text);
    opacity: 0.8;
    background: rgba(255, 255, 255, 0.1);
    text-decoration: none;
}

.banner-logout-btn i {
    font-size: 0.9rem;
}

/* Theme Toggle Button */
.theme-toggle-btn {
    display: flex;
    align-items: center;
    padding: 0.25rem;
    background: none;
    border: none;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.3s ease;
    margin-right: 0.5rem;
}

.theme-toggle-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

.theme-toggle-switch {
    position: relative;
    display: flex;
    align-items: center;
    width: 40px;
    height: 18px;
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 9px;
    padding: 1px;
    transition: all 0.3s ease;
}

/* Better visibility in light mode */
[data-theme="light"] .theme-toggle-switch {
    background: rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(0, 0, 0, 0.2);
}

.theme-icon-left,
.theme-icon-right {
    position: absolute;
    font-size: 0.5rem;
    color: var(--top-banner-text);
    transition: all 0.3s ease;
    z-index: 2;
}

/* Better icon visibility in light mode */
[data-theme="light"] .theme-icon-left,
[data-theme="light"] .theme-icon-right {
    color: #2c3e50;
}

.theme-icon-left {
    left: 3px;
}

.theme-icon-right {
    right: 3px;
}

.toggle-slider {
    position: absolute;
    width: 14px;
    height: 14px;
    background: var(--top-banner-text);
    border-radius: 50%;
    transition: all 0.3s ease;
    z-index: 3;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Dark mode - slider on the right */
[data-theme="dark"] .toggle-slider {
    transform: translateX(22px);
}

/* Light mode - slider on the left */
[data-theme="light"] .toggle-slider {
    transform: translateX(0);
}

/* Main content wrapper */
.main-wrapper {
    transition: margin-left 0.3s ease;
    min-height: 100vh;
    position: relative;
    margin-left: 200px;
    margin-top: 0;
    background: var(--main-bg);
    display: flex;
    flex-direction: column;
}

/* Mobile menu button — fixed, only shown on mobile */
.mobile-menu-btn {
    position: fixed;
    top: 1rem;
    left: 1rem;
    z-index: 1002;
    background: #8B4513;
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1.1rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
    display: none; /* Hidden on desktop */
}

.mobile-menu-btn:hover {
    background: #D2691E;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}


/* Breadcrumb Navigation */
.breadcrumb-container {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(139, 69, 19, 0.1);
    padding: 0.75rem 0;
}

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
}

.breadcrumb-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    color: #6c757d;
    transition: color 0.3s ease;
}

.breadcrumb-item:hover {
    color: var(--sidebar-text);
}

.breadcrumb-item i {
    font-size: 0.8rem;
}

/* Main Content */
.main-content {
    flex: 1;
    background: var(--main-bg);
    display: flex;
    flex-direction: column;
}

.container {
    width: 100%;
    max-width: 100%;
    padding: 1rem;
    background: var(--card-bg);
    border-radius: 0;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
    margin: 0;
    flex: 1;
    box-sizing: border-box;
}

/* Dashboard Styles */
.page-header {
    background: var(--card-bg);
    border-radius: 0;
    padding: 1rem 1.5rem;
    margin: 0.25rem 0 0.5rem 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.6);
    position: relative;
    overflow: visible;
}

/* Desktop unchanged — mobile title cards match dashboard */

.page-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(135deg, #8B4513 0%, #D2691E 100%);
    border-radius: 0;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    position: relative;
    z-index: 1;
}

.page-header h1 {
    color: var(--text-primary);
    font-size: 1.2rem;
    font-weight: 600;
    margin: 0;
    background: linear-gradient(135deg, #8B4513 0%, #D2691E 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.5px;
}

.page-header h1 i {
    font-size: 1.2rem;
    margin-right: 0.5rem;
    color: var(--sidebar-text);
}

.page-header p {
    color: var(--text-secondary);
    font-size: 0.8rem;
    margin: 0.5rem 0 0 0;
    font-weight: 400;
    line-height: 1.4;
}

.page-subtitle {
    color: var(--text-secondary);
    font-size: 0.8rem;
    margin: 0.5rem 0 0 0;
    font-weight: 400;
    line-height: 1.4;
}

/* Budgets Page Styles */
.budgets-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: linear-gradient(135deg, #8B4513 0%, #D2691E 100%);
    border-radius: 12px;
    color: white;
    box-shadow: 0 4px 15px rgba(139, 69, 19, 0.3);
}

.budgets-header .header-left .create-budget-btn {
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.budgets-header .header-left .create-budget-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

.budgets-header .header-right .filter-container {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.budgets-header .filter-select {
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    backdrop-filter: blur(10px);
    font-weight: 500;
}

.budgets-header .filter-select option {
    background: #2c3e50;
    color: white;
}

.create-budget-card {
    margin-bottom: 0.75rem;
    border: none;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.6);
    background: var(--card-bg);
    overflow: hidden;
}

.create-budget-card .card-body {
    padding: 0.9rem 1.1rem;
}

.create-budget-card .form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    margin-bottom: 0.65rem;
}

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

.create-budget-card .form-group label {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.2rem;
    font-size: 0.72rem;
}

.create-budget-card .form-group input,
.create-budget-card .form-group select {
    padding: 0.35rem 0.65rem;
    border: 2px solid var(--border-color);
    border-radius: 4px;
    font-size: 0.82rem;
    transition: all 0.3s ease;
    background: var(--card-bg);
    color: var(--text-primary);
}

.create-budget-card .form-group input:focus,
.create-budget-card .form-group select:focus {
    outline: none;
    border-color: #8B4513;
    background: var(--card-bg) !important;
    color: var(--text-primary) !important;
    box-shadow: 0 0 0 3px rgba(139, 69, 19, 0.1);
}

.create-budget-card .form-actions {
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
    margin-top: 0.65rem;
    padding-top: 0.5rem;
    border-top: 1px solid #e1e8ed;
}

.budgets-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--card-bg);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.6);
}

.budgets-table thead {
    background: linear-gradient(135deg, #8B4513 0%, #D2691E 100%);
    color: white;
}

.budgets-table th {
    padding: 1rem 1.5rem;
    text-align: left;
    font-weight: 600;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.budgets-table tbody tr {
    border-bottom: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.budgets-table tbody tr:hover {
    background: var(--main-bg);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.budgets-table tbody tr.active {
    background: var(--main-bg);
    border-left: 4px solid #4caf50;
}

.budgets-table td {
    padding: 1rem 1.5rem;
    vertical-align: middle;
    color: var(--text-primary);
}

.period-name {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 1.1rem;
}

.period-type .type-badge {
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.period-type .type-badge.monthly {
    background: #e3f2fd;
    color: #1976d2;
}

.period-type .type-badge.quarterly {
    background: #f3e5f5;
    color: #7b1fa2;
}

.period-type .type-badge.yearly {
    background: #e8f5e8;
    color: #388e3c;
}

.period-type .type-badge.custom {
    background: #fff3e0;
    color: #f57c00;
}

.period-dates {
    color: #666;
    font-size: 0.9rem;
}

.period-created {
    color: #888;
    font-size: 0.9rem;
}

.period-status .badge {
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.period-status .badge-success {
    background: #4caf50;
    color: white;
}

.period-status .badge-secondary {
    background: #6c757d;
    color: white;
}

.period-actions .action-buttons {
    display: flex;
    gap: 0.5rem;
}

.period-actions .btn {
    padding: 0.5rem;
    border-radius: 6px;
    border: none;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    min-width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.period-actions .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.period-actions .btn-primary {
    background: #8B4513;
    color: white;
}

.period-actions .btn-danger {
    background: #e74c3c;
    color: white;
}

.no-data {
    text-align: center;
    padding: 3rem;
    color: #666;
    font-style: italic;
    background: #f8f9fa;
}

.loading {
    text-align: center;
    padding: 2rem;
    color: #666;
    font-style: italic;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .budgets-header {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .budgets-header .header-right {
        width: 100%;
        justify-content: center;
    }
    
    .create-budget-card .form-row {
        grid-template-columns: 1fr;
    }
    
    .create-budget-card .form-actions {
        flex-direction: column;
    }
    
    .budgets-table {
        font-size: 0.9rem;
    }
    
    .budgets-table th,
    .budgets-table td {
        padding: 0.75rem 1rem;
    }
    
    .period-actions .action-buttons {
        flex-direction: column;
        gap: 0.25rem;
    }
}

@media (max-width: 480px) {
    .budgets-table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }
    
    .budgets-table thead,
    .budgets-table tbody,
    .budgets-table th,
    .budgets-table td,
    .budgets-table tr {
        display: block;
    }
    
    .budgets-table thead tr {
        position: absolute;
        top: -9999px;
        left: -9999px;
    }
    
    .budgets-table tr {
        border: 1px solid var(--border-color);
        margin-bottom: 1rem;
        border-radius: 8px;
        padding: 1rem;
        background: var(--card-bg);
    }
    
    .budgets-table td {
        border: none;
        position: relative;
        padding-left: 50%;
        white-space: normal;
    }
    
    .budgets-table td:before {
        content: attr(data-label) ": ";
        position: absolute;
        left: 6px;
        width: 45%;
        padding-right: 10px;
        white-space: nowrap;
        font-weight: bold;
        color: #2c3e50;
    }
}

/* Settings Page Styles */
/* Theme Selector */
.theme-selector {
    display: flex;
    gap: 0.5rem;
}

.theme-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border: 2px solid var(--border-color);
    background: var(--card-bg);
    color: var(--text-secondary);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.875rem;
    font-weight: 500;
}

.theme-btn:hover {
    border-color: #8B4513;
    color: var(--text-primary);
    background: rgba(139, 69, 19, 0.05);
}

.theme-btn.active {
    border-color: #8B4513;
    background: #8B4513;
    color: white;
}

.theme-btn i {
    font-size: 1rem;
}

.settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.settings-card {
    background: var(--card-bg);
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
    overflow: hidden;
    transition: all 0.3s ease;
    border: 1px solid var(--border-color);
}

.settings-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
}

.settings-card-header {
    background: linear-gradient(135deg, #8B4513 0%, #D2691E 100%);
    color: white;
    padding: 1.5rem 2rem;
    position: relative;
    overflow: hidden;
}

.settings-card-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, rgba(255, 255, 255, 0.1) 0%, transparent 100%);
    pointer-events: none;
}

.settings-card-header h2 {
    margin: 0;
    font-size: 1.3rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    position: relative;
    z-index: 1;
}

.settings-card-header i {
    font-size: 1.1rem;
    opacity: 0.9;
}

.settings-card-body {
    padding: 2rem;
}

.setting-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 0;
    border-bottom: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.setting-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.setting-item:first-child {
    padding-top: 0;
}

.setting-item:hover {
    background: #f8f9fa;
    margin: 0 -2rem;
    padding-left: 2rem;
    padding-right: 2rem;
    border-radius: 8px;
}

.setting-info {
    flex: 1;
    margin-right: 1.5rem;
}

.setting-info h3 {
    margin: 0 0 0.5rem 0;
    color: #2c3e50;
    font-size: 1.1rem;
    font-weight: 600;
}

.setting-info p {
    margin: 0;
    color: #666;
    font-size: 0.9rem;
    line-height: 1.4;
}

.setting-item .btn {
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 500;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    white-space: nowrap;
}

.setting-item .btn-outline {
    background: transparent;
    border: 2px solid #8B4513;
    color: var(--sidebar-text);
}

.setting-item .btn-outline:hover {
    background: #8B4513;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(139, 69, 19, 0.3);
}

.setting-item .btn-danger {
    background: #e74c3c;
    border: 2px solid #e74c3c;
    color: white;
}

.setting-item .btn-danger:hover {
    background: #c0392b;
    border-color: #c0392b;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(231, 76, 60, 0.3);
}

.about-content {
    text-align: center;
    padding: 1rem 0;
}

.about-content p {
    margin: 0.75rem 0;
    color: #666;
    font-size: 0.95rem;
}

.about-content .verse {
    font-style: italic;
    color: var(--sidebar-text);
    font-size: 1rem;
    margin-top: 1.5rem;
    padding: 1rem;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 8px;
    border-left: 4px solid #8B4513;
}

/* Modal Improvements */
.modal {
    display: none;
    position: fixed;
    z-index: 1200;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    animation: fadeIn 0.3s ease;
}

.modal-content {
    background: var(--card-bg);
    margin: 0;
    padding: 0;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 500px;
    width: 90%;
    animation: slideIn 0.3s ease;
    max-height: 90dvh;
    overflow: hidden;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 2002;
    display: flex;
    flex-direction: column;
}

.modal-header {
    background: linear-gradient(135deg, #8B4513 0%, #D2691E 100%);
    color: white;
    padding: 1.5rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.modal-header h3 {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.modal-close {
    background: none;
    border: none;
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    transition: all 0.3s ease;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: rotate(90deg);
}

.modal-body {
    padding: 2rem;
    overflow-y: auto;
    flex: 1;
    min-height: 0;
}

.modal-footer {
    padding: 1.5rem 2rem;
    background: #f8f9fa;
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    justify-content: flex-end;
    border-top: 1px solid #e9ecef;
    flex-shrink: 0;
}

.warning-message {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.warning-message p {
    margin: 0.5rem 0;
    color: #856404;
}

.warning-message ul {
    margin: 1rem 0;
    padding-left: 1.5rem;
}

.warning-message li {
    margin: 0.5rem 0;
    color: #856404;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--text-primary);
}

.form-group input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: var(--main-bg);
    color: var(--text-primary);
}

.form-group input:focus {
    outline: none;
    border-color: #8B4513;
    background: var(--card-bg);
    color: var(--text-primary);
    box-shadow: 0 0 0 3px rgba(139, 69, 19, 0.1);
}

.form-group select {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: var(--main-bg);
    color: var(--text-primary);
    cursor: pointer;
}

.form-group select:focus {
    outline: none;
    border-color: #8B4513;
    background: var(--card-bg);
    color: var(--text-primary);
    box-shadow: 0 0 0 3px rgba(139, 69, 19, 0.1);
}

.form-group input[readonly] {
    background: var(--main-bg);
    color: var(--text-secondary);
    cursor: not-allowed;
    opacity: 0.7;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

/* Mobile Responsive */
@media (max-width: 768px) {
    .settings-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        margin-top: 1.5rem;
    }
    
    .settings-card-header {
        padding: 1.25rem 1.5rem;
    }
    
    .settings-card-header h2 {
        font-size: 1.1rem;
    }
    
    .settings-card-body {
        padding: 1.5rem;
    }
    
    .setting-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
        padding: 1.25rem 0;
    }
    
    .setting-item:hover {
        margin: 0 -1.5rem;
        padding-left: 1.5rem;
        padding-right: 1.5rem;
    }
    
    .setting-info {
        margin-right: 0;
        width: 100%;
    }
    
    .setting-item .btn {
        width: 100%;
        justify-content: center;
    }
    
    .modal-content {
        margin: 0;
        width: 95%;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        max-height: calc(90dvh - 62px - env(safe-area-inset-bottom, 0px));
        display: flex;
        flex-direction: column;
    }

    .modal-body {
        overflow-y: auto;
        flex: 1;
        min-height: 0;
    }

    .modal-header,
    .modal-body,
    .modal-footer {
        padding: 1.25rem 1.5rem;
    }

    .modal-footer .btn {
        flex: 1 1 auto;
        min-width: fit-content;
    }
}

@media (max-width: 480px) {
    .settings-card-header h2 {
        font-size: 1rem;
    }
    
    .settings-card-header i {
        font-size: 0.9rem;
    }
    
    .setting-info h3 {
        font-size: 1rem;
    }
    
    .setting-info p {
        font-size: 0.85rem;
    }
    
    .about-content .verse {
        font-size: 0.9rem;
        padding: 0.75rem;
    }
}

/* Budget switcher dropdown */
.budget-switcher {
    position: relative;
}

.budget-switcher-btn {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    background: none;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 0.3rem 0.6rem;
    cursor: pointer;
    transition: all 0.2s ease;
    color: var(--text-secondary);
}

.budget-switcher-btn:hover {
    border-color: var(--sidebar-active-border, #8B4513);
    color: var(--sidebar-active-border, #8B4513);
    background: rgba(139, 69, 19, 0.06);
}

.budget-name {
    font-weight: 500;
    color: inherit;
    font-size: 0.85rem;
}

.budget-switcher-chevron {
    font-size: 0.7rem;
    transition: transform 0.2s ease;
}

.budget-switcher-chevron.rotated {
    transform: rotate(180deg);
}

.budget-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    min-width: 200px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: var(--shadow, 0 4px 16px rgba(0,0,0,0.12));
    z-index: 1000;
    overflow: hidden;
}

.budget-dropdown.open {
    display: block;
}

.budget-dropdown-loading,
.budget-dropdown-empty {
    padding: 0.75rem 1rem;
    color: var(--text-secondary);
    font-size: 0.85rem;
    text-align: center;
}

.budget-dropdown-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 0.55rem 1rem;
    background: none;
    border: none;
    text-align: left;
    cursor: pointer;
    font-size: 0.85rem;
    color: var(--text-primary);
    transition: background 0.15s ease;
    gap: 0.5rem;
}

.budget-dropdown-item:hover {
    background: var(--sidebar-hover, rgba(0,0,0,0.04));
}

.budget-dropdown-item.active {
    font-weight: 600;
    color: var(--sidebar-active-border, #8B4513);
    cursor: default;
    background: var(--sidebar-active, rgba(139, 69, 19, 0.08));
}

.budget-dropdown-name {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.budget-active-check {
    font-size: 0.75rem;
    color: var(--sidebar-active-border, #8B4513);
    flex-shrink: 0;
}

.budget-dropdown-footer {
    border-top: 1px solid var(--border-color);
    padding: 0.5rem 1rem;
}

.budget-see-more {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.8rem;
    padding: 0.2rem 0;
    transition: color 0.15s ease;
}

.budget-see-more:hover {
    color: var(--sidebar-active-border, #8B4513);
}

/* Dashboard Content */
.dashboard-content {
    margin: 1rem 0;
    overflow: visible;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 260px 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
}

/* Overview cards take full width at top */
.overview-cards {
    grid-column: 1 / -1;
    grid-row: 1;
}

/* Col 1: Spending by Category */
.category-health-section {
    grid-column: 1;
    grid-row: 2;
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* Col 2: Allocation Chart (standalone grid item) */
.budget-chart-section {
    grid-column: 2;
    grid-row: 2;
}

/* Col 3: Quick Actions + Recent Transactions */
.right-content {
    grid-column: 3;
    grid-row: 2;
    height: 100%;
}

/* Budget Allocation Chart — nested inside right-content */
.budget-chart-card {
    background: var(--card-bg);
    border-radius: 0;
    padding: 1rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.6);
    overflow: visible;
}

.budget-chart-section {
    overflow: visible;
}

.budget-chart-header {
    margin-bottom: 0.65rem;
}

.budget-chart-header h3 {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

.budget-chart-header p {
    font-size: 0.78rem;
    color: var(--text-secondary);
    margin: 0;
}

.budget-chart-container {
    position: relative;
    height: 220px;
}

.chart-legend-compact {
    margin-top: 0.75rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

/* Pill chip legend */
.chart-legend-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.22rem 0.6rem;
    background: var(--hover-bg);
    border: 1px solid var(--border-color);
    border-radius: 100px;
    font-size: 0.7rem;
    cursor: default;
    transition: border-color 0.2s, background 0.2s;
}
.chart-legend-chip:hover {
    border-color: var(--primary-color);
    background: rgba(210,105,30,0.07);
}
.chart-legend-chip-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    flex-shrink: 0;
}
.chart-legend-chip-label {
    color: var(--text-primary);
    white-space: nowrap;
    max-width: 80px;
    overflow: hidden;
    text-overflow: ellipsis;
}
.chart-legend-chip-pct {
    color: var(--text-secondary);
    font-weight: 600;
    white-space: nowrap;
}


.recent-transactions-card {
    background: var(--card-bg);
    border-radius: 0;
    padding: 1rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.6);
}

.recent-transactions-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-color);
}

.recent-transactions-header h3 {
    margin: 0;
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--text-primary);
}

.recent-transactions-header p {
    margin: 0;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.recent-transactions-link {
    font-size: 0.8rem;
    color: #8B4513;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.3rem;
    flex-shrink: 0;
}

.recent-transactions-link:hover {
    text-decoration: underline;
}

.recent-transactions-list {
    display: grid;
    grid-template-columns: 1fr;
    flex: 1;
    overflow-y: auto;
    align-content: start;
}

.txn-item {
    display: grid;
    grid-template-columns: 52px 10px 1fr auto;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border-color);
}

.txn-cat-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

/* Remove bottom border from last item */
.txn-item:last-child {
    border-bottom: none;
}

.txn-date {
    font-size: 0.68rem;
    color: var(--text-secondary);
    font-weight: 400;
    white-space: nowrap;
}

.txn-details {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    min-width: 0;
}

.txn-desc {
    font-size: 0.78rem;
    font-weight: 400;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.txn-category {
    font-size: 0.72rem;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.txn-amount {
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
}

.txn-loading,
.txn-empty {
    padding: 1rem 0;
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

[data-theme="dark"] .budget-chart-card {
    background: #1e1e1e;
    border: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.6);
}

[data-theme="dark"] .recent-transactions-card {
    background: #1e1e1e;
    border: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.6);
}

[data-theme="dark"] .recent-transactions-link {
    color: #D2691E;
}

/* Compact overview cards */
.overview-card.compact {
    padding: 0.75rem;
    min-height: auto;
}

.overview-card.compact .card-header {
    margin-bottom: 0.25rem;
}

.overview-card.compact .card-title h3 {
    font-size: 0.78rem;
    margin: 0;
    font-weight: 500;
}

.overview-card.compact .card-title p {
    font-size: 0.65rem;
    margin: 0;
    opacity: 0.7;
}

.overview-card.compact .card-value .value {
    font-size: 1.1rem;
    font-weight: 500;
}

/* Desktop: pull ring out of flow — position top-right of card so card can be compact */
@media (min-width: 769px) {
    .days-card {
        overflow: visible;
    }
    .days-card .days-ring-container {
        position: absolute;
        top: 50%;
        right: 0.6rem;
        transform: translateY(-50%);
        margin: 0;
    }
    .days-card .days-ring {
        width: 60px;
        height: 60px;
    }
    .days-ring-value {
        font-size: 0.95rem !important;
    }
    /* Remove the translateY on 3 cards since ring is no longer in flow */
    .overview-card.compact:not(.days-card) .card-value {
        transform: none;
    }
    /* Compact all 4 cards */
    .overview-card.compact {
        padding: 0.85rem 0.75rem;
    }
    .overview-card.compact .card-header {
        margin-bottom: 0.15rem;
    }
}

/* Mobile: lower amount on Available to Allocate to align with ring centre */
@media (max-width: 768px) {
    #available-card .card-value {
        transform: translateY(8px);
    }
}


/* Overview Cards */
.overview-cards {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 1fr;
    gap: 1rem;
}

.overview-card {
    background: var(--card-bg);
    border-radius: 0;
    padding: 1.5rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.6);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.overview-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #8B4513 0%, #D2691E 100%);
}

.overview-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.7);
}

.card-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.card-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    color: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.income-card .card-icon {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
}

.balance-card .card-icon {
    background: linear-gradient(135deg, #007bff 0%, #6610f2 100%);
}

.available-card .card-icon {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
}

.days-card .card-icon {
    background: linear-gradient(135deg, #ffc107 0%, #fd7e14 100%);
}


/* ── Watermark icon background per overview card (mobile only) ── */
@media (max-width: 768px) {
    .income-card.overview-card::after,
    .balance-card.overview-card::after,
    .available-card.overview-card::after,
    .days-card.overview-card::after {
        font-family: 'Font Awesome 6 Free';
        font-weight: 900;
        position: absolute;
        bottom: -8px;
        right: -4px;
        font-size: 4.5rem;
        opacity: 0.07;
        pointer-events: none;
        line-height: 1;
        color: var(--text-primary);
    }

    .income-card.overview-card::after    { content: '\f062'; }
    .balance-card.overview-card::after   { content: '\f555'; }
    .available-card.overview-card::after { content: '\f055'; }
    .days-card.overview-card::after      { content: '\f073'; }

    [data-theme="light"] .income-card.overview-card::after    { color: #28a745; opacity: 0.2; }
    [data-theme="light"] .balance-card.overview-card::after   { color: #007bff; opacity: 0.2; }
    [data-theme="light"] .available-card.overview-card::after { color: #6f42c1; opacity: 0.2; }
    [data-theme="light"] .days-card.overview-card::after      { color: #fd7e14; opacity: 0.2; }
}

/* Days remaining circular ring */
.days-ring-container {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.days-ring {
    width: 60px;
    height: 60px;
    transform: rotate(-90deg);
    flex-shrink: 0;
}

.days-ring-bg {
    fill: none;
    stroke: var(--border-color);
    stroke-width: 3;
}

.days-ring-fg {
    fill: none;
    stroke: #8B4513;
    stroke-width: 3;
    stroke-linecap: round;
    stroke-dasharray: 113.1;
    stroke-dashoffset: 113.1;
    transition: stroke-dashoffset 0.6s ease, stroke 0.4s ease;
}

.days-ring-value {
    position: absolute;
    font-size: 1rem !important;
    font-weight: 700;
    line-height: 1;
}

.card-title h3 {
    color: var(--text-primary);
    font-size: 1rem;
    font-weight: 600;
    margin: 0;
    letter-spacing: -0.25px;
}

.card-title p {
    color: var(--text-secondary);
    font-size: 0.8rem;
    margin: 0.25rem 0 0 0;
    font-weight: 400;
}

.card-value {
    text-align: right;
}

.value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1;
    letter-spacing: -0.5px;
}

/* Right Content Area */
.right-content {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* Category Health Card */
.category-health-card {
    background: var(--card-bg);
    border-radius: 0;
    padding: 1rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.6);
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    flex: 1;
}

.category-health-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-color);
}

.category-health-header h3 {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-primary);
    margin: 0 0 0.2rem;
}

.category-health-header p {
    font-size: 0.72rem;
    color: var(--text-secondary);
    margin: 0;
}

.health-summary-stat {
    text-align: right;
    flex-shrink: 0;
}

.health-summary-label {
    display: block;
    font-size: 0.62rem;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    color: var(--text-secondary);
    margin-bottom: 0.15rem;
}

.health-summary-value {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-primary);
}

.category-health-list {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    flex: 1;
    overflow-y: auto;
    padding-right: 0.25rem;
}

.health-loading {
    text-align: center;
    padding: 2rem;
    color: var(--text-secondary);
    font-size: 1.2rem;
}

.health-empty {
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.85rem;
    padding: 1.5rem 0;
    margin: 0;
}

.health-item {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.health-item-top {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
}

.health-item-name {
    font-size: 0.72rem;
    font-weight: 400;
    color: var(--text-primary);
}

.health-item-pct {
    font-size: 0.68rem;
    font-weight: 400;
    color: var(--text-secondary);
}

.health-item--ok .health-item-pct    { color: #28a745; }
.health-item--warning .health-item-pct { color: #fd7e14; }
.health-item--over .health-item-pct  { color: #dc3545; }

.health-item--clickable {
    cursor: pointer;
    transition: background 0.2s ease;
}
.health-item--clickable:hover {
    background: rgba(139, 69, 19, 0.06);
}

.overview-card--nav {
    cursor: pointer;
}
.overview-card--nav:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.7);
}

@keyframes categoryPulse {
    0%   { box-shadow: 0 0 0 0 rgba(139, 69, 19, 0.5); }
    50%  { box-shadow: 0 0 0 6px rgba(139, 69, 19, 0.15); }
    100% { box-shadow: 0 0 0 0 rgba(139, 69, 19, 0); }
}
.category-highlight {
    animation: categoryPulse 1.5s ease forwards;
}

.health-item-amounts {
    font-size: 0.62rem;
    color: var(--text-secondary);
    margin-top: 0.2rem;
}

.health-bar-track {
    height: 5px;
    background: var(--border-color);
    border-radius: 3px;
    overflow: hidden;
}

.health-bar-fill {
    height: 100%;
    border-radius: 3px;
    background: #28a745;
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.health-item--warning .health-bar-fill { background: #fd7e14; }
.health-item--over    .health-bar-fill { background: #dc3545; }

.health-item-bottom {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
}

.health-item-amounts {
    font-size: 0.67rem;
    color: var(--text-secondary);
}

.health-item-remaining {
    font-size: 0.67rem;
    font-weight: 600;
    color: #28a745;
}

.health-item-remaining.over { color: #dc3545; }

/* Legacy chart section kept for potential reuse */
.chart-section { display: none; }

.chart-card {
    width: 100%;
}

.chart-header {
    text-align: center;
    margin-bottom: 1rem;
}

.chart-header h3 {
    color: var(--text-primary);
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0 0 0.5rem 0;
}

.chart-header p {
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin: 0;
}

.chart-container {
    position: relative;
    width: 100%;
    height: 200px;
    margin-bottom: 0.75rem;
    display: flex;
    justify-content: center;
    align-items: center;
}

.chart-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
    margin-top: 0.75rem;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.2rem 0.4rem;
    background: var(--main-bg);
    border-radius: 4px;
    font-size: 0.75rem;
    color: var(--text-primary);
}

.legend-color {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.legend-label {
    font-weight: 500;
    color: var(--text-primary);
}

.legend-value {
    color: var(--text-secondary);
    font-weight: 600;
}

.progress-header {
    text-align: center;
    margin-bottom: 1.5rem;
}

.progress-header h3 {
    color: var(--text-primary);
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0;
}

.score-card {
    text-align: center;
    padding: 1rem 0;
}

.score-percentage {
    margin-bottom: 1rem;
}

.score-percentage span {
    display: inline-block;
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--sidebar-text);
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    background: linear-gradient(135deg, #8B4513 0%, #A0522D 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.score-details {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
}

.score-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.score-amount {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
}

/* Color coding for different spending levels */
.score-percentage.low-spending span {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.score-percentage.moderate-spending span {
    background: linear-gradient(135deg, #ffc107 0%, #fd7e14 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.score-percentage.high-spending span {
    background: linear-gradient(135deg, #dc3545 0%, #e83e8c 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}


/* Actions Section */
.actions-section {
    background: var(--card-bg);
    border-radius: 0;
    padding: 0.75rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.6);
    flex: 1;
    display: flex;
    flex-direction: column;
}

.actions-section .recent-transactions-header {
    margin-top: 1rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border-color);
}

.actions-header {
    margin-bottom: 0;
}

.actions-header h3 {
    color: #2c3e50;
    font-size: 1rem;
    font-weight: 600;
    margin: 0 0 0.25rem 0;
}

.actions-header p {
    color: #6c757d;
    margin: 0;
    font-size: 0.8rem;
}

.actions-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.5rem;
}

.action-primary-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
    width: 100%;
    padding: 0.65rem 1rem;
    background: linear-gradient(135deg, #8B4513 0%, #D2691E 100%);
    color: #ffffff;
    border: none;
    border-radius: 10px;
    font-size: 0.82rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
    box-shadow: 0 4px 14px rgba(139, 69, 19, 0.3);
}

.action-primary-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(139, 69, 19, 0.45);
}

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

.action-secondary-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
    width: 100%;
    padding: 0.5rem 1rem;
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    font-size: 0.78rem;
    font-weight: 400;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
    text-decoration: none;
}

.action-secondary-btn:hover {
    background: var(--sidebar-hover);
    color: var(--text-primary);
    border-color: #8B4513;
}

.action-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
    text-decoration: none;
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    transition: all 0.3s ease;
    background: var(--main-bg);
}

.action-item:hover {
    background: rgba(139, 69, 19, 0.05);
    border-color: rgba(139, 69, 19, 0.3);
    transform: translateX(2px);
    color: var(--sidebar-text);
}

.action-icon {
    width: 24px;
    height: 24px;
    border-radius: 4px;
    background: linear-gradient(135deg, #8B4513 0%, #D2691E 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 0.75rem;
    flex-shrink: 0;
}

.action-content {
    flex: 1;
    min-width: 0;
}

.action-content h4 {
    margin: 0 0 0.125rem 0;
    font-size: 0.8rem;
    font-weight: 600;
    line-height: 1.2;
    color: var(--text-primary);
}

.action-content p {
    margin: 0;
    font-size: 0.7rem;
    color: var(--text-secondary);
    line-height: 1.2;
}

.action-arrow {
    color: var(--sidebar-text);
    font-size: 0.8rem;
    transition: transform 0.3s ease;
    flex-shrink: 0;
}

.action-item:hover .action-arrow {
    transform: translateX(2px);
}

/* Alert Cards */
.no-budget-card,
.budget-alert,
.overspending-alert {
    background: var(--card-bg);
    border-radius: 8px;
    padding: 0.65rem 1rem;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
    margin: 0.75rem 0;
    text-align: center;
}

.no-budget-content {
    max-width: 500px;
    margin: 0 auto;
}

.no-budget-icon {
    font-size: 4rem;
    color: var(--sidebar-text);
    margin-bottom: 1rem;
}

.no-budget-message h3 {
    color: #2c3e50;
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.no-budget-message p {
    color: #6c757d;
    margin-bottom: 2rem;
    line-height: 1.6;
}

.no-budget-actions {
    margin-top: 1.5rem;
}

.alert-content {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    text-align: left;
}

.alert-icon {
    font-size: 1rem;
    color: #ffc107;
    flex-shrink: 0;
}

.alert-message {
    flex: 1;
}

.alert-message h3 {
    color: #2c3e50;
    font-size: 0.82rem;
    font-weight: 600;
    margin: 0 0 0.15rem 0;
}

.alert-message p {
    color: #6c757d;
    font-size: 0.78rem;
    margin: 0;
}

.alert-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.5rem;
}
.alert-actions .btn {
    padding: 0.25rem 0.65rem;
    font-size: 0.75rem;
}

.overspending-details {
    margin-top: 0.4rem;
    text-align: left;
}

.overspent-item {
    background: rgba(220, 53, 69, 0.05);
    border: 1px solid rgba(220, 53, 69, 0.2);
    border-radius: 5px;
    padding: 0.35rem 0.6rem;
    margin-bottom: 0.3rem;
}

.overspent-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.2rem;
}

.category-name {
    font-weight: 600;
    font-size: 0.78rem;
    color: #2c3e50;
}

.overspent-amount {
    color: #dc3545;
    font-weight: 600;
    font-size: 0.78rem;
}

.overspent-stats {
    display: flex;
    gap: 0.75rem;
    font-size: 0.75rem;
    color: #6c757d;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .sidebar {
        left: -200px;
    }

    .sidebar.active {
        left: 0;
    }

    .sidebar.pinned { /* Sidebar is always unpinned on mobile */
        left: -200px;
    }
    
    .main-wrapper {
        margin-left: 0 !important;
        margin-top: 0;
        padding-top: 0; /* Bottom nav replaces hamburger — no top offset needed */
    }
    
    .banner-content {
        padding: 0 1rem;
    }
    
    .container {
        padding: 0 1rem;
        max-width: 100%;
        overflow-x: hidden;
    }
    
    /* Ensure all content fits within viewport */
    * {
        box-sizing: border-box;
    }
    
    /* Prevent horizontal overflow */
    body {
        overflow-x: visible;
        overflow-y: visible;
    }
    
    .main-wrapper {
        max-width: 100vw;
        overflow-x: visible;
        overflow-y: visible;
    }
    
    .main-content {
        max-width: 100%;
        overflow-x: visible;
        overflow-y: visible;
    }
    
    /* Shrink dashboard cards to fit */
    .overview-cards {
        max-width: 100%;
        overflow-x: visible;
        overflow-y: visible;
    }
    
    .overview-card.compact {
        min-width: 0;
        flex-shrink: 1;
    }
    
    /* Ensure text doesn't overflow */
    .overview-card.compact .card-title h3 {
        word-wrap: break-word;
        overflow-wrap: break-word;
    }
    
    .overview-card.compact .card-value .value {
        word-wrap: break-word;
        overflow-wrap: break-word;
    }
    
    
    .banner-logout-btn span {
        display: none; /* Hide text on mobile, keep icon */
    }
    
    .banner-logout-btn {
        padding: 0.25rem;
        min-width: 30px;
        justify-content: center;
    }
    
    
    .theme-toggle-btn {
        padding: 0.25rem;
        min-width: 40px;
        justify-content: center;
    }
    
    .mobile-menu-btn {
        display: block; /* Show mobile menu button */
    }

    .nav-menu {
        position: fixed;
        top: 70px;
        left: -100%;
        width: 100%;
        height: calc(100vh - 70px);
        background: white;
        flex-direction: column;
        padding: 2rem;
        transition: left 0.3s ease;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    }

    .nav-menu.active {
        left: 0;
    }

    .nav-link {
        width: 100%;
        justify-content: flex-start;
        padding: 1rem;
        border-radius: 8px;
        margin-bottom: 0.5rem;
    }

    .nav-toggle {
        display: flex;
    }

    .nav-toggle.active .bar:nth-child(1) {
        transform: rotate(45deg) translate(5px, 5px);
    }

    .nav-toggle.active .bar:nth-child(2) {
        opacity: 0;
    }

    .nav-toggle.active .bar:nth-child(3) {
        transform: rotate(-45deg) translate(7px, -6px);
    }

    .dashboard-grid {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

    .header-content {
        flex-direction: column;
        align-items: stretch;
        gap: 0.5rem;
    }

    .page-header h1 {
        font-size: 1.5rem;
    }

    .overview-cards {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

    .overview-card {
        padding: 0.75rem;
    }

    .overview-card.compact {
        padding: 0.75rem;
    }

    .value {
        font-size: 1.5rem;
    }

    .progress-details {
        flex-direction: column;
        gap: 0.25rem;
    }

    .actions-grid {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }

    .action-item {
        padding: 0.4rem;
        font-size: 0.85rem; /* Slightly smaller text */
    }

    .alert-content {
        flex-direction: column;
        text-align: center;
    }

    .alert-actions {
        flex-direction: column;
    }

    .overspent-info {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .overspent-stats {
        flex-direction: column;
        gap: 0.25rem;
    }
}

/* ========================================
   BUTTONS & FORM ELEMENTS
   ======================================== */

/* Button Styles */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    line-height: 1.2;
    box-sizing: border-box;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    text-transform: capitalize !important;
    overflow: hidden;
}

/* Ensure all button variants use capitalize */
button,
.btn,
.btn-primary,
.btn-secondary,
.btn-success,
.btn-danger,
.btn-outline,
.btn-modern,
.btn-full {
    text-transform: capitalize !important;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
    font-weight: 400 !important;
}

/* Override for logout button to be uppercase */
.banner-logout-btn {
    text-transform: uppercase !important;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

.btn-primary {
    background: linear-gradient(135deg, #8B4513 0%, #D2691E 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(139, 69, 19, 0.3);
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(139, 69, 19, 0.4);
}

.btn-secondary {
    background: #6c757d;
    color: white;
    box-shadow: 0 4px 15px rgba(108, 117, 125, 0.3);
}

.btn-secondary:hover:not(:disabled) {
    background: #5a6268;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(108, 117, 125, 0.4);
}

.btn-success {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.3);
}

.btn-success:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(40, 167, 69, 0.4);
}

.btn-danger {
    background: linear-gradient(135deg, #dc3545 0%, #e83e8c 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(220, 53, 69, 0.3);
}

.btn-danger:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(220, 53, 69, 0.4);
}

.btn-outline {
    background: transparent;
    border: 2px solid #8B4513;
    color: var(--sidebar-text);
}

.btn-outline:hover:not(:disabled) {
    background: #8B4513;
    color: white;
    transform: translateY(-2px);
}

/* Form Elements */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-primary);
    font-size: 0.9rem;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: var(--card-bg);
    color: var(--text-primary);
    box-sizing: border-box;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #8B4513;
    box-shadow: 0 0 0 3px rgba(139, 69, 19, 0.1);
    transform: translateY(-1px);
    background: var(--card-bg) !important;
    color: var(--text-primary) !important;
}

.form-group input:hover,
.form-group select:hover,
.form-group textarea:hover {
    border-color: #8B4513;
}

.form-group input.error,
.form-group select.error,
.form-group textarea.error {
    border-color: #e74c3c;
    box-shadow: 0 0 0 3px rgba(231, 76, 60, 0.1);
}

.form-group input.success,
.form-group select.success,
.form-group textarea.success {
    border-color: #27ae60;
    box-shadow: 0 0 0 3px rgba(39, 174, 96, 0.1);
}

.form-help {
    font-size: 10px;
    color: #6c757d;
    margin-top: 0.25rem;
}

.error-message {
    color: #e74c3c;
    font-size: 0.8rem;
    margin-top: 0.25rem;
    display: none;
}

.success-message {
    color: #27ae60;
    font-size: 0.8rem;
    margin-top: 0.25rem;
    display: none;
}

/* Input Groups */
.input-group {
    position: relative;
    display: flex;
    align-items: center;
}

.input-prefix {
    position: absolute;
    left: 1rem;
    color: var(--text-secondary);
    font-weight: 500;
    z-index: 1;
    pointer-events: none;
}

.input-group input {
    padding-left: 2.5rem;
}

/* Form Rows */
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.form-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 2rem;
}

/* Modal Form Styles */
.modal-form {
    max-width: 100%;
}

.modal-form .form-group {
    margin-bottom: 1rem;
}

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

.modal-form .form-actions {
    margin-top: 1.5rem;
    justify-content: flex-end;
}

/* Record Transaction modal — compact overrides */
#addExpenseModal .modal-content {
    border-radius: 8px;
}

#addExpenseModal .modal-header {
    padding: 0.65rem 1.25rem;
    border-radius: 8px 8px 0 0;
}

#addExpenseModal .modal-header h2 {
    font-size: 0.95rem;
    font-weight: 600;
}

#addExpenseModal .modal-body {
    padding: 0.9rem 1.25rem 0.75rem;
}

#addExpenseModal .modal-form .form-group {
    margin-bottom: 0.5rem;
}

#addExpenseModal .modal-form .form-group label {
    font-size: 0.72rem;
    margin-bottom: 0.2rem;
    font-weight: 500;
}

#addExpenseModal .modal-form input,
#addExpenseModal .modal-form select,
#addExpenseModal .modal-form textarea {
    padding: 0.4rem 0.75rem;
    font-size: 0.82rem;
    border-radius: 6px;
}

#addExpenseModal .modal-form .input-prefix {
    font-size: 0.82rem;
    left: 0.75rem;
}

#addExpenseModal .modal-form .input-group input {
    padding-left: 1.75rem;
}

#addExpenseModal .modal-form .form-actions {
    margin-top: 0.75rem;
    gap: 0.5rem;
}

#addExpenseModal .modal-form .btn {
    padding: 0.45rem 1rem;
    font-size: 0.82rem;
}

/* Footer */
.footer {
    background: var(--footer-bg);
    color: var(--footer-text);
    text-align: center;
    padding: 0.85rem 1rem;
    margin-top: 0;
    transition: background-color 0.3s ease, color 0.3s ease, margin-left 0.3s ease;
    margin-left: 200px; /* Default margin for visible sidebar */
    border-top: 1px solid var(--border-color);
}

.footer-content p {
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.72rem;
    letter-spacing: 0.02em;
}

.footer-links {
    margin: 1rem 0;
    text-align: center;
}

.footer-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--footer-text);
    text-decoration: none;
    font-weight: 500;
    padding: 0.5rem 1rem;
    border: 1px solid var(--footer-link-border);
    border-radius: 6px;
    background: var(--footer-link-bg);
    transition: all 0.3s ease;
    margin: 0 0.5rem;
}

.footer-link:hover {
    background: var(--footer-link-hover-bg);
    color: var(--footer-link-hover-text);
    text-decoration: none;
}

.footer-subtitle {
    font-style: italic;
    margin-bottom: 1.5rem;
    color: rgba(255, 255, 255, 0.9);
    font-size: 1.1rem;
}

.footer-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.footer-logo {
    height: 24px;
    width: auto;
    max-width: 24px;
    object-fit: contain;
}

.footer-text {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--footer-text);
}

.verse {
    font-style: italic;
    color: var(--footer-text-muted);
    font-size: 0.9rem;
}

.footer-info {
    margin-top: 1rem;
}

.footer-info p {
    color: var(--footer-text);
    margin: 0.25rem 0;
}

/* Footer responsive to sidebar state - handled by JavaScript */

/* Landing page footer should span full width */
.landing-page .footer {
    margin-left: 0;
    width: 100%;
}

/* Public pages footer should span full width */
.public-page .footer {
    margin-left: 0;
    width: 100%;
}

/* Dark Mode Card Enhancements */
[data-theme="dark"] .overview-card {
    background: #1e1e1e;
    border: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.6);
}

[data-theme="dark"] .page-header {
    background: #1e1e1e;
    border: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.6);
}

@media (max-width: 768px) {
    .page-header {
        padding: 1rem 1.25rem !important;
        min-height: unset !important;
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 0.75rem !important;
    }
    .page-header h1 {
        font-size: 1.1rem !important;
        white-space: normal;
        overflow: visible;
    }
    .page-header p,
    .page-subtitle {
        font-size: 0.72rem !important;
        margin-top: 0.25rem !important;
        white-space: normal;
        overflow: visible;
    }
    .page-header .btn {
        width: 100%;
        justify-content: center;
    }
}

[data-theme="dark"] .actions-section {
    background: #1e1e1e;
    border: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.6);
}

[data-theme="dark"] .transactions-container .card {
    background: #1e1e1e;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

[data-theme="dark"] .create-budget-card {
    background: #1e1e1e;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

[data-theme="dark"] .no-budget-card,
[data-theme="dark"] .budget-alert,
[data-theme="dark"] .overspending-alert {
    background: #1e1e1e;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

[data-theme="dark"] .budgets-table {
    background: #1e1e1e;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

[data-theme="dark"] .accounts-table-container {
    background: #1e1e1e;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

[data-theme="dark"] .no-accounts-card {
    background: #1e1e1e;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

[data-theme="dark"] .breakdown-container .budget-stat {
    background: #1e1e1e;
    border: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.6);
}

[data-theme="dark"] .breakdown-container .category-card {
    background: #1e1e1e;
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 4px 20px rgba(0,0,0,0.5);
}

[data-theme="dark"] .income-sources-section,
[data-theme="dark"] .balance-form-section {
    background: #1e1e1e;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

[data-theme="dark"] .category-health-card {
    background: #1e1e1e;
    border: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.6);
}

[data-theme="dark"] .health-bar-track {
    background: rgba(255, 255, 255, 0.08);
}

/* Dark Mode Quick Actions Title */
[data-theme="dark"] .actions-header h3 {
    color: #ffffff;
}

[data-theme="dark"] .actions-header p {
    color: #b0b0b0;
}

/* Notifications */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    color: white;
    font-weight: 500;
    z-index: 10000;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    transform: translateX(400px);
    transition: transform 0.3s ease;
    max-width: 300px;
    word-wrap: break-word;
}

.notification.show {
    transform: translateX(0);
}

.notification.success {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
}

.notification.error {
    background: linear-gradient(135deg, #dc3545 0%, #e83e8c 100%);
}

.notification.warning {
    background: linear-gradient(135deg, #ffc107 0%, #fd7e14 100%);
    color: #2c3e50;
}

.notification.info {
    background: linear-gradient(135deg, #17a2b8 0%, #6f42c1 100%);
}

/* Password strength indicators */
.strength-weak { 
    background: #dc3545; 
    width: 25%; 
}

.strength-fair { 
    background: #ffc107; 
    width: 50%; 
}

.strength-good { 
    background: #17a2b8; 
    width: 75%; 
}

.strength-strong { 
    background: #28a745; 
    width: 100%; 
}

/* Mobile Form Responsive */
@media (max-width: 768px) {
    .form-row {
        grid-template-columns: 1fr;
        gap: 0;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
        justify-content: center;
    }
    
    .modal-form .form-row {
        grid-template-columns: 1fr;
        gap: 0;
    }
    
    .modal-form .form-actions {
        flex-direction: column;
    }
}


/* ========================================
   INCOME PAGE STYLES
   ======================================== */

/* Income Page Layout */
.income-form-container {
    margin: 0.5rem 0;
}

.income-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 0.25rem;
}

/* Income Sources Section */
.income-sources-section {
    background: var(--card-bg);
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.6);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--border-color);
}

.section-header h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.section-header .btn {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
}

/* Income Sources List */
.income-sources-list {
    max-height: 300px;
    overflow-y: auto;
    padding-right: 0.5rem;
}

.income-sources-list::-webkit-scrollbar {
    width: 4px;
}

.income-sources-list::-webkit-scrollbar-track {
    background: var(--main-bg);
    border-radius: 2px;
}

.income-sources-list::-webkit-scrollbar-thumb {
    background: rgba(139, 69, 19, 0.3);
    border-radius: 2px;
}

.income-sources-list::-webkit-scrollbar-thumb:hover {
    background: rgba(139, 69, 19, 0.5);
}

.income-source-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    margin-bottom: 0.75rem;
    background: var(--main-bg);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.income-source-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: linear-gradient(180deg, #28a745 0%, #20c997 100%);
}

.income-source-item:hover {
    background: var(--card-bg);
    border-color: var(--border-color);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.6);
}

.source-info {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
}

.source-name {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.9rem;
    margin-bottom: 0.25rem;
}

.source-amount {
    font-weight: 700;
    color: #28a745;
    font-size: 1rem;
}

.source-actions {
    display: flex;
    gap: 0.5rem;
    margin-left: 0.75rem;
}

.source-actions .btn {
    padding: 0.375rem 0.5rem;
    font-size: 0.75rem;
    min-width: auto;
    border-radius: 4px;
}

.no-income-sources {
    text-align: center;
    color: #6c757d;
    font-style: italic;
    margin: 2rem 0;
    padding: 2rem;
    background: rgba(139, 69, 19, 0.05);
    border-radius: 8px;
    border: 2px dashed rgba(139, 69, 19, 0.2);
}

.no-income-sources i {
    font-size: 2rem;
    color: rgba(139, 69, 19, 0.3);
    margin-bottom: 0.5rem;
    display: block;
}

/* Balance Form Section */
.balance-form-section {
    background: var(--card-bg);
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.6);
}

.balance-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.balance-form .form-group {
    margin-bottom: 0;
}

.balance-display {
    background: linear-gradient(135deg, rgba(40, 167, 69, 0.1) 0%, rgba(32, 201, 151, 0.1) 100%);
    border: 2px solid rgba(40, 167, 69, 0.2);
    border-radius: 8px;
    padding: 1rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.balance-display::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #28a745 0%, #20c997 100%);
}

.balance-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.balance-amount {
    font-size: 1.8rem;
    font-weight: 700;
    color: #28a745;
    line-height: 1;
}

.balance-subtitle {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
}

/* Summary Cards */
.income-summary {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.summary-card {
    background: var(--card-bg);
    border-radius: 8px;
    padding: 1rem;
    text-align: center;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.summary-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #8B4513 0%, #D2691E 100%);
}

.summary-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.summary-card h4 {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin: 0 0 0.5rem 0;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.summary-card .amount {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1;
}

.summary-card.income .amount {
    color: #28a745;
}

.summary-card.balance .amount {
    color: #007bff;
}

.summary-card.forward .amount {
    color: var(--sidebar-text);
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .income-layout {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .income-summary {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
    
    .income-sources-list {
        max-height: 250px;
    }
    
    .income-source-item {
        padding: 0.5rem;
        flex-direction: column;
        align-items: stretch;
        gap: 0.5rem;
    }
    
    .source-info {
        text-align: center;
    }
    
    .source-actions {
        justify-content: center;
        margin-left: 0;
    }
    
    .balance-amount {
        font-size: 1.5rem;
    }
    
    .summary-card .amount {
        font-size: 1.25rem;
    }
}



/* ========================================
   INCOME PAGE STYLES - COMPACT VERSION
   ======================================== */

/* Income Summary Cards - Compact */
.income-summary {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.summary-card {
    background: var(--card-bg);
    border-radius: 8px;
    padding: 1.25rem;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
    text-align: center;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.summary-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #8B4513 0%, #D2691E 100%);
}

.summary-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.summary-card h4 {
    color: #6c757d;
    font-size: 0.8rem;
    margin-bottom: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.summary-card .amount {
    font-size: 1.8rem;
    font-weight: 700;
    line-height: 1;
}

.summary-card.income .amount {
    color: #28a745;
}

.summary-card.balance .amount {
    color: #007bff;
}

.summary-card.forward .amount {
    color: var(--sidebar-text);
}

/* Compact Income Layout */
.income-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 1rem;
}

.income-sources-section,
.balance-form-section {
    background: var(--card-bg);
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.6);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--border-color);
}

.section-header h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.section-header .btn {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
}

/* Compact Income Sources List */
.income-sources-list {
    max-height: 200px;
    overflow-y: auto;
    padding-right: 0.5rem;
}

.income-sources-list::-webkit-scrollbar {
    width: 4px;
}

.income-sources-list::-webkit-scrollbar-track {
    background: var(--main-bg);
    border-radius: 2px;
}

.income-sources-list::-webkit-scrollbar-thumb {
    background: rgba(139, 69, 19, 0.3);
    border-radius: 2px;
}

.income-sources-list::-webkit-scrollbar-thumb:hover {
    background: rgba(139, 69, 19, 0.5);
}

.income-source-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    margin-bottom: 0.75rem;
    background: var(--main-bg);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.income-source-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: linear-gradient(180deg, #28a745 0%, #20c997 100%);
}

.income-source-item:hover {
    background: var(--card-bg);
    border-color: var(--border-color);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.6);
}

.source-info {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
}

.source-name {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.9rem;
    margin-bottom: 0.25rem;
}

.source-amount {
    font-weight: 700;
    color: #28a745;
    font-size: 1rem;
}

.source-actions {
    display: flex;
    gap: 0.5rem;
    margin-left: 0.75rem;
}

.source-actions .btn {
    padding: 0.375rem 0.5rem;
    font-size: 0.75rem;
    min-width: auto;
    border-radius: 4px;
}

.no-income-sources {
    text-align: center;
    color: #6c757d;
    font-style: italic;
    margin: 1.5rem 0;
    padding: 1.5rem;
    background: rgba(139, 69, 19, 0.05);
    border-radius: 8px;
    border: 2px dashed rgba(139, 69, 19, 0.2);
}

.no-income-sources i {
    font-size: 1.5rem;
    color: rgba(139, 69, 19, 0.3);
    margin-bottom: 0.5rem;
    display: block;
}

/* Compact Balance Form */
.balance-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.balance-form .form-group {
    margin-bottom: 0;
}

.balance-display {
    background: linear-gradient(135deg, rgba(40, 167, 69, 0.1) 0%, rgba(32, 201, 151, 0.1) 100%);
    border: 2px solid rgba(40, 167, 69, 0.2);
    border-radius: 8px;
    padding: 1rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.balance-display::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #28a745 0%, #20c997 100%);
}

.balance-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.balance-amount {
    font-size: 1.5rem;
    font-weight: 700;
    color: #28a745;
    line-height: 1;
}

.balance-subtitle {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
}

/* Mobile Responsive - Compact */
@media (max-width: 768px) {
    .income-layout {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .income-summary {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
    
    .income-sources-list {
        max-height: 150px;
    }
    
    .income-source-item {
        padding: 0.5rem;
        flex-direction: column;
        align-items: stretch;
        gap: 0.5rem;
    }
    
    .source-info {
        text-align: center;
    }
    
    .source-actions {
        justify-content: center;
        margin-left: 0;
    }
    
    .balance-amount {
        font-size: 1.25rem;
    }
    
    .summary-card .amount {
        font-size: 1.5rem;
    }
}



/* ========================================
   INCOME PAGE STYLES - COMPACT VERSION
   ======================================== */

/* Income Layout - Two Column */
.income-layout {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 1.5rem !important;
    margin-bottom: 1rem !important;
    width: 100% !important;
}

.income-sources-section,
.balance-form-section {
    background: var(--card-bg);
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.6);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--border-color);
}

.section-header h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.section-header .btn {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
}

/* Income Sources List */
.income-sources-list {
    max-height: 300px;
    overflow-y: auto;
    padding-right: 0.5rem;
}

.income-sources-list::-webkit-scrollbar {
    width: 4px;
}

.income-sources-list::-webkit-scrollbar-track {
    background: var(--main-bg);
    border-radius: 2px;
}

.income-sources-list::-webkit-scrollbar-thumb {
    background: rgba(139, 69, 19, 0.3);
    border-radius: 2px;
}

.income-sources-list::-webkit-scrollbar-thumb:hover {
    background: rgba(139, 69, 19, 0.5);
}

.income-source-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    margin-bottom: 0.75rem;
    background: var(--main-bg);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.income-source-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: linear-gradient(180deg, #28a745 0%, #20c997 100%);
}

.income-source-item:hover {
    background: var(--card-bg);
    border-color: var(--border-color);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.6);
}

.source-info {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
}

.source-name {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.9rem;
    margin-bottom: 0.25rem;
}

.source-amount {
    font-weight: 700;
    color: #28a745;
    font-size: 1rem;
}

.source-actions {
    display: flex;
    gap: 0.5rem;
    margin-left: 0.75rem;
}

.source-actions .btn {
    padding: 0.375rem 0.5rem;
    font-size: 0.75rem;
    min-width: auto;
    border-radius: 4px;
}

.no-income-sources {
    text-align: center;
    color: #6c757d;
    font-style: italic;
    margin: 1.5rem 0;
    padding: 1.5rem;
    background: rgba(139, 69, 19, 0.05);
    border-radius: 8px;
    border: 2px dashed rgba(139, 69, 19, 0.2);
}

.no-income-sources i {
    font-size: 1.5rem;
    color: rgba(139, 69, 19, 0.3);
    margin-bottom: 0.5rem;
    display: block;
}

/* Balance Form */
.balance-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.balance-form .form-group {
    margin-bottom: 0;
}

.balance-display {
    background: linear-gradient(135deg, rgba(40, 167, 69, 0.1) 0%, rgba(32, 201, 151, 0.1) 100%);
    border: 2px solid rgba(40, 167, 69, 0.2);
    border-radius: 8px;
    padding: 1rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.balance-display::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #28a745 0%, #20c997 100%);
}

.balance-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.balance-amount {
    font-size: 1.5rem;
    font-weight: 700;
    color: #28a745;
    line-height: 1;
}

.balance-subtitle {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .income-layout {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .income-sources-list {
        max-height: 200px;
    }
    
    .income-source-item {
        padding: 0.5rem;
        flex-direction: column;
        align-items: stretch;
        gap: 0.5rem;
    }
    
    .source-info {
        text-align: center;
    }
    
    .source-actions {
        justify-content: center;
        margin-left: 0;
    }
    
    .balance-amount {
        font-size: 1.25rem;
    }
}

.income-sources-section,
.balance-form-section {
    background: var(--card-bg);
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.6);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--border-color);
}

.section-header h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.section-header .btn {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
}

/* Compact Income Sources List */
.income-sources-list {
    max-height: 200px;
    overflow-y: auto;
    padding-right: 0.5rem;
}

.income-sources-list::-webkit-scrollbar {
    width: 4px;
}

.income-sources-list::-webkit-scrollbar-track {
    background: var(--main-bg);
    border-radius: 2px;
}

.income-sources-list::-webkit-scrollbar-thumb {
    background: rgba(139, 69, 19, 0.3);
    border-radius: 2px;
}

.income-sources-list::-webkit-scrollbar-thumb:hover {
    background: rgba(139, 69, 19, 0.5);
}

.income-source-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    margin-bottom: 0.75rem;
    background: var(--main-bg);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.income-source-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: linear-gradient(180deg, #28a745 0%, #20c997 100%);
}

.income-source-item:hover {
    background: var(--card-bg);
    border-color: var(--border-color);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.6);
}

.source-info {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
}

.source-name {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.9rem;
    margin-bottom: 0.25rem;
}

.source-amount {
    font-weight: 700;
    color: #28a745;
    font-size: 1rem;
}

.source-actions {
    display: flex;
    gap: 0.5rem;
    margin-left: 0.75rem;
}

.source-actions .btn {
    padding: 0.375rem 0.5rem;
    font-size: 0.75rem;
    min-width: auto;
    border-radius: 4px;
}

.no-income-sources {
    text-align: center;
    color: #6c757d;
    font-style: italic;
    margin: 1.5rem 0;
    padding: 1.5rem;
    background: rgba(139, 69, 19, 0.05);
    border-radius: 8px;
    border: 2px dashed rgba(139, 69, 19, 0.2);
}

.no-income-sources i {
    font-size: 1.5rem;
    color: rgba(139, 69, 19, 0.3);
    margin-bottom: 0.5rem;
    display: block;
}

/* Compact Balance Form */
.balance-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.balance-form .form-group {
    margin-bottom: 0;
}

.balance-display {
    background: linear-gradient(135deg, rgba(40, 167, 69, 0.1) 0%, rgba(32, 201, 151, 0.1) 100%);
    border: 2px solid rgba(40, 167, 69, 0.2);
    border-radius: 8px;
    padding: 1rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.balance-display::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #28a745 0%, #20c997 100%);
}

.balance-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.balance-amount {
    font-size: 1.5rem;
    font-weight: 700;
    color: #28a745;
    line-height: 1;
}

.balance-subtitle {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
}

/* Mobile Responsive - Compact */
@media (max-width: 768px) {
    .income-layout {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .income-summary {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
    
    .income-sources-list {
        max-height: 150px;
    }
    
    .income-source-item {
        padding: 0.5rem;
        flex-direction: column;
        align-items: stretch;
        gap: 0.5rem;
    }
    
    .source-info {
        text-align: center;
    }
    
    .source-actions {
        justify-content: center;
        margin-left: 0;
    }
    
    .balance-amount {
        font-size: 1.25rem;
    }
}


/* Income Layout - Two Column */
.income-layout {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 1rem !important;
    margin-bottom: 0.5rem !important;
    width: 100% !important;
}

.income-sources-section,
.balance-form-section {
    background: var(--card-bg) !important;
    border-radius: 0 !important;
    padding: 1rem !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.6) !important;
    width: 100% !important;
    min-height: auto !important;
}

.section-header {
    margin-bottom: 0.6rem !important;
    padding-bottom: 0.5rem !important;
    border-bottom: 1px solid var(--border-color) !important;
}

.section-header h3 {
    font-size: 0.85rem !important;
    font-weight: 600 !important;
}

.section-header .header-actions {
    display: flex;
    gap: 0.4rem;
}

.section-header .btn {
    padding: 0.3rem 0.65rem !important;
    font-size: 0.75rem !important;
}

.income-source-item {
    padding: 0.45rem 0.6rem !important;
    margin-bottom: 0.4rem !important;
    border-radius: 4px !important;
}

.source-name {
    font-size: 0.8rem !important;
    margin-bottom: 0.1rem !important;
}

.source-amount {
    font-size: 0.82rem !important;
}

.balance-form {
    gap: 0.65rem !important;
}

.balance-display {
    padding: 0.6rem !important;
    border-radius: 6px !important;
}

.balance-label {
    font-size: 0.7rem !important;
    margin-bottom: 0.2rem !important;
}

.balance-amount {
    font-size: 1.25rem !important;
}

.balance-subtitle {
    font-size: 0.65rem !important;
}

.no-income-sources {
    margin: 0.75rem 0 !important;
    padding: 1rem !important;
    font-size: 0.8rem;
}

.no-income-sources i {
    font-size: 1.2rem !important;
    margin-bottom: 0.3rem !important;
}

.income-layout .form-group label,
.balance-form-section .form-group label {
    font-size: 0.72rem !important;
    margin-bottom: 0.2rem !important;
}

.income-layout .form-group input,
.income-layout .form-group select,
.balance-form-section .form-group input,
.balance-form-section .form-group select {
    padding: 0.4rem 0.75rem !important;
    font-size: 0.82rem !important;
}

.income-layout .input-group input,
.balance-form-section .input-group input {
    padding-left: 1.75rem !important;
}

.balance-form .form-actions {
    margin-top: 0 !important;
    gap: 0.5rem !important;
}

.balance-form .form-actions .btn,
.income-sources-section .form-actions .btn {
    padding: 0.4rem 0.85rem !important;
    font-size: 0.78rem !important;
}

/* ========================================
   TRANSACTIONS PAGE STYLES
   ======================================== */

/* Transactions Container */
.transactions-container {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}


/* Add Expense Button */
.add-expense-btn {
    white-space: nowrap;
}

/* Transactions Filter Bar */
.transactions-filter-bar {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.75rem 1.25rem;
    border-bottom: 1px solid var(--border-color);
    flex-wrap: wrap;
}

.filter-search-wrap {
    position: relative;
    flex: 1;
    min-width: 180px;
}

.filter-search-icon {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
    font-size: 0.8rem;
    pointer-events: none;
}

.filter-search-input {
    width: 100%;
    padding: 0.5rem 0.75rem 0.5rem 2.1rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 0.875rem;
    background: var(--card-bg);
    color: var(--text-primary);
    outline: none;
    box-sizing: border-box;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.filter-search-input::placeholder {
    color: var(--text-secondary);
}

.filter-search-input:focus {
    border-color: var(--sidebar-active-border);
    box-shadow: 0 0 0 2px rgba(139, 69, 19, 0.1);
}

.filter-select {
    padding: 0.5rem 0.625rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 0.875rem;
    background: var(--card-bg);
    color: var(--text-primary);
    outline: none;
    min-width: 140px;
    transition: border-color 0.2s;
}

.filter-select:focus {
    border-color: var(--sidebar-active-border);
    box-shadow: 0 0 0 2px rgba(139, 69, 19, 0.1);
}

#unassignedFilterBtn.active {
    background: var(--sidebar-active-border);
    color: white;
    border-color: var(--sidebar-active-border);
}

.clear-filters-btn {
    background: #6b7280;
    color: white;
    border: none;
    padding: 0.5rem 0.75rem;
    border-radius: 4px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    white-space: nowrap;
    font-weight: 500;
}

.clear-filters-btn:hover {
    background: #4b5563;
    transform: translateY(-1px);
}

/* Transactions Table Card */
.transactions-container .card {
    background: var(--card-bg);
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.6);
    overflow: hidden;
}

.transactions-container .card-header {
    background: var(--main-bg);
    padding: 1.5rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.transactions-container .card-header h2 {
    margin: 0;
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--text-primary);
}

/* Table Container */
.table-container {
    overflow-x: auto;
    border-radius: 0 0 12px 12px;
}

/* Transactions Table */
.transactions-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8rem;
}

.transactions-table thead {
    background: linear-gradient(135deg, #8B4513 0%, #D2691E 100%);
    color: white;
}

.transactions-table th {
    padding: 0.75rem 0.5rem;
    text-align: left;
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: none;
}

.sortable-th {
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
}

.sortable-th:hover {
    opacity: 0.85;
}

.sort-icon {
    font-size: 0.65rem;
    opacity: 0.5;
    margin-left: 0.2rem;
}

.sortable-th.sort-active .sort-icon {
    opacity: 1;
}

.transactions-table tbody tr {
    border-bottom: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.transactions-table tbody tr:hover {
    background: var(--main-bg);
}

.transactions-table tbody tr:last-child {
    border-bottom: none;
}

.transactions-table td {
    padding: 0.75rem 0.5rem;
    vertical-align: middle;
    color: var(--text-primary);
}

.transactions-table .amount {
    font-weight: 700;
    font-family: 'Arial Narrow', Arial, sans-serif;
    color: #dc3545;
    text-align: right;
}

.transactions-table .comment-cell {
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    cursor: help;
    position: relative;
}


/* Action Buttons */
.action-buttons {
    display: flex;
    gap: 0.25rem;
    align-items: center;
}

.action-btn {
    background: none;
    border: 1px solid #e9ecef;
    color: #6c757d;
    padding: 0.375rem;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    font-size: 0.75rem;
}

.action-btn:hover {
    background: #f8f9fa;
    border-color: #8B4513;
    color: var(--sidebar-text);
}

.action-btn.edit:hover {
    background: rgba(0, 123, 255, 0.1);
    border-color: #007bff;
    color: #007bff;
}

.action-btn.delete:hover {
    background: rgba(220, 53, 69, 0.1);
    border-color: #dc3545;
    color: #dc3545;
}

/* No Data State */
.no-data {
    text-align: center;
    padding: 3rem 1rem;
    color: #6c757d;
    font-style: italic;
    background: #f8f9fa;
}

/* Comment Tooltip */
.comment-tooltip {
    position: absolute;
    background: #2c3e50;
    color: white;
    padding: 0.75rem 1rem;
    border-radius: 6px;
    font-size: 0.85rem;
    z-index: 1000;
    max-width: 300px;
    word-wrap: break-word;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    opacity: 0;
    transform: translateY(-5px);
    transition: all 0.3s ease;
}

.comment-tooltip.show {
    opacity: 1;
    transform: translateY(0);
}

.comment-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: #2c3e50;
}

/* ========================================
   TRANSACTIONS PAGE RESPONSIVE DESIGN
   ======================================== */

/* Mobile Styles */
@media (max-width: 768px) {
    .transactions-header {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
        padding: 1rem;
    }
    
    .header-left {
        justify-content: center;
    }
    
    .header-right {
        flex-direction: column;
        gap: 0.75rem;
        align-items: stretch;
    }
    
    .transactions-container .card-header {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
        padding: 1rem;
    }
    
    .transactions-container .card-header h2 {
        text-align: center;
    }
    
    .add-expense-btn {
        width: 100%;
        justify-content: center;
    }

    .transactions-container .card-header > div {
        width: 100%;
        justify-content: stretch;
    }

    .transactions-container .card-header > div .btn {
        flex: 1;
        justify-content: center;
        font-size: 0.78rem;
        white-space: nowrap;
        padding-left: 0.5rem;
        padding-right: 0.5rem;
    }
    
    .search-container {
        width: 100%;
    }
    
    .search-input {
        min-width: unset;
        flex: 1;
    }
    
    .filter-options {
        flex-wrap: wrap;
        justify-content: center;
        gap: 0.5rem;
        padding: 0.75rem;
    }
    
    .filter-select,
    .filter-date {
        min-width: 100px;
        flex: 1;
    }
    
    .clear-filters-btn {
        width: 100%;
        justify-content: center;
        margin-top: 0.5rem;
    }
    
    
    /* Transactions: card layout on mobile */
    .table-container { overflow-x: visible; }

    .transactions-table thead { display: none; }

    .transactions-table tbody {
        display: flex;
        flex-direction: column;
        gap: 0.5rem;
        padding: 0.5rem;
    }

    .transactions-table tbody tr {
        display: grid;
        grid-template-columns: 1fr auto;
        grid-template-areas:
            "date    amount"
            "merch   merch"
            "subcat  actions"
            "comment comment";
        gap: 0.2rem 0.75rem;
        padding: 0.75rem;
        border-radius: 8px;
        background: var(--card-bg);
        border: 1px solid var(--border-color) !important;
        border-bottom: 1px solid var(--border-color) !important;
        box-shadow: var(--shadow);
    }

    .transactions-table tbody tr:hover { background: var(--card-bg); }

    .transactions-table td { padding: 0; border: none; }

    /* Date */
    .transactions-table td:nth-child(1) {
        grid-area: date;
        font-size: 0.7rem;
        color: var(--text-secondary);
        align-self: center;
    }

    /* Merchant */
    .transactions-table td:nth-child(2) {
        grid-area: merch;
        font-weight: 600;
        font-size: 0.9rem;
        color: var(--text-primary);
    }

    /* Category — hidden, subcategory is sufficient */
    .transactions-table td:nth-child(3) { display: none; }

    /* Subcategory */
    .transactions-table td:nth-child(4) {
        grid-area: subcat;
        font-size: 0.72rem;
        color: var(--text-secondary);
        align-self: center;
    }

    /* Amount */
    .transactions-table td:nth-child(5) {
        grid-area: amount;
        font-size: 0.9rem;
        font-weight: 700;
        text-align: right;
        align-self: center;
    }

    /* Comment */
    .transactions-table td:nth-child(6) {
        grid-area: comment;
        font-size: 0.72rem;
        color: var(--text-secondary);
        font-style: italic;
        max-width: none;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    /* Actions */
    .transactions-table td:nth-child(7) {
        grid-area: actions;
        align-self: center;
    }

    .transactions-table .action-buttons { justify-content: flex-end; }

    .action-btn {
        width: 28px;
        height: 28px;
        padding: 0.25rem;
        font-size: 0.75rem;
    }
}

/* ========================================
   TRANSACTION MODAL STYLES
   ======================================== */

/* Modal Form Enhancements */
.modal-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.modal-form .form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.modal-form .form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.modal-form .form-group label {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.9rem;
}

.modal-form .form-group input,
.modal-form .form-group select,
.modal-form .form-group textarea {
    padding: 0.75rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    background: var(--card-bg);
    color: var(--text-primary);
}

.modal-form .form-group input:focus,
.modal-form .form-group select:focus,
.modal-form .form-group textarea:focus {
    outline: none;
    border-color: #8B4513;
    box-shadow: 0 0 0 3px rgba(139, 69, 19, 0.1);
    background: var(--card-bg) !important;
    color: var(--text-primary) !important;
}

.modal-form .form-group textarea {
    resize: vertical;
    min-height: 80px;
    font-family: inherit;
}

.modal-form .form-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

.modal-form .btn {
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    border-radius: 8px;
    transition: all 0.3s ease;
    cursor: pointer;
    border: none;
    font-size: 0.9rem;
}

.modal-form .btn-primary {
    background: linear-gradient(135deg, #8B4513 0%, #D2691E 100%);
    color: white;
}

.modal-form .btn-primary:hover {
    background: linear-gradient(135deg, #7a3d0f 0%, #b85a1a 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(139, 69, 19, 0.3);
}

.modal-form .btn-secondary {
    background: #6c757d;
    color: white;
}

.modal-form .btn-secondary:hover {
    background: #5a6268;
    transform: translateY(-1px);
}

/* Input Group for Currency */
.modal-form .input-group {
    display: flex;
    align-items: stretch;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    background: var(--card-bg);
    overflow: hidden;
    transition: all 0.3s ease;
    height: 48px;
}

.modal-form .input-group:focus-within {
    border-color: #8B4513;
    box-shadow: 0 0 0 3px rgba(139, 69, 19, 0.1);
}

.modal-form .input-prefix {
    background: var(--main-bg);
    padding: 0.75rem;
    color: var(--text-secondary);
    font-weight: 600;
    border-right: 1px solid var(--border-color);
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    white-space: nowrap;
    flex-shrink: 0;
    width: 40px;
    justify-content: center;
}

.modal-form .input-group input {
    border: none;
    padding: 0.75rem;
    font-size: 0.9rem;
    outline: none;
    background: transparent;
    flex: 1;
    min-width: 0;
    height: 100%;
}

.modal-form .input-group input:focus {
    outline: none;
    background: var(--card-bg) !important;
    color: var(--text-primary) !important;
}

/* Accounts Modal Specific Styling */
#addAccountModal .modal-content,
#editAccountModal .modal-content {
    padding: 0;
    border-radius: 16px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

#addAccountModal .modal-form,
#editAccountModal .modal-form {
    padding: 2rem;
    background: var(--card-bg);
    flex: 1;
    overflow-y: auto;
    min-height: 0; /* Allows flex item to shrink below content size */
}

#addAccountModal .form-actions,
#editAccountModal .form-actions {
    display: flex !important;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid #e9ecef;
}

#addAccountModal .form-actions .btn,
#editAccountModal .form-actions .btn {
    display: inline-block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

#addAccountModal .modal-header,
#editAccountModal .modal-header {
    padding: 1.5rem 2rem;
    background: linear-gradient(135deg, #8B4513 0%, #D2691E 100%);
    color: white;
    border-radius: 0;
    margin: 0;
}

#addAccountModal .modal-header h3,
#editAccountModal .modal-header h3 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
}

#addAccountModal .close-btn,
#editAccountModal .close-btn {
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    transition: all 0.3s ease;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
}

#addAccountModal .close-btn:hover,
#editAccountModal .close-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: rotate(90deg);
}

/* Currency Input Styling for Accounts Modal */
#addAccountModal .currency-input,
#editAccountModal .currency-input {
    display: flex;
    align-items: center;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    background: white;
    overflow: hidden;
    transition: all 0.3s ease;
}

#addAccountModal .currency-input:focus-within,
#editAccountModal .currency-input:focus-within {
    border-color: #8B4513;
    box-shadow: 0 0 0 3px rgba(139, 69, 19, 0.1);
}

#addAccountModal .currency-symbol,
#editAccountModal .currency-symbol {
    background: var(--main-bg);
    padding: 0.75rem 1rem;
    color: var(--text-secondary);
    font-weight: 600;
    border-right: 1px solid var(--border-color);
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    white-space: nowrap;
    flex-shrink: 0;
    min-width: 40px;
    justify-content: center;
}

#addAccountModal .currency-input input,
#editAccountModal .currency-input input {
    border: none;
    padding: 0.75rem;
    font-size: 0.9rem;
    outline: none;
    background: transparent;
    flex: 1;
    min-width: 0;
}

#addAccountModal .currency-input input:focus,
#editAccountModal .currency-input input:focus {
    outline: none;
}

/* Accounts Table Styling */
.accounts-table-container {
    background: var(--card-bg);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.6);
    overflow: hidden;
    margin-top: 1rem;
}

.table-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    background: var(--main-bg);
    border-bottom: 1px solid var(--border-color);
}

.table-header h3 {
    margin: 0;
    color: var(--text-primary);
    font-size: 1.1rem;
    font-weight: 600;
}

.table-wrapper {
    overflow-x: auto;
    max-height: 50vh;
    overflow-y: auto;
}

.accounts-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--card-bg);
}

.accounts-table thead {
    background: linear-gradient(135deg, #8B4513 0%, #D2691E 100%);
    color: white;
    position: sticky;
    top: 0;
    z-index: 10;
}

.accounts-table th {
    padding: 0.5rem 0.75rem;
    text-align: left;
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-right: 1px solid rgba(255, 255, 255, 0.2);
}

.accounts-table th:last-child {
    border-right: none;
}

.accounts-table tbody tr {
    border-bottom: 1px solid var(--border-color);
    transition: all 0.2s ease;
}

.accounts-table tbody tr:hover {
    background: var(--main-bg);
}

.accounts-table tbody tr:last-child {
    border-bottom: none;
}

.accounts-table td {
    padding: 0.5rem 0.75rem;
    vertical-align: middle;
    border-right: 1px solid var(--border-color);
    font-size: 0.85rem;
    color: var(--text-primary);
}

.accounts-table td:last-child {
    border-right: none;
}

/* Account Name Column */
.account-name {
    font-weight: 600;
    color: var(--text-primary);
    min-width: 100px;
    width: 100px;
}

/* Account Type Column */
.account-type {
    min-width: 80px;
    width: 80px;
}

.type-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.type-checking { background: var(--main-bg); color: #1976d2; border: 1px solid #1976d2; }
.type-savings { background: var(--main-bg); color: #388e3c; border: 1px solid #388e3c; }
.type-credit { background: var(--main-bg); color: #f57c00; border: 1px solid #f57c00; }
.type-investment { background: var(--main-bg); color: #7b1fa2; border: 1px solid #7b1fa2; }
.type-cash { background: var(--main-bg); color: #00695c; border: 1px solid #00695c; }
.type-other { background: var(--main-bg); color: var(--text-secondary); border: 1px solid var(--border-color); }

/* Bank Name Column */
.bank-name {
    color: #6c757d;
    min-width: 80px;
    width: 80px;
}

/* Account Number Column */
.account-number {
    color: #6c757d;
    font-family: 'Courier New', monospace;
    min-width: 70px;
    width: 70px;
}

/* Balance Column */
.balance-cell {
    min-width: 120px;
    width: 120px;
}

.balance-editable {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.balance-display {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.9rem;
    padding: 0.25rem 0.5rem;
    background: var(--main-bg);
    border-radius: 4px;
    border: 1px solid var(--border-color);
    min-width: 80px;
    text-align: right;
}

.balance-input {
    width: 80px;
    padding: 0.25rem 0.5rem;
    border: 2px solid #8B4513;
    border-radius: 4px;
    font-size: 0.85rem;
    font-weight: 600;
    text-align: right;
    background: var(--card-bg) !important;
    color: var(--text-primary) !important;
}

.balance-input:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(139, 69, 19, 0.1);
}

/* Balance Form Section Inputs */
.balance-form-section input[type="number"],
.balance-form-section input[type="text"] {
    background: var(--card-bg) !important;
    color: var(--text-primary) !important;
    border: 2px solid var(--border-color) !important;
}

/* Balance Form Section Input Prefixes */
.balance-form-section .input-prefix,
.balance-form-section .currency-symbol {
    background: var(--main-bg) !important;
    color: var(--text-secondary) !important;
    border-right: none !important;
}

/* Balance Form Section Input Groups */
.balance-form-section .input-group {
    background: var(--main-bg) !important;
    border: 1px solid var(--border-color) !important;
}

.edit-balance-btn {
    background: none;
    border: none;
    color: var(--sidebar-text);
    cursor: pointer;
    padding: 0.2rem;
    border-radius: 3px;
    transition: all 0.2s ease;
    font-size: 0.75rem;
    opacity: 0.7;
}

.edit-balance-btn:hover {
    background: rgba(139, 69, 19, 0.1);
    opacity: 1;
    transform: scale(1.05);
}

/* Actions Column */
.actions-cell {
    min-width: 80px;
    width: 80px;
}

.action-buttons {
    display: flex;
    gap: 0.5rem;
}

.btn-icon {
    background: none;
    border: none;
    color: #6c757d;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 4px;
    transition: all 0.2s ease;
    font-size: 0.9rem;
}

.btn-icon:hover {
    background: rgba(0, 0, 0, 0.1);
    transform: scale(1.1);
}

.btn-icon.delete:hover {
    background: rgba(220, 53, 69, 0.1);
    color: #dc3545;
}

/* No Accounts Message */
.no-accounts-message {
    padding: 3rem 2rem;
    text-align: center;
    background: #f8f9fa;
}

.no-accounts-content {
    max-width: 400px;
    margin: 0 auto;
}

.no-accounts-icon {
    font-size: 3rem;
    color: #dee2e6;
    margin-bottom: 1rem;
}

.no-accounts-text h3 {
    color: #6c757d;
    margin-bottom: 0.5rem;
}

.no-accounts-text p {
    color: #adb5bd;
    margin-bottom: 2rem;
}

/* Mobile Responsiveness for Table */
@media (max-width: 768px) {
    .table-header {
        flex-direction: column;
        gap: 0.75rem;
        align-items: stretch;
        padding: 0.75rem 1rem;
    }
    
    .table-header h3 {
        text-align: center;
        font-size: 1rem;
    }
    
    .accounts-table {
        font-size: 0.8rem;
    }
    
    .accounts-table th,
    .accounts-table td {
        padding: 0.5rem 0.75rem;
    }
    
    .accounts-table th:nth-child(3),
    .accounts-table td:nth-child(3),
    .accounts-table th:nth-child(4),
    .accounts-table td:nth-child(4) {
        display: none;
    }
    
    .balance-input {
        width: 70px;
    }
    
    .table-wrapper {
        max-height: 40vh;
    }
}

@media (max-width: 480px) {
    .accounts-table th,
    .accounts-table td {
        padding: 0.5rem;
    }
    
    .accounts-table th:nth-child(2),
    .accounts-table td:nth-child(2) {
        display: none;
    }
}

/* Ensure currency symbol stays inline - override any conflicting styles */
.modal .input-group,
.income-layout .input-group,
.balance-form-section .input-group {
    display: flex !important;
    align-items: stretch !important;
    position: relative !important;
}

.modal .input-prefix,
.income-layout .input-prefix,
.balance-form-section .input-prefix {
    position: static !important;
    float: none !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex-shrink: 0 !important;
    width: 40px !important;
    height: 100% !important;
}

.modal .input-group input,
.income-layout .input-group input,
.balance-form-section .input-group input {
    position: static !important;
    float: none !important;
    flex: 1 !important;
    height: 100% !important;
}

/* Form Validation States */
.modal-form .form-group.error input,
.modal-form .form-group.error select,
.modal-form .form-group.error textarea {
    border-color: #dc3545;
    box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.1);
}

.modal-form .form-group.success input,
.modal-form .form-group.success select,
.modal-form .form-group.success textarea {
    border-color: #28a745;
    box-shadow: 0 0 0 3px rgba(40, 167, 69, 0.1);
}

.modal-form .form-error {
    color: #dc3545;
    font-size: 0.8rem;
    margin-top: 0.25rem;
    opacity: 0;
    transform: translateY(-5px);
    transition: all 0.3s ease;
}

.modal-form .form-error.show {
    opacity: 1;
    transform: translateY(0);
}

/* Loading States */
.modal-form .form-loading {
    opacity: 0.7;
    pointer-events: none;
}

.modal-form .btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

/* Mobile Modal Responsiveness */
@media (max-width: 768px) {
    .modal-form .form-row {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .modal-form .form-actions {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .modal-form .btn {
        width: 100%;
        justify-content: center;
    }
    
    /* Accounts Modal Mobile Styling */
    #addAccountModal .modal-content,
    #editAccountModal .modal-content {
        width: 95%;
        margin: 0;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        max-height: calc(90dvh - 62px - env(safe-area-inset-bottom, 0px));
        overflow-y: auto;
        display: flex;
        flex-direction: column;
    }
    
    #addAccountModal .modal-form,
    #editAccountModal .modal-form {
        padding: 1.5rem;
        flex: 1;
        overflow-y: auto;
        min-height: 0; /* Allows flex item to shrink below content size */
    }
    
    #addAccountModal .modal-header,
    #editAccountModal .modal-header {
        padding: 1.25rem 1.5rem;
    }
    
    #addAccountModal .modal-header h3,
    #editAccountModal .modal-header h3 {
        font-size: 1.1rem;
    }
}

/* Danger Card Styles */
.danger-card {
    border: 2px solid #dc3545;
    background: linear-gradient(135deg, #fff5f5 0%, #ffeaea 100%);
}

.danger-card .settings-card-header {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
    color: white;
}

.danger-card .settings-card-header h2 {
    color: white;
}

.warning-text {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 8px;
    padding: 12px;
    margin-top: 12px;
    color: #856404;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.warning-text i {
    color: #f39c12;
    font-size: 1.1rem;
}

/* Delete Account Modal Styles */
.danger-header {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%) !important;
    color: white !important;
}

.danger-header h3 {
    color: white !important;
}

.danger-message {
    text-align: center;
    padding: 20px;
    background: #fff5f5;
    border: 2px solid #dc3545;
    border-radius: 12px;
    margin-bottom: 20px;
}

.danger-icon {
    font-size: 3rem;
    color: #dc3545;
    margin-bottom: 15px;
}

.danger-message h4 {
    color: #dc3545;
    font-size: 1.3rem;
    margin-bottom: 15px;
    font-weight: 700;
}

.danger-message ul {
    text-align: left;
    margin: 15px 0;
    padding-left: 20px;
}

.danger-message li {
    margin: 8px 0;
    color: #721c24;
}

.final-warning {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    border-radius: 8px;
    padding: 15px;
    margin-top: 20px;
    color: #721c24;
    font-weight: 600;
}

.final-warning p {
    margin: 0;
    font-size: 1rem;
}

/* Form help text styling */
.form-help {
    color: #6c757d;
    font-size: 0.8rem;
    margin-top: 5px;
    font-style: italic;
}

/* ========================================
   CONTACT PAGE STYLES
   ======================================== */

.contact-container {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 2rem;
    margin-top: 2rem;
}

.contact-info {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.contact-card {
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.contact-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.contact-icon {
    font-size: 1.8rem;
    color: var(--sidebar-text);
    margin-bottom: 1rem;
}

.contact-card h3 {
    color: #2c3e50;
    margin-bottom: 0.5rem;
    font-size: 1.2rem;
}

.contact-card p {
    color: #6c757d;
    margin-bottom: 1rem;
    font-size: 0.9rem;
    line-height: 1.5;
}

.contact-card a {
    color: var(--sidebar-text);
    text-decoration: none;
    font-weight: 600;
    font-size: 1rem;
}

.contact-card a:hover {
    text-decoration: underline;
}

.response-time, .support-type {
    display: inline-block;
    background: #e3f2fd;
    color: #1976d2;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}

.contact-form-container {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.contact-form-card {
    padding: 2rem;
}

.form-header {
    text-align: center;
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 2px solid #f8f9fa;
}

.form-header h2 {
    color: #2c3e50;
    margin-bottom: 0.5rem;
    font-size: 1.8rem;
}

.form-header p {
    color: #6c757d;
    font-size: 1rem;
}

.contact-form {
    max-width: none;
}

.contact-form .form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
}

.contact-form .form-group {
    margin-bottom: 1.5rem;
}

.contact-form label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #2c3e50;
    font-size: 0.95rem;
}

.contact-form input,
.contact-form select,
.contact-form textarea {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    font-family: inherit;
}

.contact-form input:focus,
.contact-form select:focus,
.contact-form textarea:focus {
    outline: none;
    border-color: #8B4513;
    box-shadow: 0 0 0 3px rgba(139, 69, 19, 0.1);
}

.contact-form textarea {
    resize: vertical;
    min-height: 120px;
    font-family: inherit;
}

.char-count {
    text-align: right;
    font-size: 0.8rem;
    margin-top: 0.25rem;
    color: #6c757d;
}

.checkbox-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 0.9rem;
    color: #2c3e50;
    margin-bottom: 0;
}

.checkbox-label input[type="checkbox"] {
    display: none;
}

.checkmark {
    width: 20px;
    height: 20px;
    border: 2px solid #e9ecef;
    border-radius: 4px;
    margin-right: 0.75rem;
    position: relative;
    transition: all 0.3s ease;
}

.checkbox-label input[type="checkbox"]:checked + .checkmark {
    background: #8B4513;
    border-color: #8B4513;
}

.checkbox-label input[type="checkbox"]:checked + .checkmark::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 12px;
    font-weight: bold;
}

.form-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid #e9ecef;
}

.faq-section {
    margin-top: 3rem;
    padding: 2rem;
    background: #f8f9fa;
    border-radius: 12px;
}

.faq-section h2 {
    text-align: center;
    color: #2c3e50;
    margin-bottom: 2rem;
    font-size: 1.8rem;
}

.faq-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.faq-item {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.faq-item h4 {
    color: var(--sidebar-text);
    margin-bottom: 0.75rem;
    font-size: 1.1rem;
}

.faq-item p {
    color: #6c757d;
    line-height: 1.6;
    margin: 0;
}

/* Mobile Responsiveness for Contact Page */
@media (max-width: 768px) {
    .contact-container {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .contact-form .form-row {
        grid-template-columns: 1fr;
        gap: 0;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .form-actions .btn {
        width: 100%;
        justify-content: center;
    }
    
    .faq-grid {
        grid-template-columns: 1fr;
    }
    
    .contact-form-card {
        padding: 1.5rem;
    }
    
    .faq-section {
        padding: 1.5rem;
    }
    
    .contact-icon {
        font-size: 1.5rem;
    }
    
    .footer-logo {
        height: 20px;
        max-width: 20px;
    }
    
    .footer-text {
        font-size: 1rem;
    }
    
    .page-header h1 i {
        font-size: 1rem;
    }
}

/* ========================================
   FORM INPUT STYLES (GLOBAL)
   ======================================== */

/* Input Group - for currency inputs */
.input-group {
    display: flex;
    align-items: center;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background: var(--card-bg);
    overflow: hidden;
    transition: all 0.3s ease;
}

.input-group:focus-within {
    border-color: #8B4513;
    box-shadow: 0 0 0 2px rgba(139, 69, 19, 0.1);
}

.input-prefix {
    background: var(--main-bg);
    padding: 0.5rem 0.75rem;
    color: var(--text-secondary);
    font-weight: 500;
    border-right: 1px solid var(--border-color);
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    white-space: nowrap;
}

.input-group input {
    border: none;
    padding: 0.5rem 0.75rem;
    font-size: 0.9rem;
    outline: none;
    background: transparent;
    flex: 1;
    min-width: 0;
}

.input-group input:focus {
    outline: none;
}

/* ========================================
   BUDGET BREAKDOWN PAGE STYLES (SPECIFIC)
   ======================================== */

/* Only apply to budget breakdown page */
.breakdown-container {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin-top: 1rem;
}

/* Budget Summary Card - specific to breakdown page */
.breakdown-container .breakdown-stats-row {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 1rem;
    margin-bottom: 0;
}

/* Sticky Available to Allocate - fixed position badge */
.breakdown-container .sticky-available-badge {
    position: fixed;
    top: 15px;
    right: 15px;
    background: linear-gradient(135deg, #8B4513 0%, #D2691E 100%);
    color: white;
    padding: 0.4rem 0.8rem;
    border-radius: 18px;
    font-size: 0.75rem;
    font-weight: 600;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    z-index: 1000;
    display: none;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
    max-width: 180px;
    min-width: 120px;
}

.breakdown-container .sticky-available-badge.show {
    display: flex;
    flex-direction: column;
    align-items: center;
    animation: slideInFromRight 0.3s ease-out;
}

.breakdown-container .sticky-available-badge .label {
    font-size: 0.65rem;
    opacity: 0.9;
    margin-bottom: 0.2rem;
    text-align: center;
    line-height: 1.1;
}

.breakdown-container .sticky-available-badge .amount {
    font-weight: 700;
    font-size: 0.8rem;
    text-align: center;
    line-height: 1;
    font-family: 'Arial Narrow', Arial, sans-serif;
    letter-spacing: -0.3px;
}

@keyframes slideInFromRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Notification/Error Message Positioning */

.breakdown-container .budget-stat {
    background: var(--card-bg);
    border-radius: 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.6);
    padding: 1.25rem 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.breakdown-container .budget-stat::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(135deg, #8B4513 0%, #D2691E 100%);
}

.breakdown-container .stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.1;
    margin-bottom: 0.25rem;
}

.breakdown-container .stat-label {
    font-size: 0.62rem;
    color: var(--text-secondary);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.breakdown-container .stat-value.positive {
    color: #28a745;
}

.breakdown-container .stat-value.negative {
    color: #dc3545;
}

/* Categories Grid - single column full-width */
.breakdown-container .categories-grid {
    display: flex;
    flex-direction: column;
    gap: 1.75rem;
}

/* Category Card */
.breakdown-container .category-card {
    background: var(--card-bg);
    border-radius: 10px;
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 16px rgba(0,0,0,0.28);
    overflow: visible;
    transition: box-shadow 0.2s ease;
}

/* Category Header */
.breakdown-container .category-header {
    background: var(--main-bg);
    border-radius: 10px 10px 0 0;
    padding: 0.65rem 1rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    cursor: pointer;
    transition: background-color 0.2s ease;
    border-bottom: 1px solid var(--border-color);
}
.breakdown-container .category-header:hover { background-color: rgba(139,69,19,0.04); }
.breakdown-container .category-header:active { background-color: rgba(139,69,19,0.08); }

.breakdown-container .category-header-left {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
    min-width: 0;
}

.breakdown-container .category-collapse-icon {
    color: var(--text-secondary);
    font-size: 0.65rem;
    transition: transform 0.25s ease;
    flex-shrink: 0;
}

.breakdown-container .category-header h3 {
    margin: 0;
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Header summary stats */
.breakdown-container .category-header-summary {
    display: flex;
    gap: 0;
    flex-shrink: 0;
    justify-content: flex-end;
}

.breakdown-container .cat-stat {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.1rem;
    min-width: 120px;
    padding: 0 1.5rem;
    border-left: 1px solid var(--border-color);
}

.breakdown-container .cat-stat-label {
    font-size: 0.6rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    color: var(--text-secondary);
}

.breakdown-container .cat-stat-value {
    font-size: 0.82rem;
    font-weight: 700;
    font-family: 'Inter', -apple-system, sans-serif;
}

.breakdown-container .cat-stat-value.allocated { color: #007bff; }
.breakdown-container .cat-stat-value.spent      { color: var(--text-secondary); }
.breakdown-container .cat-stat-value.positive   { color: #28a745; }
.breakdown-container .cat-stat-value.negative   { color: #dc3545; }

.breakdown-container .category-actions {
    display: flex;
    gap: 0.25rem;
    flex-shrink: 0;
}

.breakdown-container .category-actions .btn {
    padding: 0 !important;
    font-size: 0.68rem;
    border-radius: 50% !important;
    width: 26px !important;
    height: 26px !important;
    min-width: unset !important;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Category progress bar */
.breakdown-container .category-progress-wrap {
    height: 3px;
    background: var(--border-color);
}

.breakdown-container .category-progress-fill {
    height: 100%;
    transition: width 0.4s ease;
}

/* Category Content - collapsible */
.breakdown-container .category-content {
    overflow: hidden;
    transition: max-height 0.3s ease, opacity 0.3s ease;
    max-height: 5000px;
    opacity: 1;
}

.breakdown-container .category-content.collapsed {
    max-height: 0;
    opacity: 0;
}

.breakdown-container .category-card.category-collapsed { height: auto; }

/* Subcategory table header */
.breakdown-container .sub-table-header {
    display: grid;
    grid-template-columns: 1fr 140px 120px 120px 200px 80px;
    gap: 0 1.75rem;
    gap: 0;
    padding: 0.3rem 1rem;
    background: var(--main-bg);
    border-bottom: 1px solid var(--border-color);
}

.breakdown-container .sub-table-header .sub-col-label {
    font-size: 0.6rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
    padding: 0.2rem 0.4rem;
}

.breakdown-container .sub-table-header .sub-col-label.right {
    text-align: right;
}

.breakdown-container .sub-table-header .sub-col-label.center {
    text-align: center;
}

/* Subcategory rows */
.breakdown-container .subcategory-row {
    display: grid;
    grid-template-columns: 1fr 140px 120px 120px 200px 80px;
    gap: 0 1.75rem;
    gap: 0;
    align-items: center;
    padding: 0.45rem 1rem;
    border-bottom: 1px solid var(--border-color);
    background: var(--card-bg);
    transition: background-color 0.15s ease;
}

.breakdown-container .subcategory-row:last-of-type { border-bottom: none; }
.breakdown-container .subcategory-row:hover { background: rgba(139,69,19,0.03); }

/* Sub columns */
.breakdown-container .sub-col { padding: 0 0.4rem; }

.breakdown-container .sub-col-name {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 0;
}

.breakdown-container .subcategory-name {
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.breakdown-container .subcategory-actions .btn {
    padding: 0 !important;
    font-size: 0.6rem;
    border-radius: 50% !important;
    width: 20px !important;
    height: 20px !important;
    min-width: unset !important;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Allocated input column */
.breakdown-container .sub-col-allocated {
    display: flex;
    justify-content: center;
}

.breakdown-container .input-group {
    width: 140px;
    height: 26px;
    display: flex;
    align-items: center;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background: var(--main-bg);
    overflow: hidden;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.breakdown-container .input-group:focus-within {
    border-color: #8B4513;
    box-shadow: 0 0 0 2px rgba(139,69,19,0.12);
}

.breakdown-container .input-group input {
    border: none;
    padding: 0 0.4rem;
    font-size: 0.78rem;
    text-align: center;
    outline: none;
    background: transparent;
    width: 100%;
    height: 100%;
    font-weight: 600;
    color: var(--text-primary);
}

/* Progress bar column */
.breakdown-container .sub-col-progress {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0 0.75rem;
}

.breakdown-container .sub-progress-wrap {
    flex: 1;
    height: 6px;
    background: var(--border-color);
    border-radius: 3px;
    overflow: hidden;
}

.breakdown-container .sub-progress-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.4s ease;
}

.breakdown-container .sub-progress-pct {
    font-size: 0.65rem;
    font-weight: 600;
    color: var(--text-secondary);
    min-width: 32px;
    text-align: right;
}

/* Amount columns */
.breakdown-container .sub-col-spent,
.breakdown-container .sub-col-balance {
    text-align: right;
}

.breakdown-container .amount-value {
    font-size: 0.82rem;
    font-weight: 700;
    font-family: 'Inter', -apple-system, sans-serif;
}

.breakdown-container .amount-value.spent      { color: var(--text-secondary); }
.breakdown-container .amount-value.positive   { color: #28a745; }
.breakdown-container .amount-value.negative   { color: #dc3545; }

/* Actions column */
.breakdown-container .sub-col-actions {
    display: flex;
    justify-content: flex-end;
}


/* Backwards compat — keep .total-value classes for updateCategoryTotals() */
.breakdown-container .total-value.allocated { color: #007bff; }
.breakdown-container .total-value.spent     { color: var(--text-secondary); }
.breakdown-container .total-value.balance.positive { color: #28a745; }
.breakdown-container .total-value.balance.negative { color: #dc3545; }

/* Add Category Section - specific to breakdown page */
.breakdown-container .add-category-section {
    text-align: center;
    padding: 2rem;
    background: linear-gradient(135deg, rgba(139, 69, 19, 0.05) 0%, rgba(210, 105, 30, 0.05) 100%);
    border-radius: 12px;
    border: 2px dashed rgba(139, 69, 19, 0.2);
    margin-top: 1rem;
}

.breakdown-container .add-category-section .btn-large {
    padding: 1rem 2rem;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 8px;
    text-transform: capitalize;
}

/* Mobile Responsive for Dashboard */
@media (max-width: 768px) {
    .overview-cards {
        grid-template-columns: 1fr 1fr;
        gap: 0.5rem;
        overflow: visible;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }
    
    .overview-card.compact {
        padding: 0.5rem;
        min-width: 0;
        max-width: 100%;
        box-sizing: border-box;
    }
    
    .overview-card.compact .card-title h3 {
        font-size: 0.8rem;
        word-wrap: break-word;
        overflow-wrap: break-word;
    }
    
    .overview-card.compact .card-title p {
        font-size: 0.65rem;
        word-wrap: break-word;
        overflow-wrap: break-word;
    }
    
    .overview-card.compact .card-value .value {
        font-size: 1.1rem;
        word-wrap: break-word;
        overflow-wrap: break-word;
    }
    
    /* Force card width constraints on mobile */
    .overview-card {
        min-width: 0 !important;
        max-width: 100% !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }
    
    .dashboard-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
        max-width: 100%;
        overflow-x: visible;
        overflow-y: visible;
        width: 100%;
        box-sizing: border-box;
    }
    
    /* Ensure container doesn't allow horizontal overflow */
    .container {
        max-width: 100vw !important;
        overflow-x: visible !important;
        padding: 0 8px; /* Add padding to create space for shadows */
    }
    
    /* Ensure all dashboard sections fit */
    .category-health-section,
    .right-content {
        max-width: 100%;
        overflow: visible;
        padding: 2px; /* allow box-shadow to show */
    }

    .category-health-card {
        box-shadow: 0 8px 30px rgba(0, 0, 0, 0.55), 0 2px 8px rgba(0, 0, 0, 0.3);
    }

    [data-theme="dark"] .category-health-card {
        box-shadow: 0 8px 30px rgba(0, 0, 0, 0.9), 0 2px 8px rgba(0, 0, 0, 0.6);
    }

    .category-health-header h3 {
        font-weight: 700 !important;
    }
    
    /* Shrink chart container */
    .chart-container {
        max-width: 100%;
        overflow-x: hidden;
    }
    
    /* Ensure action items fit */
    .actions-grid {
        max-width: 100%;
        overflow-x: visible;
    }
    
    .action-item {
        min-width: 0;
        flex-shrink: 1;
    }
    
    /* Income page specific mobile optimizations */
    .income-layout {
        display: grid !important;
        grid-template-columns: 1fr !important;
        gap: 1rem !important;
        max-width: 100%;
    }

    .income-sources-section {
        border-radius: 0 !important;
        padding: 1rem !important;
        max-width: 100%;
        margin-top: 1rem !important;
    }

    .balance-form-section {
        border-radius: 0 !important;
        padding: 1rem !important;
        max-width: 100%;
    }
    
    .balance-form {
        max-width: 100%;
        overflow-x: hidden;
    }
    
    .balance-form .form-group {
        max-width: 100%;
        overflow-x: hidden;
    }
    
    .balance-form .input-group {
        max-width: 100%;
        overflow-x: hidden;
    }
    
    .balance-form input[type="number"] {
        max-width: 100%;
        min-width: 0;
        font-size: 16px; /* Prevent mobile zoom */
    }
    
    .balance-display {
        max-width: 100%;
        overflow-x: hidden;
    }
    
    .balance-amount {
        word-wrap: break-word;
        overflow-wrap: break-word;
        max-width: 100%;
    }
    
    .income-sources-list {
        max-width: 100%;
        overflow-x: hidden;
    }
    
    .income-source-item {
        flex-direction: row !important;
        align-items: center !important;
        padding: 0.4rem 0.6rem !important;
        margin-bottom: 0.35rem !important;
        max-width: 100%;
        min-width: 0;
    }

    .income-source-item .source-info {
        flex-direction: column !important;
        text-align: left !important;
        flex: 1 1 auto;
        min-width: 0;
    }

    .income-source-item .source-name {
        font-size: 0.8rem !important;
        margin-bottom: 0.1rem !important;
        word-break: break-word;
    }


    .income-source-item .source-amount {
        font-size: 0.82rem !important;
        white-space: nowrap;
    }

    .income-source-item .source-actions {
        flex-direction: row !important;
        justify-content: flex-end !important;
        margin-left: 0.5rem !important;
        gap: 0.25rem !important;
        width: auto !important;
        flex-shrink: 0 !important;
    }

    .income-source-item .source-actions .btn {
        padding: 0 !important;
        width: 26px !important;
        height: 26px !important;
        min-width: unset !important;
        border-radius: 50% !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        font-size: 0.68rem !important;
        flex-shrink: 0;
    }
    
    /* Additional balance management mobile fixes */
    .balance-form-section .section-header {
        max-width: 100%;
        overflow-x: hidden;
    }
    
    .balance-form-section .section-header h3 {
        word-wrap: break-word;
        overflow-wrap: break-word;
        max-width: 100%;
    }
    
    .balance-form-section .input-group {
        width: 100%;
        max-width: 100%;
    }
    
    .balance-form-section .input-prefix {
        flex-shrink: 0;
        min-width: auto;
    }
    
    .balance-form-section input {
        width: 100%;
        max-width: 100%;
        min-width: 0;
    }
    
    /* Ensure balance display doesn't overflow */
    .balance-display {
        width: 100%;
        max-width: 100%;
        text-align: center;
    }
    
    .balance-label {
        word-wrap: break-word;
        overflow-wrap: break-word;
        max-width: 100%;
    }
    
    .balance-amount {
        word-wrap: break-word;
        overflow-wrap: break-word;
        max-width: 100%;
        font-size: 1.2rem;
        font-weight: 700;
    }
    
    .overview-cards {
        grid-column: 1;
        grid-row: 1;
    }
    
    /* Mobile order: Spending by Category → Recent Transactions → Allocation chart */
    .category-health-section {
        grid-column: 1;
        grid-row: 2;
        max-width: none;
        width: 100%;
    }

    .right-content {
        grid-column: 1;
        grid-row: 3;
        max-width: none;
        padding: 0;
    }

    .budget-chart-section {
        grid-column: 1;
        grid-row: 4;
    }

    .actions-section {
        overflow-x: visible;
        overflow-y: visible;
    }
}

/* Mobile Responsive for Budget Breakdown */
@media (max-width: 768px) {
    .breakdown-container .categories-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .breakdown-container .breakdown-stats-row {
        grid-template-columns: 1fr 1fr 1fr;
        gap: 0.5rem;
    }

    .breakdown-container .budget-stat {
        padding: 0.5rem;
        border-radius: 50% !important;
        aspect-ratio: 1;
        justify-content: center;
        align-items: center;
        overflow: hidden;
        position: relative;
    }

    .breakdown-container .budget-stat::before {
        display: none;
    }

    /* Watermark icons */
    #available-stat::after,
    #allocated-stat::after,
    #spent-stat::after {
        font-family: 'Font Awesome 6 Free';
        font-weight: 900;
        position: absolute;
        bottom: -6px;
        right: -4px;
        font-size: 3rem;
        opacity: 0.1;
        pointer-events: none;
        line-height: 1;
    }
    #available-stat::after { content: '\f0d6'; color: #28a745; }
    #allocated-stat::after { content: '\f555'; color: #007bff; }
    #spent-stat::after     { content: '\f07a'; color: #fd7e14; }

    [data-theme="light"] #available-stat::after { opacity: 0.18; }
    [data-theme="light"] #allocated-stat::after { opacity: 0.18; }
    [data-theme="light"] #spent-stat::after     { opacity: 0.18; }

    .breakdown-container .stat-value {
        font-size: 0.85rem;
        margin-bottom: 0.1rem;
    }

    .breakdown-container .stat-label {
        font-size: 0.5rem;
        letter-spacing: 0;
    }
    
    /* Hide table header on mobile */
    .breakdown-container .sub-table-header { display: none; }

    /* Category header: wrap so stats sit below the title */
    .breakdown-container .category-header {
        flex-wrap: wrap;
        gap: 0.4rem 0.5rem;
        padding: 0.5rem 0.75rem;
    }

    .breakdown-container .category-header-left {
        flex: 1;
        min-width: 0;
    }

    .breakdown-container .category-actions {
        flex-shrink: 0;
        order: 2;
    }

    .breakdown-container .category-header-summary {
        order: 3;
        width: 100%;
        justify-content: space-around;
        gap: 0;
        border-top: 1px solid var(--border-color);
        padding-top: 0.4rem;
        margin-top: 0.1rem;
    }

    .breakdown-container .cat-stat {
        min-width: 0;
        flex: 1;
        align-items: center;
        padding: 0 0.5rem;
        border-left: none;
    }

    /* Subcategory rows: grid layout — name+actions on row 1, amounts on row 2 */
    .breakdown-container .subcategory-row {
        display: grid;
        grid-template-columns: 1fr 1fr 1fr;
        grid-template-areas:
            "name name actions"
            "alloc spent balance";
        gap: 0.5rem 0;
        padding: 0.75rem;
        align-items: center;
    }

    .breakdown-container .sub-col-name     { grid-area: name; }
    .breakdown-container .sub-col-actions  { grid-area: actions; display: flex; justify-content: flex-end; }
    .breakdown-container .sub-col-allocated { grid-area: alloc;   display: flex; flex-direction: column; align-items: center; text-align: center; }
    .breakdown-container .sub-col-spent     { grid-area: spent;   display: flex; flex-direction: column; align-items: center; text-align: center; }
    .breakdown-container .sub-col-balance   { grid-area: balance; display: flex; flex-direction: column; align-items: center; text-align: center; }
    .breakdown-container .sub-col-progress  { display: none; }

    .breakdown-container .sub-col-allocated::before { content: 'Allocated'; font-size: 0.6rem; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.4px; margin-bottom: 0.15rem; }
    .breakdown-container .sub-col-spent::before     { content: 'Spent';     font-size: 0.6rem; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.4px; margin-bottom: 0.15rem; }
    .breakdown-container .sub-col-balance::before   { content: 'Balance';   font-size: 0.6rem; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.4px; margin-bottom: 0.15rem; }

    .breakdown-container .input-group { width: 100%; max-width: 140px; }
    .breakdown-container .input-group input { font-size: 16px !important; text-align: center; }

    /* Prevent mobile zoom */
    input[type="text"], input[type="number"], input[type="email"],
    input[type="password"], input[type="tel"], textarea, select {
        font-size: 16px !important;
    }
}

/* ========================================
   KEBAB MENU (3-dot context menu)
   ======================================== */

.kebab-wrap {
    position: relative;
    display: inline-flex;
}

.kebab-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.25rem 0.4rem;
    border-radius: 4px;
    color: var(--text-secondary);
    font-size: 1rem;
    line-height: 1;
    transition: background 0.15s, color 0.15s;
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.kebab-dropdown {
    display: none;
    position: absolute;
    right: 0;
    top: calc(100% + 4px);
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.18);
    min-width: 140px;
    z-index: 1050;
    overflow: hidden;
}

.kebab-dropdown.open { display: block; }

.kebab-dropdown button {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    width: 100%;
    padding: 0.6rem 1rem;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 0.82rem;
    color: var(--text-primary);
    text-align: left;
    transition: background 0.15s;
    white-space: nowrap;
}

.kebab-dropdown button:hover { background: var(--main-bg); }

.kebab-dropdown button.danger { color: #dc3545; }
.kebab-dropdown button.danger:hover { background: rgba(220,53,69,0.08); }

.kebab-dropdown button i { width: 14px; text-align: center; font-size: 0.78rem; }

/* Accounts Page Styles */
.accounts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.account-card {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.account-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #8B4513 0%, #D2691E 100%);
}

.account-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12);
    border-color: rgba(139, 69, 19, 0.25);
}

.account-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.account-info h4 {
    margin: 0 0 0.25rem 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: #333;
}

.account-type {
    margin: 0 0 0.25rem 0;
    font-size: 0.85rem;
    color: var(--sidebar-text);
    font-weight: 500;
}

.bank-name, .account-number {
    margin: 0 0 0.25rem 0;
    font-size: 0.8rem;
    color: #666;
}

.account-actions {
    display: flex;
    gap: 0.5rem;
}

.btn-icon {
    background: none;
    border: none;
    padding: 0.5rem;
    border-radius: 6px;
    color: #666;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.btn-icon:hover {
    background: rgba(139, 69, 19, 0.1);
    color: var(--sidebar-text);
}

.btn-icon.delete:hover {
    background: rgba(220, 53, 69, 0.1);
    color: #dc3545;
}

.account-balance {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 1rem;
    border-top: 1px solid rgba(139, 69, 19, 0.1);
}

.balance-label {
    font-size: 0.85rem;
    color: #666;
    font-weight: 500;
}

.balance-value {
    font-size: 1.25rem;
    font-weight: 600;
    color: #333;
}

/* Balance Summary Card */
.balance-summary-card {
    background: var(--card-bg);
    border-radius: 8px;
    padding: 1rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.6);
    margin-bottom: 1rem;
}

.summary-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.summary-header h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.alignment-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
}

.alignment-indicator.aligned {
    background: rgba(40, 167, 69, 0.1);
    color: #28a745;
}

.alignment-indicator.misaligned {
    background: rgba(220, 53, 69, 0.1);
    color: #dc3545;
}

.alignment-status {
    font-weight: 600;
}

.alignment-percentage {
    font-size: 0.9rem;
    font-weight: 700;
}

.summary-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 0.75rem;
}

.balance-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.balance-item.difference {
    border-left: 3px solid #8B4513;
    padding-left: 0.75rem;
}

.balance-item .balance-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.balance-item .balance-value {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
}

.balance-item.difference .balance-value {
    color: var(--sidebar-text);
}

/* No Accounts Message */
.no-accounts-card {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 3rem 2rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.6);
    text-align: center;
    margin-top: 2rem;
}

.no-accounts-content {
    max-width: 400px;
    margin: 0 auto;
}

.no-accounts-icon {
    font-size: 3rem;
    color: var(--sidebar-text);
    margin-bottom: 1rem;
}

.no-accounts-message h3 {
    margin: 0 0 0.5rem 0;
    font-size: 1.5rem;
    color: #333;
}

.no-accounts-message p {
    margin: 0 0 1.5rem 0;
    color: #666;
    line-height: 1.5;
}

/* Mobile Responsive for Accounts */
@media (max-width: 768px) {
    .accounts-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .account-card {
        padding: 1rem;
    }
    
    .summary-content {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
    
    .balance-item.difference {
        border-left: none;
        border-top: 3px solid #8B4513;
        padding-left: 0;
        padding-top: 0.75rem;
    }
    
    .alignment-indicator {
        flex-direction: column;
        gap: 0.25rem;
        text-align: center;
    }
}

/* Onboarding Styles */
.onboarding-body {
    background: linear-gradient(135deg, rgb(236, 207, 186) 0%, rgb(243, 233, 225) 50%, rgb(247, 238, 230) 100%);
    min-height: 100vh;
    font-family: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    position: relative;
}

.onboarding-body::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: url('/static/images/wall2.png');
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
    opacity: 0.3;
    z-index: 0;
}

.onboarding-body::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="25" cy="25" r="1" fill="%23ffffff" opacity="0.1"/><circle cx="75" cy="75" r="1" fill="%23ffffff" opacity="0.1"/><circle cx="50" cy="10" r="0.5" fill="%23ffffff" opacity="0.1"/><circle cx="10" cy="60" r="0.5" fill="%23ffffff" opacity="0.1"/><circle cx="90" cy="40" r="0.5" fill="%23ffffff" opacity="0.1"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
    pointer-events: none;
    z-index: 1;
}


.onboarding-container {
    max-width: 600px;
    margin: 0 auto;
    padding: 1rem;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
    z-index: 2;
}

.progress-container {
    margin-bottom: 1.5rem;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 16px;
    padding: 1rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.progress-bar {
    width: 100%;
    height: 12px;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 1rem;
    position: relative;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.progress-fill {
    height: 100%;
    background: linear-gradient(135deg, #28a745 0%, #20c997 50%, #1e7e34 100%);
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    width: 20%;
    position: relative;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(40, 167, 69, 0.4);
}

.progress-fill::after {
    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-text {
    text-align: center;
    color: #4a5568;
    font-size: 1rem;
    font-weight: 600;
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.8);
}

.onboarding-content {
    flex: 1;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    padding: 1.5rem;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    margin-bottom: 1.5rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
    position: relative;
    overflow: hidden;
}

.onboarding-content::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(135deg, #28a745 0%, #20c997 50%, #1e7e34 100%);
}

.onboarding-step {
    display: none;
    animation: fadeInUp 0.6s ease-out;
}

.onboarding-step.active {
    display: block;
}

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

.step-header {
    text-align: center;
    margin-bottom: 1rem;
    position: relative;
}

.step-header h2 {
    color: #0d4f1a;
    font-size: 1.15rem;
    margin-bottom: 0.4rem;
    font-weight: 600;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    letter-spacing: -0.01em;
}

.step-header p {
    color: #718096;
    font-size: 0.85rem;
    font-weight: 500;
    line-height: 1.4;
}

.onboarding-form {
    max-width: 500px;
    margin: 0 auto;
}

/* Legal Acceptance Form - Wider Layout */
.legal-acceptance-form {
    max-width: 900px !important;
    width: 100% !important;
}

#step5 .onboarding-form {
    max-width: 900px !important;
    width: 100% !important;
}

.legal-acceptance-container {
    width: 100% !important;
    max-width: 100% !important;
    display: block;
}

.legal-document-box {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 12px;
    padding: 12px 16px;
    margin-bottom: 12px;
    max-height: none;
    overflow-y: visible;
    width: 100%;
}

.legal-document-box h3 {
    margin-top: 0;
    color: #1e293b;
    font-size: 14px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.legal-document-box h3 i {
    color: #8B4513;
    font-size: 16px;
}

.legal-content {
    color: #64748b;
    line-height: 1.6;
    font-size: 11px;
    width: 100%;
}

.legal-content p {
    margin-bottom: 6px;
    font-size: 11px;
    line-height: 1.4;
}

.legal-content ul {
    margin: 6px 0;
    padding-left: 20px;
}

.legal-content li {
    margin-bottom: 2px;
    font-size: 11px;
}

.legal-content strong {
    font-size: 11px;
}

.legal-link {
    margin-top: 8px !important;
    margin-bottom: 0 !important;
}

.legal-link a {
    color: #8B4513;
    text-decoration: underline;
    font-weight: 600;
}

.legal-link a:hover {
    color: #A0522D;
}

.legal-link i {
    font-size: 12px;
    margin-left: 4px;
}

.acceptance-checkboxes {
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 16px;
    margin-top: 12px;
    width: 100%;
    box-sizing: border-box;
}

.acceptance-checkbox-wrapper {
    margin-bottom: 12px;
    width: 100%;
}

.acceptance-checkbox-wrapper:last-of-type {
    margin-bottom: 0;
}

.acceptance-checkbox {
    display: flex !important;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 0;
    cursor: pointer;
    width: 100% !important;
    max-width: 100% !important;
    padding: 10px;
    border-radius: 8px;
    transition: background-color 0.2s ease;
    box-sizing: border-box;
}

#acceptTerms-error,
#acceptPrivacy-error {
    display: none;
    color: #e53e3e !important;
    font-size: 11px !important;
    margin-top: 0.4rem !important;
    margin-left: 38px !important;
    font-weight: normal !important;
    font-style: italic !important;
    padding: 0 !important;
    background: none !important;
    border: none !important;
    border-radius: 0 !important;
}

.acceptance-checkbox:hover {
    background-color: #f8f9fa;
}

.acceptance-checkbox input[type="checkbox"] {
    width: 22px;
    height: 22px;
    margin-top: 2px;
    cursor: pointer;
    flex-shrink: 0;
    flex-grow: 0;
    accent-color: #8B4513;
}

.checkbox-text {
    flex: 1 1 auto !important;
    min-width: 0 !important;
    display: block;
    width: auto;
    max-width: none !important;
}

.checkbox-text strong {
    color: #1e293b;
    display: block;
    margin-bottom: 6px;
    font-size: 14px;
    width: 100%;
    word-wrap: break-word;
}

.checkbox-text span {
    color: #64748b;
    font-size: 11px;
    display: block;
    line-height: 1.6;
    width: 100%;
    word-wrap: break-word;
}

.legal-notice {
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 8px;
    padding: 16px;
    margin-top: 20px;
    width: 100%;
}

/* Step 6: Trial Information & Payment Setup Styles */
.trial-info-box {
    background: #f0f9ff;
    border: 2px solid #3b82f6;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 20px;
}

.trial-info-content {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.trial-info-icon {
    font-size: 18px;
    color: #3b82f6;
    flex-shrink: 0;
}

.trial-info-text {
    flex: 1;
}

.trial-info-text h3 {
    margin: 0 0 8px 0;
    color: #1e40af;
    font-size: 14px;
    font-weight: 600;
}

.trial-info-text p {
    margin: 0 0 6px 0;
    color: #1e293b;
    line-height: 1.5;
    font-size: 11px;
}

.trial-info-text p:last-child {
    margin-bottom: 0;
}

.trial-info-text strong {
    font-size: 11px;
    font-weight: 600;
}

.payment-security-note {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 14px;
    margin-top: 16px;
}

.payment-security-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.payment-security-header i {
    color: #28a745;
    font-size: 16px;
}

.payment-security-header h4 {
    margin: 0;
    color: #1e293b;
    font-size: 13px;
    font-weight: 600;
}

.payment-security-list {
    margin: 0;
    padding-left: 18px;
    color: #6c757d;
    line-height: 1.6;
    font-size: 11px;
}

.payment-security-list li {
    margin-bottom: 4px;
}

.payment-security-list li:last-child {
    margin-bottom: 0;
}

.legal-notice p {
    margin: 0;
    color: #856404;
    font-size: 14px;
    line-height: 1.6;
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.legal-notice i {
    margin-top: 2px;
    flex-shrink: 0;
}

/* Responsive adjustments for legal acceptance */
@media (max-width: 768px) {
    .legal-acceptance-form {
        max-width: 100% !important;
    }
    
    .legal-document-box {
        padding: 10px 12px;
        max-height: none;
    }
    
    .acceptance-checkboxes {
        padding: 12px;
    }
    
    #acceptTerms-error,
    #acceptPrivacy-error {
        margin-left: 32px;
        font-size: 0.8rem;
        padding: 4px 8px;
    }
    
    .legal-document-box h3 {
        font-size: 13px;
    }
    
    .legal-content {
        font-size: 10px;
    }
    
    .legal-content p,
    .legal-content li,
    .legal-content strong {
        font-size: 10px;
    }
    
    .acceptance-checkbox {
        gap: 12px;
        padding: 10px;
    }
    
    .acceptance-checkbox input[type="checkbox"] {
        width: 20px;
        height: 20px;
    }
    
    .checkbox-text strong {
        font-size: 13px;
    }
    
    .checkbox-text span {
        font-size: 10px;
    }
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.form-group {
    margin-bottom: 1rem;
    position: relative;
}

.form-group label {
    display: block;
    margin-bottom: 0.4rem;
    color: var(--text-primary);
    font-weight: 600;
    font-size: 11px;
    transition: color 0.3s ease;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 0.6rem 0.85rem;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    font-size: 11px;
    font-weight: 500;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-sizing: border-box;
    background: var(--card-bg);
    color: var(--text-primary);
    position: relative;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #28a745;
    box-shadow: 0 0 0 3px rgba(40, 167, 69, 0.1);
    background: var(--card-bg);
    color: var(--text-primary);
    transform: translateY(-1px);
}

.form-group input:hover,
.form-group select:hover {
    border-color: var(--sidebar-active-border);
    background: var(--card-bg);
}

.form-group input::placeholder,
.form-group select::placeholder {
    color: var(--text-secondary);
    font-weight: 400;
    font-size: 11px;
}

/* Onboarding form placeholders - italic and light grey */
.onboarding-form .form-group input::placeholder,
.onboarding-form .form-group select::placeholder {
    font-style: italic;
    color: #999;
}

.password-strength {
    margin-top: 0.5rem;
    padding: 0.6rem;
    background: rgba(40, 167, 69, 0.05);
    border-radius: 10px;
    border: 1px solid rgba(40, 167, 69, 0.1);
}

.strength-bar {
    width: 100%;
    height: 8px;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 0.5rem;
    position: relative;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.strength-fill {
    height: 100%;
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 6px;
    position: relative;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.strength-fill.weak {
    background: linear-gradient(135deg, #ff6b6b, #ee5a52);
}

.strength-fill.medium {
    background: linear-gradient(135deg, #ffd93d, #ffb347);
}

.strength-fill.strong {
    background: linear-gradient(135deg, #28a745, #20c997);
}

.strength-fill.very-strong {
    background: linear-gradient(135deg, #28a745, #1e7e34);
}

.strength-text {
    font-size: 11px;
    color: #4a5568;
    font-weight: 600;
    text-align: center;
}

.password-requirements {
    background: rgba(40, 167, 69, 0.05);
    padding: 0.75rem;
    border-radius: 10px;
    margin-top: 0.6rem;
    border: 1px solid rgba(40, 167, 69, 0.1);
}

.password-requirements h4 {
    margin: 0 0 0.5rem 0;
    color: #2d3748;
    font-size: 12px;
    font-weight: 600;
}

.password-requirements ul {
    margin: 0;
    padding-left: 0;
    list-style: none;
}

.password-requirements li {
    font-size: 11px;
    color: #718096;
    margin-bottom: 0.4rem;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    padding: 0.25rem 0;
}

.password-requirements li::before {
    content: '✗';
    margin-right: 0.75rem;
    color: #e53e3e;
    font-weight: bold;
    transition: all 0.3s ease;
}

.password-requirements li.met {
    color: #38a169;
}

.password-requirements li.met::before {
    content: '✓';
    color: #38a169;
}

.radio-group {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.radio-option {
    display: flex;
    align-items: center;
    cursor: pointer;
    padding: 0.6rem 0.85rem;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    position: relative;
    overflow: hidden;
}

.radio-option::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, #28a745 0%, #1e7e34 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.radio-option:hover {
    border-color: #28a745;
    background: rgba(40, 167, 69, 0.05);
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.15);
}

.radio-option input[type="radio"] {
    display: none;
}

.radio-custom {
    width: 24px;
    height: 24px;
    border: 2px solid #cbd5e0;
    border-radius: 50%;
    margin-right: 1rem;
    position: relative;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: white;
    z-index: 1;
}

.radio-option input[type="radio"]:checked + .radio-custom {
    border-color: #28a745;
    background: #28a745;
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.3);
}

.radio-option input[type="radio"]:checked + .radio-custom::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 10px;
    height: 10px;
    background: white;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.radio-option span {
    position: relative;
    z-index: 1;
    font-weight: 500;
    color: #2d3748;
    transition: color 0.3s ease;
    font-size: 11px;
}

.radio-option input[type="radio"]:checked ~ span {
    color: #28a745;
    font-weight: 600;
}

.category-subtitle {
    color: #6c757d;
    font-size: 11px;
    margin-bottom: 0.75rem;
}

.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
}

.category-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    cursor: pointer;
    padding: 0.75rem;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.category-option:hover {
    border-color: #8B4513;
    background: rgba(139, 69, 19, 0.05);
}

.category-option input[type="checkbox"] {
    display: none;
}

.category-custom {
    width: 24px;
    height: 24px;
    border: 2px solid #e9ecef;
    border-radius: 4px;
    margin-bottom: 0.5rem;
    position: relative;
    transition: all 0.3s ease;
}

.category-option input[type="checkbox"]:checked + .category-custom {
    border-color: #8B4513;
    background: #8B4513;
}

.category-option input[type="checkbox"]:checked + .category-custom::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 12px;
    font-weight: bold;
}

.category-option i {
    font-size: 1.2rem;
    color: #6c757d;
    margin-bottom: 0.4rem;
    transition: color 0.3s ease;
}

.category-option:hover i {
    color: var(--sidebar-text);
}

.category-option span {
    font-size: 11px;
    color: #2c3e50;
    font-weight: 500;
}

.welcome-content {
    text-align: center;
    max-width: 400px;
    margin: 0 auto;
}

.welcome-icon {
    font-size: 3rem;
    color: #28a745;
    margin-bottom: 1rem;
}

.welcome-message h3 {
    color: #2c3e50;
    font-size: 1.2rem;
    margin-bottom: 0.75rem;
    font-weight: 600;
}

.welcome-message p {
    color: #6c757d;
    font-size: 11px;
    margin-bottom: 1.5rem;
    line-height: 1.5;
}

.welcome-features {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.6rem;
    background: #f8f9fa;
    border-radius: 8px;
}

.feature-item i {
    color: var(--sidebar-text);
    font-size: 1rem;
}

.feature-item span {
    color: #2c3e50;
    font-weight: 500;
    font-size: 11px;
}

.welcome-actions {
    margin-top: 2rem;
    text-align: center;
}

.welcome-actions .btn-primary {
    padding: 0.75rem 1.5rem;
    font-size: 0.9rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    text-transform: capitalize;
}

.onboarding-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
}

/* Onboarding navigation buttons - match modal button font size */
.onboarding-navigation .btn-primary,
.onboarding-navigation .btn-secondary {
    padding: 0.6rem 1.5rem;
    border: none;
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 400;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    min-width: 120px;
    position: relative;
    overflow: hidden;
    text-transform: capitalize;
    letter-spacing: 0.5px;
}

/* Removed general button font-size override - using base .btn font-size: 0.9rem */

.btn-primary {
    background: linear-gradient(135deg, #28a745 0%, #1e7e34 100%);
    color: white;
    box-shadow: 0 6px 20px rgba(40, 167, 69, 0.3);
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(40, 167, 69, 0.4);
}

.btn-primary:hover:not(:disabled)::before {
    left: 100%;
}

.btn-primary:active:not(:disabled) {
    transform: translateY(-1px);
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.2);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.9);
    color: #4a5568;
    border: 2px solid #e2e8f0;
    backdrop-filter: blur(10px);
}

.btn-secondary:hover {
    border-color: #28a745;
    color: #28a745;
    background: rgba(40, 167, 69, 0.05);
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(40, 167, 69, 0.15);
}

/* Onboarding Error Styling */
.onboarding-error {
    background: linear-gradient(135deg, #fed7d7 0%, #feb2b2 100%);
    border: 1px solid #fc8181;
    border-radius: 12px;
    padding: 1.25rem;
    margin: 1.5rem 0;
    display: none;
    box-shadow: 0 8px 25px rgba(220, 53, 69, 0.15);
    backdrop-filter: blur(10px);
}

.error-content {
    display: flex;
    align-items: center;
    gap: 1rem;
    color: #742a2a;
}

.error-content i {
    font-size: 1.5rem;
    color: #28a745;
    animation: pulse 2s infinite;
}

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

.error-content span {
    flex: 1;
    font-weight: 600;
    font-size: 1rem;
}

.error-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #742a2a;
    cursor: pointer;
    padding: 0.25rem;
    line-height: 1;
    transition: all 0.3s ease;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.error-close:hover {
    color: #28a745;
    background: rgba(40, 167, 69, 0.1);
    transform: scale(1.1);
}

/* Show field error messages for email and username validation */
.field-error {
    display: block !important;
    color: #e53e3e !important;
    font-size: 11px !important;
    font-style: italic !important;
    font-weight: normal !important;
    margin-top: 0.4rem !important;
    background: none !important;
    border: none !important;
    padding: 0 !important;
    border-radius: 0 !important;
}

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

/* Remove error styling from form inputs */
.form-group input.error,
.form-group select.error {
    border-color: #e2e8f0 !important;
    box-shadow: none !important;
    background: rgba(255, 255, 255, 0.8) !important;
}

/* Remove category error styling */
.category-grid.error {
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    padding: 0.5rem;
    background: rgba(255, 255, 255, 0.8);
}

/* Mobile Responsive for Onboarding */
@media (max-width: 768px) {
    .onboarding-container {
        padding: 0.75rem;
    }
    
    .onboarding-content {
        padding: 1.25rem;
        border-radius: 16px;
    }
    
    .step-header h2 {
        font-size: 1.1rem;
        font-weight: 600;
    }
    
    .step-header p {
        font-size: 0.8rem;
    }
    
    .form-row {
        grid-template-columns: 1fr;
        gap: 0;
    }
    
    .form-group {
        margin-bottom: 1rem;
    }
    
    .form-group input,
    .form-group select {
        padding: 0.75rem 0.875rem;
        font-size: 0.9rem;
    }
    
    .category-grid {
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    }
    
    .onboarding-navigation {
        flex-direction: column;
        gap: 0.75rem;
        padding: 1rem 0;
    }
    
    .onboarding-navigation .btn-primary,
    .onboarding-navigation .btn-secondary {
        width: 100%;
        padding: 0.6rem 1.25rem;
        font-size: 0.9rem;
    }
    
    .progress-container {
        padding: 0.75rem;
        margin-bottom: 1.25rem;
    }
    
    .radio-option {
        padding: 0.625rem 0.875rem;
    }
    
    .radio-custom {
        width: 18px;
        height: 18px;
        margin-right: 0.625rem;
    }
}

@media (max-width: 480px) {
    .onboarding-container {
        padding: 0.5rem;
    }
    
    .onboarding-content {
        padding: 1rem;
        border-radius: 12px;
    }
    
    .step-header h2 {
        font-size: 1rem;
        font-weight: 600;
    }
    
    .step-header p {
        font-size: 0.75rem;
    }
    
    .progress-container {
        padding: 0.625rem;
        margin-bottom: 1rem;
    }
    
    .onboarding-navigation .btn-primary,
    .onboarding-navigation .btn-secondary {
        padding: 0.5rem 1rem;
        font-size: 0.85rem;
    }
    
    .form-group {
        margin-bottom: 0.875rem;
    }
    
    .form-group input,
    .form-group select {
        padding: 0.625rem 0.75rem;
        font-size: 0.875rem;
    }
}

/* Recurring Allocation Styles */
.header-actions {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.recurring-section {
    margin-bottom: 1.5rem;
}

.recurring-list {
    max-height: 400px;
    overflow-y: auto;
    margin-top: 1rem;
}

.recurring-source-item,
.recurring-allocation-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    margin-bottom: 0.75rem;
    transition: all 0.2s ease;
}

.recurring-source-item:hover,
.recurring-allocation-item:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.6);
    transform: translateY(-1px);
}

.source-info,
.allocation-info {
    flex: 1;
}

.source-name,
.allocation-subcategory {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.allocation-category {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 0.25rem;
}

.source-amount,
.allocation-amount {
    font-size: 1.125rem;
    font-weight: 700;
    color: #28a745;
}

.source-actions,
.allocation-actions {
    display: flex;
    gap: 0.5rem;
}

.no-recurring-sources,
.no-recurring-allocations {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-secondary);
}

.no-recurring-sources i,
.no-recurring-allocations i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.no-recurring-sources p,
.no-recurring-allocations p {
    margin-bottom: 0.5rem;
}

.action-buttons-section {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 2rem;
    flex-wrap: wrap;
}

.action-buttons-section .btn {
    min-width: 200px;
}

/* Responsive adjustments for recurring components */
@media (max-width: 768px) {
    .header-actions {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .action-buttons-section {
        flex-direction: column;
        align-items: center;
    }
    
    .action-buttons-section .btn {
        width: 100%;
        max-width: 300px;
    }
    
    .recurring-source-item,
    .recurring-allocation-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .source-actions,
    .allocation-actions {
        width: 100%;
        justify-content: flex-end;
    }
}

/* Information Card Styles - Enhanced "How Budget Periods Work" Section */
.info-card {
    background: linear-gradient(135deg, var(--card-bg) 0%, var(--light-color) 100%);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: var(--shadow);
    margin-bottom: 2rem;
    overflow: hidden;
    position: relative;
}

.info-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #8B4513, #D2691E, #CD853F);
}

.info-card .card-header {
    background: linear-gradient(135deg, var(--card-bg) 0%, var(--light-color) 100%);
    border-bottom: 1px solid var(--border-color);
    padding: 1.5rem 2rem;
    position: relative;
}

.info-card .card-header h3 {
    margin: 0;
    color: var(--text-primary);
    font-size: 1.4rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.info-card .card-header h3 i {
    color: #8B4513;
    font-size: 1.2rem;
}

.info-card .card-body {
    padding: 1.5rem;
}

.info-content {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
}

.info-section {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1rem;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.info-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #8B4513, #D2691E);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.info-section:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    border-color: #8B4513;
}

.info-section:hover::before {
    transform: scaleX(1);
}

.info-section h4 {
    margin: 0 0 0.75rem 0;
    color: var(--text-primary);
    font-size: 0.95rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.info-section h4 i {
    color: #8B4513;
    font-size: 0.9rem;
    width: 18px;
    text-align: center;
}

.info-section p {
    margin: 0;
    color: var(--text-secondary);
    line-height: 1.5;
    font-size: 0.85rem;
}

/* Enhanced visual hierarchy with different colors for each section */
.info-section:nth-child(1) h4 i { color: #28a745; }
.info-section:nth-child(2) h4 i { color: #007bff; }
.info-section:nth-child(3) h4 i { color: #17a2b8; }
.info-section:nth-child(4) h4 i { color: #ffc107; }

/* Responsive design for info sections */
@media (max-width: 1200px) {
    .info-content {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
}

@media (max-width: 768px) {
    .info-content {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .info-card .card-header {
        padding: 1rem 1.5rem;
    }
    
    .info-card .card-body {
        padding: 1.5rem;
    }
    
    .info-section {
        padding: 1rem;
    }
    
    .info-card .card-header h3 {
        font-size: 1.2rem;
    }
}

/* Mobile Expandable Budget Periods */
.mobile-toggle-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 6px;
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

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

.mobile-toggle-btn i {
    transition: transform 0.3s ease;
}

.mobile-periods-container {
    display: none; /* Hidden by default on mobile */
}

.mobile-periods-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.mobile-period-item {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.mobile-period-item.active {
    border-left: 4px solid #4caf50;
    background: var(--main-bg);
}

.mobile-period-header {
    padding: 0.75rem 1rem;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background-color 0.3s ease;
    min-height: 60px;
}

.mobile-period-header:hover {
    background: var(--light-color);
}

.mobile-period-title h4 {
    margin: 0 0 0.25rem 0;
    color: var(--text-primary);
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.2;
}

.mobile-period-title {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    flex: 1;
}

.mobile-period-title .type-badge {
    font-size: 0.7rem;
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    align-self: flex-start;
}

.mobile-period-title .active-indicator {
    font-size: 0.65rem;
    padding: 0.15rem 0.3rem;
    border-radius: 3px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    align-self: flex-start;
}

.mobile-period-toggle {
    color: var(--text-secondary);
    font-size: 1.2rem;
}

.mobile-period-content {
    display: none;
    padding: 0 1rem 0.75rem 1rem;
    border-top: 1px solid var(--border-color);
}

.mobile-period-details {
    margin-bottom: 0.75rem;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.35rem 0;
    border-bottom: 1px solid var(--border-color);
}

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

.detail-row .label {
    font-weight: 500;
    color: var(--text-secondary);
    font-size: 0.8rem;
}

.detail-row .value {
    color: var(--text-primary);
    font-size: 0.8rem;
    text-align: right;
}

.mobile-period-actions {
    display: flex;
    gap: 0.4rem;
    justify-content: flex-end;
}

.mobile-period-actions .btn {
    font-size: 0.75rem;
    padding: 0.3rem 0.6rem;
    min-width: auto;
}

/* Responsive visibility */
@media (min-width: 769px) {
    .mobile-view {
        display: none !important;
    }
    
    .desktop-view {
        display: block;
    }
    
    .mobile-toggle-btn {
        display: none;
    }
}

@media (max-width: 768px) {
    .desktop-view {
        display: none !important;
    }
    
    .mobile-view {
        display: block;
    }
    
    .mobile-toggle-btn {
        display: flex;
    }
    
    .card-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
    }
    
    .card-header h3 {
        margin: 0;
    }
}

/* Floating Record Transaction Button */
.floating-record-btn {
    position: fixed;
    bottom: 20px;
    right: 30px;
    background: linear-gradient(135deg, #8B4513 0%, #D2691E 100%);
    color: white;
    border: none;
    border-radius: 50px;
    padding: 12px 20px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 6px 20px rgba(139, 69, 19, 0.4);
    z-index: 1000;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.floating-record-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(139, 69, 19, 0.5);
    background: linear-gradient(135deg, #A0522D 0%, #E3964A 100%);
}

.floating-record-btn:active {
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(139, 69, 19, 0.4);
}

.floating-record-btn i {
    font-size: 18px;
    line-height: 1;
}

.floating-btn-text {
    white-space: nowrap;
}

/* Mobile responsive - show only icon on small screens */
@media (max-width: 768px) {
    .floating-record-btn {
        bottom: 20px;
        right: 20px;
        padding: 18px;
        border-radius: 50%;
        width: 60px;
        height: 60px;
        justify-content: center;
    }
    
    .floating-btn-text {
        display: none;
    }
    
    .floating-record-btn i {
        font-size: 24px;
        margin: 0;
    }
}

/* Dark theme support */
[data-theme="dark"] .floating-record-btn {
    background: linear-gradient(135deg, #A0522D 0%, #D2691E 100%);
    box-shadow: 0 6px 20px rgba(210, 105, 30, 0.5);
}

[data-theme="dark"] .floating-record-btn:hover {
    background: linear-gradient(135deg, #B87333 0%, #E3964A 100%);
    box-shadow: 0 8px 25px rgba(210, 105, 30, 0.6);
}

/* ── Bottom Navigation Bar (Mobile Only) ── */
.bottom-nav {
    display: none;
}

@media (max-width: 768px) {
    /* Show bottom nav */
    .bottom-nav {
        display: flex;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        height: 62px;
        background: var(--card-bg);
        border-top: 1px solid var(--border-color);
        z-index: 1100;
        align-items: stretch;
        padding-bottom: env(safe-area-inset-bottom, 0px);
        box-shadow: 0 -2px 16px rgba(0, 0, 0, 0.12);
    }

    .bottom-nav-item {
        flex: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 3px;
        color: var(--text-secondary);
        text-decoration: none;
        font-size: 0.62rem;
        font-weight: 500;
        letter-spacing: 0.01em;
        cursor: pointer;
        border: none;
        background: none;
        padding: 0;
        transition: color 0.2s ease;
        -webkit-tap-highlight-color: transparent;
        font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    }

    .bottom-nav-item i {
        font-size: 1.2rem;
        line-height: 1;
    }

    .bottom-nav-item.active,
    .bottom-nav-item.active i {
        color: #8B4513;
    }

    /* Centre FAB */
    .bottom-nav-fab {
        flex: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        border: none;
        background: none;
        padding: 0;
        -webkit-tap-highlight-color: transparent;
    }

    .bottom-nav-fab-inner {
        width: 52px;
        height: 52px;
        background: linear-gradient(135deg, #8B4513 0%, #D2691E 100%);
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        box-shadow: 0 4px 14px rgba(139, 69, 19, 0.45);
        margin-top: -18px;
        transition: transform 0.18s ease, box-shadow 0.18s ease;
    }

    .bottom-nav-fab-inner i {
        color: white;
        font-size: 1.25rem;
        line-height: 1;
    }

    .bottom-nav-fab:active .bottom-nav-fab-inner {
        transform: scale(0.91);
        box-shadow: 0 2px 8px rgba(139, 69, 19, 0.3);
    }

    .bottom-nav-item.disabled,
    .bottom-nav-item.disabled i {
        color: var(--text-secondary) !important;
        opacity: 0.45;
        cursor: not-allowed;
    }

    .bottom-nav-fab.disabled .bottom-nav-fab-inner {
        background: var(--text-secondary) !important;
        box-shadow: none;
        opacity: 0.45;
        cursor: not-allowed;
    }

    .more-menu-item.disabled,
    .more-menu-item.disabled i {
        color: var(--text-secondary) !important;
        opacity: 0.45;
        cursor: not-allowed;
        pointer-events: none;
    }

    /* Hide hamburger — bottom nav replaces it */
    .mobile-menu-btn {
        display: none !important;
    }

    /* Hide floating FAB — bottom nav + button replaces it */
    .floating-record-btn {
        display: none !important;
    }

    /* Add breathing room at the bottom for content */
    .main-wrapper {
        padding-bottom: calc(62px + env(safe-area-inset-bottom, 0px));
        padding-top: 0;
    }

    /* Hide footer on mobile */
    .footer {
        display: none;
    }

    /* ── Modal Bottom Sheet ── */
    .modal-content {
        width: 100% !important;
        max-width: 100% !important;
        top: auto !important;
        bottom: 0 !important;
        left: 0 !important;
        right: 0 !important;
        transform: none !important;
        border-radius: 20px 20px 0 0 !important;
        max-height: 88vh;
        animation: sheetSlideUp 0.28s cubic-bezier(0.32, 0.72, 0, 1);
        padding-bottom: env(safe-area-inset-bottom, 0px);
    }

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

    /* Sheet drag handle indicator */
    .modal-content::before {
        content: '';
        display: block;
        width: 36px;
        height: 4px;
        background: var(--border-color);
        border-radius: 2px;
        margin: 10px auto 0;
        flex-shrink: 0;
    }

    /* ── Touch Targets ── */
    .action-btn {
        width: 36px !important;
        height: 36px !important;
        padding: 0 !important;
        display: flex !important;
        align-items: center;
        justify-content: center;
        font-size: 0.8rem !important;
    }

    /* ── Font Readability — raise minimums ── */
    .card-title p,
    .overview-card .card-title p {
        font-size: 0.78rem !important;
    }

    .total-label {
        font-size: 0.78rem !important;
    }
}

/* ── More Menu Popup ── */
.more-menu-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 1150;
}

.more-menu-overlay.active {
    display: block;
}

.more-menu-popup {
    display: none;
    position: fixed;
    bottom: 70px;
    right: 8px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 6px 0;
    min-width: 210px;
    box-shadow: 0 -4px 28px rgba(0, 0, 0, 0.18);
    z-index: 1200;
}

.more-menu-popup.active {
    display: block;
    animation: moreMenuSlideUp 0.2s ease;
}

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

.more-menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 18px;
    color: var(--text-primary);
    text-decoration: none;
    font-size: 0.88rem;
    font-weight: 500;
    cursor: pointer;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    transition: background 0.15s ease;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    -webkit-tap-highlight-color: transparent;
}

.more-menu-item i {
    width: 18px;
    text-align: center;
    color: #8B4513;
    font-size: 0.95rem;
    flex-shrink: 0;
}

.more-menu-item:active {
    background: rgba(139, 69, 19, 0.08);
}

.more-menu-divider {
    height: 1px;
    background: var(--border-color);
    margin: 4px 0;
}

.more-menu-logout,
.more-menu-logout i {
    color: #e74c3c;
}

/* ── Budgets page compact overrides ── */
.info-card {
    background: var(--card-bg) !important;
    border-radius: 0 !important;
    margin-bottom: 0.75rem !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.6) !important;
}
.info-card::before { border-radius: 0 !important; }
.info-card .card-header {
    padding: 0.55rem 1rem !important;
    background: var(--card-bg) !important;
}
.info-card .card-header h3 { font-size: 0.82rem !important; gap: 0.5rem !important; }
.info-card .card-header h3 i { font-size: 0.78rem !important; }
.info-card .card-body { padding: 0.6rem 0.75rem !important; }
.info-content { gap: 0.5rem !important; }
.info-section {
    border-radius: 0 !important;
    padding: 0.5rem 0.65rem !important;
    box-shadow: none !important;
}
.info-section:hover { transform: none !important; box-shadow: none !important; }
.info-section h4 { font-size: 0.75rem !important; margin: 0 0 0.25rem 0 !important; gap: 0.35rem !important; }
.info-section h4 i { font-size: 0.72rem !important; width: 14px !important; }
.info-section p { font-size: 0.7rem !important; line-height: 1.35 !important; }

.budgets-table { border-radius: 0 !important; font-size: 0.82rem !important; }
.budgets-table th { padding: 0.45rem 0.75rem !important; font-size: 0.7rem !important; letter-spacing: 0.3px !important; }
.budgets-table td { padding: 0.45rem 0.75rem !important; }
.budgets-table tbody tr:hover { transform: none !important; box-shadow: none !important; }
.period-name { font-size: 0.82rem !important; }
.period-type .type-badge {
    padding: 0.15rem 0.45rem !important;
    border-radius: 2px !important;
    font-size: 0.68rem !important;
}
.period-dates, .period-created { font-size: 0.78rem !important; }
.period-status .badge {
    padding: 0.15rem 0.45rem !important;
    border-radius: 2px !important;
    font-size: 0.68rem !important;
}
.period-actions .btn {
    min-width: 28px !important;
    height: 28px !important;
    font-size: 0.78rem !important;
    border-radius: 2px !important;
    padding: 0.25rem !important;
}
.period-actions .btn:hover { transform: none !important; }
.no-data { padding: 1.5rem !important; }
.loading { padding: 1rem !important; }



.source-recurring-icon {
    color: #28a745 !important;
    font-size: 0.75rem;
    flex-shrink: 0;
    align-self: center;
}

/* ── CSV Import Page ──────────────────────────────────────────────────────── */

/* Step indicator */
.import-steps {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    margin-bottom: 1.5rem;
    flex-wrap: nowrap;
}
.import-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.3rem;
    opacity: 0.4;
    transition: opacity 0.2s;
}
.import-step.active,
.import-step.done { opacity: 1; }
.step-circle {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--border-color);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
    transition: background 0.2s, color 0.2s;
}
.import-step.active .step-circle {
    background: var(--primary-color);
    color: #fff;
}
.import-step.done .step-circle {
    background: #28a745;
    color: #fff;
}
.step-label {
    font-size: 0.7rem;
    color: var(--text-secondary);
    white-space: nowrap;
}
.import-step.active .step-label { color: var(--text-primary); font-weight: 600; }
.import-step-line {
    flex: 1;
    height: 2px;
    background: var(--border-color);
    min-width: 24px;
    max-width: 60px;
    margin-bottom: 1.1rem;
}

/* Upload area */
.import-upload-area {
    border: 2px dashed var(--border-color);
    border-radius: 12px;
    padding: 2rem 1.5rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
    background: var(--card-bg);
}
.import-upload-area.drag-over {
    border-color: var(--primary-color);
    background: var(--hover-bg);
}
.import-upload-icon {
    font-size: 2.5rem;
    color: var(--text-secondary);
}
.import-upload-text { font-weight: 600; color: var(--text-primary); margin: 0; }
.import-upload-sub { color: var(--text-secondary); margin: 0; font-size: 0.85rem; }

/* File info bar */
.import-file-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 0.75rem;
    background: var(--hover-bg);
    border-radius: 8px;
    font-size: 0.9rem;
}
.import-file-info .text-success { color: #28a745; }
.import-file-info span { flex: 1 1 auto; }

/* Profile row */
.import-profile-row {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}
.import-profile-row .form-control { flex: 1; min-width: 0; }
.import-profile-row .btn { flex-shrink: 0; width: auto !important; }

/* Column mapping grid */
.import-mapping-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem 1.5rem;
    margin-bottom: 1rem;
}
@media (max-width: 600px) {
    .import-mapping-grid { grid-template-columns: 1fr; }
}

/* Preview table */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.import-preview-table-wrap {
    margin-bottom: 1.5rem;
    max-width: 100%;
    overflow: hidden;
}
.import-preview-label {
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    margin-bottom: 0.4rem;
}
.import-preview-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8rem;
}
.import-preview-table th {
    background: var(--hover-bg);
    padding: 0.4rem 0.6rem;
    text-align: left;
    white-space: nowrap;
    color: var(--text-secondary);
    font-weight: 600;
    border-bottom: 1px solid var(--border-color);
}
.import-preview-table td {
    padding: 0.35rem 0.6rem;
    border-bottom: 1px solid var(--border-color);
    white-space: nowrap;
    max-width: 160px;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Save profile */
.import-save-profile {
    margin: 1rem 0;
    padding: 0.75rem;
    background: var(--hover-bg);
    border-radius: 8px;
}
.import-checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.9rem;
}

/* Bulk assign */

/* Review table */
.import-review-header { display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap; }
.import-review-stats { display: flex; gap: 0.5rem; }
.import-review-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}
.import-review-table th {
    background: var(--hover-bg);
    padding: 0.5rem 0.6rem;
    text-align: left;
    color: var(--text-secondary);
    font-weight: 600;
    border-bottom: 1px solid var(--border-color);
    white-space: nowrap;
}
.import-review-table td {
    padding: 0.4rem 0.6rem;
    border-bottom: 1px solid var(--border-color);
    vertical-align: middle;
}
.import-desc-cell {
    max-width: 220px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.review-subcat-sel { min-width: 160px; font-size: 0.82rem; }

/* Parse errors */
.import-errors {
    margin-top: 1rem;
    padding: 0.75rem 1rem;
    background: rgba(220,53,69,0.08);
    border: 1px solid rgba(220,53,69,0.3);
    border-radius: 8px;
    font-size: 0.85rem;
}
.import-errors h4 { margin: 0 0 0.5rem; color: #dc3545; font-size: 0.9rem; }
.import-errors ul { margin: 0; padding-left: 1.2em; }

/* Summary step 4 */
.import-summary {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
}
.import-summary-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}
.import-summary-label { font-size: 0.78rem; text-transform: uppercase; color: var(--text-secondary); font-weight: 600; }
.import-summary-value { font-size: 2rem; font-weight: 700; color: var(--text-primary); }

/* Result box */
.import-result {
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    font-size: 0.9rem;
    line-height: 1.6;
}
.import-result--success {
    background: rgba(40,167,69,0.1);
    border: 1px solid rgba(40,167,69,0.3);
    color: var(--text-primary);
}
.import-result .fa-check-circle { color: #28a745; margin-right: 0.4rem; }

/* Badge */
.badge { display: inline-block; padding: 0.2em 0.55em; border-radius: 999px; font-size: 0.78rem; font-weight: 600; }
.badge-primary { background: var(--primary-color); color: #fff; }
.badge-danger { background: #dc3545; color: #fff; }

/* Review filter tabs */
.review-filters {
    display: flex;
    gap: 0.35rem;
    margin-bottom: 1rem;
}
.review-filter-btn {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.9rem;
    border-radius: 999px;
    border: 1px solid var(--border-color);
    background: var(--card-bg);
    color: var(--text-secondary);
    font-size: 0.85rem;
    cursor: pointer;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.review-filter-btn:hover {
    background: var(--hover-bg);
    color: var(--text-primary);
}
.review-filter-btn.active {
    background: var(--primary-color);
    color: #fff;
    border-color: var(--primary-color);
}
.review-filter-count {
    background: rgba(255,255,255,0.25);
    color: inherit;
    border-radius: 999px;
    padding: 0 0.45em;
    font-size: 0.75rem;
    font-weight: 700;
}
.review-filter-btn:not(.active) .review-filter-count {
    background: var(--hover-bg);
    color: var(--text-secondary);
}

/* Remove button in review table */
.review-remove-btn {
    width: 26px !important;
    height: 26px !important;
    min-width: unset !important;
    padding: 0 !important;
    border-radius: 50% !important;
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    transition: background 0.15s, color 0.15s;
}
.review-remove-btn:hover {
    background: #dc3545;
    border-color: #dc3545;
    color: #fff;
}

/* Review tabs (underline style) */
.review-tabs {
    display: flex;
    border-bottom: 2px solid var(--border-color);
    margin-bottom: 1.25rem;
    gap: 0;
}
.review-tab {
    padding: 0.55rem 1.25rem;
    border: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    background: none;
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.45rem;
    transition: color 0.15s, border-color 0.15s;
    white-space: nowrap;
}
.review-tab:hover { color: var(--text-primary); }
.review-tab.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
    font-weight: 600;
}
.review-tab-count {
    display: inline-block;
    background: var(--hover-bg);
    color: var(--text-secondary);
    border-radius: 999px;
    padding: 0 0.5em;
    font-size: 0.72rem;
    font-weight: 700;
    min-width: 1.4em;
    text-align: center;
}
.review-tab.active .review-tab-count {
    background: var(--primary-color);
    color: #fff;
}

/* ── Importer: keyword filter + bulk assign bar ────────────────────────────── */
.import-filter-bar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-bottom: 0.75rem;
}
.import-filter-input-wrap {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 1 1 180px;
    background: var(--input-bg, var(--card-bg));
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 0 0.6rem;
}
.import-filter-input-wrap .fa-search { color: var(--text-secondary); font-size: 0.8rem; }
.import-filter-input-wrap .form-control {
    border: none !important;
    background: transparent !important;
    box-shadow: none !important;
    padding-left: 0 !important;
}
.import-filter-assign {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}
.import-filter-assign .form-control { min-width: 160px; }

/* ── Transactions page: bulk reassign panel ────────────────────────────────── */
.bulk-reassign-panel {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    padding: 0.65rem 1rem;
    background: var(--hover-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    margin-bottom: 1rem;
    font-size: 0.85rem;
}
.bulk-reassign-count { color: var(--text-secondary); white-space: nowrap; }
.bulk-reassign-select { flex: 1 1 200px; min-width: 160px; }

/* Unassigned filter button active state */
#unassignedFilterBtn.active {
    background: var(--primary-color);
    color: #fff;
    border-color: var(--primary-color);
}

/* Import draft resume banner */
.import-draft-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    background: var(--card-bg);
    border: 1px solid var(--primary-color);
    border-left: 4px solid var(--primary-color);
    border-radius: 8px;
    padding: 0.75rem 1rem;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
}
.import-draft-banner-content {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    color: var(--text-primary);
    font-size: 0.9rem;
}
.import-draft-banner-content .fa-clock { color: var(--primary-color); }
.import-draft-banner-actions { display: flex; gap: 0.5rem; }

/* Resolve progress bar */
.import-resolve-progress {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 0;
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
}
.import-resolve-progress .btn { flex-shrink: 0; }
.import-resolve-progress-text {
    font-size: 0.82rem;
    color: var(--text-secondary);
    white-space: nowrap;
    min-width: 180px;
}
.import-resolve-bar {
    flex: 1;
    height: 6px;
    background: var(--hover-bg);
    border-radius: 999px;
    overflow: hidden;
}
.import-resolve-bar-fill {
    height: 100%;
    background: #28a745;
    border-radius: 999px;
    transition: width 0.25s ease;
}

/* Resolve button (green checkmark) */
.review-resolve-btn {
    width: 26px !important;
    height: 26px !important;
    min-width: unset !important;
    padding: 0 !important;
    border-radius: 50% !important;
    background: transparent;
    border: 1px solid #28a745;
    color: #28a745;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    transition: background 0.15s, color 0.15s;
}
.review-resolve-btn:hover {
    background: #28a745;
    color: #fff;
}

/* ── Merchant Rules page ───────────────────────────────────────────────────── */
.rules-card {
    margin-top: 1.5rem;
}
.rules-page .card-header h2 {
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
}

.rules-count-badge {
    display: inline-block;
    background: var(--primary-color);
    color: #fff;
    border-radius: 999px;
    padding: 0 0.55em;
    font-size: 0.72rem;
    font-weight: 700;
    min-width: 1.4em;
    text-align: center;
    vertical-align: middle;
    margin-left: 0.4rem;
}

.rules-empty {
    text-align: center;
    padding: 2.5rem 1rem;
    color: var(--text-secondary);
}
.rules-empty-icon {
    font-size: 2.5rem;
    color: var(--text-secondary);
    opacity: 0.4;
    display: block;
    margin-bottom: 0.75rem;
}
.rules-empty p { margin: 0 0 0.35rem; }

.rules-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}
.rules-table thead tr {
    border-bottom: 2px solid var(--border-color);
}
.rules-table th {
    padding: 0.6rem 0.75rem;
    text-align: left;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    white-space: nowrap;
}
.rules-table tbody tr {
    border-bottom: 1px solid var(--border-color);
    transition: background 0.12s;
}
.rules-table tbody tr:last-child { border-bottom: none; }
.rules-table tbody tr:hover { background: var(--hover-bg); }
.rules-table td {
    padding: 0.6rem 0.75rem;
    vertical-align: middle;
}

.rule-keyword {
    background: var(--hover-bg);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 0.15em 0.5em;
    font-family: monospace;
    font-size: 0.85em;
    color: var(--text-primary);
}
.rule-category {
    color: var(--text-secondary);
    font-size: 0.85em;
}
.rule-arrow {
    font-size: 0.65rem;
    color: var(--text-secondary);
    margin: 0 0.35rem;
}
.rule-used {
    color: var(--text-secondary);
    font-size: 0.85em;
    white-space: nowrap;
}

/* ── Import page: rule badge on matched rows ───────────────────────────────── */
.rule-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--primary-color);
    color: #fff;
    font-size: 0.6rem;
    flex-shrink: 0;
    cursor: default;
}
.import-subcat-cell {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

/* ── Save-as-rule overlay (import page) ────────────────────────────────────── */
.save-rule-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 9000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}
.save-rule-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 1.5rem;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
}
.save-rule-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 0.35rem;
}
.save-rule-sub {
    font-size: 0.82rem;
    color: var(--text-secondary);
    margin: 0 0 1rem;
}
.save-rule-subcat-display {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 1.1rem;
}
.save-rule-subcat-display strong { color: var(--text-primary); }

/* ── Reports page ──────────────────────────────────────────────────────────── */
.reports-range-group {
    display: flex;
    gap: 0.35rem;
    align-items: center;
    margin-top: 0.9rem;
}
.reports-range-btn {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 999px;
    padding: 0.2rem 0.7rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    transition: background 0.15s, color 0.15s, border-color 0.15s, box-shadow 0.15s;
}
.reports-range-btn:hover {
    color: var(--text-primary);
    border-color: var(--primary-color);
}
.reports-range-btn.active {
    background: var(--primary-color);
    color: #fff;
    border-color: var(--primary-color);
    box-shadow: 0 2px 8px rgba(139, 69, 19, 0.35);
}

/* Reports page — card section titles */
.reports-page .card-header h2 {
    font-size: 0.95rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-primary);
}

/* Reports page — chart cards */
.reports-page .card {
    background: var(--card-bg);
    border-radius: 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.6);
    position: relative;
    overflow: hidden;
    margin-bottom: 1.5rem;
    transition: box-shadow 0.2s;
}
.reports-page .card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #8B4513 0%, #D2691E 100%);
    z-index: 1;
}
.reports-page .card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 1.5rem 0.75rem;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 0;
}
.reports-page .card-body {
    padding: 1.25rem 1.5rem;
}

/* KPI row */
.reports-kpi-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-top: 1rem;
    margin-bottom: 1.25rem;
}
.reports-kpi-card {
    background: var(--card-bg);
    border-radius: 0;
    padding: 1.5rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.6);
    position: relative;
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
}
.reports-kpi-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #8B4513 0%, #D2691E 100%);
}
.reports-kpi-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.7);
}
.reports-kpi-label {
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    margin-bottom: 0.4rem;
}
.reports-kpi-value {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
}
.reports-kpi-value.kpi-positive { color: #10b981; }
.reports-kpi-value.kpi-negative { color: #ef4444; }
.reports-kpi-sub {
    font-size: 0.73rem;
    color: var(--text-secondary);
    margin-top: 0.3rem;
}

/* Mid row (category + budget vs actual) */
.reports-mid-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
    margin-bottom: 1.25rem;
}

/* Category doughnut layout */
.reports-cat-body {
    display: flex;
    gap: 2rem;
    align-items: center;
    flex-wrap: wrap;
}
.reports-donut-wrap {
    width: 280px;
    flex-shrink: 0;
}
.reports-cat-legend {
    flex: 1;
    min-width: 200px;
    max-width: 420px;
    display: flex;
    flex-direction: column;
    gap: 0;
}
.reports-cat-legend-item {
    display: grid;
    grid-template-columns: 12px 1fr 90px 40px;
    align-items: center;
    column-gap: 0.5rem;
    font-size: 0.82rem;
    padding: 0.45rem 0.5rem;
    border-radius: 6px;
    transition: background 0.12s;
}
.reports-cat-legend-item:hover { background: var(--hover-bg); }
.reports-cat-dot {
    width: 12px;
    height: 12px;
    border-radius: 3px;
    flex-shrink: 0;
}
.reports-cat-name {
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}
.reports-cat-amt {
    color: var(--text-primary);
    font-weight: 600;
    white-space: nowrap;
    text-align: right;
}
.reports-cat-pct {
    color: var(--text-secondary);
    font-size: 0.73rem;
    white-space: nowrap;
    text-align: right;
}

/* Badge-muted (period label next to Budget vs Actual heading) */
.badge-muted {
    font-size: 0.72rem;
    font-weight: 500;
    color: var(--text-secondary);
    background: var(--hover-bg);
    border-radius: 999px;
    padding: 0.15em 0.6em;
    margin-left: 0.5rem;
    vertical-align: middle;
}

/* Budget vs Actual bars */
.bva-list { display: flex; flex-direction: column; gap: 0.65rem; }
.bva-item {}
.bva-labels {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 0.5rem;
    margin-bottom: 0.25rem;
    font-size: 0.8rem;
}
.bva-name {
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 55%;
}
.bva-amount {
    color: var(--text-secondary);
    white-space: nowrap;
    font-size: 0.78rem;
    display: flex;
    align-items: center;
    gap: 0.3rem;
    flex-wrap: wrap;
    justify-content: flex-end;
}
.bva-amount.bva-over { color: #ef4444; }
.bva-of { color: var(--text-secondary); font-size: 0.72em; }
.bva-over-tag {
    background: rgba(239,68,68,0.12);
    color: #ef4444;
    border-radius: 4px;
    padding: 0 0.3em;
    font-size: 0.78em;
    font-weight: 600;
}
.bva-track {
    height: 6px;
    background: var(--hover-bg);
    border-radius: 999px;
    overflow: hidden;
}
.bva-fill {
    height: 100%;
    background: var(--primary-color);
    border-radius: 999px;
    transition: width 0.3s ease;
}
.bva-fill.bva-fill-over { background: #ef4444; }

/* Merchant table */
@media (max-width: 768px) {
    .reports-merchant-table th:nth-child(1),
    .reports-merchant-table td:nth-child(1),
    .reports-merchant-table th:nth-child(3),
    .reports-merchant-table td:nth-child(3) { display: none; }
}

.reports-merchant-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}
.reports-merchant-table thead tr { border-bottom: 2px solid var(--border-color); }
.reports-merchant-table th {
    padding: 0.6rem 0.75rem;
    text-align: left;
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    white-space: nowrap;
}
.reports-merchant-table td {
    padding: 0.6rem 0.75rem;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
    vertical-align: middle;
}
.reports-merchant-table tbody tr:last-child td { border-bottom: none; }
.reports-merchant-table tbody tr:hover { background: var(--hover-bg); }
.merchant-share-cell {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    min-width: 100px;
}
.merchant-share-track {
    flex: 1;
    height: 6px;
    background: var(--hover-bg);
    border-radius: 999px;
    overflow: hidden;
}
.merchant-share-bar {
    height: 100%;
    background: var(--primary-color);
    border-radius: 999px;
    opacity: 0.75;
    min-width: 2px;
    transition: width 0.3s;
}
.merchant-share-cell span {
    font-size: 0.78rem;
    color: var(--text-secondary);
    white-space: nowrap;
    min-width: 3em;
    text-align: right;
}

/* Responsive */
@media (max-width: 900px) {
    .reports-kpi-row { grid-template-columns: repeat(2, 1fr); }
    .reports-mid-row { grid-template-columns: 1fr; }
}
@media (max-width: 540px) {
    .reports-kpi-row { grid-template-columns: repeat(2, 1fr); gap: 0.6rem; }
    .reports-kpi-card { padding: 1rem 1.1rem; }
    .reports-range-btn { padding: 0.25rem 0.65rem; font-size: 0.78rem; }
    .reports-cat-body { flex-direction: column; align-items: flex-start; }
    .reports-donut-wrap { width: 100%; max-width: 280px; margin: 0 auto; }
}

/* ── Trend chart view toggle (Total / By Category) ─────────────────────── */
.reports-view-toggle {
    display: flex;
    gap: 0;
    background: var(--main-bg);
    border: 1.5px solid var(--border-color);
    border-radius: 999px;
    padding: 0.18rem;
}
.reports-view-btn {
    background: transparent;
    border: none;
    border-radius: 999px;
    padding: 0.22rem 0.85rem;
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
    white-space: nowrap;
}
.reports-view-btn:hover { color: var(--text-primary); }
.reports-view-btn.active {
    background: var(--primary-color);
    color: #fff;
    box-shadow: 0 1px 4px rgba(0,0,0,0.2);
}
.reports-chart-type-toggle {
    display: flex;
    gap: 0;
    background: var(--main-bg);
    border: 1.5px solid var(--border-color);
    border-radius: 999px;
    padding: 0.18rem;
}
.reports-chart-type-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: 999px;
    width: 26px;
    height: 26px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}
.reports-chart-type-btn:hover { color: var(--text-primary); }
.reports-chart-type-btn.active {
    background: var(--primary-color);
    color: #fff;
    box-shadow: 0 1px 4px rgba(0,0,0,0.2);
}

/* Trend chart checkbox legend */
.reports-trend-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 14px;
    padding: 10px 4px 2px;
    justify-content: center;
}
.trend-legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    user-select: none;
    font-size: 0.8rem;
    color: var(--text-primary);
}
.trend-legend-checkbox {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 14px;
    height: 14px;
    border-radius: 3px;
    border: 2px solid;
    flex-shrink: 0;
    transition: opacity 0.15s;
}
.trend-legend-checkbox svg {
    width: 10px;
    height: 8px;
    display: block;
    transition: opacity 0.15s;
}
.trend-legend-checkbox.unchecked {
    background: transparent !important;
    opacity: 0.45;
}
.trend-legend-checkbox.unchecked svg {
    opacity: 0;
}
.trend-legend-label {
    transition: opacity 0.15s;
}
.trend-legend-item:has(.unchecked) .trend-legend-label {
    opacity: 0.45;
}

/* ── Onboarding Tour ─────────────────────────────────────────────────────── */

/* Shared pieces */
.tour-skip-btn {
    background: none;
    border: none;
    font-size: 0.78rem;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    transition: color 0.15s;
    white-space: nowrap;
}
.tour-skip-btn:hover { color: var(--text-primary); }

.tour-icon-wrap { display: flex; justify-content: center; margin-bottom: 1.25rem; }
.tour-icon { width: 2.75rem; height: 2.75rem; color: var(--primary-color); stroke-width: 1.5; }

.tour-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    text-align: center;
    margin: 0 0 0.65rem 0;
}
.tour-dots { display: flex; gap: 0.35rem; align-items: center; }
.tour-dot {
    width: 7px; height: 7px;
    border-radius: 50%;
    background: var(--border-color);
    flex-shrink: 0;
    transition: background 0.2s, transform 0.2s;
}
.tour-dot--done { background: rgba(139, 69, 19, 0.35); }
.tour-dot--active { background: var(--primary-color); transform: scale(1.35); }

.tour-actions { display: flex; gap: 0.6rem; flex-shrink: 0; }

.tour-tip {
    display: flex;
    align-items: flex-start;
    gap: 0.4rem;
    background: rgba(139, 69, 19, 0.07);
    border-left: 3px solid var(--primary-color);
    border-radius: 0 6px 6px 0;
    padding: 0.5rem 0.75rem;
    margin-top: 0.85rem;
    font-size: 0.8rem;
    color: var(--text-secondary);
    text-align: left;
}
.tour-tip-icon {
    width: 0.85rem; height: 0.85rem;
    color: var(--primary-color);
    flex-shrink: 0; margin-top: 0.1rem;
}

/* ── Centered modal (welcome / final) ─── */
.tour-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.65);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}
.tour-modal-card {
    background: var(--card-bg);
    border-radius: 16px;
    max-width: 480px;
    width: 100%;
    padding: 2rem;
    position: relative;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.45);
    overflow: hidden;
    opacity: 0;
    transform: translateY(14px);
    transition: opacity 0.25s ease, transform 0.25s ease;
}
.tour-modal-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; height: 4px;
    background: linear-gradient(90deg, var(--primary-color), #d2691e);
}
.tour-card--in { opacity: 1; transform: translateY(0); }
.tour-modal-card .tour-skip-btn { position: absolute; top: 1rem; right: 1rem; }
.tour-modal-text {
    font-size: 0.875rem;
    color: var(--text-secondary);
    line-height: 1.65;
    text-align: center;
}
.tour-modal-text strong { color: var(--text-primary); }
.tour-modal-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 1.75rem;
    gap: 1rem;
}

/* ── Tour panel (fixed bottom bar) ──────────────────────────────────────── */
.tour-panel {
    position: fixed;
    bottom: 1.25rem;
    left: 50%;
    transform: translateX(-50%);
    width: min(660px, calc(100% - 2rem));
    z-index: 9998;
    opacity: 0;
    transition: opacity 0.2s ease;
}
.tour-panel--in { opacity: 1; }
.tour-panel-inner {
    background: var(--card-bg);
    border: 1px solid rgba(245, 158, 11, 0.4);
    border-radius: 14px;
    padding: 1rem 1.25rem;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(245, 158, 11, 0.15), 0 0 28px rgba(245, 158, 11, 0.12);
    overflow: hidden;
    position: relative;
}
.tour-panel-inner::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; height: 3px;
    background: linear-gradient(90deg, var(--primary-color), #d2691e);
}
.tour-panel-top {
    display: flex;
    align-items: baseline;
    gap: 0.6rem;
    margin-bottom: 0.45rem;
    cursor: grab;
    user-select: none;
}
.tour-panel-top:active { cursor: grabbing; }

.tour-collapse-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.2rem 0.35rem;
    border-radius: 4px;
    color: var(--text-secondary);
    font-size: 0.7rem;
    line-height: 1;
    flex-shrink: 0;
    transition: background 0.15s, color 0.15s;
}
.tour-collapse-btn:hover { background: var(--border-color); color: var(--text-primary); }
.tour-collapse-btn i { transition: transform 0.2s ease; }

.tour-panel--collapsed .tour-panel-inner { padding-bottom: 0; }
.tour-panel--collapsed .tour-panel-top { border-bottom: none; padding-bottom: 0; }
.tour-drag-icon {
    color: var(--text-muted, #aaa);
    font-size: 0.8rem;
    flex-shrink: 0;
    align-self: center;
    pointer-events: none;
}
.tour-panel-counter {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--primary-color);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    flex-shrink: 0;
}
.tour-panel-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
    flex: 1;
}
.tour-panel-text {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.6;
}
.tour-panel-text strong { color: var(--text-primary); }
.tour-panel-tip { margin-top: 0.65rem; }
.tour-panel-nav {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin-top: 0.65rem;
    padding: 0.35rem 0.65rem;
    background: rgba(245, 158, 11, 0.08);
    border: 1px solid rgba(245, 158, 11, 0.25);
    border-radius: 6px;
    font-size: 0.75rem;
    color: rgba(245, 158, 11, 0.9);
    font-weight: 500;
}
.tour-nav-icon { width: 13px; height: 13px; flex-shrink: 0; }
.tour-panel-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 0.85rem;
    gap: 0.75rem;
}

/* ── Tour overlay (subtle dim — pointer-events:none so clicks pass through) ─ */
.tour-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.18);
    z-index: 9996;
    pointer-events: none;
}

/* ── Element highlight ring (fixed overlay, never clipped by parent overflow) ─── */
.tour-ring {
    position: fixed;
    pointer-events: none;
    z-index: 9997;
    border-radius: 8px;
    border: 2.5px solid #f59e0b;
    box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.55);
    animation: tourRingPulse 1.4s ease-out infinite;
}
@keyframes tourRingPulse {
    0%   { border-color: #f59e0b; box-shadow: 0 0 0 0   rgba(245,158,11,0.55); }
    65%  { border-color: #fb923c; box-shadow: 0 0 0 10px rgba(245,158,11,0);   }
    100% { border-color: #f59e0b; box-shadow: 0 0 0 0   rgba(245,158,11,0);   }
}

@media (max-width: 520px) {
    .tour-modal-card { padding: 1.5rem 1.25rem; }
    .tour-panel { bottom: 4.5rem; }
    .tour-panel-top { flex-wrap: wrap; }
    .tour-panel-footer,
    .tour-modal-footer {
        flex-direction: column-reverse;
        align-items: stretch;
        gap: 0.6rem;
    }
    .tour-panel-footer .tour-actions,
    .tour-modal-footer .tour-actions {
        display: flex;
        justify-content: flex-end;
    }
    .tour-panel-footer .tour-dots,
    .tour-modal-footer .tour-dots {
        justify-content: center;
    }
}

/* ── Help / User Guide Page ──────────────────────────────────────────────── */
.help-page .page-header { margin-bottom: 1.25rem; }
.help-page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.75rem;
}
.help-tour-btn { white-space: nowrap; flex-shrink: 0; }

/* Search bar */
.help-search-wrap {
    position: relative;
    display: flex;
    align-items: center;
    margin-bottom: 0.85rem;
}
.help-search-icon {
    position: absolute;
    left: 0.85rem;
    width: 1rem;
    height: 1rem;
    color: var(--text-secondary);
    pointer-events: none;
    flex-shrink: 0;
}
.help-search-input {
    width: 100%;
    padding: 0.6rem 2.5rem 0.6rem 2.5rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--card-bg);
    color: var(--text-primary);
    font-size: 0.875rem;
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.help-search-input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(139, 69, 19, 0.12);
}
.help-search-input::placeholder { color: var(--text-secondary); }
.help-search-clear {
    position: absolute;
    right: 0.65rem;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 1.4rem;
    height: 1.4rem;
    border: none;
    background: var(--border-color);
    border-radius: 50%;
    cursor: pointer;
    color: var(--text-secondary);
    padding: 0;
    transition: background 0.15s;
}
.help-search-clear:hover { background: var(--text-secondary); color: var(--card-bg); }
.help-search-clear svg { width: 0.75rem; height: 0.75rem; }
.help-search-status {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
}
.help-search-status--empty { color: var(--text-secondary); }
mark.help-highlight {
    background: rgba(139, 69, 19, 0.18);
    color: var(--text-primary);
    border-radius: 2px;
    padding: 0 1px;
}
[data-theme="dark"] mark.help-highlight {
    background: rgba(210, 105, 30, 0.28);
}

/* Nav pills strip */
.help-nav-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    position: sticky;
    top: 0;
    z-index: 50;
    background: var(--main-bg);
    padding: 0.65rem 0;
    margin-bottom: 1.35rem;
}
.help-nav-pill {
    display: inline-block;
    padding: 0.3rem 0.85rem;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 500;
    background: var(--card-bg);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    text-decoration: none;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.help-nav-pill:hover,
.help-nav-pill.active {
    background: var(--primary-color);
    color: #fff;
    border-color: var(--primary-color);
}

/* Section */
.help-section {
    margin-bottom: 2.5rem;
    scroll-margin-top: 80px;
}
.help-section-header {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    margin-bottom: 1rem;
    padding-bottom: 0.6rem;
    border-bottom: 2px solid var(--border-color);
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}
.help-section-header h2 {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-primary);
}
.help-section-icon {
    width: 1.2rem;
    height: 1.2rem;
    color: var(--primary-color);
    flex-shrink: 0;
}

/* Cards grid */
.help-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
}
.help-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 1.1rem 1.25rem;
}
.help-card--full { grid-column: 1 / -1; }
.help-card h3 {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 0.65rem 0;
}
.help-card p,
.help-card li {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 0.35rem;
}
.help-card ol,
.help-card ul {
    padding-left: 1.25rem;
    margin: 0.35rem 0;
}
.help-card li { margin-bottom: 0.25rem; }
.help-card a { color: var(--primary-color); }

/* Inline note / warning */
.help-note {
    display: block;
    background: rgba(139, 69, 19, 0.07);
    border-left: 3px solid var(--primary-color);
    border-radius: 0 6px 6px 0;
    padding: 0.5rem 0.75rem;
    margin-top: 0.65rem;
    font-size: 0.82rem !important;
    color: var(--text-secondary) !important;
}
.help-warning {
    display: block;
    background: rgba(220, 53, 69, 0.07);
    border-left: 3px solid #dc3545;
    border-radius: 0 6px 6px 0;
    padding: 0.5rem 0.75rem;
    margin-top: 0.65rem;
    font-size: 0.82rem;
    color: var(--text-secondary);
}
.help-inline-icon {
    display: inline;
    width: 0.85rem;
    height: 0.85rem;
    vertical-align: -0.15rem;
    margin-right: 0.2rem;
}

/* Contact CTA */
.help-contact-cta {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem 1.75rem;
    margin-top: 1rem;
    flex-wrap: wrap;
}
.help-cta-icon {
    width: 2rem;
    height: 2rem;
    color: var(--primary-color);
    flex-shrink: 0;
}
.help-contact-cta > div { flex: 1; min-width: 180px; }
.help-contact-cta h3 { margin: 0 0 0.2rem 0; font-size: 0.95rem; color: var(--text-primary); }
.help-contact-cta p { margin: 0; font-size: 0.83rem; color: var(--text-secondary); }

@media (max-width: 600px) {
    .help-cards { grid-template-columns: 1fr; }
    .help-contact-cta { flex-direction: column; align-items: flex-start; }
}

/* ============================================================
   Password Toggle
   ============================================================ */
.pw-wrap {
    position: relative;
}
.pw-wrap input {
    padding-right: 2.5rem !important;
}
.pw-toggle {
    position: absolute;
    right: 0.6rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-muted, #999);
    padding: 0.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    line-height: 1;
}
.pw-toggle:hover { color: var(--text-primary); }

/* ============================================================
   Contact Page
   ============================================================ */
.contact-page { padding-bottom: 3rem; }

.contact-layout {
    display: grid;
    grid-template-columns: 1fr 1.6fr;
    gap: 2rem;
    align-items: start;
}

/* Left column */
.contact-info-col {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.contact-tile {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 1rem 1.25rem;
}
.contact-tile-icon {
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 8px;
    background: rgba(139, 69, 19, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    color: var(--primary-color);
    flex-shrink: 0;
}
.contact-tile h3 {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 0.2rem 0;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.contact-tile p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin: 0;
    line-height: 1.5;
}
.contact-tile-link {
    font-size: 0.85rem;
    color: var(--primary-color);
    text-decoration: none;
}
.contact-tile-link:hover { text-decoration: underline; }

/* FAQ inside left column */
.contact-faq-col {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 1.25rem;
    margin-top: 0.35rem;
}
.contact-faq-title {
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--text-primary);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin: 0 0 1rem 0;
}
.contact-faq-list {
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
}
.contact-faq-item h4 {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 0.25rem 0;
}
.contact-faq-item p {
    font-size: 0.82rem;
    color: var(--text-secondary);
    margin: 0;
    line-height: 1.55;
}

/* Right column — form card */
.contact-form-col { position: sticky; top: 1.5rem; }
.contact-card { border-radius: 12px; }

/* Success state */
.contact-success {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 3rem 2rem;
    gap: 0.75rem;
}
.contact-success-icon {
    font-size: 3rem;
    color: #28a745;
    margin-bottom: 0.5rem;
}
.contact-success h2 {
    font-size: 1.3rem;
    color: var(--text-primary);
    margin: 0;
}
.contact-success p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin: 0;
}

/* Error message */
.contact-error-msg {
    background: rgba(220, 53, 69, 0.08);
    border-left: 3px solid #dc3545;
    border-radius: 0 6px 6px 0;
    padding: 0.6rem 0.85rem;
    font-size: 0.85rem;
    color: #dc3545;
    margin-bottom: 1rem;
}

/* Char counter */
.contact-char-count {
    display: block;
    text-align: right;
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

/* Required asterisk */
.required { color: #dc3545; }

@media (max-width: 900px) {
    .contact-layout { grid-template-columns: 1fr; }
    .contact-form-col { position: static; }
}

@media (max-width: 600px) {
    .contact-tile { padding: 0.85rem 1rem; }
    .contact-success { padding: 2rem 1.25rem; }
}

/* ── Dark mode quick-win overrides ──────────────────────────────────── */

/* Modal footer */
[data-theme="dark"] .modal-footer {
    background: var(--card-bg);
    border-top-color: var(--border-color);
}

/* Warning message boxes */
[data-theme="dark"] .warning-message {
    background: rgba(255, 193, 7, 0.07);
    border-color: rgba(255, 193, 7, 0.2);
}
[data-theme="dark"] .warning-message p,
[data-theme="dark"] .warning-message li {
    color: var(--text-secondary);
}

/* Password requirements checklist */
[data-theme="dark"] .password-requirements {
    background: rgba(40, 167, 69, 0.07);
    border-color: rgba(40, 167, 69, 0.15);
}
[data-theme="dark"] .password-requirements h4 { color: var(--text-primary); }
[data-theme="dark"] .password-requirements li { color: var(--text-secondary); }
[data-theme="dark"] .strength-text { color: var(--text-secondary); }

/* Info banner (modal info/success boxes) */
.modal-info-banner {
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 20px;
    text-align: center;
}
.modal-info-banner.info {
    background: #e3f2fd;
    border: 1px solid #2196f3;
}
.modal-info-banner.info i { color: #2196f3; margin-right: 8px; }
.modal-info-banner.info strong { color: #1976d2; }
.modal-info-banner.success {
    background: #e8f5e8;
    border: 1px solid #4caf50;
}
.modal-info-banner.success i { color: #4caf50; margin-right: 8px; }
.modal-info-banner.success strong { color: #2e7d32; }
[data-theme="dark"] .modal-info-banner.info {
    background: rgba(33, 150, 243, 0.1);
    border-color: rgba(33, 150, 243, 0.25);
}
[data-theme="dark"] .modal-info-banner.info i { color: #64b5f6; }
[data-theme="dark"] .modal-info-banner.info strong { color: #90caf9; }
[data-theme="dark"] .modal-info-banner.success {
    background: rgba(76, 175, 80, 0.1);
    border-color: rgba(76, 175, 80, 0.25);
}
[data-theme="dark"] .modal-info-banner.success i { color: #81c784; }
[data-theme="dark"] .modal-info-banner.success strong { color: #a5d6a7; }

/* Settings password requirements box */
.settings-pw-requirements {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: 2px solid #8B4513;
    border-radius: 10px;
    padding: 15px;
    margin-top: 10px;
    font-size: 0.9rem;
    box-shadow: 0 2px 8px rgba(139, 69, 19, 0.1);
}
.settings-pw-requirements-header {
    font-weight: 700;
    margin-bottom: 12px;
    color: #8B4513;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 8px;
}
.settings-pw-requirements > ul {
    margin: 0;
    padding-left: 0;
    color: #495057;
    font-size: 0.85rem;
    line-height: 1.6;
    list-style: none;
}
[data-theme="dark"] .settings-pw-requirements {
    background: var(--card-bg);
    border-color: rgba(210, 105, 30, 0.4);
    box-shadow: none;
}
[data-theme="dark"] .settings-pw-requirements-header { color: var(--primary-color); }
[data-theme="dark"] .settings-pw-requirements > ul { color: var(--text-secondary); }

/* Password example hint */
.password-example-hint {
    margin-top: 10px;
    padding: 8px;
    background: #e9ecef;
    border-radius: 4px;
    font-size: 0.85rem;
    color: #495057;
}
[data-theme="dark"] .password-example-hint {
    background: var(--border-color);
    color: var(--text-secondary);
}

/* ============================================================
   DARK MODE SYSTEMATIC PASS — hardcoded light-color overrides
   ============================================================ */

/* 1. .ribbon-signup and .ribbon-btn:hover */
[data-theme="dark"] .ribbon-signup {
    background: var(--card-bg);
    color: var(--text-primary);
}
[data-theme="dark"] .ribbon-btn:hover {
    background: var(--hover-bg);
    color: var(--text-primary);
}

/* 2. .step and .step:hover (how-it-works section) */
[data-theme="dark"] .step {
    background: var(--card-bg);
}
[data-theme="dark"] .step:hover {
    background: var(--hover-bg);
}

/* 3. .roadmap-step */
[data-theme="dark"] .roadmap-step {
    background: var(--card-bg);
    border-color: var(--border-color);
}

/* 4. .auth-tabs and .tab-btn (auth modal) */
[data-theme="dark"] .auth-tabs {
    background: var(--main-bg);
    border-bottom-color: var(--border-color);
}
[data-theme="dark"] .tab-btn {
    color: var(--text-secondary);
}
[data-theme="dark"] .tab-btn.active {
    background: var(--card-bg);
    color: var(--text-primary);
}

/* 5. Modal close-btn hover (login/signup modals) */
[data-theme="dark"] #loginModal .close-btn:hover,
[data-theme="dark"] #signupModal .close-btn:hover {
    background: var(--hover-bg);
    color: var(--text-primary);
}

/* 6. .no-data (both instances) */
[data-theme="dark"] .no-data {
    background: var(--card-bg);
    color: var(--text-secondary);
}

/* 7. .setting-item:hover (was listed as .period-item, ~line 2944) */
[data-theme="dark"] .setting-item:hover {
    background: var(--hover-bg);
}

/* 8. .setting-info h3 and .setting-info p */
[data-theme="dark"] .setting-info h3 {
    color: var(--text-primary);
}
[data-theme="dark"] .setting-info p {
    color: var(--text-secondary);
}

/* 9. .about-content p and .about-content .verse */
[data-theme="dark"] .about-content p {
    color: var(--text-secondary);
}
[data-theme="dark"] .about-content .verse {
    background: linear-gradient(135deg, var(--card-bg) 0%, var(--main-bg) 100%);
}

/* 10. .form-help */
[data-theme="dark"] .form-help {
    color: var(--text-secondary);
}

/* 11. .danger-card */
[data-theme="dark"] .danger-card {
    background: linear-gradient(135deg, rgba(220, 53, 69, 0.08) 0%, rgba(220, 53, 69, 0.04) 100%);
}

/* 12. .danger-message */
[data-theme="dark"] .danger-message {
    background: rgba(220, 53, 69, 0.1);
    border-color: #dc3545;
}
[data-theme="dark"] .danger-message h4 {
    color: #ff6b7a;
}
[data-theme="dark"] .danger-message li {
    color: var(--text-secondary);
}

/* 13. .final-warning */
[data-theme="dark"] .final-warning {
    background: rgba(220, 53, 69, 0.12);
    border-color: rgba(220, 53, 69, 0.4);
    color: #ff6b7a;
}

/* ── Empty state card ────────────────────────────────────────────── */
.empty-state-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 3.5rem 2rem;
    background: var(--card-bg);
    border: 2px dashed var(--border-color);
    border-radius: 16px;
    margin: 1.5rem 0;
}
.empty-state-icon {
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(210, 105, 30, 0.1);
    border-radius: 50%;
    margin-bottom: 1.25rem;
    color: var(--primary-color);
}
.empty-state-icon svg,
.empty-state-icon i {
    width: 28px;
    height: 28px;
    font-size: 1.5rem;
    color: var(--primary-color);
}
.empty-state-card h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 0.5rem;
}
.empty-state-card p {
    font-size: 0.875rem;
    color: var(--text-secondary);
    max-width: 360px;
    line-height: 1.6;
    margin: 0 0 1.5rem;
}
.empty-state-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    justify-content: center;
}


/* ── Import page mobile ─────────────────────────────────────────────────── */
@media (max-width: 768px) {
    /* Step indicator: smaller circles and labels */
    .step-circle {
        width: 26px;
        height: 26px;
        font-size: 0.75rem;
    }
    .step-label {
        font-size: 0.62rem;
    }

    /* Card headers */
    .import-panel .card-header h2 {
        font-size: 1rem;
    }

    /* Upload area: less padding, smaller icon and text */
    .import-upload-area {
        padding: 1.25rem 1rem;
    }
    .import-upload-icon {
        font-size: 1.8rem;
    }
    .import-upload-text {
        font-size: 0.85rem;
    }
    .import-upload-sub {
        font-size: 0.78rem;
    }

    /* Preview table: scrollable with smaller text */
    .import-preview-table-wrap .table-responsive {
        border: 1px solid var(--border-color);
        border-radius: 6px;
    }
    .import-preview-table {
        font-size: 0.72rem;
        min-width: max-content;
    }
    .import-preview-table th,
    .import-preview-table td {
        padding: 0.3rem 0.4rem;
    }

    /* Review table */
    .import-review-table {
        font-size: 0.75rem;
    }
    .import-review-table th,
    .import-review-table td {
        padding: 0.3rem 0.4rem;
    }
    .review-subcat-sel {
        min-width: 120px;
        font-size: 0.75rem;
    }
    .import-desc-cell {
        max-width: 130px;
    }

    /* Review filter tabs */
    .review-filter-btn {
        font-size: 0.75rem;
        padding: 0.3rem 0.65rem;
    }

    /* Summary step 4: shrink large numbers */
    .import-summary-value {
        font-size: 1.4rem;
    }
    .import-summary-label {
        font-size: 0.7rem;
    }

    /* Draft banner */
    .import-draft-banner {
        flex-direction: column;
        gap: 0.5rem;
        font-size: 0.82rem;
    }
    .import-draft-banner-actions {
        display: flex;
        gap: 0.5rem;
    }
    .import-draft-banner-actions .btn {
        flex: 1;
        justify-content: center;
    }

    /* Checkbox label */
    .import-checkbox-label {
        font-size: 0.82rem;
    }
}
