/* ----------------------------------------------------------------------- */
/* Dashboard Layout                                                      */
/* ----------------------------------------------------------------------- */
.dashboard-container {
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
}

.dashboard-header {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 5px 0;
    width: 100%;
}

/* Conflict with below
.dashboard-content {
    display: grid;
    grid-template-columns: 0.75fr 2fr;
    gap: 0.5rem;
    align-items: stretch;
    width: 100%;
}
*/

.dashboard-content {
    display: grid;  /* ← ADD THIS */
    grid-template-columns: 0.75fr 2fr;/*1fr 1.2fr !important;*/
    gap: 0.5rem; /*1rem;*/
    align-items: start;/*start;*/
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    position: relative;
}

.left-summary-column {
    display: flex;
    flex-direction: column;
}

.right-budget-column {
    display: flex;
    flex-direction: column;
    width: 100%;
}

.budget-accounts-list {
    display: flex;
    flex-direction: column;
    width: 100%;
}

.budget-summary-section {
    margin-bottom: 0.5rem;
    width: 100%;
}

.income-expense-card {
    margin-top: 0.5rem;
}

.total-funds-section {
    background-color: #e6f3ff;
    border-radius: 8px;
    padding: 1rem 1.2rem;
    display: flex;
    flex-direction: column;
    margin-top: 0.5rem;
    align-items: center;
}

.total-funds-section .label {
    font-weight: bold;
    color: var(--primary);
}

.total-funds-amount {
    font-size: 1.2rem;
    font-weight: bold;
    color: var(--dark);
}

.account-list {
    display: flex;
    flex-direction: column;
}

.account-item-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.95rem;
}

.account-info {
    display: flex;
    align-items: center;
}

.account-icon {
    font-size: 1.2rem;
    color: var(--gray);
}

.account-balance-amount {
    font-weight: 600;
    color: var(--dark);
}

.edit-note-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
    border-radius: 4px;
    color: var(--gray);
    transition: var(--transition);
}

.edit-note-btn:hover {
    background: #f39c12;
    color: white;
}

.note-text {
    font-size: 1rem;
    color: var(--dark);
    line-height: 1.5;
    padding: .5rem .75rem;
    background: #fff;
    border-radius: 8px;
    border: 1px solid #eee;
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.04);
    max-height: 200px;
    overflow-y: auto;
    white-space: pre-line;
    cursor: pointer;
    transition: border-color 0.2s ease;
}

.note-text:hover {
    border-color: #f39c12;
}

.note-text.placeholder {
    color: #888;
    font-style: italic;
}

.note-textarea {
    width: 100%;
    min-height: 100px;
    max-height: 300px;
    font-size: 1rem;
    color: var(--dark);
    line-height: 1.5;
    padding: .5rem .75rem;
    background: #fff;
    border-radius: 8px;
    border: 2px solid #f39c12;
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.04);
    white-space: pre-line;
    resize: vertical;
    font-family: inherit;
    outline: none;
    transition: border-color 0.2s ease;
}

.note-textarea:focus {
    border-color: #e67e22;
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.04), 0 0 0 3px rgba(243, 156, 18, 0.1);
}

.note-actions {
    display: flex;
    gap: 8px;
    margin-top: 10px;
}

.save-note-btn, .cancel-note-btn {
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: var(--transition);
}

.save-note-btn {
    background: #27ae60;
    color: white;
}

.save-note-btn:hover {
    background: #229954;
}

.cancel-note-btn {
    background: #95a5a6;
    color: white;
}

.cancel-note-btn:hover {
    background: #7f8c8d;
}

.note-status {
    margin-top: 10px;
    padding: 8px;
    border-radius: 4px;
    font-size: 0.9rem;
    font-weight: 500;
}

/* Notes card */
.notes-card {
    margin-top: 0.5rem;
    margin-bottom: 0.5rem;
    background: #fcfcfc;
}

.notes-card .card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.notes-card .card-header h2 {
    display: flex;
    align-items: center;
    font-size: 1.1rem;
    color: #444;
    margin: 0;
}

/* ----------------------------------------------------------------------- */
/* Budget Summary Styles                                                 */
/* ----------------------------------------------------------------------- */
.budget-summary-card {
    background: #fff;
    border-radius: 12px;
    box-shadow: var(--card-shadow);
    padding: 1.2rem;
    transition: var(--transition);
}

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

