/* Gastro-Recherche – Basis-Stylesheet (ohne Build-Schritt, CSP-konform: keine Inline-Styles) */

:root {
    --bg: #f4f5f7;
    --surface: #ffffff;
    --text: #1f2933;
    --muted: #616e7c;
    --border: #d9dee4;
    --primary: #1f5f8b;
    --primary-dark: #174a6d;
    --ok-bg: #e3f4e8;
    --ok-text: #1e6b38;
    --warn-bg: #fff4d6;
    --warn-text: #7a5600;
    --error-bg: #fde8e8;
    --error-text: #9b1c1c;
    --radius: 6px;
    --shadow: 0 1px 2px rgba(16, 24, 40, 0.06);
}

* { box-sizing: border-box; }

html { font-size: 15px; }

body {
    margin: 0;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    line-height: 1.5;
    color: var(--text);
    background: var(--bg);
}

a { color: var(--primary); }
a:hover { color: var(--primary-dark); }

h1 { font-size: 1.6rem; margin: 0 0 1rem; }
h2 { font-size: 1.15rem; margin: 1.75rem 0 0.75rem; }

code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.9em;
    background: #eef1f4;
    padding: 0.05em 0.3em;
    border-radius: 3px;
}
code.small { font-size: 0.8em; background: none; padding: 0; color: var(--muted); }

pre.code {
    background: #eef1f4;
    padding: 0.75rem 1rem;
    border-radius: var(--radius);
    overflow-x: auto;
}

.muted { color: var(--muted); }
.hint { color: var(--muted); font-size: 0.87rem; margin: 0.25rem 0 0.75rem; }
.nowrap { white-space: nowrap; }
.inline { display: inline; }

