/* Einheitliche App-Optik (Peter 29.10.2026): kompakte Listenköpfe, Listen als Zeilen/Karten, Detailseiten wie die Kundenakte,
   Gutachtenschritte als einzeilige Schrittleiste, mehrzeilige Felder ohne Scrollbalken. */

/* ---------- Mehrzeilige Felder: immer ganz sichtbar ---------- */
textarea.textarea-fit{overflow-y:hidden;resize:none}
textarea[data-single-line]{line-height:1.4}

/* ---------- Stammdaten-Kopf: Titel · Umschalter · + Neu in einer Zeile ---------- */
.list-head{display:flex;align-items:center;gap:12px;margin:0 0 14px;flex-wrap:wrap}
.list-head h1{margin:0 auto 0 0;font-size:1.65rem;line-height:1.15;letter-spacing:-.035em}
.segmented{display:inline-flex;padding:3px;border:1px solid var(--line,#dfe6ee);border-radius:10px;background:color-mix(in srgb,var(--blue,#0874e8) 4%,var(--surface,#fff))}
.segmented a{padding:6px 13px;border-radius:7px;font-size:.78rem;font-weight:700;color:var(--muted,#5e6d7d);text-decoration:none;white-space:nowrap}
.segmented a:hover{color:var(--ink,#101a28)}
.segmented a[aria-current=page]{background:var(--surface,#fff);color:var(--blue,#0874e8);box-shadow:0 1px 4px rgba(7,21,37,.14)}
.list-add{display:inline-flex;align-items:center;gap:6px;font-size:.8rem;white-space:nowrap}
.list-add>span[aria-hidden]{font-size:1.15rem;line-height:1;font-weight:600}
.compact-search{padding:0;border:0;background:none;box-shadow:none;margin:0 0 14px}
.compact-search input{padding:10px 13px 10px 36px!important;border-radius:11px!important;background:var(--surface,#fff) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%237c8998' stroke-width='2.2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E") no-repeat 12px center}
.result-line{display:flex;align-items:baseline;justify-content:space-between;gap:12px;margin:0 0 8px}
.result-line h2{margin:0;font-size:.8rem;font-weight:750;color:var(--muted,#5e6d7d);letter-spacing:0}
.customer-results:has(>.result-line){margin-top:0}

/* ---------- Listen als Zeilen (Versicherungen, Ansprechpartner) ---------- */
.entity-list{display:flex;flex-direction:column;padding:4px;overflow:hidden}
.entity-row{display:flex;align-items:center;gap:12px;padding:10px 12px;border-radius:10px;color:inherit;text-decoration:none;min-width:0}
.entity-list>.entity-row:nth-child(even){background:color-mix(in srgb,var(--blue,#0874e8) 4%,var(--surface,#fff))}
a.entity-row:hover{background:color-mix(in srgb,var(--blue,#0874e8) 9%,var(--surface,#fff))}
.entity-avatar{flex:none;width:38px;height:38px;border-radius:50%;display:grid;place-items:center;background:color-mix(in srgb,var(--blue,#0874e8) 12%,var(--surface,#fff));color:var(--blue,#0874e8);font-weight:800;font-size:.95rem}
.entity-avatar-lg{width:52px;height:52px;border-radius:14px;font-size:1.3rem}
.entity-copy{display:flex;flex-direction:column;flex:1;min-width:0}
.entity-copy strong{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.entity-copy small{margin-top:2px;color:var(--muted,#5e6d7d);font-size:.74rem;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.entity-chevron{flex:none;color:var(--muted,#7c8998);font-size:1.5rem;line-height:1}
.entity-empty{margin:0;padding:16px;color:var(--muted,#5e6d7d)}

/* ---------- Detailseite (Versicherung, Ansprechpartner) im Stil der Kundenakte ---------- */
.detail-head{margin:0 0 16px}
.detail-back{display:inline-flex;align-items:center;gap:6px;margin-bottom:10px;color:var(--blue,#0874e8);font-size:.82rem;font-weight:700;text-decoration:none}
.detail-back span{font-size:1.2rem;line-height:1}
.detail-title{display:flex;align-items:center;gap:14px;min-width:0}
.detail-title h1{margin:2px 0 0;font-size:clamp(1.3rem,2.2vw,1.8rem);line-height:1.15;letter-spacing:-.03em;overflow-wrap:anywhere}

/* ---------- Gutachten: Schrittleiste in einer Zeile ---------- */
.step-bar{display:block;margin:0 0 18px;padding:10px 0 12px;border-bottom:1px solid var(--line,#dfe6ee)}
.step-bar ol{display:flex;align-items:center;margin:0;padding:0;list-style:none;min-width:0}
.step-bar li{display:flex;align-items:center;flex:1 1 auto;min-width:0}
.step-bar li:last-child{flex:0 1 auto}
.step-bar li:not(:last-child)::after{content:"";flex:1 1 10px;min-width:8px;height:2px;margin:0 6px;border-radius:2px;background:var(--line,#dfe6ee)}
.step-bar li:has(.step-done):not(:last-child)::after{background:color-mix(in srgb,#1e7a46 55%,var(--surface,#fff))}
.step-bar a,.step-bar .step-locked{display:flex;align-items:center;gap:8px;min-width:0;padding:5px 10px 5px 5px;border:0;border-radius:999px;background:none;box-shadow:none;color:var(--muted,#5e6d7d);font-size:.8rem;font-weight:650;text-decoration:none;white-space:nowrap}
.step-bar a:hover{background:color-mix(in srgb,var(--blue,#0874e8) 7%,transparent);color:var(--ink,#101a28)}
.step-bar .step-label{overflow:hidden;text-overflow:ellipsis;min-width:0}
.step-bar .step-num{flex:none;width:26px;height:26px;display:grid;place-items:center;border:2px solid var(--line-strong,#c9d3de);border-radius:50%;background:var(--surface,#fff);font-size:.74rem;font-weight:800}
.step-bar .step-done .step-num{border-color:#1e7a46;background:#e8f5ee;color:#1e7a46}
.step-bar a[aria-current=step]{background:color-mix(in srgb,var(--blue,#0874e8) 10%,transparent);color:var(--blue,#0874e8);font-weight:800;box-shadow:none}
.step-bar a[aria-current=step] .step-num{border-color:var(--blue,#0874e8);background:var(--blue,#0874e8);color:#fff}
.step-bar .step-locked{opacity:.5;cursor:not-allowed}
.step-bar .step-locked .step-num{border-style:dashed}
.step-bar li.is-current{flex-shrink:0}
[data-theme=dark] .step-bar .step-done .step-num{background:#173628;color:#7fd3a5;border-color:#3f9e6c}

@media (max-width:700px){
  .list-head{gap:10px;margin-bottom:10px}
  .list-head h1{font-size:1.4rem}
  .list-head .segmented{display:none}   /* Kunden/Versicherungen stehen unten in der Leiste */
  .list-add{padding:9px 14px}

  .detail-title h1{font-size:1.25rem}
  .step-bar{padding:8px 0 10px;margin-bottom:12px}
}

/* Gutachten: „+ … hinzufügen“ oben, Formular als Ebene */
.entry-add{display:flex;align-items:center;flex-wrap:wrap;gap:12px;margin:.75rem 0 1rem}
.entry-add .button{display:inline-flex;align-items:center;gap:6px;font-size:.9rem;padding:.7rem 1.1rem}
.entry-add .button span{font-size:1.2rem;line-height:1}
@media (max-width:700px){.entry-add .button{flex:1 1 100%;justify-content:center;min-height:48px}}
dialog[data-entry-new][open]{height:fit-content!important;max-height:94dvh}

/* ---------- Gutachtenliste und Kopf ---------- */
.segmented-filter{display:flex;width:max-content;max-width:100%;overflow-x:auto;margin:-4px 0 14px;scrollbar-width:none}
.report-row{align-items:flex-start}
.report-row .entity-avatar,.report-row .entity-chevron,.report-row .status-badge{margin-top:2px}
.entity-copy strong.wrap{white-space:normal;overflow:visible}
.status-badge{flex:none;display:inline-flex;align-items:center;padding:3px 10px;border-radius:999px;font-size:.72rem;font-weight:750;white-space:nowrap;background:#fdf3dc;color:#8a5a00}
.status-badge.status-review{background:#e6f0fd;color:#0b5cc0}
.status-badge.status-released{background:#e8f5ee;color:#1e7a46}
[data-theme=dark] .status-badge{background:#3a3220;color:#f0c66b}
[data-theme=dark] .status-badge.status-review{background:#16304f;color:#8fbcff}
[data-theme=dark] .status-badge.status-released{background:#173628;color:#7fd3a5}

.step-bar .step-tiny{display:none}
@media (max-width:700px){
  .segmented-filter{width:100%}
  .segmented-filter a{flex:1 1 auto;text-align:center;padding:6px 5px;font-size:.72rem}
  .report-row{flex-wrap:wrap}
  .report-row .entity-copy{flex:1 1 calc(100% - 80px)}
  .report-row .status-badge{margin-left:50px;margin-top:0}
  .report-row .entity-chevron{display:none}
  .report-author{display:none!important}

  /* Schrittleiste am Handy: jeder Kreis mit kleinem Namen darunter, Linie dahinter */
  .step-bar ol{position:relative;align-items:flex-start;gap:0}
  .step-bar ol::before{content:"";position:absolute;left:7%;right:7%;top:17px;height:2px;background:var(--line,#dfe6ee);z-index:0}
  .step-bar li,.step-bar li.is-current{flex:1 1 0;min-width:0;justify-content:center}
  .step-bar li:not(:last-child)::after{display:none}
  .step-bar a,.step-bar .step-locked,.step-bar li:not(.is-current) a,.step-bar li:not(.is-current) .step-locked{position:relative;z-index:1;flex-direction:column;gap:3px;padding:2px 0;border-radius:8px;background:none;width:100%}
  .step-bar a[aria-current=step]{background:none}
  .step-bar .step-label,.step-bar li:not(.is-current) .step-label{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
  .step-bar .step-tiny{display:block;font-size:.6rem;font-weight:650;line-height:1.1;letter-spacing:-.01em;white-space:nowrap;color:inherit}
  .step-bar a[aria-current=step] .step-tiny{font-weight:850}
  .step-bar .step-num{width:30px;height:30px}
}
/* ADR-0023, Paket 4: Gutachten – Kopf wie überall, Inhalt in einer Karte, Einträge als ruhige Kacheln */
.assess-page .step-bar{margin:0 0 14px}
.assess-body .customer-form,.adv-dialog .customer-form{padding:0}
.assess-body>.section-note:first-child,.assess-body>.notice:first-child{margin-top:0}
.assess-body .assessment-record{border:1px solid var(--line,#dfe6ee);border-radius:14px;background:var(--ui-tint,#f6f9fd);padding:14px 16px}
.assess-body .assessment-record h3{margin:0 0 6px;font-size:.98rem}
.assess-body .assessment-record p{margin:0 0 6px;font-size:.88rem;color:var(--muted,#526275)}
.assess-body .assessment-record p:first-of-type{color:var(--ink,#101a28)}
.assess-body .entry-add{margin-bottom:14px}
@media (max-width:700px){
  .assess-body .entry-add .button{width:100%;justify-content:center}
  .assess-page .ui-head .ui-secondary{display:none}
}
.status-badge.status-archived{background:#eef1f5;color:#5b6675}
[data-theme=dark] .status-badge.status-archived{background:#262d38;color:#a9b4c3}
.list-head>div{margin-right:auto}.list-head>div h1{margin:0}.list-head .eyebrow{display:block}