.budget-summary-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--light-gray);
}

.budget-summary-header h2 {
    font-size: 1.3rem;
    color: var(--dark);
    display: flex;
    align-items: center;
    margin: 0;
}

.days-left-badge {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    border-radius: 8px;
    padding: 0.3rem 0.6rem;
    min-width: 60px;
}

.days-count {
    font-size: 1.5rem;
    font-weight: bold;
    line-height: 1;
}

.days-text {
    font-size: 0.8rem;
    opacity: 0.9;
}

.bank-account-header {
    position: relative;
    cursor: pointer;
}

.chevron {
    transition: transform 0.2s ease;
}

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

.expand-indicator {
    position: relative;
    margin-left: 10px;
    display: flex;
    align-items: center;
    font-size: 16px;
    cursor: pointer;
}

.chevron {
    transition: transform 0.2s ease;
}

/* Tooltip styling */
.expand-tooltip {
    position:absolute;
    bottom: 0;
    left: 100%;
    background: #222;
    color: #fff;
    font-size: 12px;
    padding: 6px 6px;
    border-radius: 6px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transform: translateY(5px);
    transition: opacity 0.2s ease, transform 0.2s ease;
    z-index: 2147483647;
}

/* Show tooltip on hover */
.expand-indicator:hover .expand-tooltip {
    opacity: 1;
    transform: translateY(0);
}

/* Chevron rotation */
.chevron.rotated {
    transform: rotate(180deg);
}

.budget-summary-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.summary-item {
    display: flex;
    flex-direction: column;
}

.summary-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    color: var(--gray);
    font-weight: 500;
}

.summary-value {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--dark);
}

.summary-value.positive {
    color: #27ae60;
}

.summary-value.negative {
    color: #e74c3c;
}

.budget-date-link {
    color: var(--primary);
    text-decoration: none;
    transition: color 0.2s;
}

.budget-date-link:hover {
    color: var(--secondary);
    text-decoration: underline;
}

.budget-progress {
    margin-top: 1.5rem;
}

.progress-labels {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.4rem;
    font-size: 0.8rem;
    color: var(--gray);
}

.progress-bar {
    height: 10px;
    background-color: #f0f0f0;
    border-radius: 5px;
    overflow: hidden;
    position: relative;
    margin-bottom: 0.3rem;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #4cc9f0, #4361ee);
    border-radius: 5px;
    transition: width 0.5s ease;
}

.progress-zones {
    display: flex;
    height: 4px;
    border-radius: 2px;
    overflow: hidden;
}

.zone {
    height: 100%;
}

.zone.safe {
    background-color: #2ecc71;
}

.zone.warning {
    background-color: #f39c12;
}

.zone.danger {
    background-color: #e74c3c;
}

/* ----------------------------------------------------------------------- */
/* Tooltip Styles                                                        */
/* ----------------------------------------------------------------------- */
.tooltip {
    position: relative;
    display: inline-block;
    cursor: help;
}

.tooltip .tooltiptext {
    visibility: hidden;
    width: 200px;
    background-color: #333;
    color: #fff;
    text-align: center;
    border-radius: 6px;
    padding: 8px;
    position: absolute;
    z-index: 1;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%);
    opacity: 0;
    transition: opacity 0.3s;
    font-size: 0.9rem;
    font-weight: normal;
    line-height: 1.4;
}

.tooltip .tooltiptext::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: #333 transparent transparent transparent;
}

.tooltip:hover .tooltiptext {
    visibility: visible;
    opacity: 1;
}

.tooltip .fa-question-circle {
    color: var(--gray);
    font-size: 0.85rem;
}

.accounts-container {
    width: 100%;
    max-width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* ----------------------------------------------------------------------- */
/* Bank Account Header Styles - Fixed Alignment                          */
/* ----------------------------------------------------------------------- */
/* Bank Account Header - Fixed and professional */
.bank-account-header {
    display: grid;
    grid-template-columns: auto 1fr auto auto;
    grid-template-rows: auto auto;
    width: 100%;
    background: #2c3e50;
    color: #fff;
    padding: 1vw;
    border-radius: 8px;
    position: sticky;
    top: 6.5vw;
    z-index: 99;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    margin-bottom: 0.3vw;
    border: 1px solid #34495e;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    gap: 0.5vw 1.5vw;
    align-items: center;
}

/* Account image styling */
.bank-account-header .account-image {
    width: 60px;
    height: 60px;
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.1);
}

