/* Statistik, Aufgabenketten und Löschkonzept */
.stat-toolbar-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; }
.stat-kpis article strong { font-size: 26px; }
.stat-delta { font-weight: 700; }
.stat-delta.up { color: #21683f; }
.stat-delta.down { color: #9a2c22; }
.stat-grid { display:grid; grid-template-columns:repeat(auto-fit, minmax(340px, 1fr)); gap:16px; margin-top:16px; }
@media (min-width:1500px) { .stat-grid { grid-template-columns:repeat(3, minmax(0,1fr)); } }
.stat-grid .panel { margin:0; display:flex; flex-direction:column; }
.stat-grid .panel .panel-head { margin-bottom:0; }
.stat-body { display:flex; flex-direction:column; flex:1; padding:6px 22px 18px; }
.stat-body .empty { margin:auto 0; }
.stat-grid .panel .panel-head h2 { font-size:15px; }
.stat-bar-row { display:grid; grid-template-columns:minmax(140px, 42%) minmax(0,1fr) 44px; gap:14px; align-items:center; padding:10px 0; border-bottom:1px solid var(--line, #ebe6ee); font-size:13.5px; }
.stat-bar-row:last-child { border-bottom:0; }
.stat-bar-row > span { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; color:var(--text, #2b2432); }
.stat-bar-row b { display:inline-grid; place-items:center; min-width:34px; height:26px; padding:0 8px; border-radius:8px; background:#f1e9f5; color:#4e2555; font-size:13px; }
.stat-bar { height:14px; border-radius:7px; background:#efe9f2; overflow:hidden; }
.stat-bar i { display:block; height:100%; min-width:6px; background:linear-gradient(90deg, #643182, #9b6cb5); border-radius:inherit; transition:width .35s ease; }
.stat-grid .empty { margin:auto 0; padding:26px 12px; text-align:center; color:var(--muted, #6a6072); font-size:13.5px; border:1px dashed var(--line, #ebe6ee); border-radius:12px; background:#fbf9fc; }
.stat-inline-bar { position: relative; min-width: 120px; height: 20px; border-radius: 4px; background: #f1edf3; overflow: hidden; }
.stat-inline-bar i { position: absolute; inset: 0 auto 0 0; background: #cdb6d8; }
.stat-inline-bar.gold i { background: #e9d6a8; }
.stat-inline-bar span { position: relative; display: block; line-height: 20px; padding: 0 6px; font-size: 12.5px; font-weight: 600; }
.stat-month-table tfoot td { border-top: 2px solid #643182; }

.task-template-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 16px; margin-top: 16px; }
.task-template-card { display: grid; gap: 10px; padding: 18px 20px; border: 1px solid var(--line, #ebe6ee); border-radius: 14px; background: #fff; }
.task-template-card.inactive { opacity: .7; }
.task-template-card header { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.task-template-card h3 { margin: 0; font-size: 16px; }
.task-template-card header span:not(.status) { display: block; font-size: 12.5px; color: var(--muted, #6a6072); margin-top: 3px; }
.task-template-card > p { margin: 0; font-size: 13.5px; color: var(--muted, #6a6072); }
.task-template-items { margin: 0; padding-left: 20px; display: grid; gap: 6px; }
.task-template-items li span { display: block; font-size: 13.5px; }
.task-template-items li small { color: var(--muted, #6a6072); }
.task-template-card footer { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; padding-top: 8px; border-top: 1px solid var(--line, #ebe6ee); }
.task-template-card footer > span { display: flex; gap: 6px; }
.button.danger-text { color: #9a2c22; }
.task-template-types { display: flex; flex-wrap: wrap; gap: 6px 14px; padding: 6px 0; }
.task-template-types label { display: inline-flex; gap: 6px; align-items: center; font-size: 13.5px; font-weight: 500; text-transform: none; letter-spacing: 0; }
.task-template-table td { vertical-align: middle; }
.task-template-table td.center { text-align: center; }
.task-template-table input[type=text] { width: 100%; min-width: 220px; }
.task-template-table input[type=number] { width: 80px; }
.task-template-row-actions { white-space: nowrap; }
.task-template-row-actions .icon-button { background: transparent; border: 0; cursor: pointer; padding: 4px; color: var(--muted, #6a6072); }
.task-template-row-actions .icon-button svg { width: 16px; height: 16px; }
.task-template-row-actions [data-row-up] svg { transform: rotate(180deg); }
.task-template-modal .modal { max-width: 960px; }

.retention-layout { display: grid; grid-template-columns: minmax(300px, 1fr) minmax(0, 1.6fr); gap: 16px; margin: 16px 0; }
.retention-layout .panel { margin: 0; }
.retention-note { margin: 12px 0 0; padding: 12px 14px; border-radius: 10px; background: #f6f1f9; font-size: 13px; color: #4a3d52; }
.retention-subhead { margin: 16px 0 6px; font-size: 14px; }
.retention-upcoming { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.retention-upcoming li { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; padding: 6px 0; border-bottom: 1px solid var(--line, #ebe6ee); }
.retention-upcoming li span { color: var(--muted, #6a6072); }
.retention-blockers { display: block; margin-top: 4px; color: var(--muted, #6a6072); font-size: 12px; max-width: 320px; }
.retention-actions { white-space: nowrap; }
.retention-actions .button { margin: 2px 4px 2px 0; }
.button.danger { background: #9a2c22; border-color: #9a2c22; color: #fff; }
.button.danger:hover { background: #7f2119; }
.retention-warning { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; margin-bottom: 14px; border-radius: 12px; background: #fbe9e7; color: #5c1a14; font-size: 13.5px; line-height: 1.5; }
.retention-warning svg { width: 22px; height: 22px; flex: 0 0 22px; }
@media (max-width: 960px) { .retention-layout { grid-template-columns: 1fr; } .stat-bar-row { grid-template-columns: 1fr; gap: 4px; } }

.case-task-template-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 14px; padding: 12px 16px; border-radius: 12px; background: #f6f1f9; font-size: 13px; }
.case-task-template-bar > span { display: inline-flex; gap: 8px; align-items: center; color: #4a3d52; }
.case-task-template-bar svg { width: 16px; height: 16px; color: #643182; }

.stat-more { margin:8px 0 0; font-size:12.5px; color:var(--muted, #6a6072); text-align:right; }

/* Fahrkarte endgültig löschen: besonderer Hinweis */
.force-delete-warning { display:grid; gap:12px; }
.force-delete-lead { margin:0; padding:12px 14px; border:1px solid #e3b5b5; border-left:4px solid #bd4a40; border-radius:10px; background:#fff5f4; color:#6b2b25; line-height:1.5; }
.force-delete-lead svg { width:16px; height:16px; vertical-align:-3px; margin-right:4px; }
.force-delete-warning ul { margin:0; padding-left:20px; color:#4a3d52; }
.force-delete-warning p { margin:0; line-height:1.55; }
.force-delete-warning .checkbox { display:flex; align-items:flex-start; gap:8px; font-weight:600; }
.icon-button.force-delete { color:#bd4a40; }

/* Anruferprotokoll in der Fallakte */
.call-log-form { margin:14px 0 18px; padding:16px 18px; border:1px solid #e3dde6; border-radius:12px; background:#fbf9fc; }
.call-log-form .form-grid { display:grid; grid-template-columns:minmax(0,1.4fr) minmax(0,1fr); gap:12px; }
.call-log-form .field { margin-top:0; }
.call-log-form .field + .field, .call-log-form > .field { margin-top:12px; }
.call-log-actions { display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:10px; margin-top:12px; }
.call-log-actions small { color:#6f667a; }
.call-log-entry .record-note-mark { background:#f1e9f5; color:#643182; }
.call-log-caller { margin:0 0 4px; }
.call-log-delete { margin-left:auto; padding:2px 6px; border:0; background:transparent; color:#9a8fa3; cursor:pointer; }
.call-log-delete:hover { color:#bd4a40; }
.call-log-delete svg { width:14px; height:14px; }
@media (max-width:720px) { .call-log-form .form-grid { grid-template-columns:1fr; } }

/* Gefahrenbereich: endgültiges Löschen (Administration) */
.danger-zone { margin-top:18px; padding:14px 16px; border:1px solid #e3b8b4; border-radius:12px; background:#fdf3f2; }
.danger-zone > header { display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:12px; }
.danger-zone > header > div { display:grid; gap:4px; max-width:720px; }
.danger-zone strong { color:#9a2c22; }
.danger-zone span { font-size:12.5px; color:#6b4a47; line-height:1.45; }
.danger-zone .button.danger { background:#9a2c22; border-color:#9a2c22; color:#fff; }
.permanent-deletion-form .danger-text { padding:10px 12px; border-radius:8px; background:#fbe9e7; color:#7d2019; font-size:13px; }
.permanent-deletion-form code { padding:1px 6px; border-radius:4px; background:#f1e9f5; }

/* Fingerabdruck-Gedenkurkunde: mehrere Abdrücke */
.fp-form { display:grid; gap:14px; }
.fp-section { padding:12px 14px; border:1px solid #e6dfea; border-radius:12px; background:#faf8fb; }
.fp-section > header { display:grid; gap:2px; margin-bottom:10px; }
.fp-section > header span { font-size:12.5px; color:#6f667a; }
.fp-print { display:grid; grid-template-columns:26px minmax(0,1.6fr) minmax(0,1fr) minmax(0,1fr) 78px 34px; gap:8px; align-items:end; margin-bottom:8px; }
.fp-print label { display:grid; gap:3px; font-size:11.5px; font-weight:600; color:#4a4152; min-width:0; }
.fp-print select { min-height:36px; padding:4px 8px; border:1px solid #d9d0de; border-radius:8px; background:#fff; font:inherit; font-size:13px; }
.fp-index { display:grid; place-items:center; width:26px; height:26px; margin-bottom:5px; border-radius:50%; background:#643182; color:#fff; font-size:12px; font-weight:700; }
.fp-print .icon-button { margin-bottom:2px; }
.fp-confirm { display:flex; align-items:flex-start; gap:10px; font-size:12.5px; color:#4a4152; }
.fp-confirm input { width:18px; height:18px; flex:none; margin-top:2px; }
/* Gestaltung: zwei Kacheln mit Vorschaugrafik (Rahmen & Ornament = Standard, Klassisch) */
.fp-designs { display:grid; grid-template-columns:repeat(2, minmax(0,1fr)); gap:10px; margin-bottom:12px; }
.fp-design { position:relative; display:grid; grid-template-columns:52px minmax(0,1fr); gap:12px; align-items:center; padding:10px 12px; border:1.5px solid #e6dfea; border-radius:12px; background:#fff; cursor:pointer; transition:border-color .15s, box-shadow .15s; }
.fp-design:hover { border-color:#b394cc; }
.fp-design input { position:absolute; inset:0; width:100%; height:100%; margin:0; opacity:0; cursor:pointer; }
.fp-design:has(input:checked) { border-color:#643182; box-shadow:0 0 0 2px rgba(100,49,130,.18); background:#faf7fc; }
.fp-design:has(input:focus-visible) { outline:2px solid #643182; outline-offset:2px; }
.fp-design-art { display:block; width:52px; height:73px; border-radius:4px; overflow:hidden; box-shadow:0 1px 3px rgba(43,37,48,.16); }
.fp-design-art svg { display:block; width:100%; height:100%; }
.fp-design-text { display:grid; gap:3px; min-width:0; }
.fp-design-text strong { font-size:13.5px; color:#2b2530; }
.fp-design-text strong em { margin-left:6px; padding:1px 7px; border-radius:999px; background:#efe8f3; color:#643182; font-size:10.5px; font-style:normal; font-weight:600; vertical-align:middle; }
.fp-design-text small { font-size:12px; line-height:1.4; color:#6f6675; }
.fp-form textarea[name="introText"] { min-height:72px; resize:vertical; font:inherit; font-size:13px; line-height:1.45; }
.fp-hint { display:block; margin-top:3px; font-size:11.5px; font-weight:400; color:#6f6675; }
@media (max-width:720px) { .fp-designs { grid-template-columns:1fr; } }
html[data-workspace-theme="dark"] .fp-design { background:#2a2430; border-color:#463c4e; }
html[data-workspace-theme="dark"] .fp-design:has(input:checked) { background:#33283d; }
html[data-workspace-theme="dark"] .fp-design-text strong { color:#f3eef6; }
html[data-workspace-theme="dark"] .fp-design-text small { color:#b9afc2; }
@media (max-width:720px) { .fp-print { grid-template-columns:26px minmax(0,1fr) 34px; } .fp-print label:nth-child(3), .fp-print label:nth-child(4), .fp-print label:nth-child(5) { grid-column:2; } }

/* Endaufstellung der Bestattungskosten */
.final-statement { margin-top:16px; }
.final-statement > header { display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:12px; margin-bottom:10px; }
.final-statement > header > div { display:grid; gap:4px; max-width:700px; }
.final-statement > header span { font-size:12.5px; color:#6f667a; }
.final-statement-list { margin:0; padding:0; list-style:none; display:grid; gap:8px; }
.final-statement-list li { display:grid; gap:2px; padding:10px 12px; border:1px solid #e6dfea; border-radius:10px; background:#faf8fb; }
.final-statement-list a { color:#4e2555; font-weight:600; text-decoration:none; }
.final-statement-list small { color:#6f667a; font-size:12px; }
.fs-summary { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:8px; margin-bottom:12px; }
.fs-summary > div { display:grid; gap:2px; padding:10px 12px; border:1px solid #e6dfea; border-radius:10px; background:#faf8fb; }
.fs-summary span { font-size:11px; letter-spacing:.05em; text-transform:uppercase; color:#7a7086; }
.fs-summary strong { font-size:16px; font-variant-numeric:tabular-nums; }
.fs-summary .open strong { color:#9a2c22; }
.fs-summary .ok strong { color:#246b48; }
.final-statement-form .field.checkbox { display:flex; align-items:center; gap:10px; }
.final-statement-form .field.checkbox input { width:18px; height:18px; }
.final-statement-form .field.checkbox > span { display:grid; gap:2px; }
.final-statement-form .field.checkbox small { color:#6f667a; font-size:12px; line-height:1.4; }
.final-statement-form .field.checkbox input:disabled + span { opacity:.85; }

/* Hinweis: Akte einer anderen Filiale (nur lesend) */
.branch-notice { display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:12px; margin:0 0 14px; padding:12px 16px; border:1px solid #f0dcb5; border-left:5px solid #b28b55; border-radius:12px; background:#fdf6e8; }
.branch-notice > div { display:grid; gap:3px; }
.branch-notice strong { color:#6b4a12; }
.branch-notice span { font-size:12.5px; color:#6b4a12; }

/* Aufnahme: Schritte und einklappbare Zusatzangaben */
.intake-form .form-section.intake-step { display:flex; align-items:center; gap:12px; margin:22px 0 10px; padding:12px 0 10px; border-top:1px solid #e6dfea; }
.intake-form .form-section.intake-step:first-child { margin-top:0; border-top:0; padding-top:0; }
.intake-step-no { flex:none; display:grid; place-items:center; width:32px; height:32px; border-radius:50%; background:#643182; color:#fff; font-size:14px; font-weight:700; }
.intake-step > span:last-child { display:grid; gap:2px; font-size:16px; font-weight:700; color:#2b2432; }
.intake-step small { font-size:12.5px; font-weight:400; color:#6f667a; }
.intake-more { grid-column:1 / -1; margin:6px 0 4px; border:1px dashed #d9c6e3; border-radius:12px; background:#faf8fb; }
.intake-more > summary { cursor:pointer; padding:11px 14px; font-weight:600; color:#4e2555; list-style:none; display:flex; align-items:center; gap:8px; }
.intake-more > summary::before { content:"+"; display:grid; place-items:center; width:20px; height:20px; border-radius:50%; background:#f1e9f5; color:#643182; font-weight:700; }
.intake-more[open] > summary::before { content:"–"; }
.intake-more > summary small { font-weight:400; color:#7a7086; font-size:12px; }
.intake-more > summary::-webkit-details-marker { display:none; }
.intake-more > .form-grid { padding:4px 14px 14px; }
.intake-more .form-section { margin-top:14px; }
.intake-check { display:flex; align-items:flex-start; gap:10px; padding:10px 12px; border-radius:10px; background:#f1e9f5; color:#4e2555; font-weight:600; }
.intake-check input { width:18px; height:18px; flex:none; margin-top:2px; }
@media (max-width:760px) { .intake-more > .form-grid { grid-template-columns:1fr; } }

/* Startseite: Kacheln „Was heute zählt“ */
.dashboard-tiles { margin:0 0 18px; }
.dashboard-tiles > header { display:flex; align-items:baseline; justify-content:space-between; margin-bottom:8px; }
.dashboard-tiles > header strong { font-size:13px; letter-spacing:.06em; text-transform:uppercase; color:#6f667a; }
.dashboard-tiles > header span { font-size:12px; color:#7a7086; }
.dt-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(180px,1fr)); gap:10px; }
.dt-tile { display:grid; gap:3px; padding:14px 16px; border:1px solid var(--compact-line,#e6dfea); border-left:5px solid #c9b3d6; border-radius:14px; background:var(--compact-surface,#fff); color:var(--compact-text,#2b2432); text-align:left; cursor:pointer; font:inherit; box-shadow:0 6px 18px rgba(60,32,74,.05); transition:transform .15s, box-shadow .15s; }
.dt-tile:hover { transform:translateY(-1px); box-shadow:0 10px 24px rgba(60,32,74,.10); }
.dt-tile small { font-size:11px; letter-spacing:.06em; text-transform:uppercase; color:var(--compact-muted,#7a7086); }
.dt-tile strong { font-size:24px; line-height:1.15; color:var(--compact-text,#2b2432); font-variant-numeric:tabular-nums; }
.dt-tile span { font-size:12.5px; color:var(--compact-muted,#6f667a); }
.dt-tile.ok { border-left-color:#7fd7a2; }
.dt-tile.warn { border-left-color:#f2c36b; background:#fffbf3; }
.dt-tile.danger { border-left-color:#e07a72; background:#fdf4f3; }
.dt-tile.danger strong { color:#9a2c22; }
/* Dunkelmodus: Zahlen und Flächen über die Lila-Tokens (zuvor fest #2b2432 auf dunklem Grund – unsichtbar) */
html[data-workspace-theme="dark"] .dt-tile.warn { background:#403728; }
html[data-workspace-theme="dark"] .dt-tile.danger { background:#4b2e2d; }
html[data-workspace-theme="dark"] .dt-tile.danger strong { color:#f19b96; }
html[data-workspace-theme="dark"] .dashboard-tiles > header :is(strong,span) { color:var(--compact-muted,#bfb1ca); }

/* Preisinformation in Sterbefall übernehmen */
.pi-takeover-list{display:grid;gap:.5rem;margin-top:.75rem}
.pi-takeover-row{display:flex;gap:.75rem;align-items:flex-start;padding:.7rem .9rem;border:1px solid var(--border,#e2d9ea);border-radius:12px;cursor:pointer;background:#fff}
.pi-takeover-row:has(input:checked){border-color:var(--accent,#6b3f8a);background:rgba(107,63,138,.06)}
.pi-takeover-row.expired{opacity:.55;cursor:not-allowed}
.pi-takeover-row input{margin-top:.3rem}
.pi-takeover-row div{display:grid;gap:.15rem}
.pi-takeover-row span,.pi-takeover-row small{color:var(--muted,#6b6473)}

/* Bewertung nach der Beisetzung (Fallakte) */
.case-feedback .panel-head{display:flex;justify-content:space-between;gap:1rem;align-items:flex-start;flex-wrap:wrap}
.cf-stars{display:inline-flex;gap:2px;color:#d9cde2;vertical-align:middle}
.cf-stars .on{color:#c6a15b}
.cf-entry-head{display:flex;flex-wrap:wrap;align-items:center;gap:.5rem 1rem;margin-bottom:.5rem}
.cf-entry blockquote{margin:.5rem 0;padding:.75rem 1rem;border-left:4px solid var(--accent,#6b3f8a);background:rgba(107,63,138,.05);border-radius:0 10px 10px 0;line-height:1.55}
.cf-response{margin-top:.75rem;display:grid;gap:.5rem}

/* Löschkonzept: Vorsorgen unbefristet (feste Anzeige statt Jahresfeld) */
.retention-fixed { display: flex; flex-direction: column; gap: 2px; min-height: 38px; padding: 8px 12px; border: 1px dashed #c9bdd0; border-radius: 8px; background: #faf7fb; }
.retention-fixed small { color: var(--muted, #6a6072); font-size: 12px; }
.retention-preneed { display: flex; gap: 8px; align-items: flex-start; margin-top: 0; }
.retention-preneed svg { flex: none; width: 16px; height: 16px; margin-top: 1px; }
/* Endaufstellung: Vorschau des Zahlungsblocks „Restbetrag“ im Dialog (final-statement.js) */
.fs-payment { margin:0 0 12px; padding:12px 14px; border-top:2px solid #643182; background:#f9f6f8; border-radius:0 0 8px 8px; }
.fs-payment h4 { margin:0 0 8px; font-size:11px; letter-spacing:.08em; text-transform:uppercase; color:#643182; }
.fs-payment dl { margin:0; display:grid; gap:5px; }
.fs-payment dl > div { display:grid; grid-template-columns:minmax(110px,140px) minmax(0,1fr); gap:8px; align-items:baseline; padding-bottom:4px; border-bottom:1px solid #d9c8e4; }
.fs-payment dl > div:last-child { border-bottom:0; }
.fs-payment dt { font-size:10.5px; letter-spacing:.06em; text-transform:uppercase; color:#643182; font-weight:600; }
.fs-payment dd { margin:0; font-size:13px; color:#2b2530; overflow-wrap:anywhere; }
.fs-payment dd.strong { font-weight:600; }
.fs-payment .muted, .fs-payment .status { margin:8px 0 0; }
.fs-payment-settled { font-size:13px; color:#246b48; }
@media (max-width:600px) { .fs-payment dl > div { grid-template-columns:minmax(0,1fr); } .fs-summary { grid-template-columns:repeat(2,minmax(0,1fr)); } }
