/* Accounts Tool Styles */

/* ===== MAX WIDTH CONFIGURATION ===== */
/* Change this value to experiment with different max widths for the Accounts tab */
:root {
    --accounts-tab-max-width: 1700px;  /* Adjust this value as needed */
    /* Accounts Overview color variables */
    --aa-bg: #f5f7fb;
    --aa-blue: #2b74d7;
    --aa-blue-soft: #e4efff;
    --aa-green: #28a745;
    --aa-green-soft: #e6f6ec;
    --aa-red: #d94545;
    --aa-red-soft: #fce6e6;
    --aa-gray: #6f7b8b;
    --aa-border: #dde3ef;
    --aa-card-radius: 14px;
    --aa-shadow: 0 8px 18px rgba(15, 35, 67, 0.06);
}

/* ===== ACCOUNTS & ASSETS OVERVIEW SECTION ===== */
.accounts-assets-overview {
    background: #ffffff;
    border-radius: 18px;
    padding: 20px 24px 22px;
    box-shadow: var(--aa-shadow);
    border: 1px solid #edf0f7;
    margin-bottom: 20px;
}

.aa-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}

.aa-header-left h2 {
    font-size: 18px;
    margin: 0;
    color: #1a2740;
    display: flex;
    align-items: center;
    gap: 8px;
}

.aa-header-left h2 span.icon {
    font-size: 18px;
}

.aa-header-left p {
    margin: 2px 0 0;
    font-size: 13px;
    color: var(--aa-gray);
}

.aa-header-right {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.aa-status-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border-radius: 999px;
    padding: 6px 12px;
    background: var(--aa-green-soft);
    color: #167a32;
    font-size: 12px;
    font-weight: 500;
}

.aa-status-pill span.dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #28a745;
}

.aa-primary-btn {
    border-radius: 999px;
    border: none;
    padding: 9px 18px;
    font-size: 13px;
    cursor: pointer;
    background: var(--aa-blue);
    color: #ffffff;
    font-weight: 600;
    box-shadow: 0 6px 12px rgba(24, 95, 190, 0.25);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: filter 0.2s;
}

.aa-primary-btn:hover {
    filter: brightness(0.96);
}

.aa-primary-btn span.icon {
    font-size: 14px;
}

/* KPI Cards */
.aa-kpi-row {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 20px;
}

@media (max-width: 1024px) {
    .aa-kpi-row {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 640px) {
    .aa-header {
        flex-direction: column;
        align-items: flex-start;
    }
    .aa-header-right {
        justify-content: flex-start;
    }
    .aa-kpi-row {
        grid-template-columns: minmax(0, 1fr);
    }
    .aa-panel {
        flex-wrap: wrap;
    }
    .aa-panel-left,
    .aa-panel-right {
        flex-wrap: wrap;
        flex: 1 1 100%;
    }
    .aa-share-banner {
        white-space: normal;
    }
    .aa-share-sub {
        white-space: normal;
    }
}

.aa-kpi-card {
    background: #ffffff;
    border-radius: var(--aa-card-radius);
    border: 1px solid var(--aa-border);
    padding: 14px 14px 13px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 6px;
}

.aa-kpi-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.aa-kpi-label {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--aa-gray);
    font-weight: 500;
}

.aa-kpi-icon {
    width: 30px;
    height: 30px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 600;
}

.aa-kpi-icon.blue {
    background: var(--aa-blue-soft);
    color: var(--aa-blue);
}

.aa-kpi-icon.green {
    background: var(--aa-green-soft);
    color: var(--aa-green);
}

.aa-kpi-icon.red {
    background: var(--aa-red-soft);
    color: var(--aa-red);
}

.aa-kpi-value {
    font-size: 20px;
    font-weight: 700;
    color: #111827;
}

.aa-kpi-sub {
    font-size: 12px;
    color: var(--aa-gray);
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.aa-trend-pill {
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
}

.aa-trend-pill.positive {
    background: var(--aa-green-soft);
    color: #1b7b37;
}

.aa-trend-pill.negative {
    background: var(--aa-red-soft);
    color: #ba3030;
}

/* Snapshot & Share Panel */
.aa-panel {
    display: flex;
    gap: 16px;
    flex-wrap: nowrap;
    background: var(--aa-bg);
    border-radius: 16px;
    padding: 14px 16px;
    border: 1px dashed #d1d9ec;
    align-items: center;
}

.aa-panel-left,
.aa-panel-right {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: nowrap;
}

.aa-panel-left {
    flex: 0 0 auto;
}

.aa-panel-right {
    justify-content: flex-end;
    flex: 1 1 auto;
    margin-left: auto;
}

.aa-secondary-btn,
.aa-ghost-btn {
    border-radius: 999px;
    padding: 8px 14px;
    font-size: 13px;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    border: 1px solid transparent;
    background: #ffffff;
    color: #1a2740;
    transition: all 0.2s;
}

.aa-secondary-btn {
    border-color: #d3ddf1;
    box-shadow: 0 3px 8px rgba(15, 35, 67, 0.08);
}

.aa-secondary-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(15, 35, 67, 0.12);
}

.aa-secondary-btn span.icon,
.aa-ghost-btn span.icon {
    font-size: 14px;
}

.aa-ghost-btn {
    background: transparent;
    border-color: transparent;
    color: #46526a;
}

.aa-ghost-btn:hover {
    background: rgba(0, 0, 0, 0.04);
}

.aa-share-banner {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 12px;
    padding: 9px 13px;
    background: #e8f6ff;
    border-radius: 14px;
    border: 1px solid #c8e3ff;
    white-space: nowrap;
}

.aa-share-buttons {
    display: flex;
    gap: 8px;
    align-items: center;
}

.aa-share-main {
    font-size: 13px;
    color: #115293;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.aa-share-main span.icon {
    font-size: 15px;
    background: #ffffff;
    border-radius: 999px;
    padding: 4px;
}


.aa-tag,
.aa-outline-btn {
    border-radius: 999px;
    padding: 7px 12px;
    font-size: 12px;
    font-weight: 500;
    border: 1px solid transparent;
    background: #ffffff;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s;
}

.aa-tag {
    border-color: #f3c488 !important;
    background: #fff4e1 !important;
    color: #9a5a11 !important;
}

.aa-outline-btn {
    border-color: #c8d3ea;
    color: #1a2740;
}

.aa-outline-btn:hover {
    background: #f8fafc;
}

