/* CSS Variables */
:root {
    --color-primary: #005b59;
    --color-seafoam: #95bea4;
    --color-purple: #5f308f;
    --color-forest: #3e4e3a;
    --color-light-grey: #8a8a8a;
    --color-background: #f8f9fa;
    --color-surface: #ffffff;
    --color-text: #333333;
    --color-danger: #dc3545;
    --color-border-light: #dee2e6;
    --color-success: #28a745;
    --color-light-seafoam: #e8f5f0;
    --color-light-red: #ffeaea;
    --color-auth-primary: #333333;
    --color-auth-secondary: #666666;
    --color-auth-accent: #e67e22;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: var(--color-background);
    color: var(--color-text);
    line-height: 1.6;
    font-size: 14px;
}

/* ENHANCED AUTHENTICATION STYLES */
#auth-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 2rem;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
}

.auth-form {
    width: 100%;
    max-width: 400px;
    background: var(--color-surface);
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    transition: all 0.3s ease;
}

.auth-form:hover {
    box-shadow: 0 25px 70px rgba(0, 0, 0, 0.15);
    transform: translateY(-5px);
}

.auth-form-content {
    padding: 3rem 2.5rem;
    text-align: center;
}

.auth-form h1 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--color-auth-primary);
    margin-bottom: 0.5rem;
    letter-spacing: -0.5px;
}

.auth-subtitle {
    color: var(--color-auth-secondary);
    margin-bottom: 2rem;
    font-size: 1rem;
    font-weight: 400;
}

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

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

.form-group input {
    width: 100%;
    padding: 1rem;
    border: 2px solid #e1e5e9;
    border-radius: 12px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: #fafbfc;
}

.form-group input:focus {
    outline: none;
    border-color: var(--color-primary);
    background: var(--color-surface);
    box-shadow: 0 0 0 4px rgba(0, 91, 89, 0.1);
}

