:root {
    --bg: #f7f8fa;
    --fg: #1c2330;
    --muted: #5b6577;
    --accent: #1f5fbf;
    --card: #fff;
    --line: #dfe3ea;
    --err: #b3261e;
}
@media (prefers-color-scheme: dark) {
    :root {
        --bg: #12151b;
        --fg: #e8ebf1;
        --muted: #9aa3b5;
        --accent: #6aa3ff;
        --card: #1b2029;
        --line: #2b3240;
        --err: #ff8a80;
    }
}
* { box-sizing: border-box; }
body {
    margin: 0;
    background: var(--bg);
    color: var(--fg);
    font: 16px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif;
}
.top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: var(--card);
    border-bottom: 1px solid var(--line);
}
.top nav { display: flex; gap: 16px; align-items: center; }
.brand { font-weight: 600; color: var(--fg); text-decoration: none; }
a { color: var(--accent); }
main { max-width: 560px; margin: 32px auto; padding: 0 16px; }
h1 { font-size: 1.5rem; line-height: 1.25; }
label { display: block; margin: 16px 0 4px; font-weight: 500; }
input {
    width: 100%;
    padding: 10px 12px;
    font: inherit;
    color: var(--fg);
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 8px;
}
.btn {
    display: inline-block;
    margin-top: 16px;
    padding: 10px 18px;
    font: inherit;
    color: #fff;
    background: var(--accent);
    border: 0;
    border-radius: 8px;
    text-decoration: none;
    cursor: pointer;
}
.error { color: var(--err); }
select { width: 100%; padding: 10px 12px; font: inherit; color: var(--fg); background: var(--card); border: 1px solid var(--line); border-radius: 8px; }
small { display: block; color: var(--muted); }
fieldset { margin: 20px 0 0; padding: 8px 14px 14px; border: 1px solid var(--line); border-radius: 8px; }
label.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; }
label.check input { width: auto; margin-top: 5px; }
h2 { font-size: 1.1rem; margin-top: 28px; }
.progress { color: var(--muted); }
.hint { padding: 10px 12px; border-radius: 8px; border: 1px solid var(--line); background: var(--card); }
.hint.warn { border-color: var(--err); }
ul.checklist { list-style: none; padding: 0; margin: 0; }
ul.checklist li { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 12px; padding: 10px 12px; margin-bottom: 6px; background: var(--card); border: 1px solid var(--line); border-radius: 8px; }
ul.checklist li small { flex-basis: 100%; }
ul.checklist em { color: var(--muted); font-style: normal; font-size: .9em; }
textarea { width: 100%; padding: 10px 12px; font: inherit; color: var(--fg); background: var(--card); border: 1px solid var(--line); border-radius: 8px; }
h3 { font-size: 1rem; margin: 18px 0 8px; color: var(--muted); }
.rejected { color: var(--err); font-size: .9em; }
.btn.danger { background: var(--err); }
form.review { flex-basis: 100%; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
form.review input[type=text] { flex: 1 1 180px; padding: 6px 10px; }
form.filter { display: flex; gap: 10px; align-items: center; margin-bottom: 16px; }
form.filter label { margin: 0; }
form.filter select { width: auto; }
small.error { color: var(--err); }
small.suggest { color: var(--accent); }
input.suggested, select.suggested { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 8%, var(--card)); }
table.items { width: 100%; border-collapse: collapse; margin-top: 8px; }
table.items th, table.items td { padding: 8px 6px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
table.items td.num, table.items th.num { text-align: right; white-space: nowrap; }
table.items input.num { text-align: right; min-width: 90px; }
table.items tr.needs { background: color-mix(in srgb, var(--err) 10%, transparent); }
table.items tfoot tr.sum td { font-weight: 600; border-top: 2px solid var(--fg); }
table.items select { width: auto; padding: 8px 6px; }
section.quote { padding: 12px 14px; margin-bottom: 20px; border: 1px solid var(--accent); border-radius: 8px; background: var(--card); }
main:has(table.items input) { max-width: 760px; }
.flash { padding: 10px 12px; border-radius: 8px; border: 1px solid var(--line); background: var(--card); }
.flash.error { border-color: var(--err); color: var(--err); }
.file { flex-basis: 100%; display: flex; gap: 12px; align-items: center; word-break: break-all; }
.file .size { color: var(--muted); font-size: .9em; white-space: nowrap; }
form.upload { flex-basis: 100%; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 4px; }
form.upload input[type=file] { width: auto; flex: 1 1 200px; padding: 6px; }
.btn.small { margin: 0; padding: 6px 12px; font-size: .9rem; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
li.state-missing .status { color: var(--err); }
li.state-accepted .status, li.state-scanned .status, li.state-uploaded .status { color: var(--accent); }
form.inline { display: inline; margin: 0; }
button.link {
    background: none;
    border: 0;
    padding: 0;
    font: inherit;
    color: var(--accent);
    cursor: pointer;
}

/* Statusfilter im Backoffice: Buttons links untereinander, Ergebnis rechts */
.split { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 24px; align-items: start; margin-top: 16px; }
nav.chips { display: flex; flex-direction: column; border: 1px solid var(--line); background: var(--card); }
nav.chips .chip { padding: 12px 14px; color: var(--fg); font-size: .95rem; text-decoration: none; border-bottom: 1px solid var(--line); }
nav.chips .chip:last-child { border-bottom: 0; }
nav.chips .chip:hover { background: var(--bg); }
nav.chips .chip.on { background: var(--accent); color: #fff; font-weight: 600; }
.split .results > :first-child { margin-top: 0; }
@media (max-width: 640px) { .split { grid-template-columns: 1fr; gap: 16px; } }

/* QR-Fenster für den Foto-Upload vom Handy */
dialog.capture-dialog { border: 1px solid var(--line); border-radius: 14px; background: var(--card); color: var(--fg); padding: 24px; max-width: 420px; width: calc(100% - 32px); }
dialog.capture-dialog::backdrop { background: rgba(10, 14, 22, .55); }
dialog.capture-dialog h2 { margin-top: 0; }
.capture-qr { width: 260px; max-width: 100%; margin: 12px auto; background: #fff; padding: 8px; border-radius: 8px; min-height: 60px; }
.capture-qr svg { display: block; width: 100%; height: auto; }
.capture-state { text-align: center; color: var(--muted); min-height: 1.5em; }
.capture-state.ok { color: var(--accent); font-weight: 600; }
.capture-btn { margin-left: auto; }

/* Handy-Seite: Schrittanzeige und Weiter-Knopf */
.capture-step { margin: 0 0 6px; color: var(--muted); font-size: .9rem; }
.capture-bar { height: 6px; background: var(--line); border-radius: 3px; margin-bottom: 16px; overflow: hidden; }
.capture-bar span { display: block; height: 100%; background: var(--accent); }
.capture-count { color: var(--accent); font-weight: 600; }
a.capture-close { display: flex; justify-content: center; margin-top: 12px; text-decoration: none; }
a.capture-next { display: flex; justify-content: center; margin-top: 12px; text-decoration: none; }

/* Abschlussseite am Handy: animierter Haken */
.capture-done { text-align: center; padding: 32px 0; }
.capture-done .capture-final { margin-top: 24px; min-width: 200px; }
.capture-done .check { display: block; margin: 0 auto 16px; }
.capture-done .check-circle { stroke: var(--accent); stroke-width: 3; stroke-dasharray: 151; stroke-dashoffset: 151; animation: check-draw .6s ease-out forwards; }
.capture-done .check-mark { stroke: var(--accent); stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 40; stroke-dashoffset: 40; animation: check-draw .35s .5s ease-out forwards; }
.capture-done .check { transform-origin: center; animation: check-pop .35s .85s ease-out; }
.capture-done h1, .capture-done p { animation: check-fade .5s .7s ease-out both; }
@keyframes check-draw { to { stroke-dashoffset: 0; } }
@keyframes check-pop { 50% { transform: scale(1.12); } }
@keyframes check-fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
    .capture-done * { animation: none !important; stroke-dashoffset: 0 !important; opacity: 1 !important; }
}

/* Foto-Knopf der Gestoría: volle Breite mit Kamera-Symbol */
.btn.capture-wide { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; box-sizing: border-box; }
.btn.capture-wide::before { content: ''; width: 1.3em; height: 1.3em; flex: none; background: currentColor; -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M23 19a2 2 0 0 1-2 2H3a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h4l2-3h6l2 3h4a2 2 0 0 1 2 2z'/%3E%3Ccircle cx='12' cy='13' r='4'/%3E%3C/svg%3E") center / contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M23 19a2 2 0 0 1-2 2H3a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h4l2-3h6l2 3h4a2 2 0 0 1 2 2z'/%3E%3Ccircle cx='12' cy='13' r='4'/%3E%3C/svg%3E") center / contain no-repeat; }

/* Fehlende Pflichtfelder: roter, pulsierender Rahmen */
input.missing, select.missing, textarea.missing { border-color: var(--err) !important; animation: need-pulse 1.6s ease-in-out infinite; }
@keyframes need-pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(179, 38, 30, 0); } 50% { box-shadow: 0 0 0 4px rgba(179, 38, 30, .28); } }
@media (prefers-reduced-motion: reduce) { input.missing, select.missing, textarea.missing { animation: none; box-shadow: 0 0 0 2px rgba(179, 38, 30, .28); } }

/* Einladungsfenster */
.invite-form label { display: block; margin-top: 12px; font-weight: 600; }
.invite-form input, .invite-form select { width: 100%; box-sizing: border-box; }
.invite-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 20px; }

/* Kunden-Startseite: zentriert, technisch und klar */
main:has(.dash) { max-width: 760px; }
.dash { text-align: center; padding: 12px 0 8px; }
.dash h1 { font-size: clamp(1.6rem, 4vw, 2.1rem); letter-spacing: -.02em; margin: 14px 0 10px; }
.dash-badge { display: inline-block; padding: 4px 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--card); color: var(--accent); font: 600 .72rem/1.6 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; letter-spacing: .12em; text-transform: uppercase; }
.dash-lead { max-width: 560px; margin: 0 auto 28px; color: var(--muted); font-size: 1.05rem; line-height: 1.6; }
.dash-steps { list-style: none; margin: 0 0 30px; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; text-align: left; }
.dash-steps li { position: relative; display: flex; flex-direction: column; gap: 6px; padding: 18px 16px 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); }
.dash-steps li svg { color: var(--accent); margin-bottom: 4px; }
.dash-steps .dash-num { position: absolute; top: 14px; right: 14px; color: var(--muted); font: 500 .75rem/1 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; letter-spacing: .08em; }
.dash-steps strong { font-size: .98rem; }
.dash-steps li > span:last-child { color: var(--muted); font-size: .88rem; line-height: 1.5; }
.dash a.btn.dash-cta { display: inline-flex; justify-content: center; min-width: 260px; padding: 14px 28px; font-size: 1.02rem; }
.dash-note { margin: 12px 0 0; color: var(--muted); font-size: .85rem; }
.dash-list { text-align: left; margin-bottom: 22px; }
@media (max-width: 640px) { .dash-steps { grid-template-columns: 1fr; } .dash a.btn.dash-cta { width: 100%; box-sizing: border-box; } }

