/* DentaPlan 2.3 desktop lists (VORAAA-90; flag layout_v23, ADR 0004): Übersicht lanes/table + preview,
 * HKP-Liste and Patienten tables, Patientenseite and Einstellungen columns. lists23.js renders the board
 * and the tables only with <html class="l23"> and a window ≥ 600 px; the Patientenseite and Einstellungen
 * get their wrapper classes only with l23. Every rule here is scoped to html.l23, so with the flag off and
 * on the phone (< 600) nothing changes. Tier columns: .c-lap ≥ 1024, .c-lap2 ≥ 1280, .c-desk ≥ 1440. No inline styles. */

/* ---------- shared: table, stage chips, preview pane ---------- */
html.l23 .tbl-wrap23 { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: auto; }
html.l23 .tbl23 { width: 100%; border-collapse: separate; border-spacing: 0; font-size: var(--fs-sm); }
html.l23 .tbl23 th { position: sticky; top: 0; z-index: 1; background: var(--sunk); color: var(--ink-3); font-size: var(--fs-xs); font-weight: var(--fw-semi); text-transform: uppercase; letter-spacing: var(--tracking-caps); text-align: left; padding: 0 var(--row-pad); height: 40px; white-space: nowrap; border-bottom: 1px solid var(--line); }
html.l23 .tbl23 th.r { text-align: right; }
html.l23 .th-sort { display: inline-flex; align-items: center; gap: 4px; min-height: 32px; padding: 0; border: 0; background: transparent; color: inherit; font: inherit; text-transform: inherit; letter-spacing: inherit; cursor: pointer; }
html.l23 .th-sort:hover, html.l23 .th-sort.on { color: var(--ink); }
html.l23 .th-sort .sort-i { width: 13px; height: 13px; opacity: .45; }
html.l23 .th-sort.on .sort-i { opacity: 1; color: var(--accent-text); }
html.l23 .tbl23 td { padding: var(--row-pad); border-bottom: 1px solid var(--row-line); vertical-align: middle; }
html.l23 .tbl23 tbody tr:last-child td { border-bottom: 0; }
html.l23 .tbl23 td b { font-weight: var(--fw-semi); }
html.l23 .tbl23 td small { display: block; color: var(--ink-3); font-size: var(--fs-xs); }
html.l23 .tbl23 td a { color: var(--ink); text-decoration: none; }
html.l23 .tbl23 td a:hover { text-decoration: underline; }
html.l23 .tbl23 td a:focus-visible { outline: 0; box-shadow: var(--focus); border-radius: var(--r-xs); }
html.l23 .tbl23 tbody tr { cursor: pointer; }
html.l23 .tbl23 tbody tr:hover td { background: var(--sunk); }
html.l23 .tbl23 tbody tr.sel td { background: var(--accent-50); }
html.l23 .tbl23 tbody tr.sel td:first-child { box-shadow: inset 3px 0 0 var(--accent); }
html.l23 .tbl23 tbody tr.krow-on { box-shadow: none; }
html.l23 .tbl23 tbody tr.krow-on td { background: var(--accent-50); }
html.l23 .tbl23 tbody tr.is-storno { opacity: .72; }
html.l23 .tbl23 .r { text-align: right; }
/* names and Kasse wrap on every tier (VORAAA-94 D2: realistic names made the 1440/1920 tables scroll sideways) */
html.l23 .tbl23 .num { font-variant-numeric: tabular-nums; white-space: nowrap; }
html.l23 .tbl23 .mono { font-family: var(--font-mono); font-size: 12.5px; white-space: nowrap; }
html.l23 .tbl23 td .tiny.mono { white-space: normal; } /* tooth lists in Versorgung wrap */
html.l23 .tbl23 td:last-child .btn-icon { margin: -6px 0; }
html.l23 .tbl23 .chip { padding: 2px 9px; }
html.l23 .tbl23 .c-lap, html.l23 .tbl23 .c-lap2, html.l23 .tbl23 .c-desk, html.l23 .tbl23 .c-wide { display: none; }
html.l23 .tbl-wrap23 { container-type: inline-size; }
@container (min-width: 1560px) {
  html.l23 .tbl23 .c-wide { display: table-cell; }
  html.l23 .tbl23 .c-nowide { display: none; }
}
html.l23 .warn-t { color: var(--warn-ink); }
html.l23 .err-t { color: var(--error-ink); font-weight: var(--fw-semi); }
html.l23 .pager23 { display: flex; justify-content: space-between; gap: var(--sp-3); padding: var(--sp-2) var(--sp-1); font-size: var(--fs-xs); color: var(--ink-3); }
html.l23 .pill-n { font-variant-numeric: tabular-nums; opacity: .7; margin-left: 2px; }
html.l23 .tb23 .search kbd.k { margin-left: auto; }