.auth-btn {
    width: 100%;
    padding: 1rem;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin: 1.5rem 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.auth-btn.primary {
    background: var(--color-auth-primary);
    color: white;
    position: relative;
    overflow: hidden;
}

.auth-btn.primary:hover {
    background: #2c2c2c;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

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

.forgot-password {
    color: var(--color-auth-accent);
    text-decoration: none;
    font-size: 0.9rem;
    float: right;
    margin-top: 0.5rem;
    font-weight: 500;
}

.forgot-password:hover {
    text-decoration: underline;
}

.auth-switch {
    margin-top: 2rem;
    color: var(--color-auth-secondary);
    font-size: 0.95rem;
}

.auth-switch a {
    color: var(--color-auth-accent);
    text-decoration: none;
    font-weight: 600;
}

.auth-switch a:hover {
    text-decoration: underline;
}

/* Settings Modal Styles */
.settings-section {
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--color-border-light);
}

.settings-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.settings-section h3 {
    color: var(--color-primary);
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
    font-weight: 600;
}

.settings-info {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.setting-item {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.setting-item label {
    font-weight: 600;
    color: var(--color-text);
    font-size: 0.9rem;
}

.setting-value {
    font-size: 1rem;
    color: var(--color-auth-secondary);
    padding: 0.75rem;
    background: var(--color-light-seafoam);
    border-radius: 8px;
    border: 1px solid var(--color-seafoam);
}

.password-section {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.password-hidden {
    flex: 1;
    color: var(--color-auth-secondary);
    font-size: 1.2rem;
    letter-spacing: 2px;
}

.btn-secondary {
    background: var(--color-seafoam);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-size: 0.9rem;
    cursor: pointer;
    white-space: nowrap;
}

.btn-secondary:hover {
    background: #7aa888;
}

.btn-danger {
    background: var(--color-danger);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-size: 0.9rem;
    cursor: pointer;
    font-weight: 500;
}

.btn-danger:hover {
    background: #c82333;
}

/* Navigation Styles - FLEXIBLE FOR ANY NUMBER OF TABS */
.nav {
    background: var(--color-primary);
    padding: 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

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

.nav-title {
    font-size: 1.5rem;
    font-weight: bold;
    color: white;
}

.nav-tabs {
    display: flex;
    gap: 0;
    flex-wrap: wrap; /* ALLOWS WRAPPING FOR MORE TABS */
    align-items: center;
}

.nav-tab {
    background: transparent;
    color: rgba(255,255,255,0.8);
    border: none;
    padding: 1rem 1.25rem;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s ease;
    border-bottom: 3px solid transparent;
    white-space: nowrap;
    min-width: fit-content;
}

.nav-tab:hover {
    background: rgba(255,255,255,0.1);
    color: white;
}

.nav-tab.active {
    color: white;
    border-bottom-color: var(--color-seafoam);
    background: rgba(255,255,255,0.1);
}

/* Responsive Navigation - HANDLES 6 TABS GRACEFULLY */
@media (max-width: 768px) {
    .nav-container {
        flex-direction: column;
        padding: 0.5rem;
        min-height: auto;
    }

    .nav-title {
        margin-bottom: 0.5rem;
        font-size: 1.25rem;
    }

    .nav-tabs {
        width: 100%;
        justify-content: center;
        gap: 0.25rem;
    }

    .nav-tab {
        padding: 0.75rem 0.5rem;
        font-size: 0.8rem;
        flex: 1;
        text-align: center;
        min-width: 70px;
    }
}

@media (max-width: 480px) {
    .nav-tabs {
        flex-wrap: wrap;
        gap: 0.25rem;
    }

    .nav-tab {
        flex: 1 1 calc(33.333% - 0.25rem);
        min-width: 60px;
        font-size: 0.75rem;
        padding: 0.5rem 0.25rem;
    }
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

/* Tab Content */
.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.3s ease-in-out;
}

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

/* Card Styles */
.card {
    background: var(--color-surface);
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    padding: 2rem;
    margin-bottom: 2rem;
}

/* Dashboard Styles */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--color-surface);
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    text-align: center;
}

.stat-value {
    font-size: 2rem;
    font-weight: bold;
    color: var(--color-primary);
    margin-bottom: 0.5rem;
}

.stat-label {
    color: var(--color-light-grey);
    font-size: 0.9rem;
    font-weight: 500;
}

/* Dashboard Account Card Styles */
.dashboard-accounts-card {
    margin-bottom: 2rem;
}

.dashboard-accounts-card h2 {
    margin-bottom: 1rem;
    color: var(--color-primary);
}

/* Account Summary Styles for Dashboard */
.account-summary-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--color-border-light);
    font-size: 0.9rem;
}

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

.account-summary-item .label {
    flex: 1;
    text-align: left;
}

.account-summary-item .amount {
    font-weight: bold;
}

.account-summary-item .amount.positive {
    color: var(--color-success);
}

.account-summary-item .amount.negative {
    color: var(--color-danger);
}

/* Dashboard Savings Preview Styles */
.savings-dashboard-preview {
    background: linear-gradient(135deg, var(--color-light-seafoam), #f0f8ff);
    border: 1px solid var(--color-seafoam);
    margin-bottom: 2rem;
}

.savings-dashboard-preview h2 {
    color: var(--color-primary);
    margin-bottom: 1.5rem;
    text-align: center;
}

.dashboard-savings-list {
    display: grid;
    gap: 1rem;
}

.dashboard-savings-goal {
    background: white;
    padding: 1rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.dashboard-savings-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.dashboard-savings-progress-bar {
    height: 8px;
    background: var(--color-border-light);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 0.75rem;
}

.dashboard-savings-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--color-primary), var(--color-seafoam));
    transition: width 0.3s ease;
    border-radius: 4px;
}

.dashboard-savings-amounts {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    font-size: 0.85rem;
}

.dashboard-savings-amounts span {
    background: var(--color-light-seafoam);
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    color: var(--color-primary);
    font-weight: 500;
    font-size: 0.75rem;
}

/* Chart and Breakdown Styles */
.breakdown-card {
    position: relative;
}

.breakdown-card h2 {
    margin-bottom: 1.5rem;
    color: var(--color-primary);
}