/* Expedientes als Karten */
.case-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; text-align: left; margin-bottom: 8px; }
.case-card { position: relative; display: flex; flex-direction: column; gap: 6px; padding: 18px; border: 1px solid var(--line); border-radius: 14px; background: var(--card); transition: border-color .15s, box-shadow .15s, transform .15s; }
.case-card:hover { border-color: var(--accent); box-shadow: 0 6px 20px rgba(31, 95, 191, .10); transform: translateY(-1px); }
.case-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; padding-right: 36px; }
.case-ico { display: inline-flex; align-items: center; justify-content: center; width: 46px; height: 46px; border-radius: 12px; background: rgba(31, 95, 191, .10); color: var(--accent); }
.case-pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; border: 1px solid var(--line); font-size: .76rem; font-weight: 600; color: var(--muted); }
.case-pill::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.st-progress .case-pill { color: var(--accent); border-color: rgba(31, 95, 191, .35); }
.st-draft .case-pill { color: #a15c00; border-color: rgba(161, 92, 0, .35); }
.st-done .case-pill { color: #1b7a43; border-color: rgba(27, 122, 67, .35); }
.st-cancel { opacity: .75; }
.case-title { margin: 0; font-size: 1.12rem; letter-spacing: -.01em; }
.case-title a { color: inherit; text-decoration: none; }
.case-title a::after { content: ''; position: absolute; inset: 0; border-radius: 14px; }
.case-meta { margin: 0; color: var(--muted); font-size: .86rem; min-height: 1.3em; }
.case-plate { padding: 1px 7px; border: 1px solid var(--line); border-radius: 5px; font: 600 .78rem/1.6 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; letter-spacing: .04em; color: var(--fg); }
.case-phases { list-style: none; display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; margin: 12px 0 6px; padding: 0; }
.case-phases li { font-size: .68rem; color: var(--muted); }
.case-phases li span { display: block; height: 4px; border-radius: 2px; background: var(--line); margin-bottom: 5px; }
.case-phases li.done span { background: var(--accent); }
.case-phases li.now span { background: linear-gradient(90deg, var(--accent) 50%, var(--line) 50%); }
.case-phases li.done, .case-phases li.now { color: var(--fg); }
.case-foot { display: flex; justify-content: space-between; gap: 8px; margin: 6px 0 0; color: var(--muted); font-size: .78rem; }
.case-go { color: var(--accent); font-weight: 600; white-space: nowrap; }
.case-card .row-delete { position: absolute; top: 12px; right: 12px; z-index: 2; margin: 0; }
.case-card .row-delete button { width: 32px; height: 32px; font-size: 1.3rem; }
.case-new { align-items: center; justify-content: center; text-align: center; border-style: dashed; color: var(--muted); text-decoration: none; min-height: 190px; }
.case-new .case-ico { margin-bottom: 4px; }
.case-new strong { color: var(--fg); }
.case-new span:last-child { font-size: .84rem; }

/* Unterschriftskarte in der Kundenansicht */
.sign-card { margin: 20px 0; padding: 20px; border: 1px solid var(--line); border-radius: 14px; background: var(--card); }
.sign-head { display: flex; gap: 14px; align-items: flex-start; }
.sign-head h2 { margin: 2px 0 4px; font-size: 1.15rem; }
.sign-head p { margin: 0; color: var(--muted); font-size: .9rem; line-height: 1.5; }
.sign-how { list-style: none; margin: 18px 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.sign-how li { display: flex; flex-direction: column; gap: 8px; padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); font-size: .82rem; line-height: 1.45; color: var(--muted); }
.sign-how svg { color: var(--accent); }
.sign-parties { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.sign-parties li { display: flex; align-items: center; gap: 12px; padding: 12px 14px; }
.sign-parties li + li { border-top: 1px solid var(--line); }
.sign-avatar { display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; border-radius: 50%; background: rgba(31, 95, 191, .10); color: var(--accent); flex: none; }
.sign-who { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.sign-who em { font-style: normal; font-size: .72rem; font-weight: 600; color: var(--accent); border: 1px solid rgba(31, 95, 191, .35); border-radius: 999px; padding: 0 7px; margin-left: 6px; }
.sign-who small { color: var(--muted); }
.sign-parties .case-pill { margin-left: auto; white-space: nowrap; }
.sign-parties .sg-progress .case-pill { color: var(--accent); border-color: rgba(31, 95, 191, .35); }
.sign-parties .sg-done .case-pill { color: #1b7a43; border-color: rgba(27, 122, 67, .35); }
.sign-download { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; box-sizing: border-box; margin-top: 16px; }
@media (max-width: 640px) { .sign-how { grid-template-columns: 1fr; } .sign-how li { flex-direction: row; align-items: center; } }
.case-ico { flex: none; }

/* Backoffice: Übersicht und Detailseite */
main:has(.bo-grid), main:has(.split) { max-width: 1100px; }
.bo-back { margin: 0 0 12px; font-size: .9rem; }
.bo-head { padding: 20px 22px; border: 1px solid var(--line); border-radius: 14px; background: var(--card); margin-bottom: 20px; }
.bo-head-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.bo-kicker { margin: 0; color: var(--muted); font: 600 .72rem/1.4 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; letter-spacing: .1em; text-transform: uppercase; }
.bo-head h1 { margin: 4px 0 2px; font-size: 1.6rem; letter-spacing: -.02em; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.bo-sub { margin: 0; color: var(--muted); }
.bo-head .case-phases { margin: 18px 0 14px; max-width: 520px; }
.bo-facts { list-style: none; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 0; padding: 14px 0 0; border-top: 1px solid var(--line); }
.bo-facts li { display: flex; flex-direction: column; gap: 3px; }
.bo-facts small { color: var(--muted); font-size: .74rem; text-transform: uppercase; letter-spacing: .06em; }
.bo-facts strong { font-size: 1.02rem; }
.bo-bar { display: block; height: 5px; border-radius: 3px; background: var(--line); overflow: hidden; margin-top: 4px; }
.bo-bar span { display: block; height: 100%; background: var(--accent); border-radius: 3px; }
.bo-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 20px; align-items: start; }
.bo-side { grid-column: 2; grid-row: 1; display: flex; flex-direction: column; gap: 16px; position: sticky; top: 16px; }
.bo-main { grid-column: 1; grid-row: 1; display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.bo-card { padding: 18px 20px; border: 1px solid var(--line); border-radius: 14px; background: var(--card); }
.bo-card > h2:first-child, .bo-card > form:first-child h2 { margin-top: 0; }
.bo-card h2 { font-size: .8rem; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); margin: 18px 0 10px; display: flex; align-items: center; gap: 8px; }
.bo-card h2:first-child { margin-top: 0; }
.bo-count { margin-left: auto; padding: 1px 9px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); font-size: .74rem; letter-spacing: 0; }
.bo-card h3 { font-size: .9rem; margin: 16px 0 8px; color: var(--muted); }
.bo-card ul.checklist { margin: 0; }
.bo-card textarea { width: 100%; box-sizing: border-box; }
.bo-card .btn.small { margin-top: 6px; }
.bo-card fieldset { border: 1px solid var(--line); border-radius: 12px; margin: 0 0 14px; padding: 12px 14px 14px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 14px; }
.bo-card fieldset legend { padding: 0 8px; font-weight: 600; color: var(--accent); }
.bo-card fieldset label { grid-column: auto; margin-top: 10px; font-size: .84rem; color: var(--muted); }
.bo-card fieldset input, .bo-card fieldset select { width: 100%; box-sizing: border-box; }
.bo-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.bo-row { display: grid; grid-template-columns: 46px minmax(0, 1.4fr) 210px 150px 112px; align-items: center; gap: 14px; padding: 12px 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--card); color: inherit; text-decoration: none; transition: border-color .15s, box-shadow .15s; }
.bo-row:hover { border-color: var(--accent); box-shadow: 0 6px 20px rgba(31, 95, 191, .10); }
.bo-row-main { display: flex; flex-direction: column; min-width: 0; }
.bo-row-main small, .bo-row-prog small, .bo-row-date { color: var(--muted); font-size: .78rem; }
.bo-row-prog { display: flex; flex-direction: column; }
.bo-row-date { white-space: nowrap; }
.bo-empty { color: var(--muted); }
@media (max-width: 900px) {
    .bo-grid { grid-template-columns: 1fr; }
    .bo-side, .bo-main { grid-column: 1; grid-row: auto; position: static; }
    .bo-row { grid-template-columns: 46px minmax(0, 1fr) auto; }
    .bo-row-prog, .bo-row-date { display: none; }
    .bo-card fieldset { grid-template-columns: 1fr; }
    .bo-facts { grid-template-columns: 1fr 1fr; }
}

.bo-field { display: flex; flex-direction: column; gap: 4px; margin-top: 10px; min-width: 0; }
.bo-card fieldset label { margin-top: 0; }

.bo-toolbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 4px 0 8px; }
.bo-toolbar form.inline { display: flex; align-items: center; gap: 10px; margin: 0; }
.bo-toolbar .btn.small { margin: 0; }

/* Brotkrumen */
nav.crumbs { margin: 0 0 14px; font-size: .84rem; }
nav.crumbs ol { list-style: none; display: flex; flex-wrap: wrap; align-items: center; gap: 2px 0; margin: 0; padding: 0; color: var(--muted); }
nav.crumbs li { display: inline-flex; align-items: center; }
nav.crumbs li + li::before { content: '›'; margin: 0 8px; color: var(--line); font-size: 1.1em; }
nav.crumbs a { color: var(--muted); text-decoration: none; }
nav.crumbs a:hover { color: var(--accent); text-decoration: underline; }
nav.crumbs [aria-current] { color: var(--fg); font-weight: 600; }

/* Superadmin */
.acting-bar { display: flex; justify-content: center; align-items: center; gap: 16px; padding: 8px 16px; background: #1c2330; color: #fff; font-size: .86rem; }
.acting-bar .link { color: #9cc2ff; }
.bo-row.super-row { grid-template-columns: 46px minmax(0, 1.2fr) minmax(0, 1fr) auto; }
.super-counts { display: flex; gap: 22px; }
.super-counts span { display: flex; flex-direction: column; align-items: center; }
.super-counts strong { font-size: 1.1rem; }
.super-counts small { color: var(--muted); font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; }
.super-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.super-actions form { margin: 0; }
.super-facts { list-style: none; margin: 0 0 10px; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.super-facts li { display: flex; flex-direction: column; }
.super-facts small { color: var(--muted); font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; }
.bo-two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.invite-sub { margin: 16px 0 0; }
@media (max-width: 900px) { .bo-row.super-row { grid-template-columns: 46px minmax(0, 1fr) auto; } .super-counts { display: none; } .bo-two { grid-template-columns: 1fr; } }
main:has(.super-row) { max-width: 900px; }
.super-counts { margin-right: 6px; }

/* Dauerhafter Zugangslink */
.access-card { margin: 0 0 16px; }
.access-card h2 { margin-top: 0; }
.access-card p { margin: 6px 0 12px; color: var(--muted); font-size: .92rem; line-height: 1.5; }
.access-hint { border-color: rgba(31, 95, 191, .35); background: linear-gradient(180deg, rgba(31, 95, 191, .06), transparent); }
.access-new { border-color: rgba(27, 122, 67, .45); }
.access-row { display: flex; gap: 10px; }
.access-row input { flex: 1; min-width: 0; font: .85rem ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.access-warn { color: #a15c00 !important; }
.access-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.access-actions form { margin: 0; }
.access-line { display: flex; flex-direction: column; gap: 2px; margin: 0 0 10px !important; color: var(--fg) !important; }
.access-line small { color: var(--muted); }
.access-min { margin: 0 0 10px; font-size: .84rem; }

/* Zugangslink im Gebrauch: eingeklappt auf eine Zeile */
details.access-collapsed { padding: 10px 16px; }
details.access-collapsed summary { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; cursor: pointer; list-style: none; font-size: .9rem; }
details.access-collapsed summary::-webkit-details-marker { display: none; }
details.access-collapsed summary::before { content: '›'; color: var(--muted); font-size: 1.2rem; line-height: 1; transition: transform .15s; }
details.access-collapsed[open] summary::before { transform: rotate(90deg); }
details.access-collapsed summary small { color: var(--muted); }
details.access-collapsed .access-actions { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }

/* Geführter Ablauf: Karte "Nächster Schritt" */
.guide { margin: 0 0 20px; border: 1px solid var(--line); border-left: 4px solid var(--accent); border-radius: 14px; background: var(--card); overflow: hidden; }
.guide-customer { border-left-color: #a15c00; }
.guide-none { border-left-color: var(--line); }
.guide-steps { list-style: none; display: grid; grid-template-columns: repeat(6, 1fr); margin: 0; padding: 14px 16px; background: var(--bg); border-bottom: 1px solid var(--line); }
.guide-steps li { position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; font-size: .72rem; color: var(--muted); }
.guide-steps li + li::before { content: ''; position: absolute; top: 12px; right: 50%; width: 100%; height: 2px; background: var(--line); z-index: 0; }
.guide-steps li.done + li::before, .guide-steps li.now::before { background: var(--accent); }
.guide-steps .n { position: relative; z-index: 1; display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--line); background: var(--card); font-weight: 700; font-size: .78rem; }
.guide-steps li.done .n { background: var(--accent); border-color: var(--accent); color: #fff; }
.guide-steps li.now .n { border-color: var(--accent); color: var(--accent); box-shadow: 0 0 0 4px rgba(31, 95, 191, .15); }
.guide-steps li.now .lbl { color: var(--fg); font-weight: 700; }
.guide-body { padding: 18px 20px 20px; }
.guide-body h2 { margin: 6px 0 6px; font-size: 1.3rem; letter-spacing: -.01em; text-transform: none; color: var(--fg); }
.guide-owner { margin: 0; }
.guide-customer .case-pill { color: #a15c00; border-color: rgba(161, 92, 0, .35); }
.guide-help { margin: 0 0 14px; color: var(--muted); line-height: 1.55; max-width: 62ch; }
.guide-checks { list-style: none; margin: 0 0 16px; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.guide-checks li { display: flex; gap: 10px; align-items: baseline; font-size: .92rem; }
.guide-checks .mark { width: 1.2em; text-align: center; flex: none; }
.guide-checks li.ok .mark { color: #1b7a43; font-weight: 700; }
.guide-checks li.todo { color: var(--fg); }
.guide-checks li.todo .mark { color: #a15c00; }
.guide-primary-row form { margin: 0; }
.btn.guide-primary { padding: 14px 26px; font-size: 1.05rem; }
.guide-more { margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--line); }
.guide-more summary { cursor: pointer; color: var(--muted); font-size: .9rem; }
.guide-more form { margin-top: 12px; }
.guide-more textarea { width: 100%; box-sizing: border-box; }
/* einklappbare Bereiche der Detailseite */
details.bo-fold > summary { list-style: none; cursor: pointer; display: flex; align-items: center; }
details.bo-fold > summary::-webkit-details-marker { display: none; }
details.bo-fold > summary h2 { margin: 0; flex: 1; }
details.bo-fold > summary::after { content: '›'; margin-left: 12px; color: var(--muted); font-size: 1.3rem; line-height: 1; transition: transform .15s; }
details.bo-fold[open] > summary::after { transform: rotate(90deg); }
details.bo-fold[open] > summary { margin-bottom: 14px; }
@media (max-width: 640px) { .guide-steps .lbl { display: none; } .guide-steps li.now .lbl { display: block; position: absolute; top: 34px; white-space: nowrap; } .guide-steps { padding-bottom: 30px; } }

/* Angebot: Zusammenfassung oben, Hacienda eingeklappt */
.quote-sum { display: grid; grid-template-columns: minmax(180px, auto) 1fr; gap: 22px; align-items: start; padding: 18px 20px; margin: 0 0 20px; border: 1px solid var(--line); border-radius: 14px; background: var(--card); }
.sum-total { display: flex; flex-direction: column; gap: 2px; }
.sum-total small { color: var(--muted); font-size: .76rem; text-transform: uppercase; letter-spacing: .06em; }
.sum-total strong { font-size: 2rem; letter-spacing: -.02em; }
.sum-head { margin: 0 0 6px; font-weight: 700; }
.sum-head.ok { color: #1b7a43; }
.sum-head.todo { color: #a15c00; }
.sum-state .guide-checks { margin-bottom: 12px; }
details.bo-fold-inline { margin: 18px 0; border: 1px solid var(--line); border-radius: 12px; padding: 12px 16px; background: var(--card); }
details.bo-fold-inline > summary { display: flex; align-items: center; gap: 12px; cursor: pointer; list-style: none; }
details.bo-fold-inline > summary::-webkit-details-marker { display: none; }
details.bo-fold-inline > summary h2 { margin: 0; flex: 1; font-size: 1rem; }
details.bo-fold-inline > summary::after { content: '›'; color: var(--muted); font-size: 1.3rem; transition: transform .15s; }
details.bo-fold-inline[open] > summary::after { transform: rotate(90deg); }
.hac-now { color: var(--muted); font-size: .9rem; }
details.bo-fold-inline[open] > summary { margin-bottom: 12px; }
@media (max-width: 640px) { .quote-sum { grid-template-columns: 1fr; } }

/* Liste "Zu erledigen" */
nav.chips .chip { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
nav.chips .chip.sub { padding-left: 28px; font-size: .88rem; }
nav.chips .cnt { min-width: 22px; padding: 1px 7px; border-radius: 999px; background: var(--bg); color: var(--muted); font-size: .74rem; font-weight: 700; text-align: center; }
nav.chips .chip.on .cnt { background: rgba(255, 255, 255, .25); color: #fff; }
details.chip-more { border-top: 1px solid var(--line); }
details.chip-more > summary { cursor: pointer; padding: 10px 14px; color: var(--muted); font-size: .85rem; list-style: none; }
details.chip-more > summary::-webkit-details-marker { display: none; }
details.chip-more > summary::before { content: '›'; margin-right: 8px; display: inline-block; transition: transform .15s; }
details.chip-more[open] > summary::before { transform: rotate(90deg); }
.bo-row-next { color: var(--accent); font-weight: 600; }
.bo-row-next.customer { color: #a15c00; }
.bo-row-next.none { color: var(--muted); font-weight: 400; }

/* Einrichtungs-Check und Hilfe */
details.setup-card { margin: 0 0 16px; border-color: rgba(161, 92, 0, .4); background: linear-gradient(180deg, rgba(161, 92, 0, .05), transparent); }
details.setup-card > summary { display: flex; flex-direction: column; gap: 8px; cursor: pointer; list-style: none; }
details.setup-card > summary::-webkit-details-marker { display: none; }
details.setup-card > summary small { margin-left: 10px; color: var(--muted); }
.setup-help { color: var(--muted); font-size: .9rem; margin: 12px 0; }
.setup-hint { display: block; color: var(--muted); }
.guide-helplink { margin: 14px 0 0; font-size: .86rem; }
.help-steps { list-style: none; margin: 0 0 24px; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.help-steps li { display: flex; gap: 16px; padding: 16px 18px; border: 1px solid var(--line); border-radius: 14px; background: var(--card); }
.help-n { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: 50%; background: var(--accent); color: #fff; font-weight: 700; }
.help-steps h2 { margin: 2px 0 6px; font-size: 1.05rem; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; text-transform: none; letter-spacing: 0; color: var(--fg); }
.help-steps p { margin: 0; color: var(--muted); line-height: 1.55; }
.help-glossary dt { font-weight: 700; margin-top: 12px; }
.help-glossary dd { margin: 2px 0 0; color: var(--muted); line-height: 1.5; }
main:has(.help-steps) { max-width: 760px; }

/* Einstellungen und Angebots-Editor im Kartenstil */
.bo-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 18px; }
.bo-field.span2 { grid-column: 1 / -1; }
.bo-field label { font-size: .84rem; color: var(--muted); font-weight: 600; }
.bo-field small { color: var(--muted); }
.bo-field input, .bo-field select, .bo-field textarea { width: 100%; box-sizing: border-box; }
.bo-field-inline { max-width: 320px; margin-bottom: 14px; }
.bo-save { margin: 16px 0 0; }
.set-help { margin: 0 0 14px; color: var(--muted); font-size: .9rem; line-height: 1.5; }
.set-nav { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.set-nav li + li { border-top: 1px solid var(--line); }
.set-nav a { display: block; padding: 9px 2px; text-decoration: none; color: var(--fg); font-size: .92rem; }
.set-nav a:hover { color: var(--accent); }
.bo-card table.items { width: 100%; border-collapse: collapse; margin: 6px 0 10px; }
.bo-card table.items th { text-align: left; padding: 8px 10px; background: var(--bg); color: var(--muted); font-size: .74rem; text-transform: uppercase; letter-spacing: .05em; border-bottom: 1px solid var(--line); }
.bo-card table.items td { padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.bo-card table.items td input, .bo-card table.items td select { width: 100%; box-sizing: border-box; }
.bo-card table.items tfoot td { font-weight: 600; border-bottom: 0; }
.bo-card table.items tfoot tr.sum td { font-size: 1.05rem; border-top: 2px solid var(--line); }
.bo-card table.items tr.needs td { background: rgba(179, 38, 30, .05); }
.bo-card table.items .num { text-align: right; }
.quote-form { display: flex; flex-direction: column; gap: 16px; }
.quote-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin: 0; padding: 14px 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--card); position: sticky; bottom: 12px; box-shadow: 0 6px 24px rgba(20, 30, 50, .08); }
.quote-actions .btn.send { margin-left: auto; padding: 12px 24px; }
main:has(.quote-form), main:has(.set-nav) { max-width: 1100px; }
main:has(.quote-form) { max-width: 880px; }
@media (max-width: 700px) { .bo-fields { grid-template-columns: 1fr; } .quote-actions .btn.send { margin-left: 0; } }
/* Breite trotz der älteren Regel für Seiten mit Tabellen (höhere Spezifität) */
main:has(.bo-grid):has(.bo-grid), main:has(.set-nav):has(.set-nav) { max-width: 1100px; }
main:has(.quote-form):has(.quote-form) { max-width: 880px; }

/* Mitarbeiter und Ansprechpartner */
.sign-parties li.is-off { opacity: .55; }
.sign-avatar { font-weight: 700; font-size: .85rem; }
.staff-add-title { margin: 22px 0 8px; font-size: .9rem; color: var(--muted); }
.handler-form { display: flex; align-items: center; gap: 8px; margin: 8px 0 0; font-size: .88rem; color: var(--muted); }
.handler-form select { padding: 4px 8px; font-size: .88rem; }
.contact-card { display: flex; align-items: center; gap: 14px; margin: 0 0 18px; padding: 14px 18px; border: 1px solid var(--line); border-radius: 14px; background: var(--card); }
.contact-card div { display: flex; flex-direction: column; }
.contact-card small { color: var(--muted); font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; }
.contact-card span:last-child { color: var(--muted); font-size: .88rem; }
.contact-avatar { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: 50%; background: var(--accent); color: #fff; font-weight: 700; }
.contact-avatar.small { width: 22px; height: 22px; font-size: .62rem; }
.case-contact { display: flex; align-items: center; gap: 8px; margin: 8px 0 0; color: var(--muted); font-size: .84rem; }

/* Statistik */
main:has(.stat-kpis):has(.stat-kpis) { max-width: 1000px; }
.stat-kpis { list-style: none; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin: 0 0 18px; padding: 0; }
.stat-kpis li { display: flex; flex-direction: column; gap: 2px; padding: 16px 18px; border: 1px solid var(--line); border-radius: 14px; background: var(--card); }
.stat-kpis small { color: var(--muted); font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; }
.stat-kpis strong { font-size: 2rem; letter-spacing: -.02em; }
.stat-kpis span { color: var(--muted); font-size: .8rem; }
.stat-kpis span.warn, td.warn { color: #a15c00; font-weight: 600; }
.stat-two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin: 16px 0; }
.stat-two .bo-card, .stat-kpis + .bo-card { margin-bottom: 0; }
main:has(.stat-kpis) .bo-card { margin-bottom: 16px; }
.chart { width: 100%; height: auto; display: block; }
.chart .ch-grid { stroke: var(--line); stroke-width: 1; }
.chart .ch-axis { fill: var(--muted); font: 11px system-ui, sans-serif; }
.chart .ch-label { font-size: 12px; fill: var(--fg); }
.chart .ch-val { fill: var(--fg); font: 600 11px system-ui, sans-serif; }
.chart .ch-a { fill: var(--accent); }
.chart .ch-b { fill: #1b7a43; }
.chart-legend { display: flex; gap: 6px; align-items: center; margin: 0 0 8px; color: var(--muted); font-size: .84rem; }
.chart-legend .lg { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-left: 12px; }
.chart-legend .lg:first-child { margin-left: 0; }
.chart-legend .lg.a { background: var(--accent); }
.chart-legend .lg.b { background: #1b7a43; }
.stat-table { margin-top: 18px; }
@media (max-width: 800px) { .stat-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } .stat-two { grid-template-columns: 1fr; } }

/* Hauptmenü: Karteireiter-Stil mit aktivem Punkt, Sprache als kleiner Umschalter, Abmelden abgesetzt */
header.top { padding: 10px max(16px, 2vw); box-shadow: 0 1px 0 var(--line), 0 6px 18px -14px rgba(20, 30, 50, .25); }
header.top .brand { font-size: 1.05rem; letter-spacing: -.01em; }
header.top nav.mainnav { gap: 4px; align-items: center; }
header.top nav.mainnav > a { text-decoration: none; color: var(--fg); padding: 7px 12px; border-radius: 999px; font-size: .92rem; font-weight: 500; line-height: 1.2; transition: background .15s, color .15s; }
header.top nav.mainnav > a:hover { background: color-mix(in srgb, var(--accent) 9%, transparent); color: var(--accent); }
header.top nav.mainnav > a.on { background: color-mix(in srgb, var(--accent) 13%, transparent); color: var(--accent); font-weight: 600; }
header.top .lang { gap: 2px; margin-right: 8px; padding: 2px; border: 1px solid var(--line); border-radius: 999px; }
header.top .lang a { padding: 3px 9px; border: 0; border-radius: 999px; font-size: .78rem; font-weight: 600; }
header.top .lang a.active { background: var(--accent); color: #fff; }
header.top form.logout { margin-left: 8px; padding-left: 12px; border-left: 1px solid var(--line); }
header.top form.logout button.link { min-height: 0; padding: 7px 10px; border-radius: 999px; color: var(--muted); font-size: .9rem; }
header.top form.logout button.link:hover { background: color-mix(in srgb, var(--err) 10%, transparent); color: var(--err); }
@media (max-width: 640px) { header.top nav.mainnav { justify-content: flex-start; } header.top form.logout { margin-left: 0; border-left: 0; padding-left: 0; } }

/* Diagramme wachsen ein, sobald sie sichtbar werden (app.js setzt .pre und dann .go; ohne Skript stehen sie fertig da) */
@media (prefers-reduced-motion: no-preference) {
    .chart.pre rect, .chart.pre text.ch-val, .chart.pre .ch-grid { opacity: 0; }
    .chart.go rect { transform-box: fill-box; animation: ch-up .7s cubic-bezier(.2, .8, .2, 1) both; animation-delay: var(--d, 0ms); transform-origin: 50% 100%; opacity: 1; }
    .chart.go.h rect { transform-origin: 0 50%; animation-name: ch-right; }
    .chart.go text.ch-val { animation: ch-fade .5s ease both; animation-delay: var(--d, 0ms); opacity: 1; }
    .chart.go .ch-grid { animation: ch-fade .4s ease both; opacity: 1; }
}
@keyframes ch-up { from { transform: scaleY(0); } to { transform: scaleY(1); } }
@keyframes ch-right { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes ch-fade { from { opacity: 0; } to { opacity: 1; } }

/* Ringdiagramm */
.chart.donut { width: 100%; max-width: 200px; height: auto; flex: none; }
.chart .ch-ring { stroke: var(--line); opacity: .5; }
.chart .ch-total { fill: var(--fg); font: 700 22px system-ui, sans-serif; dominant-baseline: middle; }
.chart circle.seg { stroke-linecap: butt; }
.ch-s0 { stroke: #2060c0; background: #2060c0; } .ch-s1 { stroke: #1b7a43; background: #1b7a43; } .ch-s2 { stroke: #d98a00; background: #d98a00; }
.ch-s3 { stroke: #8a4fc7; background: #8a4fc7; } .ch-s4 { stroke: #d1495b; background: #d1495b; } .ch-s5 { stroke: #5b6577; background: #5b6577; }
.donut-wrap { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; justify-content: center; padding: 6px 0 4px; }
.donut-legend { list-style: none; margin: 0; padding: 0; flex: 1 1 150px; display: grid; gap: 8px; }
.donut-legend li { display: flex; align-items: center; gap: 10px; font-size: .92rem; }
.donut-legend .dot { width: 11px; height: 11px; border-radius: 4px; flex: none; }
.donut-legend .lbl { flex: 1; }
@media (prefers-reduced-motion: no-preference) {
    .chart.pre circle.seg, .chart.pre .ch-total { opacity: 0; }
    .chart.go circle.seg { opacity: 1; animation: ch-draw .9s cubic-bezier(.2, .8, .2, 1) both; animation-delay: var(--d, 0ms); }
    .chart.go .ch-total { animation: ch-fade .6s ease .5s both; opacity: 1; }
}
@keyframes ch-draw { from { stroke-dasharray: 0 100; } to { stroke-dasharray: var(--l) var(--g); } }

/* Listenzeilen: blenden beim Scrollen ein (app.js setzt .pre und dann .go; ohne Skript stehen sie sofort da) */
.case-plate { white-space: nowrap; }
@media (prefers-reduced-motion: no-preference) {
    a.bo-row.pre { opacity: 0; transform: translateY(16px); }
    a.bo-row.pre.go { opacity: 1; transform: none; transition: opacity .45s ease, transform .5s cubic-bezier(.2, .8, .2, 1), border-color .15s, box-shadow .15s; }
    a.bo-row.pre .bo-bar span { transform: scaleX(0); transform-origin: 0 50%; }
    a.bo-row.pre.go .bo-bar span { transform: scaleX(1); transition: transform .8s cubic-bezier(.2, .8, .2, 1) .25s; }
}

/* Suche im Backoffice */
.bo-search { position: relative; display: flex; align-items: center; margin: 0 0 14px; }
.bo-search svg { position: absolute; left: 14px; color: var(--muted); pointer-events: none; }
.bo-search input[type=search] { width: 100%; margin: 0; padding: 12px 96px 12px 42px; border: 1px solid var(--line); border-radius: 14px; background: var(--card); color: var(--fg); font: inherit; transition: border-color .15s, box-shadow .15s; }
.bo-search input[type=search]:focus { outline: 0; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent); }
.bo-search-clear { position: absolute; right: 14px; font-size: .85rem; text-decoration: none; color: var(--muted); }
.bo-search-clear:hover { color: var(--accent); }
.bo-search-info { margin: 0 0 10px; color: var(--muted); font-size: .9rem; }

/* Dauerhafter Zugangslink: kleines Etikett neben dem Einladen-Knopf, Aktionen klappen darunter auf */
.access-chip { position: relative; }
.access-chip summary { display: inline-flex; align-items: center; gap: 8px; padding: 7px 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--card); font-size: .82rem; font-weight: 600; cursor: pointer; list-style: none; }
.access-chip summary::-webkit-details-marker { display: none; }
.access-chip summary:hover { border-color: var(--accent); }
.access-chip summary small { color: var(--muted); font-weight: 400; font-size: .76rem; }
.access-chip .dot { width: 8px; height: 8px; border-radius: 50%; background: #1b7a43; }
.access-pop { position: absolute; z-index: 20; top: calc(100% + 6px); left: 0; min-width: 240px; display: flex; flex-direction: column; gap: 8px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); box-shadow: 0 10px 30px rgba(20, 30, 50, .15); }
.access-pop p { margin: 0 0 2px; color: var(--muted); font-size: .8rem; }
.access-pop form { margin: 0; }
.access-pop .btn { width: 100%; }

/* Einladen-Knopf mit Symbol */
.btn.btn-invite { display: inline-flex; align-items: center; gap: 9px; padding: 10px 18px 10px 14px; border-radius: 999px; font-weight: 600; box-shadow: 0 6px 16px -6px rgba(31, 95, 191, .55), inset 0 1px 0 rgba(255, 255, 255, .18); transition: transform .12s, box-shadow .15s; }
.btn.btn-invite:hover { transform: translateY(-1px); box-shadow: 0 10px 20px -8px rgba(31, 95, 191, .6), inset 0 1px 0 rgba(255, 255, 255, .18); }
.btn.btn-invite:active { transform: none; }
.btn.btn-invite svg { flex: none; }

/* Titelzeile: Überschrift links, Zugangslink-Etikett daneben */
.bo-titlebar { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin: 0 0 6px; }
.bo-titlebar h1 { margin: 0; }
.bo-titlebar .access-pop { left: auto; right: auto; }

/* Einstellung: Sichtbarkeit der Halterwechsel */
.scope-opts { display: grid; gap: 10px; margin: 4px 0 6px; }
.scope-opt { display: flex; margin: 0; font-weight: 400; gap: 12px; align-items: flex-start; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; cursor: pointer; transition: border-color .15s, background .15s; }
.scope-opt:hover { border-color: var(--accent); }
.scope-opt:has(input:checked) { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 7%, transparent); }
.scope-opt input { width: 18px; height: 18px; flex: none; margin: 2px 0 0; padding: 0; }
.scope-opt span { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; text-align: left; }
.scope-opt small { color: var(--muted); font-size: .84rem; line-height: 1.4; }

/* Einladen-Knopf rechts auf der Höhe der Überschrift */
.bo-titlebar .title-action { margin-left: auto; }

/* Kundenliste */
.cust-list { display: grid; gap: 10px; }
.cust-row { display: grid; grid-template-columns: 46px minmax(0, 1fr) auto; align-items: center; gap: 14px; padding: 12px 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--card); transition: border-color .15s, box-shadow .15s; }
.cust-row:hover { border-color: var(--accent); box-shadow: 0 6px 20px rgba(31, 95, 191, .10); }
.cust-avatar { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 50%; background: color-mix(in srgb, var(--accent) 13%, transparent); color: var(--accent); font-weight: 700; font-size: .9rem; }
.cust-main { display: flex; flex-direction: column; min-width: 0; }
.cust-main small { color: var(--muted); font-size: .8rem; overflow-wrap: anywhere; }
.cust-cases a { color: var(--accent); text-decoration: none; font-weight: 600; }
.cust-cases a:hover { text-decoration: underline; }
.cust-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.cust-btn { display: inline-flex; align-items: center; gap: 7px; margin: 0; text-decoration: none; white-space: nowrap; border-radius: 999px; }
.cust-btn.wa:hover { border-color: #1b7a43; color: #1b7a43; }
.cust-btn.off { opacity: .4; cursor: not-allowed; }
@media (max-width: 700px) { .cust-row { grid-template-columns: 42px minmax(0, 1fr); } .cust-actions { grid-column: 1 / -1; justify-content: flex-start; } }

/* Kundendetail und anklickbare Zeilen der Kundenliste */
.cust-row { position: relative; }
.cust-link { color: inherit; text-decoration: none; }
.cust-link::after { content: ''; position: absolute; inset: 0; border-radius: 14px; }
.cust-row .cust-actions, .cust-row .cust-cases a { position: relative; z-index: 1; }
.cust-avatar.big { width: 56px; height: 56px; font-size: 1.1rem; }
.cust-head { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.cust-head .head-actions { margin-left: auto; }
.cust-cases-list { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 8px; }
.cust-cases-list a { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 14px; border: 1px solid var(--line); border-radius: 12px; color: inherit; text-decoration: none; transition: border-color .15s; }
.cust-cases-list a:hover { border-color: var(--accent); }
.cust-cases-list small { color: var(--muted); }
.cust-cases-list .when { margin-left: auto; }
.field-err { color: var(--err); }

/* Zugangslink im Menü des Etiketts: Feld mit Kopieren-Knopf */
.access-pop .access-link-label { margin: 4px 0 0; font-size: .78rem; font-weight: 600; color: var(--muted); }
.access-pop .access-row { display: flex; gap: 8px; }
.access-pop .access-row input { flex: 1; min-width: 0; margin: 0; padding: 7px 9px; font: .78rem ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.access-pop .access-row .btn { width: auto; flex: none; margin: 0; }
.access-chip .access-pop { min-width: min(420px, 86vw); }
