/* Kontenmanager - Sidebar (subaccounts, sums, toggles) */

body .subaccount-balances-table .ui-datatable-data > tr > td {
    padding: 4px 6px;
    line-height: 1.2;
    height: 32px;
    vertical-align: middle;
    border-color: #d6d6d6;
}

body .subaccount-balances-table {
    width: 100%;
    margin-top: 25px;
}

body .subaccount-empty-note {
    font-weight: bold;
    color: red;
    font-size: 1.4em;
}

body .subaccount-balances-header {
    vertical-align: middle;
}

body .subaccount-balances-title {
    vertical-align: middle;
}

body .subaccount-balances-help {
    margin-left: 5px;
    cursor: help;
    vertical-align: middle;
}

body .subaccount-balances-overlay {
    text-align: left;
    font-weight: normal;
}

body .subaccount-tooltip-label {
    font-weight: bold;
}

body .subaccount-tooltip-empty {
    font-style: italic;
}

body .subaccount-balances-table .ui-datatable-header {
    background: #2f2f2f !important;
    color: #f4f4f4 !important;
    border: 1px solid #444444 !important;
    border-bottom: none !important;
    padding: 8px 10px !important;
    font-size: 1.1em;
}

body .subaccount-balances-table .ui-datatable-tablewrapper {
    border: 1px solid #cfcfcf;
    border-top: none;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}

body .subaccount-balances-table .ui-datatable-tablewrapper table {
    width: 100%;
}

body .subaccount-balances-table .ui-datatable-data > tr:nth-child(odd) {
    background: #ffffff;
}

body .subaccount-balances-table .ui-datatable-data > tr:nth-child(even) {
    background: #f7f7f7;
}

body .subaccount-balances-table .ui-datatable-data > tr.ui-state-highlight,
body .subaccount-balances-table .ui-datatable-data > tr.ui-state-hover,
body .subaccount-balances-table .ui-datatable-data > tr.ui-state-active {
    background: inherit !important;
    box-shadow: none !important;
}