/* ===== SECTION CARD STYLES (Investment Accounts, etc.) ===== */
:root {
    --ia-bg: #f5f7fb;
    --ia-border: #dde3ef;
    --ia-card-radius: 16px;
    --ia-shadow-soft: 0 10px 24px rgba(15, 35, 67, 0.05);
    --bucket-pre-tax: #2b74d7;
    --bucket-tax-free: #27a45b;
    --bucket-taxable: #ff8a3b;
}

.ia-section {
    margin-top: 20px;
    background: #ffffff;
    border-radius: 20px;
    border: 1px solid #edf0f7;
    box-shadow: var(--ia-shadow-soft);
    padding: 20px 22px 18px;
}

.ia-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.ia-header-left {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.ia-title {
    font-size: 17px;
    font-weight: 600;
    color: #1a2740;
}

.ia-help-link {
    font-size: 12px;
    color: #2b74d7;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.ia-help-link:hover {
    text-decoration: underline;
}

.ia-header-right {
    display: flex;
    gap: 8px;
}

.ia-add-btn {
    border-radius: 999px;
    padding: 5px 10px;
    border: none;
    font-size: 14px;
    font-weight: 600;
    background: #27a45b;
    color: #ffffff;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    box-shadow: 0 4px 10px rgba(39, 164, 91, 0.25);
    transition: filter 0.2s;
    white-space: nowrap;
}

.ia-add-btn:hover {
    filter: brightness(0.96);
}

.ia-add-btn.danger {
    background: #d94545;
    box-shadow: 0 4px 10px rgba(217, 69, 69, 0.25);
}

/* Table card */
.ia-table-card {
    background: #ffffff;
    border-radius: 16px;
    border: 1px solid var(--ia-border);
    overflow: hidden;
}

.ia-table-header {
    background: var(--brand-600);
    color: #ffffff;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 9px 16px;
    display: grid;
    gap: 12px;
}

.ia-table-header.cols-4 {
    grid-template-columns: 2fr 1.5fr 0.7fr 3.8fr;
}

/* Slider styling within account rows */
.ia-slider-placeholder {
    flex: 1;
    min-width: 0;
}

.ia-balance-cell .slider-container {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
}

.ia-balance-cell .slider-label {
    display: none; /* Hide label in account rows */
}

.ia-balance-cell .slider-control {
    flex: 1;
    min-width: 80px;
    height: 6px;
    border-radius: 999px;
    appearance: none;
    -webkit-appearance: none;
    background: #e3ebff;
    outline: none;
}

.ia-balance-cell .slider-control::-webkit-slider-thumb {
    appearance: none;
    -webkit-appearance: none;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #2b74d7;
    box-shadow: 0 0 0 3px rgba(43, 116, 215, 0.25);
    cursor: pointer;
}

.ia-balance-cell .slider-control::-moz-range-thumb {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #2b74d7;
    box-shadow: 0 0 0 3px rgba(43, 116, 215, 0.25);
    cursor: pointer;
    border: none;
}

.ia-balance-cell .slider-input {
    display: flex;
    align-items: center;
    gap: 4px;
}

.ia-balance-cell .slider-input input[type="text"] {
    width: 90px;
    padding: 5px 8px;
    border-radius: 8px;
    border: 1px solid #d1d8ea;
    background: #ffffff;
    font-size: 12px;
    text-align: right;
    color: #1a2740;
}

.ia-balance-cell .slider-input input[type="text"]:focus {
    outline: none;
    border-color: #2b74d7;
    box-shadow: 0 0 0 2px rgba(43, 116, 215, 0.15);
}

.ia-balance-cell .spinner-buttons {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.ia-balance-cell .spinner-button {
    border: none;
    width: 18px;
    height: 14px;
    font-size: 12px;
    cursor: pointer;
    background: transparent;
    color: #6c757d;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ia-balance-cell .spinner-button:hover {
    color: #495057;
}

.ia-table-header.cols-5 {
    grid-template-columns: 1fr 2fr 1.5fr 3fr 0.5fr;
}

.ia-table-header.cols-6 {
    grid-template-columns: 1fr 2fr 1.5fr 1fr 2.5fr 0.5fr;
}

.ia-table-header div {
    opacity: 0.9;
}

.ia-row {
    display: grid;
    gap: 12px;
    align-items: center;
    padding: 5px 16px;
    font-size: 14px;
    border-top: 1px solid #edf0f7;
    background: #ffffff;
}

.ia-row.cols-4 {
    grid-template-columns: 2fr 1.5fr 0.7fr 3.8fr;
}

.ia-row.cols-5 {
    grid-template-columns: 1fr 2fr 1.5fr 3fr 0.5fr;
}

.ia-row.cols-6 {
    grid-template-columns: 1fr 2fr 1.5fr 1fr 2.5fr 0.5fr;
}

.ia-row:nth-child(even) {
    background: #f0f4f8;
}

.ia-row:hover {
    background: #e8f1ff !important;
    transition: background 0.15s ease;
}

.ia-cell {
    color: #1a2740;
}

.ia-cell.name {
    font-weight: 500;
}

.ia-cell.type {
    color: #4a5568;
}

.ia-cell.owner {
    color: #4a5568;
    font-size: 12px;
}

/* Owner badges for Real Estate and other sections */
.owner-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.owner-badge.primary {
    background: #e3f2fd;
    color: #1565c0;
}

.owner-badge.spouse {
    background: #fce4ec;
    color: #c2185b;
}

.owner-badge.legacy {
    background: #fff3e0;
    color: #e65100;
    font-size: 10px;
}

.ia-bucket-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    padding: 4px 10px;
    border-radius: 999px;
    font-weight: 600;
    background: #eef1f9;
    color: #364152;
    white-space: nowrap;
}

.ia-bucket-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.ia-bucket-pill.pre-tax .ia-bucket-dot {
    background: var(--bucket-pre-tax);
}

.ia-bucket-pill.tax-free .ia-bucket-dot {
    background: var(--bucket-tax-free);
}

.ia-bucket-pill.taxable .ia-bucket-dot {
    background: var(--bucket-taxable);
}

/* Balance cell */
.ia-balance-cell {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
}

.ia-slider-wrap {
    flex: 1;
    min-width: 80px;
}

.ia-slider {
    width: 100%;
    height: 6px;
    border-radius: 999px;
    appearance: none;
    background: #e3ebff;
    outline: none;
}

.ia-slider::-webkit-slider-thumb {
    appearance: none;
    width: 14px;
    height: 14px;
    border-radius: 999px;
    background: #2b74d7;
    box-shadow: 0 0 0 3px rgba(43, 116, 215, 0.25);
    cursor: pointer;
}

.ia-slider::-moz-range-thumb {
    width: 14px;
    height: 14px;
    border-radius: 999px;
    background: #2b74d7;
    box-shadow: 0 0 0 3px rgba(43, 116, 215, 0.25);
    cursor: pointer;
    border: none;
}

.ia-amount-wrap {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.ia-amount-input {
    min-width: 50px;
    width: 90px;
    padding: 5px 9px;
    border-radius: 10px;
    border: 1px solid #d1d8ea;
    background: #ffffff;
    font-size: 13px;
    font-family: Roboto, sans-serif;
    text-align: right;
    color: #1a2740;
}

.ia-amount-input:focus {
    outline: none;
    border-color: #2b74d7;
    box-shadow: 0 0 0 1px rgba(43, 116, 215, 0.25);
}

.ia-amount-input.danger {
    color: #d94545;
}

.ia-actions {
    display: flex;
    flex-direction: row;
    gap: 4px;
    margin-left: 4px;
    flex-shrink: 0;
}

.ia-action-btn {
    border: none;
    width: 24px;
    height: 24px;
    border-radius: 6px;
    cursor: pointer;
    background: transparent;
    color: #7a869a;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    transition: all 0.2s;
    padding-left:10px;

}

.ia-action-btn:hover {
    background: #edf1fb;
    color: #2b3b57;
}

.ia-action-btn.delete:hover {
    background: #fce6e6;
    color: #d94545;
}

/* Bottom analytics area */
.ia-bottom {
    margin-top: 16px;
    display: flex;
    gap: 16px;
    flex-wrap: nowrap;

}

@media (max-width: 700px) {
    .ia-bottom {
        flex-wrap: wrap;
    }
    .ia-donut-card,
    .ia-totals-card {
        flex: 1 1 100%;
    }
}

/* Donut card */
.ia-donut-card {
    background: var(--ia-bg);
    border-radius: 16px;
    border: 1px dashed #cad2e8;
    padding: 14px 16px;
    display: flex;
    align-items: center;
    gap: 16px;
    flex: 1 1 auto;
    min-width: 280px;
}

.ia-donut-legend {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 12px;
}

.ia-legend-row {
    display: flex;
    justify-content: space-between;
    gap: 10px;
}

.ia-legend-left {
    display: flex;
    align-items: center;
    gap: 7px;
}

.ia-legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 999px;
}

.ia-legend-dot.pre-tax {
    background: var(--bucket-pre-tax);
}

.ia-legend-dot.tax-free {
    background: var(--bucket-tax-free);
}

.ia-legend-dot.taxable {
    background: var(--bucket-taxable);
}

.ia-legend-label {
    font-weight: 500;
    color: #1a2740;
}

.ia-legend-meta {
    color: #6b7280;
    font-size: 11px;
}

.ia-legend-value {
    font-weight: 600;
    color: #1a2740;
    white-space: nowrap;
}

/* Totals card */
.ia-totals-card {
    background: #ffffff;
    border-radius: 16px;
    border: 1px solid var(--ia-border);
    padding: 12px 16px 10px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1 1 auto;
    min-width: 200px;
}

.ia-totals-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
    padding: 4px 0;
    white-space: nowrap;
}