.chart-container {
    position: relative;
    height: 400px;
    width: 100%;
    margin-bottom: 1rem;
}

#expense-chart {
    max-height: 400px;
    width: 100% !important;
    height: auto !important;
}

.breakdown-legend {
    margin-top: 1rem;
}

.breakdown-legend h4 {
    color: var(--color-primary);
    margin-bottom: 1rem;
}

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

@media (max-width: 768px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    .dashboard-savings-amounts {
        flex-direction: column;
        gap: 0.5rem;
        align-items: flex-start;
    }

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

/* Empty State */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--color-light-grey);
}

.empty-state h3 {
    margin-bottom: 1rem;
    color: var(--color-text);
}

/* Button Styles */
.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-block;
}

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

.btn-primary:hover {
    background: #004a48;
}

.btn-outline {
    background: transparent;
    color: var(--color-primary);
    border: 1px solid var(--color-primary);
}

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

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.8rem;
}

.edit-btn {
    background: var(--color-seafoam);
    color: white;
    padding: 0.5rem 1rem;
    margin-right: 0.5rem;
    border: none;
    border-radius: 6px;
    font-size: 0.8rem;
    cursor: pointer;
}

.delete-btn {
    background: var(--color-danger);
    color: white;
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 6px;
    font-size: 0.8rem;
    cursor: pointer;
}

/* Income/Expense Item Styles */
.income-source-item, .expense-item {
    background: var(--color-surface);
    border: 1px solid var(--color-border-light);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1rem;
}

.income-source-header, .expense-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.income-source-info, .expense-info {
    flex: 1;
}

.income-source-info h3, .expense-info h3 {
    margin-bottom: 0.5rem;
    color: var(--color-text);
}

.income-source-details, .expense-details {
    color: var(--color-light-grey);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.income-amount-display, .expense-amount-display {
    font-size: 1.25rem;
    font-weight: bold;
    color: var(--color-primary);
    margin-bottom: 0.5rem;
}

.category-badge, .type-badge {
    display: inline-block;
    background: var(--color-light-seafoam);
    color: var(--color-primary);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
    margin-right: 0.5rem;
}

/* Account Styles */
.accounts-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.add-account-btn {
    background: var(--color-primary);
    color: white;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
}

.account-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--color-surface);
    border: 1px solid var(--color-border-light);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1rem;
}

.account-item.primary-account {
    border: 2px solid var(--color-primary);
    box-shadow: 0 2px 8px rgba(0, 91, 89, 0.15);
}

.account-item-info h3 {
    margin-bottom: 0.5rem;
    color: var(--color-text);
}

.account-type-badge {
    background: var(--color-light-seafoam);
    color: var(--color-primary);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
}

.account-balance-amount {
    font-size: 1.5rem;
    font-weight: bold;
    margin-bottom: 0.25rem;
}

.account-balance-amount.positive {
    color: var(--color-success);
}

.account-balance-amount.negative {
    color: var(--color-danger);
}

.account-balance-label {
    color: var(--color-light-grey);
    font-size: 0.8rem;
}

.account-updated {
    color: var(--color-light-grey);
    font-size: 0.8rem;
    margin-top: 0.25rem;
}

.account-edit-btn, .account-delete-btn {
    padding: 0.5rem 1rem;
    margin-left: 0.5rem;
    border: none;
    border-radius: 6px;
    font-size: 0.8rem;
    cursor: pointer;
}

.account-edit-btn {
    background: var(--color-seafoam);
    color: white;
}

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

/* ENHANCED SAVINGS STYLES */
.savings-item {
    background: var(--color-surface);
    border: 1px solid var(--color-border-light);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1rem;
}

.savings-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
}

.savings-info {
    flex: 1;
}

.savings-info h3 {
    margin-bottom: 0.5rem;
    color: var(--color-text);
    font-size: 1.2rem;
}

.savings-account {
    color: var(--color-primary);
    font-weight: 500;
    font-size: 0.9rem;
    margin-bottom: 0.75rem;
    padding: 0.25rem 0.5rem;
    background: var(--color-light-seafoam);
    border-radius: 4px;
    display: inline-block;
}