html.l23 .stg23 { display: inline-flex; align-items: center; padding: 2px 9px; border-radius: var(--r-pill); font-size: var(--fs-xs); font-weight: var(--fw-semi); white-space: nowrap; background: var(--neutral-50); color: var(--ink-2); }
html.l23 .stg-planen { background: var(--blue-50); color: var(--info-ink); }
html.l23 .stg-beraten { background: var(--violet-50); color: var(--violet); }
html.l23 .stg-hkp { background: var(--amber-50); color: var(--warn-ink); }
html.l23 .stg-unterschrift { background: var(--accent-50); color: var(--accent-text); }
html.l23 .stg-genehmigt { background: var(--green-50); color: var(--ok-ink); }

html.l23 .split23 { display: grid; gap: var(--gap-ws); align-items: start; }
html.l23 .split23-main { min-width: 0; }
html.l23 .pane23 { display: none; }
html.l23 .pane23-h { display: flex; justify-content: space-between; gap: var(--sp-3); align-items: flex-start; padding: var(--sp-4) var(--sp-4) var(--sp-3); border-bottom: 1px solid var(--line); }
html.l23 .pane23-h h2 { margin: 4px 0 2px; }
html.l23 .pane23-h h2:focus { outline: 0; }
html.l23 .pane23-b { padding: var(--sp-4); overflow: auto; display: grid; gap: var(--sp-3); align-content: start; }
html.l23 .pane23-b h3 { margin: 0; font-size: var(--fs-sm); }
html.l23 .pane23-b p { margin: 0; }
html.l23 .pane23-f { display: flex; justify-content: flex-end; gap: var(--sp-2); padding: var(--sp-3) var(--sp-4); border-top: 1px solid var(--line); }
html.l23 .sums23 { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 6px var(--sp-3); margin: 0; font-size: var(--fs-sm); }
html.l23 .sums23 dt { color: var(--ink-3); }
html.l23 .sums23 dd { margin: 0; text-align: right; overflow-wrap: anywhere; }
html.l23 .sums23 .me { font-weight: var(--fw-bold); color: var(--ink); padding-top: 6px; border-top: 1px solid var(--line); }
html.l23 .mini-tl23 { list-style: none; margin: 0; padding: 0 0 0 14px; border-left: 2px solid var(--line); display: grid; gap: var(--sp-2); font-size: var(--fs-sm); color: var(--ink-2); }
html.l23 .mini-tl23 b { color: var(--ink); margin-right: 6px; font-variant-numeric: tabular-nums; }
html.l23 .pv23-chart { overflow-x: auto; }
/* the preview as a side panel (space bar, below 1920): the panel brings its own padding */
html.l23 .spanel.pv23 .spanel-in { padding: 0; }
html.l23 .spanel.pv23 .pane23-f { position: sticky; bottom: 0; background: var(--raised); }