.ia-totals-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #4b5563;
}

.ia-totals-label .pill {
    width: 3px;
    height: 18px;
    border-radius: 999px;
}

.ia-totals-label .pill.pre-tax {
    background: var(--bucket-pre-tax);
}

.ia-totals-label .pill.tax-free {
    background: var(--bucket-tax-free);
}

.ia-totals-label .pill.taxable {
    background: var(--bucket-taxable);
}

.ia-totals-amount {
    font-weight: 600;
    color: #111827;
}

.ia-totals-footer {
    margin-top: 6px;
    padding-top: 8px;
    border-top: 1px solid #e1e5f1;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
}

.ia-totals-footer-label {
    font-weight: 700;
    color: #111827;
}

.ia-totals-footer-amount {
    font-weight: 800;
    color: #1f2937;
    letter-spacing: 0.03em;
}

/* Simple totals row for sections without donut chart */
.ia-simple-total {
    margin-top: 12px;
    padding: 10px 16px;
    background: #f8fafc;
    border-radius: 12px;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 8px;
    font-size: 14px;
}

.ia-simple-total-label {
    font-weight: 600;
    color: #4b5563;
}

.ia-simple-total-value {
    font-weight: 700;
    color: #111827;
}

.ia-simple-total-value.danger {
    color: #d94545;
}

.accounts-tool-container {
    padding: 20px;
    background-color: var(--gray-50); 
    min-height: 100%;
    max-width: var(--accounts-tab-max-width);
    margin: 0;  /* Left-justified - extra space appears on the right */
}

/* Accounts Info Section Toggle */
#accountsInfoToggle:hover {
    background: rgba(21, 101, 192, 0.1) !important;
}

#accountsInfoContent {
    transition: opacity 0.3s ease, max-height 0.3s ease;
    overflow: hidden;
}

.accounts-info-section.collapsed #accountsInfoContent {
    max-height: 0 !important;
    margin-top: 0 !important;
    opacity: 0;
}

/* Summary Bar */
.accounts-summary-bar {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: clamp(0.15rem, 1vw, 0.75rem);
    margin-bottom: 2rem;
}

.summary-card {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    padding: clamp(0.5rem, 1.2vw, 0.75rem);
    border-left: 4px solid;
    transition: transform 0.2s, box-shadow 0.2s;
}

.summary-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.assets-card {
    border-left-color: var(--success-600);
}

.liabilities-card {
    border-left-color: var(--danger-600);
}

.networth-card {
    border-left-color: var(--brand-600);
}

.summary-content {
    display: flex;
    align-items: center;
}

.summary-content > div:first-child {
    flex-shrink: 1;
    min-width: 0;
}

