.entry-cost-center-modal .modal-dialog {
    max-width: min(1180px, 92vw);
}

.entry-cost-center-modal .modal-body {
    max-height: calc(100vh - 230px);
    overflow: auto;
}

.entry-cost-center-details-card {
    border-color: #e8e6ef;
}

.entry-cost-center-details-card .form-label {
    color: #6f6a7d;
    margin-bottom: 0.15rem;
}

.entry-cost-center-details-card .form-control-plaintext {
    color: #4e4a61;
    min-height: 1.8rem;
    overflow: hidden;
    padding-top: 0;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.entry-cost-center-table-card {
    border-color: #e8e6ef;
    overflow: hidden;
}

.entry-cost-center-table-card .card-header {
    padding: 0.85rem 1rem;
}

.entry-cost-center-table-card .card-body {
    padding: 0;
}

.entry-cost-center-table {
    table-layout: fixed;
}

.entry-cost-center-table thead th {
    background-color: #f4f3f8;
    color: #555268;
    font-weight: 700;
    border-bottom: 1px solid #dddce6;
    vertical-align: middle;
}

.entry-cost-center-table tbody td,
.entry-cost-center-table tbody th {
    vertical-align: middle;
    padding-top: 0.75rem;
    padding-bottom: 0.75rem;
}

.entry-cost-center-table.table-striped > tbody > tr:nth-of-type(odd) > * {
    --bs-table-accent-bg: #fbfbfd;
}

.entry-cost-center-account {
    color: #565269;
    line-height: 1.6;
    overflow: hidden;
    text-overflow: ellipsis;
}

.entry-cost-center-amount {
    color: #645f77;
    font-weight: 700;
    white-space: nowrap;
}

.cost-center-cell {
    min-width: 430px;
}

.cost-center-allocation-panel {
    background: transparent;
    padding: 0;
}

.cost-center-toolbar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 0;
}

.cost-center-allocation-panel.has-allocations .cost-center-toolbar {
    margin-bottom: 0.55rem;
}

.cost-center-mode-control {
    width: 130px;
    min-width: 130px;
}

.cost-center-add-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 112px;
}

.cost-center-total-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    min-height: 34px;
    border-radius: 6px;
    border: 1px solid #e0e0e8;
    background-color: #f7f7fb;
    color: #6b6678;
    padding: 0.35rem 0.65rem;
    font-size: 0.82rem;
    font-weight: 700;
    white-space: nowrap;
}

.cost-center-total-pill.is-balanced {
    border-color: #b8efd0;
    background-color: #edfbf3;
    color: #239a57;
}

.cost-center-total-pill.is-unbalanced {
    border-color: #ffd8a8;
    background-color: #fff7ed;
    color: #d98200;
}

.cost-center-allocation-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.cost-center-allocation-row {
    display: grid;
    grid-template-columns: minmax(180px, 1fr) minmax(120px, 150px) minmax(105px, auto) 38px;
    align-items: start;
    gap: 0.5rem;
    border: 1px solid #eceaf4;
    border-radius: 6px;
    background-color: #fff;
    padding: 0.45rem;
}

.cost-center-allocation-row.is-amount-mode {
    grid-template-columns: minmax(210px, 1fr) minmax(120px, 160px) 38px;
}

.cost-center-value-preview {
    min-height: 31px;
    border-radius: 6px;
    background-color: #f7f6fb;
    color: #5d5870;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    padding: 0.25rem 0.55rem;
    font-weight: 700;
    white-space: nowrap;
}

.cost-center-field {
    min-width: 0;
}

.cost-center-field > .form-control,
.cost-center-field > .form-select,
.cost-center-field .input-group {
    width: 100%;
}

.cost-center-field .input-group {
    flex-wrap: nowrap;
}

.cost-center-field .input-group .form-control {
    width: 1%;
    min-width: 0;
}

.cost-center-field .input-group .input-group-text {
    flex: 0 0 auto;
}

.cost-center-field .invalid-feedback {
    margin-top: 0.25rem;
    font-size: 0.76rem;
    line-height: 1.35;
    text-align: start;
    padding-inline-start: 0.25rem;
}

.cost-center-row-error {
    color: #dc3545;
    font-size: 0.78rem;
    margin-top: 0.35rem;
}

.cost-center-remove-btn {
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

@media (max-width: 991.98px) {
    .cost-center-cell {
        min-width: 520px;
    }

    .cost-center-allocation-row,
    .cost-center-allocation-row.is-amount-mode {
        grid-template-columns: 1fr;
    }

    .cost-center-remove-btn {
        width: 100%;
    }
}