/* ---------- Übersicht ---------- */
html.l23 .view23 button { display: inline-flex; align-items: center; gap: 6px; }
html.l23 .view23 .ico { width: 16px; height: 16px; }
html.l23 .view23 { display: none; } /* the table needs ≥ 1024 */
html.l23 .kpis23 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
html.l23 .lanes23 { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(260px, 1fr); gap: var(--sp-3); overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: var(--sp-2); }
html.l23 .lane23 { scroll-snap-align: start; background: var(--sunk); border: 1px solid var(--line); border-radius: var(--radius); padding: var(--sp-3); min-width: 0; }
html.l23 .lane23 h2 { display: flex; align-items: center; gap: var(--sp-2); font-size: var(--fs-sm); margin: 0 0 var(--sp-2); }
html.l23 .lane23 h2 span:first-child { flex: 1; }
html.l23 .lane23 h2:focus { outline: 0; }
html.l23 .lane23 .cnt { font-size: var(--fs-xs); padding: 1px 8px; border-radius: var(--r-pill); background: var(--card); color: var(--ink-2); border: 1px solid var(--line); }
html.l23 .lane23-b { display: grid; gap: var(--sp-2); }
html.l23 .lane23-empty { margin: var(--sp-2) 0; }
html.l23 .bcard { display: grid; gap: 4px; padding: var(--sp-3); border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--card); color: var(--ink); text-decoration: none; box-shadow: 0 1px 2px rgba(15, 42, 51, .04); }
html.l23 .bcard:hover { border-color: var(--accent-100); text-decoration: none; }
html.l23 .bcard:focus-visible { outline: 0; box-shadow: var(--focus); }
html.l23 .bcard.sel { border-color: var(--accent); box-shadow: var(--ring); }
html.l23 .bcard.krow-on { box-shadow: var(--focus); }
/* VORAAA-94 D1: nothing in a card is clipped – the name wraps, the age, teeth,
 * amount and next step wrap below each other when the lane is narrow (no clamp: the surname must stay readable) */
html.l23 .bc-top { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 var(--sp-2); }
html.l23 .bc-top b { flex: 1 1 8em; min-width: 0; font-size: var(--fs-sm); overflow-wrap: anywhere; }
html.l23 .bc-age { font-size: var(--fs-xs); color: var(--ink-3); white-space: nowrap; font-variant-numeric: tabular-nums; }
html.l23 .bc-t { display: flex; align-items: center; gap: 6px; font-size: var(--fs-sm); color: var(--ink-2); }
html.l23 .bc-meta { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2px var(--sp-2); font-size: var(--fs-xs); color: var(--ink-3); }
html.l23 .lane23-b > * { min-width: 0; }
html.l23 .bcard { min-width: 0; overflow: hidden; }
html.l23 .bc-meta .bc-teeth { font-family: var(--font-mono); min-width: 0; overflow-wrap: anywhere; }
html.l23 .bc-meta .bc-teeth:empty { display: none; }
html.l23 .bc-meta .bc-ea { margin-left: auto; }
html.l23 .bc-ea { color: var(--ink); font-weight: var(--fw-semi); white-space: nowrap; }
html.l23 .bc-next { font-size: var(--fs-xs); color: var(--ink-2); overflow-wrap: anywhere; }
html.l23 .bc-next.warn { color: var(--warn-ink); font-weight: var(--fw-semi); }
html.l23 .bcard-w { display: grid; gap: 6px; }
html.l23 .bc-acts { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 0 2px; }
html.l23 .bc-topic { flex: 1 1 100%; }
html.l23 .lane23 kbd.k { margin-left: 2px; }
@media (max-width: 1439px) { html.l23 .lane23 h2 kbd.k { display: none; } } /* narrow lanes: the count is enough */
@media (min-width: 1024px) and (max-width: 1279px) { /* six lanes in 1024: less padding, so a card keeps ~110 px of text */
  html.l23 .lane23 { padding: var(--sp-2); }
  html.l23 .bcard { padding: var(--sp-2) 10px; }
  html.l23 .lane23 h2 { flex-wrap: wrap; overflow-wrap: anywhere; }
}
html.l23 .bc-t { min-width: 0; overflow-wrap: anywhere; }

/* ---------- Patientenseite and Einstellungen (wrapper classes from lists23.js) ---------- */
html.l23 .pg23 .pg23-x { display: none; } /* Stammdaten head lines: only in the side column (≥ 1024) */

