/* v0.20.2 – Kundendaten, Vorgangsliste und kompakte Statusauswahl */

/* Die Kundenliste wird einmal aus allen Kundennamen bemessen und springt beim Scrollen nicht. */
#page-customers .split{grid-template-columns:var(--v20-customer-list-width,320px) minmax(0,1fr);align-items:start}
#page-customers #customerList{min-width:0}
#page-customers #customerDetail{min-width:0}

.v20-object-search-tools{grid-template-columns:minmax(260px,1fr) auto auto!important;padding:12px!important;background:#fff7f0!important;border:1px solid #efb88f!important;box-shadow:0 4px 15px rgba(161,78,20,.07)}
.v20-object-search-label{grid-column:1/-1;color:#713711;font-size:12px;font-weight:850;letter-spacing:.01em}
.v20-object-search-tools input{min-width:0}

.v20-tenant-list-toggle{display:flex;align-items:center;gap:10px;flex-wrap:wrap;margin-top:9px;padding:8px 10px;border:1px solid #e0e4e8;border-radius:10px;background:#f8fafb}
.v20-tenant-list-toggle button{font-weight:800}
.v20-tenant-list-toggle span{color:var(--color-text-muted);font-size:11px}
.v20-tenant-table-wrap:not(.open){display:none!important}
.v20-tenant-table-wrap.open{display:block}

.v20-customer-discount-kv strong{color:#276948}
.v20-skonto-kv strong{color:#3f4f61}
.v20-customer-terms-editor{padding:13px;border:1px solid #dfe4e8;border-radius:12px;background:#f8fafb}
.v20-terms-heading{margin-bottom:10px}
.v20-terms-heading strong,.v20-terms-heading small{display:block}
.v20-terms-heading strong{font-size:14px}
.v20-terms-heading small{margin-top:3px;color:var(--color-text-muted);font-size:11px;line-height:1.4}
.v20-terms-grid{display:grid;grid-template-columns:minmax(190px,.8fr) minmax(210px,1fr) minmax(150px,.7fr);gap:10px;align-items:end}
.v20-terms-grid>.checkline{min-height:42px;margin:0;padding:8px 10px;border:1px solid #e0e4e8;border-radius:9px;background:#fff;font-weight:800}
.v20-terms-grid input:disabled,.v20-terms-grid select:disabled{background:#eef1f3!important;color:#8a9199;cursor:not-allowed}

/* Vorgangsspalten: feste Inhaltsfelder bleiben kompakt, Kurzbeschreibung nutzt den Rest. */
.v20-case-table{width:100%;min-width:1390px;table-layout:fixed}
.v20-case-table col.v20-col-tenant{width:105px}
.v20-case-table col.v20-col-address{width:155px}
.v20-case-table col.v20-col-phone{width:105px}
.v20-case-table col.v20-col-description{width:auto}
.v20-case-table col.v20-col-customer{width:130px}
.v20-case-table col.v20-col-appointment{width:145px}
.v20-case-table col.v20-col-last{width:140px}
.v20-case-table col.v20-col-employee{width:100px}
.v20-case-table col.v20-col-status{width:175px}
.v20-case-table col.v20-col-time{width:75px}
.v20-case-table th,.v20-case-table td{white-space:normal;overflow-wrap:anywhere}
.v20-case-table .v20-case-short{max-width:none!important;min-width:250px;line-height:1.35;font-size:12px}
.v20-case-table .v20-case-appointment small{display:block;margin-top:4px;color:var(--color-text-muted);font-size:10px;line-height:1.3}
.v20-case-date-time{display:flex;align-items:baseline;gap:5px;white-space:nowrap}
.v20-case-date-time strong{font-size:11px;font-weight:850}
.v20-case-date-time i{color:#7a838d;font-style:normal;font-weight:700}

/* Eigene Statusauswahl statt der uneinheitlichen nativen Windows-Liste. */
.v20-status-select,.v20-inline-status{width:100%;min-height:40px;border:2px solid var(--v20-status)!important;border-radius:10px!important;font-family:var(--font-app)!important;cursor:pointer}
.v20-status-select{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:7px 10px;background:#fff!important;color:#171b20!important;font-size:12px;font-weight:800!important}
.v20-status-filter-value{display:flex;align-items:center;gap:8px;min-width:0;text-align:left}
.v20-status-filter-value i,.v20-status-choice-chip i{width:9px;height:9px;flex:0 0 9px;border-radius:999px;background:var(--v20-status);box-shadow:0 0 0 2px color-mix(in srgb,var(--v20-status) 22%,white)}
.v20-status-select>b,.v20-inline-status>b{font-size:13px;line-height:1}
.v20-inline-status{display:flex;align-items:center;justify-content:space-between;gap:7px;max-width:none!important;padding:6px 8px!important;background:var(--v20-status)!important;color:#fff!important;font-size:10px!important;font-weight:850!important;line-height:1.2;text-align:left;opacity:1!important}
.v20-inline-status>span{min-width:0;overflow-wrap:anywhere}

.v20-status-popover{position:fixed;z-index:1200;max-height:min(430px,72vh);overflow-y:auto;padding:6px;border:1px solid #d8dde3;border-radius:14px;background:#fff;box-shadow:0 18px 48px rgba(26,31,37,.24);font-family:var(--font-app);color:#171b20}
.v20-status-popover[hidden]{display:none!important}
.v20-status-popover-head{padding:7px 9px 8px;color:#66707b;font-size:10px;font-weight:850;text-transform:uppercase;letter-spacing:.055em}
.v20-status-choice{width:100%;min-height:34px;display:flex;align-items:center;justify-content:space-between;gap:8px;margin:1px 0;padding:4px 7px;border:0;border-radius:9px;background:#fff;color:#171b20;font-family:var(--font-app);font-size:11px;font-weight:750;text-align:left;cursor:pointer}
.v20-status-choice:hover,.v20-status-choice.selected{background:#f1f3f5}
.v20-status-choice.selected{box-shadow:inset 3px 0 var(--brand-primary)}
.v20-status-choice-chip{display:inline-flex;align-items:center;gap:8px;min-width:0;padding:5px 8px;border:1px solid color-mix(in srgb,var(--v20-status) 45%,#d7dce1);border-radius:999px;background:color-mix(in srgb,var(--v20-status) 12%,white);color:#171b20;line-height:1.2}
.v20-status-choice>b{color:#252b31;font-size:12px}

.v20-document-terms{margin:10px 0;padding:10px;border:1px solid #dfe4e8;border-radius:10px;background:#fff}
.v20-document-terms-head{margin-bottom:8px}
.v20-document-terms-head strong,.v20-document-terms-head small{display:block}
.v20-document-terms-head small{margin-top:2px;color:var(--color-text-muted);font-size:10px;line-height:1.35}
.v20-document-term-row{display:grid;grid-template-columns:minmax(125px,.8fr) minmax(130px,1fr) minmax(100px,.7fr) minmax(125px,.8fr);gap:7px;align-items:center;margin-top:6px}
.v20-document-term-row>.checkline{margin:0;font-size:11px;font-weight:800}
.v20-document-term-row select,.v20-document-term-row input{width:100%;min-width:0;border:1px solid #d9dee3;border-radius:7px;padding:7px;background:#fff;font:inherit}
.v20-document-term-row>strong{font-size:11px;text-align:right}
.v20-term-number{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:5px;font-size:10px;color:var(--color-text-muted)}
.v20-summary-discount strong{color:#266849}
.v20-summary-skonto{display:block!important;margin-top:8px;padding:8px 9px!important;border:1px solid #d8e5dc;border-radius:8px;background:#f3faf5}
.v20-summary-skonto span,.v20-summary-skonto strong{display:block}
.v20-summary-skonto strong{margin-top:3px;text-align:right}

@media(max-width:1100px){#page-customers .split{grid-template-columns:1fr}.v20-terms-grid{grid-template-columns:1fr 1fr}.v20-terms-grid>.checkline{grid-column:1/-1}}
@media(max-width:800px){.v20-object-search-tools{grid-template-columns:1fr!important}.v20-object-search-label{grid-column:auto}.v20-terms-grid,.v20-document-term-row{grid-template-columns:1fr}.v20-terms-grid>.checkline{grid-column:auto}.v20-document-term-row>strong{text-align:left}}
