#accountsTableContainer {
    max-height: 500px;
    overflow-y: auto;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}


#accountsTableContainer table {
border-collapse: separate;
border-spacing: 0;
width: 100%;
background: #fff;
margin-left: auto;
margin-right: auto;
}

#accountsTableContainer th {
    background: #f8f9fa;
    font-weight: bold;
    border-bottom: 2px solid #e9ecef;
}

#accountsTableContainer td,
#accountsTableContainer th {
    border: none !important;
    padding: 0.4rem 0.75rem;
}

/* Right-justify the Total column (header + amounts) */
#accountsTableContainer th:nth-child(2),
#accountsTableContainer td:nth-child(2) {
    text-align: right;
}

#accountsTableContainer tr {
    background: #fff;
}

#accountsTableContainer tr:hover {
    background: #f1f3f4;
}

.accounts-nav-row {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
}

.accounts-month-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.25rem;
}

.accounts-chart-btn {
    position: absolute;
    right: 0;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: none;
    background: #fff;
    box-shadow: 0 6px 16px rgba(15, 23, 42, 0.12);
    display: flex;
    justify-content: center;
    align-items: center;
    color: #0f172a;
    font-size: 1.1rem;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.accounts-chart-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 20px rgba(15, 23, 42, 0.15);
}

.accounts-chart-btn:focus-visible {
    outline: 2px solid #0f172a;
    outline-offset: 2px;
}

.accounts-summary {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1.5rem 2.5rem;
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
    padding: 0.75rem 1rem;
    color: #0f172a;
}

.accounts-summary-item {
    font-size: 0.95rem;
    color: #475569;
}

.accounts-summary-item strong {
    margin-left: 0.4rem;
    color: #0f172a;
    font-weight: 700;
}

.accounts-summary-profit strong {
    color: #00a651;
}

.accounts-summary-profit strong.accounts-profit-negative {
    color: #c00;
}

.accounts-month-label {
    font-size: 1.5rem;
    font-weight: 700;
    color: #0f172a;
    min-width: 200px;
    text-align: center;
}

.accounts-month-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: #fff;
    box-shadow: 0 6px 16px rgba(15, 23, 42, 0.12);
    display: flex;
    justify-content: center;
    align-items: center;
    color: #0f172a;
    font-size: 1.35rem;
    line-height: 1;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.accounts-month-btn:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 10px 20px rgba(15, 23, 42, 0.15);
}

.accounts-month-btn:focus-visible {
    outline: 2px solid #0f172a;
    outline-offset: 2px;
}

.accounts-month-btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
    box-shadow: none;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

.accounts-account-unallocated {
    color: #c00;
    font-weight: 700;
}

/* Category divider line with a small label above each group */
#accountsTableContainer tr.accounts-category-row {
    background: #fff;
}

#accountsTableContainer tr.accounts-category-row:hover {
    background: #fff;
}

#accountsTableContainer td.accounts-category-label {
    border-top: 1px solid #cbd5e1 !important;
    padding-top: 0.5rem;
    padding-bottom: 0.1rem;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
    color: #94a3b8;
}

/* Account chart month-range slider: visible track + thumb across browsers */
.accounts-months-range {
    -webkit-appearance: none;
    appearance: none;
    height: 20px;
    background: transparent;
    cursor: pointer;
}

.accounts-months-range::-webkit-slider-runnable-track {
    height: 6px;
    border-radius: 3px;
    background: #cbd5e1;
}

.accounts-months-range::-moz-range-track {
    height: 6px;
    border-radius: 3px;
    background: #cbd5e1;
}

.accounts-months-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    margin-top: -6px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #00a651;
    border: 2px solid #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.accounts-months-range::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #00a651;
    border: 2px solid #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.accounts-months-range:focus-visible {
    outline: 2px solid #0f172a;
    outline-offset: 4px;
}

/* Payments modal: keep Date column readable */
#paymentsModal table {
    table-layout: fixed;
    width: 100%;
}

#paymentsModal th:nth-child(1),
#paymentsModal td:nth-child(1) {
    width: 120px;
    white-space: nowrap;
}

#paymentsModal th:nth-child(2),
#paymentsModal td:nth-child(2),
#paymentsModal th:nth-child(3),
#paymentsModal td:nth-child(3) {
    overflow-wrap: anywhere;
}
