.kpi-link {
    color: inherit;
    display: block;
    text-decoration: none;
    transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}

.kpi-link:hover,
.kpi-link:focus-visible {
    border-color: #1261d6;
    box-shadow: 0 6px 18px rgba(18, 97, 214, .14);
    outline: none;
    transform: translateY(-1px);
}

.sepa-table-wrap {
    margin: 18px 0;
    overflow-x: auto;
}

.sepa-hash {
    font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
    font-size: .78rem;
    overflow-wrap: anywhere;
}

.amount-cell {
    font-variant-numeric: tabular-nums;
    text-align: right;
    white-space: nowrap;
}

.sepa-mandate-cell {
    text-align: right;
}

.sepa-mandate-cell .status,
.sepa-mandate-cell a {
    display: inline-block;
    text-align: right;
}

.sepa-mandate-cell a {
    margin-top: 4px;
}

button:disabled {
    cursor: not-allowed;
    opacity: .55;
}

.status.sepa-status-warning {
    background: #fff4e5;
    color: #934400;
}

.status.sepa-status-error {
    background: #fee4e2;
    color: #b42318;
}

.sepa-status-toolbar {
    margin-bottom: 6px;
}

.sepa-version-grid > div {
    line-height: 1.45;
    padding: 10px 0;
}

.sepa-return-cell {
    min-width: 250px;
}

.sepa-return-action > summary {
    color: #b42318;
    cursor: pointer;
    font-weight: 800;
}

.sepa-return-action form {
    margin-top: 10px;
    padding: 12px;
    border: 1px solid #fda29b;
    border-radius: 10px;
    background: #fff8f7;
}

.sepa-return-action label {
    font-size: .82rem;
}

.sepa-return-action textarea {
    min-height: 66px;
}

.sepa-return-details {
    max-width: 320px;
    line-height: 1.4;
}

.sepa-customer-mandate {
    border: 1px solid #c7d8f2;
    border-radius: 14px;
    margin: 18px 0;
    padding: 18px;
}

.sepa-customer-mandate[hidden] {
    display: none;
}

.sepa-customer-mandate fieldset {
    border: 0;
    margin: 0;
    padding: 0;
}

.sepa-customer-mandate select + .field-hint {
    margin-top: 10px;
    line-height: 1.45;
}

.invoice-head-field {
    padding-top: 0;
}

.sepa-collection-hint {
    margin-top: 10px;
    line-height: 1.45;
}

.sepa-oneoff-panel {
    margin-top: 6px;
    padding: 16px;
    border: 1px solid #c7d8f2;
    border-radius: 12px;
    background: #f8fbff;
}

.sepa-mandate-choice {
    max-width: 680px;
}

.sepa-oneoff-fields {
    border: 0;
    margin: 14px 0 0;
    padding: 0;
}

.sepa-oneoff-fields[hidden],
.sepa-oneoff-panel[hidden] {
    display: none;
}

.setup-accordion {
    margin-bottom: 18px;
}

.setup-section {
    margin: 0 0 12px;
    overflow: hidden;
    border: 1px solid #cbd9eb;
    border-radius: 12px;
    background: #fff;
}

.setup-section > summary {
    position: relative;
    padding: 16px 52px 16px 18px;
    cursor: pointer;
    color: #082b50;
    font-size: 1.2rem;
    font-weight: 800;
    list-style: none;
}

.setup-section > summary::-webkit-details-marker { display: none; }
.setup-section > summary::after {
    position: absolute;
    top: 50%;
    right: 20px;
    content: '+';
    transform: translateY(-50%);
    color: #1261d6;
    font-size: 1.55rem;
}
.setup-section[open] > summary::after { content: '−'; }
.setup-section[open] > summary { border-bottom: 1px solid #dbe5f1; }
.setup-section-content { padding: 18px; }
.setup-section-content > :first-child { margin-top: 0; }
.setup-section-content > :last-child { margin-bottom: 0; }

.setup-section-alert > summary {
    background: #fff4e6;
    color: #934400;
}

@media (max-width: 760px) {
    .invoice-head-field { padding-top: 0; }
}

@media (max-width: 760px) {
    .sepa-table-wrap table {
        min-width: 760px;
    }
}

/* Labels and controls share actual grid rows, including wrapped SEPA text. */
.invoice-head-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    grid-template-rows: auto auto auto auto;
    column-gap: 16px;
    row-gap: 8px;
}
.invoice-head-grid > .invoice-head-field,
.invoice-head-grid .sepa-date-control {
    display: grid;
    grid-template-rows: subgrid;
    grid-row: 2 / span 2;
    min-width: 0;
    padding: 0;
}
.invoice-head-grid > .invoice-head-field:nth-child(1) { grid-column: 1; }
.invoice-head-grid > .invoice-head-field:nth-child(2) { grid-column: 2; }
.invoice-head-grid .sepa-invoice-field { display: contents; }
.invoice-head-grid .sepa-method-options { grid-column: 3; grid-row: 1; }
.invoice-head-grid .sepa-date-control { grid-column: 3; }
.invoice-head-grid .sepa-collection-hint { grid-column: 3; grid-row: 4; margin: 4px 0 0; }
.invoice-head-grid .invoice-head-field label,
.invoice-head-grid .sepa-date-control label { margin: 0; align-self: end; }
.invoice-head-grid .invoice-head-field select,
.invoice-head-grid .sepa-date-control input { height: 54px; min-height: 54px; margin: 0; box-sizing: border-box; width: 100%; }
.individual-payment-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 16px; }
.individual-payment-grid > div { min-width: 0; }
@media (max-width: 760px) {
    .invoice-head-grid, .individual-payment-grid { grid-template-columns: 1fr; }
    .invoice-head-grid > .invoice-head-field,
    .invoice-head-grid .sepa-date-control { display: block; }
    .invoice-head-grid > .invoice-head-field:nth-child(1),
    .invoice-head-grid > .invoice-head-field:nth-child(2),
    .invoice-head-grid .sepa-method-options,
    .invoice-head-grid .sepa-date-control,
    .invoice-head-grid .sepa-collection-hint { grid-column: 1; grid-row: auto; }
}