.summary-label {
    font-size: clamp(10px, 0.85vw, 0.875rem);
    font-weight: 500;
    color: var(--gray-600);
    margin-bottom: 0.25rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.summary-value {
    font-size: clamp(13px, 1.5vw, 22px);
    font-weight: bold;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.success-color {
    color: var(--success-600);
}

.danger-color {
    color: var(--danger-600);
}

.primary-color {
    color: var(--brand-600);
}

.info-color {
    color: var(--brand-600);
}

.summary-icon {
    font-size: clamp(1.1rem, 1.8vw, 2rem);
    flex-shrink: 0;
    margin-left: auto;
}

/* Action Buttons */
.accounts-action-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 2rem;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem .5rem;
    border-radius: 8px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.btn-primary {
    background-color: var(--info-600);  /* Brand blue for primary actions */
    color: white;
}

.btn-primary:hover {
    background-color: var(--info-700);
}

.btn-secondary {
    background-color: var(--gray-600);  /* Neutral gray for secondary actions */
    color: white;
}

.btn-secondary:hover {
    background-color: var(--gray-700);
}

.btn-success {
    background-color: var(--success-600);  /* Green for positive actions */
    color: white;
}

.btn-success:hover {
    background-color: var(--success-700);
}

.btn-danger {
    background-color: var(--danger-600);  /* Red for destructive actions */
    color: white;
}

.btn-danger:hover {
    background-color: var(--danger-700);
}

.btn-gray {
    background-color: var(--gray-600);  /* Neutral gray */
    color: white;
}

.btn-gray:hover {
    background-color: var(--gray-700);
}

.btn-warning {
    background-color: var(--warning-600);  /* Orange for warning actions */
    color: white;
}

.btn-warning:hover {
    background-color: var(--warning-700);
}

.btn-info {
    background-color: var(--info-600);  /* Brand blue for informational actions */
    color: white;
}

.btn-info:hover {
    background-color: var(--info-700);
}

.btn-cancel {
    background-color: var(--gray-200);  /* Light gray for cancel actions */
    color: var(--gray-800);
}

.btn-cancel:hover {
    background-color: var(--gray-300);
}

/* Sections */
.accounts-section {
    background: rgb(236, 236, 236);
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.section-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--gray-800);
}

.section-subtitle {
    font-size: 0.875rem;
    color: var(--gray-600);
}

/* Bucket Totals */
.bucket-totals {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.bucket-card {
    background: var(--gray-50);
    border-radius: 8px;
    padding: 1rem;
}

.bucket-card.pre-tax {
    background: var(--danger-50);
}

.bucket-card.roth {
    background: var(--success-50);  /* Light green background */
}

.bucket-card.taxable {
    background: var(--brand-100);  /* Light blue background */
}

.bucket-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.bucket-label {
    font-size: 0.875rem;
    font-weight: 500;
}

.bucket-card.pre-tax .bucket-label {
    color: var(--danger-600);
}

.bucket-card.roth .bucket-label {
    color: var(--success-700);
}

.bucket-card.taxable .bucket-label {
    color: var(--brand-700);
}

.bucket-value {
    font-size: 1.125rem;
    font-weight: 700;
}

.bucket-card.pre-tax .bucket-value {
    color: var(--danger-600);
}

.bucket-card.roth .bucket-value {
    color: var(--success-700);
}

.bucket-card.taxable .bucket-value {
    color: var(--brand-700);
}

.bucket-progress {
    width: 100%;
    height: 0.5rem;
    background: var(--gray-300);
    border-radius: 9999px;
    overflow: hidden;
}

.bucket-bar {
    height: 100%;
    transition: width 0.3s ease;
}

.bucket-card.pre-tax .bucket-bar {
    background: var(--danger-600);
}

.bucket-card.roth .bucket-bar {
    background: var(--success-600);
}

.bucket-card.taxable .bucket-bar {
    background: var(--brand-600);
}

.bucket-percent {
    font-size: 0.75rem;
    margin-top: 0.25rem;
}

.bucket-card.pre-tax .bucket-percent {
    color: var(--danger-600);
}

.bucket-card.roth .bucket-percent {
    color: var(--success-600);
}

.bucket-card.taxable .bucket-percent {
    color: var(--brand-600);
}

/* Accounts Grid */
.accounts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.accounts-column {
    min-width: 0; /* Prevent grid blowout */
}

.column-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.column-title {
    font-size: 1.125rem;
    font-weight: 500;
    color: var(--gray-800);
}

.btn-add-account {
    padding: 0.375rem 0.75rem;
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
}

/* Accounts List */
.accounts-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

/* Account Card */
.account-card,
.account-card-liability {
    border: 1px solid var(--gray-300);
    border-radius: 8px;
    padding: 1rem;
    background: white;
    transition: all 0.2s;
}

.account-card:hover {
    border-color: var(--gray-300);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.account-card-liability {
    background: var(--danger-50);
    border-color: var(--danger-200);
}

.account-card-liability:hover {
    border-color: var(--danger-300);
    box-shadow: 0 2px 4px rgba(239, 68, 68, 0.1);
}

.account-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.5rem;
}

.account-info {
    flex: 1;
}

.account-name {
    font-weight: 500;
    color: var(--gray-900);
    margin: 0 0 0.25rem 0;
}

.account-type {
    font-size: 0.875rem;
    color: var(--gray-600);
    margin: 0 0 0.5rem 0;
}

.account-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.125rem 0.5rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
}

.badge-pretax {
    background: var(--danger-50);
    color: var(--danger-700);
}

.badge-roth {
    background: var(--success-100);
    color: var(--success-700);
}

.badge-taxable {
    background: var(--brand-100);
    color: var(--brand-700);
}

.account-delete {
    color: var(--gray-600);
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.25rem;
    transition: color 0.2s;
}

.account-delete:hover {
    color: var(--danger-600);
}

.account-balance {
    text-align: right;
}

.account-balance span {
    font-size: 1.125rem;
    font-weight: 700;
    cursor: pointer;
    padding: 0.125rem 0.5rem;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.account-balance span:hover {
    background-color: var(--gray-100);
}

.balance-normal {
    color: var(--gray-900);
}

.balance-danger {
    color: var(--danger-700);
}

/* Modal Styles */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 50;
    padding: 1rem;
}

.modal-overlay.hidden {
    display: none;
}

.modal-content {
    background: white;
    border-radius: 8px;
    padding: 1.5rem;
    width: 100%;
    max-width: 28rem;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-large {
    max-width: 56rem;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, #5B9BD5 0%, #4A90E2 100%);
    color: white;
    padding: 5px 24px;
    margin: -24px -24px 20px -24px;
    border-radius: 8px 8px 0 0;
}

.modal-header h3 {
    font-size: 1.125rem;
    font-weight: 600;
    margin: 0;
    color: white;
}

.modal-close {
    color: white;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.25rem;
    font-size: 1.5rem;
    transition: opacity 0.2s;
    opacity: 0.9;
}

.modal-close:hover {
    opacity: 1;
}

.modal-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--gray-800);
}