.bank-account-header .account-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Account info styling */
.bank-account-header .account-info {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.bank-account-header .account-name {
    font-size: 1.3rem;
    font-weight: bold;
    color: white;
}

.bank-account-header .account-name a {
    color: white;
    text-decoration: none;
}

.bank-account-header .account-name a:hover {
    text-decoration: underline;
}

.bank-account-header .account-balance {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.bank-account-header .balance-label {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.8);
}

.bank-account-header .balance-amount {
    font-size: 1.2rem;
    font-weight: bold;
    color: white;
}

/* Budget info styling */
.bank-account-header .budget-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.bank-account-header .budget-total {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.2rem;
}

.bank-account-header .budget-label {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.8);
}

.bank-account-header .budget-amount {
    font-size: 1.1rem;
    font-weight: bold;
    color: white;
}

/* Difference info styling */
.bank-account-header .difference-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.bank-account-header .difference {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.2rem;
}

.bank-account-header .difference-label {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.8);
}

.bank-account-header .difference-amount {
    font-size: 1.1rem;
    font-weight: bold;
}

.bank-account-header .difference-positive {
    color: #2ecc71;
}

.bank-account-header .difference-negative {
    color: #e74c3c;
}

/* Progress container styling */
.bank-account-header .progress-container {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    height: 6px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
    overflow: hidden;
}

.bank-account-header .progress-container .progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #3498db, #2ecc71);
    border-radius: 3px;
    transition: width 0.3s ease;
}

/* Virtual Account Items - Centered and narrower than dark box */

/* Virtual Account Items - Centered and narrower than dark box */
.virtual-accounts-wrapper {
    display: none;
    width: 98%; /* Slightly narrower than the dark header */
    margin-top: 2px;
}

.accounts-container.expanded .virtual-accounts-wrapper {
    display: block;
}

.bank-account-header {
    cursor: pointer;
}

.budget-accounts-list {
    display: block;
}

.accounts-container {
    margin-bottom: 8px;
}

.virtual-accounts-wrapper .virtual-account-item {
    margin: 0.5rem auto;
    width: 100%; /* Slightly narrower than the dark header */
    max-width: 100%;
}

/* Virtual Account Grid - 4 ROWS, 8 columns */
.virtual-accounts-wrapper .virtual-account-grid {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    grid-template-rows: auto auto auto auto; /* 4 ROWS */
    grid-row-gap: 0.4rem;
    align-items: center;
    padding: 0.6rem;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    width: 98%;
    margin: 0 auto; /* Add this to center the grid */
}

/* === ROW 1: Account name, Balance, Bank account === */
.virtual-accounts-wrapper .account-name {
    grid-row: 1;
    grid-column: 1 / 3;
    text-align: left;
    padding: 4px;
    font-weight: 600;
    color: #2c3e50;
    font-size: 1.1rem;
}

.virtual-accounts-wrapper .account-name a {
    color: #2c3e50;
    text-decoration: none;
}

.virtual-accounts-wrapper .account-name a:hover {
    color: #4a6cf7;
}

.virtual-accounts-wrapper .account-balance {
    grid-row: 1;
    grid-column: 4 / 6;
    text-align: center;
    border-radius: 6px;
    border: 2px solid; /* Thicker border like in your screenshot */
    font-size: 1.1rem;
    font-weight: 600;
    padding: 4px;
    background-color: #f8f9fa;
}

.virtual-accounts-wrapper .real-account-name {
    grid-row: 1;
    grid-column: 7 / 9;
    text-align: right;
    padding: 4px;
    font-size: 1rem;
    color: #666;
    font-style: italic;
}

/* === ROW 2: Weekly, Monthly, Yearly === */
.virtual-accounts-wrapper .weekly-amount {
    grid-row: 2;
    grid-column: 1 / 3;
    text-align: center;
    padding: 4px;
    font-size: 0.9rem;
    color: #4a5568;
}

.virtual-accounts-wrapper .monthly-amount {
    grid-row: 2;
    grid-column: 4 / 6;
    text-align: center;
    padding: 4px;
    font-size: 0.9rem;
    color: #4a5568;
}