.savings-progress-container {
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.savings-progress-bar {
    flex: 1;
    height: 12px;
    background: var(--color-border-light);
    border-radius: 6px;
    overflow: hidden;
}

.savings-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--color-primary), var(--color-seafoam));
    transition: width 0.3s ease;
    border-radius: 6px;
}

.savings-progress-text {
    font-weight: bold;
    color: var(--color-primary);
    min-width: 50px;
    text-align: right;
}

.savings-details {
    color: var(--color-light-grey);
    font-size: 0.9rem;
}

.savings-amounts {
    display: flex;
    gap: 1rem;
    margin-bottom: 0.5rem;
    flex-wrap: wrap;
}

.savings-amounts span {
    background: var(--color-light-seafoam);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    color: var(--color-primary);
    font-weight: 500;
}

.savings-target-date, .savings-timeline {
    margin: 0.5rem 0;
    font-size: 0.85rem;
    color: var(--color-light-grey);
}

.savings-transfer-info {
    margin: 0.5rem 0;
    font-size: 0.85rem;
    color: #2196F3;
    font-weight: 500;
    padding: 0.25rem 0.5rem;
    background: rgba(33, 150, 243, 0.1);
    border-radius: 4px;
    display: inline-block;
}

.savings-description {
    margin-top: 0.5rem;
    font-style: italic;
    color: var(--color-light-grey);
}

.savings-actions {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    min-width: 140px;
    align-items: stretch;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    animation: fadeIn 0.3s ease;
}

.modal-content {
    background-color: var(--color-surface);
    margin: 5% auto;
    padding: 0;
    border-radius: 12px;
    width: 90%;
    max-width: 600px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.3);
    animation: slideUp 0.3s ease;
    max-height: 90vh;
    overflow-y: auto;
}

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

.modal-header {
    background: var(--color-primary);
    color: white;
    padding: 1.5rem 2rem;
    border-radius: 12px 12px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    margin: 0;
    font-size: 1.3rem;
}

.close {
    color: white;
    font-size: 2rem;
    font-weight: bold;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close:hover {
    opacity: 0.7;
}

.modal-body {
    padding: 2rem;
}

/* Enhanced Savings Modal Styles */
.savings-modal .modal-content {
    max-width: 800px;
}

.form-section {
    background: var(--color-light-seafoam);
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.form-section h3 {
    margin: 0 0 1rem 0;
    color: var(--color-primary);
    font-size: 1.1rem;
    border-bottom: 1px solid var(--color-seafoam);
    padding-bottom: 0.5rem;
}

/* Income Modal Scroll Fix */
.income-modal .modal-body {
    max-height: 70vh;
    overflow-y: auto;
    padding-bottom: 3rem;
}

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

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

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

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--color-border-light);
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.2s ease;
}

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

.form-buttons {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid var(--color-border-light);
}

.btn-cancel {
    background: var(--color-light-grey);
    color: white;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 0.9rem;
    cursor: pointer;
}

.btn-save {
    background: var(--color-primary);
    color: white;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 0.9rem;
    cursor: pointer;
}

.btn-cancel:hover {
    background: #6a6a6a;
}

.btn-save:hover {
    background: #004a48;
}

/* Quarterly Modal Styles */
.quarterly-modal {
    display: none;
    position: fixed;
    z-index: 1001;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.6);
}

.quarterly-modal-content {
    background-color: var(--color-surface);
    margin: 10% auto;
    padding: 0;
    border-radius: 16px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.4);
}

.quarterly-header {
    background: linear-gradient(135deg, var(--color-primary), var(--color-seafoam));
    color: white;
    padding: 2rem;
    border-radius: 16px 16px 0 0;
    text-align: center;
    position: relative;
}

.quarterly-close {
    position: absolute;
    right: 1rem;
    top: 1rem;
    color: white;
    font-size: 1.5rem;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
}

.quarterly-body {
    padding: 2rem;
    text-align: center;
}

.quarterly-welcome {
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
    color: var(--color-text);
}

.quarterly-list {
    text-align: left;
    margin: 1.5rem 0;
    padding-left: 1rem;
}