.form-control {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--gray-300);
    border-radius: 6px;
    font-size: 1rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-control:focus {
    outline: none;
    border-color: var(--brand-600);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Style optgroups in the account type dropdown */
.form-control optgroup {
    font-weight: bold;
    color: var(--gray-600);
    font-size: 0.875rem;
    background: var(--gray-100);
}

.form-control optgroup option {
    font-weight: normal;
    padding-left: 1rem;
    color: var(--gray-800);
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    padding-top: 1rem;
}

.modal-body {
    padding: 0;
}

/* History Styles */
.history-empty {
    text-align: center;
    padding: 2rem;
    color: var(--gray-600);
}

.history-empty-title {
    font-size: 1.125rem;
    margin-bottom: 0.5rem;
}

.history-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.history-item {
    background: var(--gray-50);
    border-radius: 8px;
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.history-item-latest {
    border-left: 4px solid var(--brand-600);
}

.history-item-left {
    flex: 1;
}

.history-date {
    font-weight: 500;
    color: var(--gray-900);
}

.latest-badge {
    color: var(--brand-700);
    font-size: 0.875rem;
    margin-left: 0.5rem;
}

.history-time {
    font-size: 0.875rem;
    color: var(--gray-600);
}

.history-change {
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    margin-top: 0.25rem;
}

.positive-change {
    color: var(--success-700);
}

.negative-change {
    color: var(--danger-700);
}

.history-item-right {
    text-align: right;
}

.history-networth {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--gray-900);
}

.history-breakdown {
    font-size: 0.875rem;
    color: var(--gray-600);
}

/* Table Styles */
.accounts-table-container {
    overflow-x: auto;
    margin-top: 0.75rem;
}

.accounts-table {
    width: 100%;
    table-layout: auto; /* Changed from fixed to auto for better column sizing */
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.9375rem;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.07), 0 2px 4px rgba(0, 0, 0, 0.04);
    background: white;
    border: 1px solid rgba(229, 231, 235, 0.5);
}

.accounts-table thead { 
    background-color: red;
    background:red;
    border-bottom: none;
    position: relative;
} 

.accounts-table thead::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
}

.accounts-table thead tr:first-child th:first-child {
    border-top-left-radius: 12px;
}

.accounts-table thead tr:first-child th:last-child {
    border-top-right-radius: 12px;
}

.accounts-table th {
    padding: 0.625rem 1.25rem;
    text-align: left;
    font-weight: 600;
    color: white;
    white-space: nowrap;
    letter-spacing: 0.025em;
    font-size: 0.8125rem;
    text-transform: uppercase;
    border: none !important;
    border-bottom: 2px solid rgba(255, 255, 255, 0.1);
    background-color: var(--gray-500);
}