.virtual-accounts-wrapper .yearly-amount {
    grid-row: 2;
    grid-column: 7 / 9;
    text-align: center;
    padding: 4px;
    font-size: 0.9rem;
    color: #4a5568;
}

/* === ROW 3: Spent, Extra deposits, % Spent === */
.virtual-accounts-wrapper .spent-amount {
    grid-row: 3;
    grid-column: 1 / 3;
    text-align: center;
    font-size: 1rem;
    color: #5a67d8;
    font-weight: 500;
}

.virtual-accounts-wrapper .extra-deposits {
    grid-row: 3;
    grid-column: 4 / 6;
    text-align: center;
    font-size: 0.8rem;
    color: #38a169;
    font-weight: 500;
}

.virtual-accounts-wrapper .percent-spent {
    grid-row: 3;
    grid-column: 7 / 9;
    text-align: center;
    font-size: 1rem;
    font-weight: 500;
    padding: 4px;
}

/* Percent spent color classes */
.virtual-accounts-wrapper .percent-spent.high {
    color: #e53e3e;
}

.virtual-accounts-wrapper .percent-spent.medium {
    color: #d69e2e;
}

.virtual-accounts-wrapper .percent-spent.low {
    color: #38a169;
}

/* === ROW 4: Progress bar (full width) === */
.virtual-accounts-wrapper .progress-bar-container {
    grid-row: 4;
    grid-column: 1 / 9;
    background-color: transparent;
    height: 8px;
    width: 100%;
    border-radius: 3px;
    overflow: hidden;
    margin-top: 4px;
}

.virtual-accounts-wrapper .progress-bar-container svg {
    width: 100%;
    height: 100%;
    display: block;
}

.upgrade-card {
    max-width: 520px;
    margin: 40px auto;
    padding: 30px;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.08);
    text-align: center;
}

.upgrade-subtitle {
    color: #666;
    margin-bottom: 20px;
}

.upgrade-features {
    list-style: none;
    padding: 0;
    margin: 20px 0;
    text-align: left;
}

.upgrade-features li {
    margin-bottom: 10px;
    color: #333;
}

.upgrade-features i {
    color: #2ecc71;
    margin-right: 8px;
}

.upgrade-price {
    font-size: 2.5em;
    font-weight: bold;
    margin: 20px 0;
}

.upgrade-price span {
    font-size: 0.5em;
    color: #666;
}

.upgrade-note {
    font-size: 0.85em;
    color: #888;
    margin-top: 15px;
}


/* ----------------------------------------------------------------------- */
/* Responsive Design for Mobile (max-width: 768px)                       */
/* ----------------------------------------------------------------------- */
@media (max-width: 768px) {
    /* Bank Account Header */
    .bank-account-header {
        grid-template-columns: 1fr;
        gap: 1rem;
        text-align: center;
        padding: 1rem;
        top: 8rem; /* Adjusted from 6.5vw for better mobile positioning */
    }
    
    .bank-account-header .progress-container {
        position: relative;
        bottom: auto;
        left: auto;
        transform: none;
        width: 100%;
        margin-top: 1rem;
    }
    
    /* Adjust font sizes for mobile */
    .bank-account-header .account-name {
        font-size: 1.1rem;
    }
    
    .bank-account-header .balance-amount,
    .bank-account-header .budget-amount,
    .bank-account-header .difference-amount {
        font-size: 1rem;
    }
    
    /* Virtual Account Items */
    .virtual-account-item {
        width: 100%; /* Full width on mobile for better touch targets */
    }
    
    .virtual-account-grid {
        grid-template-columns: 1fr;
        grid-template-rows: auto;
        gap: 0.5rem;
        padding: 0.75rem;
    }
    
    /* Reset all grid positions for mobile */
    .virtual-account-item .account-name,
    .real-account-name,
    .virtual-account-item .account-balance,
    .spent-amount,
    .extra-deposits,
    .percent-spent,
    .progress-bar-container,
    .weekly-amount,
    .monthly-amount,
    .yearly-amount {
        grid-row: auto;
        grid-column: 1;
        text-align: center;
    }
    
    .virtual-account-item .account-name a {
        font-size: 1rem;
    }
    
    .virtual-account-item .account-balance {
        font-size: 1rem;
    }
    
    .spent-amount,
    .percent-spent {
        font-size: 0.9rem;
    }
    
    .frequency-amount {
        font-size: 0.8rem;
    }
}