.quarterly-list li {
    margin-bottom: 0.5rem;
    color: var(--color-light-grey);
}

.quarterly-instruction {
    font-style: italic;
    color: var(--color-light-grey);
    margin: 1.5rem 0;
}

.quarterly-buttons {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.quarterly-btn {
    padding: 1rem;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

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

.quarterly-btn-remind {
    background: var(--color-seafoam);
    color: white;
}

.quarterly-btn-skip {
    background: var(--color-light-grey);
    color: white;
}

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

/* Paycheck Styles */
.paycheck-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.paycheck-navigation {
    display: flex;
    gap: 0.5rem;
}

.month-nav-btn {
    background: var(--color-seafoam);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background-color 0.2s;
}

.month-nav-btn:hover {
    background: #7aa888;
}

/* Bills Styles - UPDATED LAYOUT */
.bills-section {
    margin-bottom: 2rem;
}

.bill-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--color-surface);
    border: 1px solid var(--color-border-light);
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 0.5rem;
    min-width: 340px;
    width: 100%;
    max-width: 600px;
}

.bill-item.late-bill {
    border-left: 4px solid var(--color-danger);
    background: var(--color-light-red);
}

.bill-item.upcoming-bill {
    border-left: 4px solid var(--color-primary);
}

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

.bill-info h4 {
    margin-bottom: 0.25rem;
    color: var(--color-text);
    word-wrap: break-word;
}

.bill-info p {
    color: var(--color-light-grey);
    font-size: 0.9rem;
    word-wrap: break-word;
}

.bill-amount {
    font-size: 1.1rem;
    font-weight: bold;
    color: var(--color-text);
    margin: 0 1rem;
    min-width: fit-content;
}

.bill-actions {
    min-width: 120px;
    text-align: right;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    justify-content: flex-end;
}

.mark-paid-btn {
    background: var(--color-primary);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-size: 0.8rem;
    cursor: pointer;
    white-space: nowrap;
}

/* CSV Import Info */
.csv-import-info {
    background: var(--color-light-seafoam);
    border: 1px solid var(--color-seafoam);
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
}

.csv-import-info h4 {
    color: var(--color-primary);
    margin-bottom: 0.5rem;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .container {
        padding: 1rem;
    }

    .card {
        padding: 1.5rem;
    }

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

    .income-source-header,
    .expense-header,
    .account-item,
    .savings-header {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
    }

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

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

    .paycheck-header {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
    }

    .paycheck-navigation {
        justify-content: center;
    }

    .savings-progress-container {
        flex-direction: column;
        gap: 0.5rem;
        align-items: stretch;
    }

    .savings-progress-text {
        text-align: center;
        min-width: auto;
    }

    .savings-amounts {
        flex-direction: column;
        gap: 0.5rem;
        align-items: flex-start;
    }

    .savings-actions {
        flex-direction: row;
        flex-wrap: wrap;
        min-width: auto;
    }

    .form-section {
        padding: 1rem;
    }

    .auth-form-content {
        padding: 2rem 1.5rem;
    }

    .setting-item {
        flex-direction: column;
    }

    .password-section {
        flex-direction: column;
        align-items: stretch;
    }
}

@media (max-width: 700px) {
    /* BILL ITEM MOBILE FIX */
    .bill-item {
        min-width: 0;
        max-width: 100%;
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
    }

    .bill-actions {
        min-width: 0;
        width: 100%;
        text-align: left;
        justify-content: flex-start;
    }

    .bill-amount {
        margin: 0;
        text-align: left;
    }

    /* SAVINGS MODAL MOBILE FIX */
    .savings-modal .modal-content {
        max-width: 99vw;
        width: 99vw;
        margin: 2% auto;
    }

    .savings-modal .modal-body {
        max-height: 70vh;
        padding: 1.5rem;
    }
}

@media (max-width: 480px) {
    .modal-content {
        margin: 2% auto;
        width: 95%;
    }

    .modal-body {
        padding: 1.5rem;
    }

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

    .auth-form {
        margin: 1rem;
        max-width: calc(100% - 2rem);
    }
}