/* Kopfzeile */
.topbar { background: #16324a; color: #fff; }
.topbar-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0.6rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}
.brand { color: #fff; font-weight: 600; text-decoration: none; font-size: 1.05rem; }
.brand:hover { color: #fff; }
.mainnav { display: flex; gap: 1rem; flex: 1; flex-wrap: wrap; }
.mainnav a { color: #c9d6e2; text-decoration: none; padding: 0.2rem 0; border-bottom: 2px solid transparent; }
.mainnav a:hover, .mainnav a.active { color: #fff; border-bottom-color: #7fb3d9; }
.usermenu { display: flex; align-items: center; gap: 1rem; font-size: 0.9rem; flex-wrap: wrap; }
.usermenu a, .usermenu .link-button { color: #c9d6e2; }
.usermenu a:hover, .usermenu .link-button:hover { color: #fff; }
.username { color: #fff; }

.container { max-width: 1200px; margin: 0 auto; padding: 1.5rem 1.25rem 3rem; }

/* Gast-Seiten (Login, Setup, Recovery, Fehler) */
.guest-main { margin: 3rem auto; padding: 0 1rem; }
.guest-main.narrow { max-width: 420px; }
.guest-main.wide { max-width: 860px; }
.guest-brand { text-align: center; font-weight: 600; font-size: 1.15rem; margin-bottom: 1rem; color: #16324a; }

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1.25rem 1.5rem;
    margin-bottom: 1rem;
}
.card-form { max-width: 560px; }

.error-card { text-align: center; }
.error-code { font-size: 2.5rem; font-weight: 700; color: var(--muted); margin: 0; }

.page-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.page-head h1 { margin: 0; }
.breadcrumb { font-size: 0.9rem; color: var(--muted); margin: 0 0 0.5rem; }

/* Formulare */
.form label { display: block; font-weight: 600; margin: 0.85rem 0 0.3rem; font-size: 0.93rem; }
.form label:first-of-type { margin-top: 0; }
.form input[type="text"],
.form input[type="password"],
.form select {
    width: 100%;
    padding: 0.5rem 0.65rem;
    font: inherit;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: #fff;
}
.form input:focus, .form select:focus { outline: 2px solid #7fb3d9; outline-offset: 1px; border-color: var(--primary); }
.form .button { margin-top: 1.1rem; }
.form-actions { display: flex; gap: 0.6rem; align-items: center; }

.button {
    display: inline-block;
    padding: 0.5rem 1rem;
    font: inherit;
    font-weight: 600;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: #fff;
    color: var(--text);
    text-decoration: none;
    cursor: pointer;
}
.button:hover { background: #f0f2f5; color: var(--text); }
.button-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.button-primary:hover { background: var(--primary-dark); color: #fff; }

.link-button {
    background: none;
    border: 0;
    padding: 0;
    font: inherit;
    color: var(--primary);
    cursor: pointer;
    text-decoration: underline;
}
.link-danger { color: var(--error-text); }

/* Meldungen */
.alert { padding: 0.7rem 1rem; border-radius: var(--radius); margin-bottom: 1rem; border: 1px solid transparent; }
.alert ul { margin: 0; padding-left: 1.2rem; }
.alert-success { background: var(--ok-bg); color: var(--ok-text); border-color: #b9e2c5; }
.alert-warning { background: var(--warn-bg); color: var(--warn-text); border-color: #f2dc9b; }
.alert-error { background: var(--error-bg); color: var(--error-text); border-color: #f5c2c2; }

.badge { display: inline-block; padding: 0.05rem 0.5rem; border-radius: 999px; font-size: 0.78rem; font-weight: 600; white-space: nowrap; }
.badge-ok { background: var(--ok-bg); color: var(--ok-text); }
.badge-warning { background: var(--warn-bg); color: var(--warn-text); }
.badge-error { background: var(--error-bg); color: var(--error-text); }
.badge-muted { background: #e6e9ed; color: var(--muted); }
.topbar .badge-muted { background: #2b4c69; color: #c9d6e2; }

/* Tabellen */
.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { text-align: left; padding: 0.55rem 0.8rem; border-bottom: 1px solid var(--border); vertical-align: top; }
.table th { background: #f8f9fb; font-size: 0.85rem; color: var(--muted); font-weight: 600; }
.table tbody tr:last-child td { border-bottom: 0; }
.table-compact th, .table-compact td { padding: 0.4rem 0.65rem; font-size: 0.9rem; }
.row-muted td { color: var(--muted); }
.actions { white-space: nowrap; }
.actions > * + * { margin-left: 0.75rem; }

.facts { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 0.35rem 1rem; margin: 0 0 1.25rem; font-size: 0.93rem; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }

.filterbar { display: flex; align-items: center; gap: 0.6rem; margin-bottom: 1rem; flex-wrap: wrap; }
.filterbar select { padding: 0.4rem 0.5rem; font: inherit; border: 1px solid var(--border); border-radius: var(--radius); }

.pagination { display: flex; gap: 1rem; align-items: center; justify-content: center; margin-top: 1rem; }
.pagination .disabled { color: var(--muted); }

/* Kacheln */

/* Geo-Stammdaten (M2) */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); border: 0; }
.filterbar input[type="search"] { padding: 0.4rem 0.6rem; font: inherit; border: 1px solid var(--border); border-radius: var(--radius); min-width: 16rem; }
.subnav { display: flex; gap: 1.25rem; margin: -0.25rem 0 1rem; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.subnav a { text-decoration: none; padding: 0.35rem 0; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.subnav a:hover, .subnav a.active { color: var(--primary); border-bottom-color: var(--primary); }
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 0.75rem; margin: 1rem 0; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 0.75rem 1rem; box-shadow: var(--shadow); }
.stat-value { display: block; font-size: 1.4rem; font-weight: 600; }
.stat-label { display: block; color: var(--muted); font-size: 0.85rem; }
.table th.num, .table td.num { text-align: right; white-space: nowrap; }
.plz-list { line-height: 1.9; }
.plz { display: inline-block; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.85rem; background: #eef1f4; border-radius: 3px; padding: 0 0.35rem; margin: 0 0.15rem 0.15rem 0; text-decoration: none; }
.plz:hover { background: #dfe7ef; }
.table td.indent { padding-left: 1.75rem; }
.text-error { color: var(--error-text); }

/* Betriebe (M3) */
.badge-info { background: #e1effa; color: #1f5f8b; }
.badge-category { background: #eef1f4; color: var(--text); font-weight: 500; }
.small-text { font-size: 0.82rem; }
.pre-line { white-space: pre-line; overflow-wrap: anywhere; }
.form-actions { flex-wrap: wrap; }
.business-form { max-width: 980px; }
.form-section { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); padding: 1rem 1.25rem 1.25rem; margin: 0 0 1rem; }
.form-section legend { font-weight: 600; padding: 0 0.4rem; }
.form-grid, .filter-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 0.75rem 1rem; }
.form-grid .span-2, .filter-grid .span-2, .detail-grid .span-2 { grid-column: span 2; }
.field label, .field .label { display: block; font-weight: 600; margin: 0 0 0.3rem; font-size: 0.9rem; }
.form .field label { margin-top: 0; }
.field input[type="text"], .field input[type="email"], .field input[type="search"], .field input[type="number"], .field input[type="date"], .field select, .field textarea,
.row-form input[type="text"], .row-form input[type="number"], .row-form select, .inline-form input[type="text"], .attribute-table input, .attribute-table select {
    width: 100%; padding: 0.45rem 0.6rem; font: inherit; border: 1px solid var(--border); border-radius: var(--radius); background: #fff;
}
.field textarea { resize: vertical; }
.checkbox-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 0.25rem 1rem; }
label.checkbox { display: flex; gap: 0.4rem; align-items: center; font-weight: normal; margin: 0.25rem 0; }
.hint-inline { font-weight: normal; color: var(--muted); }
.inline-input { display: flex; gap: 0.5rem; align-items: center; }
.inline-input input { flex: 1; }
.form .inline-input .button { margin-top: 0; }
.geo-picker { margin-bottom: 1rem; }
.geo-selected { padding: 0.5rem 0.75rem; background: #f8f9fb; border: 1px dashed var(--border); border-radius: var(--radius); }
.geo-derived { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 0.5rem 1.5rem; margin: 0; }
.geo-derived dt { font-size: 0.82rem; color: var(--muted); }
.geo-derived dd { margin: 0; }
.geo-selected .hint { margin-bottom: 0; }

/* Autovervollständigung (Combobox) */
.combobox { position: relative; }
.combobox input { width: 100%; }
.combobox-popup { position: absolute; z-index: 20; top: calc(100% + 2px); left: 0; right: 0; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: 0 6px 18px rgba(16, 24, 40, 0.14); max-height: 360px; overflow-y: auto; }
.combobox-list { list-style: none; margin: 0; padding: 0; }
.combobox-option { padding: 0.4rem 0.75rem; border-bottom: 1px solid var(--border); cursor: pointer; }
.combobox-option:last-child { border-bottom: 0; }
.combobox-option.is-active { background: #e1effa; }
.combobox-code { font-variant-numeric: tabular-nums; font-weight: 600; }
.combobox-context { color: var(--muted); }
.combobox-detail { display: block; color: var(--muted); font-size: 0.82rem; }
.combobox-message { margin: 0; padding: 0.45rem 0.75rem; color: var(--muted); font-size: 0.87rem; }
.combobox-message:empty { display: none; }
.field-narrow { max-width: 160px; }
.filters { padding: 1rem 1.25rem; }
.filter-more { margin-top: 0.75rem; }
.filter-more summary { cursor: pointer; color: var(--primary); font-weight: 600; }
.filter-more .filter-grid { margin-top: 0.75rem; }
.filter-actions { display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; margin-top: 1rem; }
.filter-actions select { padding: 0.4rem 0.5rem; font: inherit; border: 1px solid var(--border); border-radius: var(--radius); }
.filter-chip { margin: 0; padding: 0.45rem 0.6rem; background: #e1effa; border-radius: var(--radius); }
.filter-chip a { text-decoration: none; margin-left: 0.4rem; }
.status-cell .badge { margin-bottom: 0.15rem; }
.research-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 1rem; }
.detail-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 1rem; }
.detail-grid .card { margin-bottom: 0; }
/* Grid-Elemente nicht über den Viewport wachsen lassen (lange URLs/IDs brechen um, Tabellen scrollen in .table-wrap) */
.detail-grid > * { min-width: 0; }
#herkunft li { overflow-wrap: anywhere; }
section.card, section.detail-grid { margin-bottom: 1rem; scroll-margin-top: 1rem; }
section.card h2, .detail-grid h2 { margin-top: 0; }
.review-actions { display: flex; flex-direction: column; gap: 0.6rem; margin: 0.75rem 0; }
.review-actions form.inline { display: inline-block; margin-right: 0.5rem; }
.inline-form label { display: block; font-weight: 600; margin-bottom: 0.3rem; }
.review-decision { display: grid; grid-template-columns: 1fr auto 1fr; gap: 0.75rem; align-items: stretch; padding: 0.75rem; border: 1px solid var(--border); border-radius: var(--radius); background: #f8f9fb; }
.review-option { margin: 0; }
.review-option h3 { margin: 0 0 0.4rem; font-size: 1rem; }
.review-option label { display: block; font-size: 0.87rem; color: var(--muted); margin-bottom: 0.25rem; }
.review-option .hint { margin-bottom: 0; }
.review-or { align-self: center; color: var(--muted); font-size: 0.87rem; text-transform: uppercase; letter-spacing: 0.05em; }
@media (max-width: 860px) {
    .review-decision { grid-template-columns: 1fr; }
    .review-or { justify-self: start; }
}
.row-form { display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; }
.row-form input[type="text"] { flex: 1; min-width: 12rem; width: auto; }
.row-form .input-narrow, .row-form input.input-narrow { width: 7rem; flex: 0 0 auto; }
.row-form select { width: auto; }
.changes div { margin-bottom: 0.15rem; }
.changes del { color: var(--muted); }
.attribute-table td { vertical-align: middle; }
button:disabled { opacity: 0.5; cursor: not-allowed; }
@media (max-width: 700px) {
    .form-grid .span-2, .filter-grid .span-2, .detail-grid .span-2 { grid-column: auto; }
}

/* Importentscheidungen (M4b) */
.decision-box { border-left: 4px solid var(--warn-text); }
.decision-box-ready { border-left-color: var(--ok-text); }
.decision-list { margin: 0.5rem 0 1rem; padding-left: 1.2rem; }
.decision-form { padding: 0.6rem 0; border-top: 1px solid var(--border); }
.decision-form:first-of-type { border-top: 0; }
.decision-row h2 { font-size: 1.05rem; }
.choice-list { display: grid; gap: 0.25rem; margin: 0.4rem 0 0.6rem; }
.compare-table tr.cmp-equal td { background: var(--ok-bg); }
.compare-table tr.cmp-different td { background: var(--warn-bg); }
.compare-table tr.cmp-left_only td, .compare-table tr.cmp-right_only td { background: #f4f5f7; }

/* Schnellprüfmodus: kompakte Serienprüfung */
.button-danger { border-color: var(--error-text); color: var(--error-text); }
.button-danger:hover { background: var(--error-bg); color: var(--error-text); }
.quick-nav { display: flex; flex-wrap: wrap; gap: 0.6rem; align-items: center; margin-bottom: 0.75rem; }
.quick-nav-links { margin-left: auto; font-size: 0.9rem; }
.quick-case h1 { margin: 0 0 0.2rem; font-size: 1.5rem; }
.quick-head { display: flex; flex-wrap: wrap; gap: 1rem 2rem; justify-content: space-between; }
.quick-address { font-size: 1.1rem; margin: 0 0 0.4rem; }
.quick-contact { margin: 0; min-width: 16rem; }
.quick-note { margin: 0.6rem 0; }
.quick-decisions { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: flex-start; padding: 0.6rem 0; border-top: 1px solid var(--border); }
.quick-status { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; }
.quick-label { font-weight: 600; margin-right: 0.25rem; }
.quick-decisions details > summary { list-style: none; display: inline-block; }
.quick-decisions details > summary::-webkit-details-marker { display: none; }
.quick-panel { margin-top: 0.5rem; padding: 0.6rem; border: 1px solid var(--border); border-radius: var(--radius); background: #fafbfc; }
.quick-clarify { padding: 0.5rem 0; border-top: 1px solid var(--border); }
.quick-attributes { display: flex; flex-wrap: wrap; gap: 0.4rem; align-items: center; padding-top: 0.5rem; border-top: 1px solid var(--border); }
.quick-attributes details { flex-basis: 100%; }
.quick-attributes details > summary { list-style: none; display: inline-block; }
.quick-attributes details > summary::-webkit-details-marker { display: none; }
.quick-contact { align-self: flex-start; align-content: start; }
.quick-clarify input { padding: 0.45rem 0.6rem; border: 1px solid var(--border); border-radius: var(--radius); font: inherit; }
.quick-secondary { cursor: pointer; color: var(--primary); font-size: 0.93rem; }
.quick-secondary:hover { text-decoration: underline; }
.quick-attributes .attribute-table { width: auto; margin-bottom: 0.5rem; }
.quick-attributes .attribute-table td { padding: 0.3rem 0.6rem; border-bottom: 0; }
.quick-attributes .attribute-table input:not([type="checkbox"]), .quick-attributes .attribute-table select { min-width: 16rem; }
.quick-attributes label.checkbox { display: inline-flex; gap: 0.3rem; align-items: center; white-space: nowrap; }
.quick-exclude[open] { flex-basis: 100%; }
.quick-held form { margin-left: 0.5rem; }
.quick-attributes .table.attribute-table { width: auto; }
.quick-attributes label.checkbox input { width: auto; margin: 0; }

/* Navigationsleiste der Importzeile (admin/imports/row) */
.review-bar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 0.5rem 0.75rem; margin-bottom: 1rem; }
.review-bar-group { display: flex; flex-wrap: wrap; align-items: center; gap: 0.35rem; }
.review-bar-decide { justify-content: flex-end; margin-left: auto; }
.review-bar .button { display: inline-flex; align-items: center; justify-content: center; height: 2.4rem; padding: 0 0.6rem; line-height: 1; white-space: nowrap; }
.review-bar .button-round { width: 2.4rem; padding: 0; border-radius: 50%; font-size: 1.35rem; }
@media (max-width: 1100px) {
    .review-bar-decide { margin-left: 0; justify-content: flex-start; }
}

/* Gemeinsame Prüfleiste Detailseite/Schnellprüfung (review-bar.js): Recherche, Prüfaktionen, Betriebsstatus */
.review-toolbar { display: grid; gap: 0.5rem; margin-bottom: 1rem; padding: 0.6rem 0.75rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.review-toolbar-row { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem; min-width: 0; }
.review-toolbar-actions { padding-top: 0.5rem; border-top: 1px solid var(--border); }
.review-toolbar-status { padding-top: 0.5rem; border-top: 1px solid var(--border); }
.review-toolbar-spacer { flex: 1 1 0; }
.review-toolbar .button { display: inline-flex; align-items: center; justify-content: center; min-height: 2.4rem; padding: 0 0.7rem; line-height: 1.1; white-space: nowrap; }
.review-toolbar .button-complete { padding: 0 1.1rem; font-weight: 700; }
.review-toolbar-nav { display: inline-flex; gap: 0.35rem; }
.review-toolbar-note { font-weight: 600; padding: 0.35rem 0.7rem; border-radius: var(--radius); }
.review-toolbar-held { background: var(--warn-bg); color: var(--warn-text); }
.review-toolbar-done { background: var(--ok-bg); color: var(--ok-text); }
.review-toolbar-status-label { font-weight: 600; margin-right: 0.2rem; }
.segmented { display: inline-flex; flex-wrap: wrap; border: 1px solid var(--border); border-radius: 999px; overflow: hidden; background: #f8f9fb; }
.segment { font: inherit; font-size: 0.93rem; padding: 0.3rem 0.8rem; border: 0; border-left: 1px solid var(--border); background: transparent; color: var(--text); cursor: pointer; }
.segment:first-child { border-left: 0; }
.segment:hover { background: #eef1f4; }
.segment:focus-visible { outline: 2px solid var(--primary); outline-offset: -2px; }
.segment.is-current { background: var(--primary); color: #fff; font-weight: 600; }
.popover { position: relative; min-width: 0; }
.popover > summary { list-style: none; cursor: pointer; }
.popover > summary::-webkit-details-marker { display: none; }
.popover[open] > summary:not(.button-primary) { background: #eef1f4; }
.popover[open] > summary.button-primary { box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.45); }
.popover-panel { position: absolute; left: 0; top: calc(100% + 0.35rem); z-index: 20; width: min(24rem, calc(100vw - 2.5rem)); max-height: min(70vh, 34rem); overflow-y: auto;
    padding: 0.75rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: 0 6px 20px rgba(16, 24, 40, 0.15); }
.popover-wide .popover-panel, .popover-panel.popover-wide { width: min(36rem, calc(100vw - 2.5rem)); }
.popover-end .popover-panel { left: auto; right: 0; }
.popover-title { display: block; margin: 0 0 0.5rem; font-weight: 600; }
.popover-choices { list-style: none; margin: 0 0 0.6rem; padding: 0; display: grid; gap: 0.15rem; }
.popover-choices li { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; padding: 0.1rem 0.25rem; border-radius: var(--radius); }
.popover-choices li:hover { background: #f4f5f7; }
.popover-choices label.checkbox { display: inline-flex; gap: 0.4rem; align-items: center; }
.popover-choices input, .popover-primary input { width: auto; margin: 0; }
.popover-primary { display: inline-flex; gap: 0.2rem; align-items: center; color: var(--muted); font-size: 0.9rem; }
.popover-buttons { display: grid; gap: 0.35rem; }
.popover-buttons .button { width: 100%; }
.popover-panel textarea { width: 100%; }
.popover-panel .form-stack { display: grid; gap: 0.5rem; margin-bottom: 0.6rem; }
.popover-panel .hint { margin: 0.5rem 0 0; }
.popover-attributes { width: 100%; margin-bottom: 0.5rem; }
.popover-attributes td { padding: 0.3rem 0.4rem; border-bottom: 0; vertical-align: middle; }
.popover-attributes input:not([type="checkbox"]), .popover-attributes select { width: 100%; min-width: 0; }
.popover-attributes label.checkbox { display: inline-flex; gap: 0.3rem; align-items: center; white-space: nowrap; }
.popover-attributes label.checkbox input { width: auto; margin: 0; }
.review-note { margin: 0 0 0.75rem; padding: 0.45rem 0.75rem; background: var(--warn-bg); color: var(--warn-text); border-radius: var(--radius); overflow-wrap: anywhere; }
.review-note > summary { cursor: pointer; list-style: none; }
.review-note > summary::-webkit-details-marker { display: none; }
.review-note-more { white-space: nowrap; font-size: 0.9rem; }
.review-note-list { margin: 0.4rem 0 0.1rem; padding-left: 1.2rem; color: var(--text); }
.review-note-list li { margin: 0.15rem 0; }
.breadcrumb-quick { display: flex; flex-wrap: wrap; gap: 0.25rem 1rem; }
.breadcrumb-quick .breadcrumb-path { flex: 1 1 12rem; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.breadcrumb-quick .quick-back { white-space: nowrap; }
@media (max-width: 1100px) {
    .review-toolbar-spacer { flex-basis: 100%; height: 0; }
}
@media (max-width: 700px) {
    .breadcrumb-quick .quick-back { white-space: normal; }
    .popover { position: static; }
    .popover[open] { flex-basis: 100%; max-width: 100%; }
    .popover-panel, .popover-end .popover-panel { position: static; width: auto; max-height: none; margin-top: 0.4rem; }
    .review-toolbar-nav { margin-left: auto; }
    .segmented { border-radius: var(--radius); }
    .popover-panel { max-width: 100%; }
    .popover-attributes, .popover-attributes tbody { display: block; }
    .popover-attributes tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0.2rem 0.5rem; padding: 0.3rem 0; border-bottom: 1px solid var(--border); }
    .popover-attributes td { padding: 0; }
    .popover-attributes td:first-child { grid-column: 1 / -1; }
}

/* Betriebsliste: Filter werden sofort angewendet (list-filters.js) – „Anwenden“ nur ohne JavaScript */
.filters.is-auto .filter-apply { display: none; }
.review-bar-position { font-weight: 600; white-space: nowrap; padding: 0 0.25rem; }

/* Betriebsliste: Prüfstand der Auswahl (flache Leiste in der Filterkarte) */
.filter-stats { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem 0.6rem; margin-top: 0.85rem; padding-top: 0.75rem; border-top: 1px solid var(--border); }
.filter-stats-scope { margin-right: 0.4rem; }
.stat-chip { display: inline-flex; align-items: center; gap: 0.3rem; padding: 0.15rem 0.65rem; border-radius: 999px; border: 1px solid transparent; font-size: 0.93rem; text-decoration: none; color: var(--text); white-space: nowrap; }
.stat-chip:hover { border-color: var(--border); color: var(--text); }
.stat-chip-ok { background: var(--ok-bg); color: var(--ok-text); }
.stat-chip-muted { background: #eef0f3; }
.stat-chip-info { background: #e1effa; color: var(--primary-dark); }
.stat-chip-warning { background: var(--warn-bg); color: var(--warn-text); }
.stat-chip.is-active { border-color: currentColor; box-shadow: inset 0 0 0 1px currentColor; }
.filter-stats-progress { margin-left: auto; font-size: 0.9rem; }
.filter-stats-note { flex-basis: 100%; }

/* Recherche-Dashboard (Übersicht) */
.dashboard-kpis { display: flex; flex-wrap: wrap; align-items: center; gap: 0.45rem 0.6rem; padding: 0.85rem 1.25rem; }
.kpi-main { font-size: 1.05rem; color: var(--text); text-decoration: none; margin-right: 0.3rem; }
.kpi-main strong { font-size: 1.35rem; }
.kpi-main:hover { color: var(--primary); }
.kpi-label { font-size: 0.9rem; }
.kpi-secondary { margin-left: auto; font-size: 0.93rem; color: var(--muted); }
.kpi-secondary a { color: var(--muted); }
.dashboard-regions h2 { margin-bottom: 0.25rem; }
.dashboard-crumbs { font-size: 1rem; margin-bottom: 0.35rem; }
.region-summary { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 1.25rem; padding: 0.75rem 1rem; margin-bottom: 1rem;
    border: 1px solid var(--border); border-left: 4px solid var(--primary); border-radius: var(--radius); background: #f8f9fb; }
.region-summary h3 { margin: 0; font-size: 1.15rem; }
.region-summary p { margin: 0; }
.region-summary-stats { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem 0.55rem; flex: 1 1 24rem; }
.region-summary .button { margin-left: auto; }
.region-table tbody th, .region-table tfoot th { background: none; font-size: inherit; color: var(--text); font-weight: 600; }
.region-table tbody tr.row-muted th a { color: var(--muted); font-weight: 400; }
.region-table tfoot td, .region-table tfoot th { border-top: 2px solid var(--border); font-weight: 600; }
.region-table tr.is-selected th, .region-table tr.is-selected td { background: #e1effa; }
.dashboard-work { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; margin-top: 1rem; }
@media (max-width: 700px) {
    .kpi-secondary { margin-left: 0; flex-basis: 100%; }
    .region-summary .button { margin-left: 0; }
}

/* Dashboard-Karte (dashboard-map.js): Farbe = Prüffortschritt, nie Anzahl; „keine Daten“ eigener, schraffierter Zustand */
.region-layout.has-map { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 1.25rem; align-items: start; }
/* neben der Karte: kompakte Tabelle, damit alle Spalten ohne Scrollen sichtbar bleiben */
.region-layout.has-map .region-table th, .region-layout.has-map .region-table td { padding: 0.45rem 0.35rem; font-size: 0.88rem; }
.region-layout.has-map .region-table thead th { white-space: normal; }
.region-map { position: relative; margin: 0; }
.region-map-canvas { display: flex; justify-content: center; }
.map-svg { display: block; width: 100%; height: auto; max-height: 72vh; }
.map-area, .map-context, .map-outline { vector-effect: non-scaling-stroke; }
.map-area { stroke: #ffffff; stroke-width: 0.8px; stroke-linejoin: round; cursor: pointer; }
.map-none { fill: url(#map-hatch); }
.map-hatch-bg { fill: #f1f3f5; }
.map-hatch-line { stroke: #d3d8de; }
.map-q0 { fill: #dbe4ee; }
.map-q1 { fill: #9ec3e0; }
.map-q50 { fill: #4f8fc0; }
.map-q100 { fill: #1e5f8f; }
.map-clarify { fill: none; stroke: #c27c0e; pointer-events: none; }
.map-context { fill: #f4f5f7; stroke: #d0d5db; stroke-width: 0.6px; pointer-events: none; }
.map-outline { fill: none; stroke: #1f3b5a; stroke-width: 1.6px; pointer-events: none; }
.map-link { outline: none; }
.map-link.is-hover .map-area, .map-link:hover .map-area { stroke: #1f3b5a; stroke-width: 2px; }
.map-link:focus-visible .map-area { stroke: #111827; stroke-width: 3px; }
.map-link.is-selected .map-area { stroke: #b45309; stroke-width: 3px; }
.map-tooltip { position: absolute; z-index: 5; display: flex; flex-direction: column; gap: 0.05rem; max-width: 16rem; padding: 0.45rem 0.6rem;
    background: #fff; border: 1px solid var(--border); border-radius: var(--radius); box-shadow: 0 4px 14px rgba(16, 24, 40, 0.18); font-size: 0.88rem; pointer-events: none; }
.map-tooltip[hidden] { display: none; }
.region-map figcaption { margin-top: 0.5rem; font-size: 0.85rem; color: var(--muted); }
.map-legend-title, .map-legend-note { margin: 0.25rem 0; }
.map-legend { display: flex; flex-wrap: wrap; gap: 0.25rem 0.9rem; margin: 0.25rem 0; padding: 0; list-style: none; }
.map-legend li { display: inline-flex; align-items: center; gap: 0.35rem; }
.map-swatch { display: inline-block; width: 1rem; height: 0.8rem; border: 1px solid #c4cbd3; border-radius: 2px; }
.map-swatch.map-none { background: repeating-linear-gradient(45deg, #f1f3f5 0 3px, #d3d8de 3px 4px); }
.map-swatch.map-q0 { background: #dbe4ee; }
.map-swatch.map-q1 { background: #9ec3e0; }
.map-swatch.map-q50 { background: #4f8fc0; }
.map-swatch.map-q100 { background: #1e5f8f; }
.map-swatch-clarify { background: #fff; border: 2px dashed #c27c0e; }
.map-source { margin: 0.4rem 0 0; font-size: 0.78rem; overflow-wrap: anywhere; }
.map-source a { color: var(--muted); }
.region-table tr.is-hover th, .region-table tr.is-hover td { background: #eef4fa; }
@media (max-width: 1100px) {
    .region-layout.has-map { grid-template-columns: minmax(0, 1fr); }
    .map-svg { max-height: 60vh; }
}