@keyframes sidebarFlashPositive {
    0% { background-color: #4bd84b; }
    75% { background-color: #9fe89f; }
    100% { background-color: transparent; }
}

@keyframes sidebarFlashNegative {
    0% { background-color: #f04c4c; }
    75% { background-color: #f5a2a2; }
    100% { background-color: transparent; }
}

body .subaccount-balances-table .sidebar-flash-positive > td {
    animation: sidebarFlashPositive 3s ease-out;
}

body .subaccount-balances-table .sidebar-flash-negative > td {
    animation: sidebarFlashNegative 3s ease-out;
}

body .subaccount-balances-table .ui-datatable-data > tr > td.ui-state-hover,
body .subaccount-balances-table .ui-datatable-data > tr > td.ui-state-active {
    background: inherit !important;
}

body .subaccount-balances-table .ui-datatable-data > tr > td:focus,
body .subaccount-balances-table .ui-datatable-data > tr > td:focus-visible {
    outline: none !important;
}

body .subaccount-balances-table .ui-datatable-data > tr > td:first-child {
    width: auto;
}

body .subaccount-balances-table .ui-datatable-data > tr > td:last-child {
    width: 1%;
    white-space: nowrap;
    text-align: right !important;
}

body .subaccount-balances-table .subaccount-name {
    font-weight: 600;
    display: block;
    width: 100%;
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    vertical-align: middle;
}

body .subaccount-name-row {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
    min-height: 26px;
}

body .savings-donut-trigger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    gap: 4px;
    cursor: pointer;
}

body .savings-mini-stack {
    position: relative;
    width: 26px;
    height: 26px;
}

body .savings-donut-mini-ring {
    --ring-thickness: 3px;
}

body .savings-donut-reached-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    color: #c98900;
    font-size: 1.4em;
}

body .savings-donut {
    --progress: 0%;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: conic-gradient(var(--ring-color, #2f80ed) var(--progress), #e1e1e1 0);
    position: relative;
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.08);
}

body .savings-donut::after {
    content: "";
    position: absolute;
    inset: 4px;
    background: #ffffff;
    border-radius: 50%;
}

body .savings-donut.is-reached {
    background: conic-gradient(#1b6e1b 100%, #e1e1e1 0);
}

body .savings-donut-celebrate {
    color: #c98900;
    font-size: 0.9em;
}

body .savings-goals-overlay {
    text-align: left;
    width: 340px;
    max-width: 340px;
}

body .savings-goals-overlay {
    background: #f6f6f6 !important;
    color: #2f2f2f !important;
    border: 1px solid #cfcfcf !important;
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.18) !important;
}

body .savings-goals-overlay.ui-overlaypanel {
    background: #f6f6f6 !important;
    color: #2f2f2f !important;
    border: 1px solid #cfcfcf !important;
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.18) !important;
}

body .savings-goals-overlay.ui-overlaypanel .ui-overlaypanel-content {
    padding: 10px 12px;
    max-height: 580px;
    overflow-y: auto;
    overflow-x: hidden;
    box-sizing: border-box;
    white-space: normal;
}

body .savings-goals-header {
    font-weight: 700;
    margin-bottom: 8px;
    padding: 12px 0 4px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

body .savings-reached-hero {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin: 6px 0 10px;
    color: #1b6e1b;
    font-weight: 700;
}

body .savings-reached-hero i {
    font-size: 2.2em;
    color: #c98900;
}

body .savings-donut-stack {
    position: relative;
    width: 80px;
    height: 80px;
    margin: 4px auto 12px;
}

body .savings-goals-hint {
    display: block;
    margin: 2px 0 8px;
    font-size: 0.84em;
    color: #5f5f5f;
}

body .savings-donut-ring {
    --ring-size: 60px;
    --ring-color: #2f80ed;
    --ring-thickness: 7px;
    position: absolute;
    top: 50%;
    left: 50%;
    width: var(--ring-size);
    height: var(--ring-size);
    margin-left: calc(var(--ring-size) / -2);
    margin-top: calc(var(--ring-size) / -2);
    border-radius: 50%;
    background: conic-gradient(var(--ring-color) var(--progress), #e1e1e1 0);
    -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - var(--ring-thickness)), #000 calc(100% - var(--ring-thickness)));
    mask: radial-gradient(farthest-side, transparent calc(100% - var(--ring-thickness)), #000 calc(100% - var(--ring-thickness)));
}

body .savings-donut-ring.is-reached {
    --ring-color: #1b6e1b;
}

body .savings-tone-1 { --ring-color: #2f80ed; }
body .savings-tone-2 { --ring-color: #ff8a00; }
body .savings-tone-3 { --ring-color: #1b6e1b; }
body .savings-tone-4 { --ring-color: #2f2f2f; }
body .savings-tone-5 { --ring-color: #b00020; }

body .savings-goal-card {
    background: #ffffff;
    border: 1px solid #e1e1e1;
    border-left: 4px solid var(--ring-color, #d6d6d6);
    border-radius: 6px;
    padding: 8px 10px 8px 8px;
    margin-top: 6px;
    max-width: 100%;
    display: flex;
    flex-direction: column;
    gap: 4px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

body .savings-goal-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
    flex-wrap: wrap;
}

body .savings-goal-card:first-child {
    margin-top: 0;
}

body .savings-goal-title {
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 700;
    margin-bottom: 4px;
    flex: 1 1 180px;
    min-width: 0;
}

body .savings-reached-note {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 0 0 6px;
    font-size: 0.85em;
    color: #1b6e1b;
    font-weight: 700;
}

body .savings-reached-note i {
    color: #c98900;
}

body .savings-goal-note {
    display: block;
    margin: 0 0 6px;
    font-size: 0.82em;
    color: #6a6a6a;
}

body .savings-goal-prefix {
    font-weight: 700;
    color: #4a4a4a;
}

body .savings-goal-name {
    font-weight: 700;
    color: #2f2f2f;
}

body .savings-goal-name-single {
    font-size: 0.92em;
    font-weight: 600;
}

body .savings-goal-badges {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    flex: 1 1 auto;
}

body .savings-badge-chip {
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    gap: 6px;
    flex: 0 0 auto;
    min-width: 120px;
    border-radius: 999px;
    padding: 2px 6px;
    background: #f5f5f5;
}

body .savings-badge-label {
    font-size: 0.78em;
    font-weight: 600;
    color: #5a5a5a;
    min-width: 78px;
}

body .savings-badge-muted {
    font-size: 0.78em;
    font-weight: 600;
    color: #8a8a8a;
}

body .savings-goal-grid {
    font-size: 0.92em;
}

body .savings-goal-grid .savings-goal-grid-label {
    width: 90px;
    white-space: nowrap;
}

body .savings-goal-grid .savings-goal-grid-value {
    white-space: normal;
    overflow-wrap: anywhere;
}

body .savings-goal-label {
    font-weight: 600;
    color: #444444;
}

body .savings-goal-status-group {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    font-size: 0.9em;
}

body .savings-goal-status-group h\\:outputText,
body .savings-goal-status-group h:panelGroup h\\:outputText {
    white-space: nowrap;
}

body .savings-goal-hint {
    color: #b00020;
    font-size: 0.9em;
    margin-top: 3px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

body .savings-milestone {
    background: #f6f1d2;
    color: #6b5600;
    border-radius: 999px;
    padding: 1px 6px;
    font-size: 0.75em;
    font-weight: 700;
}

body .savings-progress-pill {
    background: #e9eef4;
    color: #2f2f2f;
    border-radius: 999px;
    padding: 1px 6px;
    font-size: 0.75em;
    font-weight: 700;
}

body .savings-history {
    margin-top: 10px;
    border-top: 1px dashed #cfcfcf;
    padding-top: 8px;
}

body .savings-history-title {
    font-weight: 700;
    margin-bottom: 6px;
    display: block;
    color: #4a4a4a;
}

body .savings-history-row {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    font-size: 0.9em;
    line-height: 1.4;
}

body .savings-history-row + .savings-history-row {
    margin-top: 3px;
}

body .savings-history-date {
    color: #6d6d6d;
}

body .savings-history-amount {
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    color: #4a4a4a;
}

body .subaccount-balances-table .subaccount-balance-amount {
    display: inline-block;
    min-width: 110px;
    padding: 1px 6px;
    border-radius: 10px;
    text-align: right;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

body .subaccount-balances-table .balance-positive {
    color: #1b6e1b;
    background: #e6f5e6;
}

body .subaccount-balances-table .balance-negative {
    color: #b00020;
    background: #fdeaea;
}

body .subaccount-balances-table .balance-zero {
    color: #555555;
    background: #efefef;
}

body .subaccount-zero-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

body .subaccount-zero-label {
    font-size: 0.95em;
    color: #444444;
    font-weight: 600;
}

body .subaccount-zero-toggle .ui-toggleswitch {
    margin-left: auto;
}

body .subaccount-zero-toggle-below {
    margin-top: 8px;
    padding: 6px 8px;
    background: #f1f1f1;
    border: 1px solid #d2d2d2;
    border-radius: 6px;
}

body .subaccount-balances-table .ui-datatable-footer {
    padding: 0 !important;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
}

body .subaccount-balances-table .booking-sum-bar,
body .subaccount-balances-table .ui-datatable-footer .booking-sum-bar {
    font-size: 1.02em;
    padding: 6px 10px;
    background: #2f2f2f !important;
    color: #ffffff !important;
    border: 1px solid #444444;
    width: 100%;
    box-sizing: border-box;
    text-align: left;
}

body .subaccount-balances-table .booking-sum-bar-bottom {
    border-top: 0;
}

body .subaccount-balances-table .booking-sum-bar .sum-line {
    display: block;
    line-height: 1.3;
}

body .subaccount-balances-table .booking-sum-bar .sum-line + .sum-line {
    margin-top: 6px;
}

body .subaccount-sum-card {
    margin-top: 10px;
    padding: 10px 12px;
    background: #f6f6f6;
    border: 1px solid #d2d2d2;
    border-radius: 6px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}

body .subaccount-sum-line {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
    font-size: 1.03em;
    line-height: 1.3;
}

body .subaccount-sum-line + .subaccount-sum-line {
    margin-top: 6px;
}

body .subaccount-sum-label {
    color: #444444;
    font-weight: 700;
}

body .subaccount-sum-value {
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

body .subaccount-sum-negative .subaccount-sum-value {
    color: #b00020;
}

body .standingorder-selected-sum-card {
    display: inline-block;
    width: auto;
}

body .standingorder-selected-sum-line {
    justify-content: flex-start;
    gap: 8px;
}