/* ============ laptop 1024–1439 ============ */
@media (min-width: 1024px) {
  html.l23 .view23 { display: inline-flex; }
  html.l23 .kpis23 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  html.l23 .lanes23 { grid-auto-flow: row; grid-template-columns: repeat(6, minmax(0, 1fr)); overflow: visible; }
  html.l23 .lane23 { min-height: 52vh; }
  html.l23 .lanes23 { gap: var(--sp-2); }
  html.l23 .tbl23 .c-lap { display: table-cell; }

  /* Patientenseite: Stammdaten sticky left · Fälle + HKPs right */
  html.l23 .pg23 { display: grid; grid-template-columns: 340px minmax(0, 1fr); gap: var(--sp-4); align-items: start; }
  html.l23 .pg23 > .grid-2 { display: contents; }
  html.l23 .pg23 .card { margin-top: 0; }
  html.l23 .pg23 .pg-stamm { grid-column: 1; grid-row: 1 / span 2; position: sticky; top: var(--sp-5); order: -1; }
  html.l23 .pg23 .pg-cases { grid-column: 2; grid-row: 1; }
  html.l23 .pg23 .pg-hkps { grid-column: 2; }
  html.l23 .pg23 .pg-cases + .grid-2 .pg-hkps { grid-row: 2; }
  /* rows in a column: the compact row of the tablet (name · amount / status) */
  html.l23 .pg23 .row { grid-template-columns: 44px minmax(0, 1fr) auto; row-gap: 6px; }
  html.l23 .pg23 .row .kasse, html.l23 .pg23 .row .chev { display: none; }
  html.l23 .pg23 .row .amount { grid-column: 3; grid-row: 1; }
  html.l23 .pg23 .row .status { grid-column: 2 / 4; }
  html.l23 .pg23 .row.crow { grid-template-columns: minmax(0, 1fr) auto; }
  html.l23 .pg23 .row.crow .status { grid-column: 2; grid-row: 1; }
  html.l23 .pg23 .kvlist { grid-template-columns: auto minmax(0, 1fr); }
  html.l23 .pg23 .pg23-x { display: block; }

  /* Einstellungen: the cards flow into two balanced columns; the hero and the Zugänge table span both */
  html.l23 .set23 { columns: 2; column-gap: var(--sp-4); }
  html.l23 .set23 > .grid-2 { display: contents; }
  html.l23 .set23 > *, html.l23 .set23 > .grid-2 > * { break-inside: avoid; }
  html.l23 .set23 .card { margin: 0 0 var(--sp-4); }
  html.l23 .set23 > .settings-hero, html.l23 .set23 > .set-users { column-span: all; }
  html.l23 .set23 > .settings-hero { display: flex; }
}
@media (min-width: 1280px) { html.l23 .tbl23 .c-lap2 { display: table-cell; } } /* the 9-column HKP table and the board table need more than 1024 */
/* ============ desktop 1440–1919 ============ */
@media (min-width: 1440px) {
  html.l23 .tbl23 .c-desk { display: table-cell; }
  html.l23 .pg23 { grid-template-columns: 320px minmax(0, 1fr) minmax(0, 1fr); }
  html.l23 .pg23 .pg-stamm { grid-row: 1; }
  html.l23 .pg23 .pg-cases { grid-column: 2; grid-row: 1; }
  html.l23 .pg23 .pg-cases + .grid-2 .pg-hkps { grid-column: 3; grid-row: 1; }
}
/* ============ wide ≥ 1920: permanent preview pane ============ */
@media (min-width: 1920px) {
  html.l23 .split23.has-pane { grid-template-columns: minmax(0, 1fr) var(--pane-w); }
  html.l23 .split23.has-pane .pane23 { display: flex; flex-direction: column; position: sticky; top: var(--sp-5); max-height: calc(100vh - 2 * var(--sp-5)); background: var(--raised); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
}
@media (min-width: 1024px) and (pointer: fine) {
  html.l23 .tbl23 th { height: 36px; }
}