/* Investment accounts table column widths (5 columns) */
#primaryInvestmentAccountsTableBody th:nth-child(1),
#primaryInvestmentAccountsTableBody td:nth-child(1),
#spouseInvestmentAccountsTableBody th:nth-child(1),
#spouseInvestmentAccountsTableBody td:nth-child(1),
#primaryInvestmentAccountsTableBody ~ tr th:nth-child(1),
#primaryInvestmentAccountsTableBody ~ tr td:nth-child(1),
table:has(#primaryInvestmentAccountsTableBody) th:nth-child(1),
table:has(#primaryInvestmentAccountsTableBody) td:nth-child(1),
table:has(#spouseInvestmentAccountsTableBody) th:nth-child(1),
table:has(#spouseInvestmentAccountsTableBody) td:nth-child(1) {
    width: 20%; /* Account Name */
}

table:has(#primaryInvestmentAccountsTableBody) th:nth-child(2),
table:has(#primaryInvestmentAccountsTableBody) td:nth-child(2),
table:has(#spouseInvestmentAccountsTableBody) th:nth-child(2),
table:has(#spouseInvestmentAccountsTableBody) td:nth-child(2) {
    width: 22%; /* Type */
}

table:has(#primaryInvestmentAccountsTableBody) th:nth-child(3),
table:has(#primaryInvestmentAccountsTableBody) td:nth-child(3),
table:has(#spouseInvestmentAccountsTableBody) th:nth-child(3),
table:has(#spouseInvestmentAccountsTableBody) td:nth-child(3) {
    width: 14%; /* Bucket */
}

table:has(#primaryInvestmentAccountsTableBody) th:nth-child(4),
table:has(#primaryInvestmentAccountsTableBody) td:nth-child(4),
table:has(#spouseInvestmentAccountsTableBody) th:nth-child(4),
table:has(#spouseInvestmentAccountsTableBody) td:nth-child(4) {
    width: 36%; /* Balance */
    text-align: left !important; /* Left-justify */
}

table:has(#primaryInvestmentAccountsTableBody) th:nth-child(5),
table:has(#primaryInvestmentAccountsTableBody) td:nth-child(5),
table:has(#spouseInvestmentAccountsTableBody) th:nth-child(5),
table:has(#spouseInvestmentAccountsTableBody) td:nth-child(5) {
    width: 8%; /* Actions - delete icon */
}

/* Consistent column widths for Cash tables (5 columns) */
table:has(#cashAccountsTableBody) {
    table-layout: fixed;
}

table:has(#cashAccountsTableBody) th:nth-child(1),
table:has(#cashAccountsTableBody) td:nth-child(1) {
    width: 15%; /* Owner */
}

table:has(#cashAccountsTableBody) th:nth-child(2),
table:has(#cashAccountsTableBody) td:nth-child(2) {
    width: 30%; /* Account Name */
}

table:has(#cashAccountsTableBody) th:nth-child(3),
table:has(#cashAccountsTableBody) td:nth-child(3) {
    width: 20%; /* Type */
}

table:has(#cashAccountsTableBody) th:nth-child(4),
table:has(#cashAccountsTableBody) td:nth-child(4) {
    width: 30%; /* Balance */
    text-align: left !important;
}

table:has(#cashAccountsTableBody) th:nth-child(5),
table:has(#cashAccountsTableBody) td:nth-child(5) {
    width: 5%; /* Actions */
}

/* Other Assets table column widths (6 columns: Owner, Name, Type, Appreciation, Value, Actions) */
table:has(#otherAssetsTableBody) {
    table-layout: fixed;
}

table:has(#otherAssetsTableBody) th:nth-child(1),
table:has(#otherAssetsTableBody) td:nth-child(1) {
    width: 12%; /* Owner */
}

table:has(#otherAssetsTableBody) th:nth-child(2),
table:has(#otherAssetsTableBody) td:nth-child(2) {
    width: 25%; /* Asset Name */
}

table:has(#otherAssetsTableBody) th:nth-child(3),
table:has(#otherAssetsTableBody) td:nth-child(3) {
    width: 18%; /* Asset Type */
}

table:has(#otherAssetsTableBody) th:nth-child(4),
table:has(#otherAssetsTableBody) td:nth-child(4) {
    width: 15%; /* Appreciation */
    text-align: center;
}

table:has(#otherAssetsTableBody) th:nth-child(5),
table:has(#otherAssetsTableBody) td:nth-child(5) {
    width: 25%; /* Value */
    text-align: left !important;
}

table:has(#otherAssetsTableBody) th:nth-child(6),
table:has(#otherAssetsTableBody) td:nth-child(6) {
    width: 5%; /* Actions */
}

/* Liabilities table column widths (5 columns: Owner, Name, Type, Balance, Actions) */
table:has(#liabilitiesTableBody) {
    table-layout: fixed;
}

table:has(#liabilitiesTableBody) th:nth-child(1),
table:has(#liabilitiesTableBody) td:nth-child(1) {
    width: 15%; /* Owner */
}

table:has(#liabilitiesTableBody) th:nth-child(2),
table:has(#liabilitiesTableBody) td:nth-child(2) {
    width: 30%; /* Liability Name */
}

table:has(#liabilitiesTableBody) th:nth-child(3),
table:has(#liabilitiesTableBody) td:nth-child(3) {
    width: 20%; /* Type */
}

table:has(#liabilitiesTableBody) th:nth-child(4),
table:has(#liabilitiesTableBody) td:nth-child(4) {
    width: 30%; /* Balance */
    text-align: left !important;
}

table:has(#liabilitiesTableBody) th:nth-child(5),
table:has(#liabilitiesTableBody) td:nth-child(5) {
    width: 5%; /* Actions */
}

.accounts-table tbody tr {
    border-bottom: 1px solid rgba(229, 231, 235, 0.5);
}

.accounts-table tbody tr:nth-child(even) {
    background-color: rgba(249, 250, 251, 0.4);
}

.accounts-table tbody tr:last-child {
    border-bottom: none;
}

.accounts-table tbody tr:last-child td:first-child {
    border-bottom-left-radius: 12px;
}

.accounts-table tbody tr:last-child td:last-child {
    border-bottom-right-radius: 12px;
}

.accounts-table td {
    padding: 4px 0 4px 5px; /* Compact vertical padding to match Investment Accounts spacing */
    color: var(--gray-900);
    font-size: clamp(13px, 1.5vh, 19px);
    border-left: none !important;
    border-right: none !important;
    border-top: none !important;
}

.accounts-table td.text-right {
    text-align: right;
    font-weight: 600;
    font-family: Roboto, sans-serif;
    background: linear-gradient(90deg, transparent 0%, rgba(249, 250, 251, 0.5) 100%);
    position: relative;
}

.accounts-table td.text-right::before {

    position: absolute;
    left: -10px;
    opacity: 0.4;
    font-weight: 400;
}

.accounts-table td.text-danger {
    color: var(--danger-700);
    font-weight: 600;
}

.balance-cell {

    text-align: left;
}

.balance-input {
    width: 140px;

    border: 2px solid transparent;
    background: linear-gradient(white, white) padding-box,
                linear-gradient(135deg, var(--gray-300), var(--gray-300)) border-box;
    border-radius: 6px;
    font-size: 0.5rem;
    font-weight: 600;
    text-align: right;
    transition: all 0.2s ease;
    cursor: pointer;
    font-family: Roboto, sans-serif;
}

/* Text mode (currency display) */
.balance-input[type="text"] {
    color: var(--gray-900);
    background: linear-gradient(white, white) padding-box,
                linear-gradient(135deg, var(--gray-100), var(--gray-300)) border-box;
}

/* Number mode (editing) */
.balance-input[type="number"] {
    background: white;
    border: 2px solid var(--brand-600);
    cursor: text;
}

.balance-input:hover {
    background: linear-gradient(white, white) padding-box,
                linear-gradient(135deg, var(--brand-600), var(--brand-700)) border-box;
    transform: translateX(2px);
}

.balance-input:focus {
    outline: none;
    background: white;
    border: 2px solid var(--brand-600);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
    transition: border-color 0.2s, box-shadow 0.2s;
    transform: none;
}

.balance-input-danger {
    color: var(--danger-700);
}

.balance-input-danger[type="text"] {
    background: linear-gradient(white, white) padding-box,
                linear-gradient(135deg, var(--danger-200), var(--danger-300)) border-box;
}

.balance-input-danger:hover {
    background: linear-gradient(white, white) padding-box,
                linear-gradient(135deg, var(--danger-600), var(--danger-700)) border-box;
}

.balance-input-danger:focus {
    border-color: var(--danger-600);
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

/* Remove spinner arrows for cleaner look */
.balance-input::-webkit-inner-spin-button,
.balance-input::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.balance-input[type=number] {
    -moz-appearance: textfield;
}

.actions-col {
    width: 50px;
    text-align: center;
}

.btn-edit-inline {
    background: none;
    border: none;
    color: var(--gray-500);
    cursor: pointer;
    padding: 0.25rem 0.4rem;
    font-size: 0.8rem;
    transition: color 0.2s;
}

.btn-edit-inline:hover {
    color: var(--brand-600);
}

.btn-delete-inline {
    background: none;
    border: none;
    color: var(--gray-500);
    cursor: pointer;
    padding: 0.25rem 0.4rem;
    font-size: 0.8rem;
    transition: color 0.2s;
}

.btn-delete-inline:hover {
    color: var(--danger-600);
}

/* Actions column with both edit and delete buttons */
.actions-col {
    white-space: nowrap;
}

/* Bucket Type Cell Styling */
.accounts-table td.bucket-type-cell {
    position: relative;
    font-weight: 500;
}

.accounts-table td.bucket-type-cell.pre-tax::after {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 20px;
    background: var(--brand-600);
    border-radius: 2px;
}

.accounts-table td.bucket-type-cell.tax-free::after {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 20px;
    background: var(--success-600);
    border-radius: 2px;
}

.accounts-table td.bucket-type-cell.taxable::after {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 20px;
    background: var(--warning-600);
    border-radius: 2px;
}

/* Table Footer Styles */
.accounts-table tfoot tr {
    font-weight: 700;
    background: linear-gradient(135deg, var(--gray-100) 0%, var(--gray-300) 100%);
    border-top: 2px solid var(--gray-300);
}

.subtotal-row {
    border-top: 2px solid var(--gray-300);
    background: linear-gradient(90deg, var(--gray-50) 0%, var(--gray-100) 100%);
}

.subtotal-row td {
    padding: 0.625rem 1.25rem; /* Same as normal rows */
    font-weight: 700;
    letter-spacing: 0.025em;
}

.subtotal-row td:first-child {
    padding-left: 1.25rem; /* No extra indentation */
}

.subtotal-row td.text-right {
    font-size: 1.125rem; /* Same as other rows */
    color: var(--gray-800);
    text-align: right;
}

.total-row {
    border-top: 2px solid var(--gray-300);
    background-color: var(--gray-50);
}

.total-row td {
    padding: 0.75rem 1rem;
    background-color: var(--gray-50) !important;
}

.total-label {
    text-align: right;
    font-weight: 600;
    color: var(--gray-800);
    white-space: nowrap;
}

.total-value {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--gray-900);
    white-space: nowrap;
}

.total-value span {
    font-weight: 700;
}

.liability-total .total-value {
    color: var(--danger-700);
}

/* Net Worth Summary Table Styles */
.total-row.net-worth-total {
    background-color: var(--gray-300);
    border-top: 3px solid var(--gray-600);
}

.total-row.net-worth-total td {
    padding: 1rem;
    font-size: 1.2rem;
    font-weight: 700;
}

#netWorthTotal {
    font-size: 1.25rem;
}

/* Investment Totals Summary Section */
.investment-totals-section {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(135deg, var(--gray-50) 0%, var(--gray-100) 100%);
    border-radius: 12px;
    padding: 0.5rem 1rem;
    margin-top: 0.65rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(229, 231, 235, 0.5);
}

.totals-chart-container {
    width: 40%;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    aspect-ratio: 1 / 1;
    max-height: 100px;
}

.totals-chart-container canvas {
    width: 100% !important;
    height: 100% !important;
    max-width: 100%;
    max-height: 100%;
}

.totals-breakdown {
    width: 50%;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding-left: 2rem;
}

.total-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.10rem 0.35rem;
    background: white;
    border-radius: 6px;
    transition: all 0.2s;
}

.total-item:hover {
    transform: translateX(4px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.06);
}

.total-item.pre-tax {
    border-left: 4px solid var(--danger-600);
}

.total-item.tax-free {
    border-left: 4px solid var(--success-600);
}

.total-item.taxable {
    border-left: 4px solid var(--brand-600);
}

.total-item.grand-total {
    background: linear-gradient(135deg, var(--gray-800) 0%, var(--gray-600) 100%);
    color: white;
    margin-top: 0.2rem;
    padding: 0.1rem 0.35rem;
}

.total-item.grand-total .total-label {
    color: white;
    font-weight: 600;
    font-size: 0.775rem;
    white-space: nowrap;
}

.total-item.grand-total .total-value {
    color: white;
    font-size: 1.125rem;
}

.total-item .total-label {
    font-weight: 500;
    color: var(--gray-600);
    font-size: 0.8125rem;
}

.total-item .total-value {
    font-weight: 700;
    color: var(--gray-900);
    font-size: 1rem;
    font-family: Roboto, sans-serif;
}

/* Compact Add Buttons */
.btn-add-compact {
    padding: 0.375rem 0.75rem;
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    transition: all 0.2s;
}

.btn-add-compact:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.btn-add-compact.btn-success {
    background-color: var(--success-600);
    color: white;
}

.btn-add-compact.btn-success:hover {
    background-color: var(--success-700);
}

.btn-add-compact.btn-danger {
    background-color: var(--danger-600);
    color: white;
}

.btn-add-compact.btn-danger:hover {
    background-color: var(--danger-700);
}

.section-actions {
    display: flex;
    gap: 0.5rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .accounts-grid {
        grid-template-columns: 1fr;
    }

    .bucket-totals {
        grid-template-columns: 1fr;
    }

    .accounts-action-buttons {
        flex-direction: column;
    }

    .btn {
        width: 100%;
        justify-content: center;
    }
}

/* Small tablets - 2 columns */
@media (max-width: 400px) {
    .accounts-summary-bar {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Very small screens (phones) - 1 column */
@media (max-width: 320px) {
    .accounts-summary-bar {
        grid-template-columns: 1fr;
    }

    .accounts-table {
        font-size: 0.875rem;
    }

    .accounts-table th,
    .accounts-table td {
        padding: 0.5rem 0.75rem;
    }

    .section-actions {
        flex-wrap: wrap;
    }

    /* Investment totals mobile layout */
    .investment-totals-section {
        flex-direction: column;
        gap: 1rem;
        padding: 0.75rem;
        justify-content: center;
    }

    .totals-chart-container {
        width: 100%;
        max-width: 250px;
        margin: 0 auto;
        display: flex;
        justify-content: center;
    }

    .totals-breakdown {
        width: 100%;
        padding-left: 0;
    }

    .total-item {
        padding: 0.75rem;
    }
}

/* Snapshot Modal Styles */
.modal-extra-large {
    max-width: 900px !important;
    width: 90%;
}

.snapshots-modal-body {
    max-height: 600px;
    overflow-y: auto;
}

.snapshots-summary {
    display: flex;
    gap: 30px;
    padding: 15px 0;
    border-bottom: 1px solid var(--gray-300);
    margin-bottom: 20px;
}

.summary-stat {
    display: flex;
    align-items: center;
    gap: 8px;
}

.stat-label {
    color: var(--gray-600);
    font-size: 13px;
}

.stat-value {
    font-weight: 600;
    font-size: 15px;
}

.snapshots-table-container {
    overflow-x: auto;
}

.snapshots-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.snapshots-table thead {
    background-color: var(--gray-50);
    border-bottom: 2px solid var(--gray-300);
}

.snapshots-table th {
    padding: 10px 12px;
    text-align: left;
    font-weight: 600;
    color: var(--gray-800);
    white-space: nowrap;
}

.snapshots-table th.text-right {
    text-align: right;
}

.snapshots-table tbody tr {
    border-bottom: 1px solid var(--gray-300);
    transition: background-color 0.2s;
}

.snapshots-table tbody tr:hover {
    background-color: var(--gray-50);
}

.snapshots-table td {
    padding: 8px 12px;
    color: var(--gray-900);
}

.snapshots-table td.text-right {
    text-align: right;
}

.snapshot-date-cell {
    font-weight: 500;
    white-space: nowrap;
}

.snapshot-date-cell > div {
    display: inline;
}

.snapshot-time {
    font-size: 11px;
    color: var(--gray-600);
    margin-left: 6px;
}

.positive-change {
    color: var(--success-600);
    font-weight: 500;
}

.negative-change {
    color: var(--danger-600);
    font-weight: 500;
}

.snapshot-actions-cell {
    text-align: center;
    white-space: nowrap;
}

.snapshot-actions-cell .btn-icon {
    padding: 4px 8px;
    margin: 0 2px;
    border: 1px solid var(--gray-300);
    background: white;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 12px;
}

.snapshot-actions-cell .btn-icon:hover {
    background: var(--gray-100);
}

.snapshot-actions-cell .btn-icon.btn-danger {
    color: var(--danger-600);
}

.snapshot-actions-cell .btn-icon.btn-danger:hover {
    background: var(--danger-600);
    color: white;
}

.snapshots-empty {
    text-align: center;
    padding: 60px 20px;
}

.snapshots-empty h4 {
    color: var(--gray-800);
    font-size: 18px;
    margin: 16px 0 8px 0;
}

/* View Toggle Tabs */
.snapshot-view-tabs {
    display: flex;
    gap: 10px;
    margin: 20px 0;
    border-bottom: 2px solid var(--gray-300);
}

.view-tab {
    padding: 10px 20px;
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    color: var(--gray-600);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: -2px;
}

.view-tab:hover {
    color: var(--gray-800);
}

.view-tab.active {
    color: var(--brand-600);
    border-bottom-color: var(--brand-600);
}

.view-tab i {
    font-size: 14px;
}

/* Graph Container */
.snapshot-graph-container {
    padding: 20px 0;
}

.graph-type-selector {
    margin-bottom: 20px;
    display: flex;
    justify-content: flex-end;
}

.graph-type-selector select {
    padding: 8px 12px;
    border: 1px solid var(--gray-300);
    border-radius: 6px;
    background: white;
    color: var(--gray-800);
    font-size: 13px;
    cursor: pointer;
}

.graph-type-selector select:focus {
    outline: none;
    border-color: var(--brand-600);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

#snapshotChart {
    max-width: 100%;
    height: 400px !important;
}

/* Success notification for snapshot */
.snapshot-success {
    position: fixed;
    top: 20px;
    right: 20px;
    background: var(--success-600);
    color: white;
    padding: 12px 20px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    animation: slideIn 0.3s ease-out;
    z-index: 10000;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Account Balance Slider Styling - No Label Variant */
.account-balance-slider {
    width: 100% !important; /* Fill the cell */
}

.account-balance-slider .slider-container {
    width: 100% !important; /* Fill the cell */
    gap: 8px !important; /* Small consistent gap */
}

/* HIDE the slider-label for account balance sliders - it's not needed in tables */
.account-balance-slider .slider-label {
    display: none !important; /* Remove the label completely */
    width: 0 !important;
    min-width: 0 !important;
    max-width: 0 !important;
}

.account-balance-slider .slider-control {
    flex-grow: 1 !important; /* Expand to fill available space */
    flex-shrink: 1 !important;
    min-width: 80px !important; /* Minimum slider width */
    max-width: none !important; /* REMOVE max-width constraint */
    margin: 0 !important; /* No margins, use gap instead */
    width: auto !important; /* Let it grow */

}

.account-balance-slider .slider-input input[type="text"] {
    font-size: .85rem !important;
    font-weight: 600 !important;
    font-family: Roboto, sans-serif !important;
    padding: 0.4rem 0.65rem !important;
    width: 115px !important;
    min-width: 115px !important;
    padding-left:10px;
}

.account-balance-slider .slider-input {
    min-width: 115px !important;
    width: 115px !important; /* Fixed width */
    flex-shrink: 0 !important; /* Input stays fixed width */
}

.account-balance-slider .spinner-buttons {
    height: 100% !important;
    flex-shrink: 0 !important; /* Spinners stay fixed */
    width: auto !important;
}

.account-balance-slider .spinner-button {
    font-size: 0.875rem !important;
}

/* Specific styling for Cash Accounts table columns */
/* Column widths now handled by unified rules above */
/* Removed specific widths to use consistent table layout */

/* Header widths now handled by unified rules above */
/* Removed to ensure consistent column widths across all tables */

/* Ensure balance cell sliders get full width */
#cashAccountsTableBody .balance-cell {
    padding-left:5px;
}

#cashAccountsTableBody .balance-cell > div {
    width: 100%;
}

#cashAccountsTableBody .account-balance-slider {
    width: 100% !important;
}

#cashAccountsTableBody .slider-container {
    width: 100% !important;
}

#cashAccountsTableBody .slider-control {
    flex: 1 !important;
    width: auto !important;
}

/* ===== ASSET TYPE SELECTION POPUP ===== */

.asset-type-popup {
    width: 800px;
    max-width: 95%;
}

.asset-type-subtitle {
    color: #6b7280;
    font-size: 0.95rem;
    margin-bottom: 20px;
    text-align: center;
}

.asset-type-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
    padding: 0 10px;
}

.asset-type-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 18px;
    background: #f8f9fa;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.asset-type-card:hover {
    background: #e8f4ff;
    border-color: var(--popup-icon-1);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(30, 106, 177, 0.15);
}

.asset-type-card:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(30, 106, 177, 0.1);
}

.asset-type-icon-circle {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--popup-icon-1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

.asset-type-icon-circle i {
    font-size: 20px;
    color: #ffffff;
}

/* Color variations using existing popup icon variables */
.asset-type-icon-circle.color-1 { background: var(--popup-icon-1); }
.asset-type-icon-circle.color-2 { background: var(--popup-icon-2); }
.asset-type-icon-circle.color-3 { background: var(--popup-icon-3); }
.asset-type-icon-circle.color-4 { background: var(--popup-icon-4); }
.asset-type-icon-circle.color-5 { background: var(--popup-icon-5); }
.asset-type-icon-circle.color-6 { background: var(--popup-icon-6); }
.asset-type-icon-circle.color-7 { background: var(--popup-icon-7); }
.asset-type-icon-circle.color-8 { background: var(--popup-icon-8); }

.asset-type-label {
    font-size: 0.95rem;
    font-weight: 500;
    color: #1a2740;
}

.main-popup-icon-circle.asset-type-icon {
    background: linear-gradient(135deg, var(--popup-icon-1), #3b82f6);
}

/* Responsive: single column on smaller screens */
@media (max-width: 500px) {
    .asset-type-grid {
        grid-template-columns: 1fr;
    }

    .asset-type-popup {
        width: 95%;
    }
}

/* Icon dropdown styles moved to utilities.css */