:root {
    /* Sigmatek CI: Dunkelblau 192B74, Blau 0B68B6, Grün AFC81A, Grau B3B9BD */
    --primary: #192b74;
    --primary-light: #0b68b6;
    --accent: #afc81a;
    --ci-grau: #b3b9bd;
    --bg: #f3f5f7;
    --card: #fff;
    --text: #1c2230;
    --muted: #6c7378;          /* aus CI-Grau abgedunkelt (lesbar) */
    --border: #dcdfe2;         /* CI-Grau, aufgehellt */
    --tint-blue: #e7f0f8;      /* CI-Blau, aufgehellt */
    --tint-blue-light: #f2f7fb;
    --tint-green: #f2f6dc;     /* CI-Grün, aufgehellt */
    --tint-grey: #eceeef;
    --green-text: #5c7300;     /* CI-Grün abgedunkelt für Text (Kontrast) */
    --kunde: #8aa514;          /* Status Kunde: CI-Grün (Punkte, Marker) */
    --lead: #0b68b6;           /* Status potenzieller Kunde: CI-Blau */
    --inaktiv: #9aa1a6;        /* Status inaktiv: CI-Grau */
    --error: #b3261e;
    --success: #5c7300;
    --primary-text: #192b74;   /* Dunkelblau als Schriftfarbe (im Dunkelmodus aufgehellt) */
    --btn-hover: #0b68b6;
    --input-bg: #fff;
    --hover-grey: #dcdfe2;
    --badge-text: #444;
    --comment-text: #3a4150;
    --group-bg: #e4e7f2;
    --warn-text: #b26a00;
    --warn-bg: #fff8e1;
    --warn-bg-strong: #fff3e0;
    --warn-border: #ef6c00;
    --error-bg: #fce8e6;
    --error-bg-light: #fff5f5;
    --internal-bg: #fffaf0;
    --logo-hell: block;        /* Logo-Variante je Farbschema (Anmeldeseite) */
    --logo-dunkel: none;
    --globe-filter: none;      /* Globus „Standard-Sprache“ */
    --overlay: rgba(16, 24, 48, 0.55);   /* Hintergrund hinter dem PDF-Fenster (halbtransparent) */
    --overlay-panel: rgba(255, 255, 255, 0.82);
    color-scheme: light;
}

/* Dunkelmodus: Settings → Darstellung „Dunkel“ oder „System“ bei dunkler Einstellung von Windows/Browser */
:root[data-theme="dunkel"] {
    --primary: #1f3a8f;
    --primary-light: #5ba3dc;
    --bg: #12161f;
    --card: #1b212c;
    --text: #e3e7ec;
    --muted: #9aa3ab;
    --border: #2e3643;
    --tint-blue: #1a2c45;
    --tint-blue-light: #172233;
    --tint-green: #26301a;
    --tint-grey: #262d38;
    --green-text: #b5cf4a;
    --kunde: #9cbc1a;
    --lead: #3d8fd6;
    --inaktiv: #7a8288;
    --error: #f28b82;
    --success: #b5cf4a;
    --primary-text: #8fb8ea;
    --btn-hover: #0b68b6;
    --input-bg: #11151d;
    --hover-grey: #313946;
    --badge-text: #c9ced4;
    --comment-text: #c3c9d0;
    --group-bg: #232c4d;
    --warn-text: #f0b54d;
    --warn-bg: #33290f;
    --warn-bg-strong: #3a2a14;
    --warn-border: #b26a00;
    --error-bg: #3b1f1e;
    --error-bg-light: #2f1a1a;
    --internal-bg: #2b2614;
    --logo-hell: none;
    --logo-dunkel: block;
    --globe-filter: invert(1) brightness(1.4);
    --overlay: rgba(0, 0, 0, 0.6);
    --overlay-panel: rgba(27, 33, 44, 0.85);
    color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
    :root[data-theme="system"] {
        --primary: #1f3a8f;
        --primary-light: #5ba3dc;
        --bg: #12161f;
        --card: #1b212c;
        --text: #e3e7ec;
        --muted: #9aa3ab;
        --border: #2e3643;
        --tint-blue: #1a2c45;
        --tint-blue-light: #172233;
        --tint-green: #26301a;
        --tint-grey: #262d38;
        --green-text: #b5cf4a;
        --kunde: #9cbc1a;
        --lead: #3d8fd6;
        --inaktiv: #7a8288;
        --error: #f28b82;
        --success: #b5cf4a;
        --primary-text: #8fb8ea;
        --btn-hover: #0b68b6;
        --input-bg: #11151d;
        --hover-grey: #313946;
        --badge-text: #c9ced4;
        --comment-text: #c3c9d0;
        --group-bg: #232c4d;
        --warn-text: #f0b54d;
        --warn-bg: #33290f;
        --warn-bg-strong: #3a2a14;
        --warn-border: #b26a00;
        --error-bg: #3b1f1e;
        --error-bg-light: #2f1a1a;
        --internal-bg: #2b2614;
        --logo-hell: none;
        --logo-dunkel: block;
        --globe-filter: invert(1) brightness(1.4);
        --overlay: rgba(0, 0, 0, 0.6);
        --overlay-panel: rgba(27, 33, 44, 0.85);
        color-scheme: dark;
    }
}
/* Eingabefelder, Karten-Popups und Textfelder folgen dem Farbschema */
input, select, textarea { color: var(--text); }
.leaflet-popup-content-wrapper, .leaflet-popup-tip { background: var(--card); color: var(--text); }

* { box-sizing: border-box; }

html, body {
    height: 100%;
    margin: 0;
    font-family: "OfficinaSansEF", "Officina Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
    font-size: 15px;
    color: var(--text);
    background: var(--bg);
}

body { display: flex; flex-direction: column; }

a { color: var(--primary-light); }

/* --- Kopfzeile ------------------------------------------------------------ */
.topbar {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: 0 1rem;
    height: 48px;
    flex-shrink: 0;
    background: var(--primary);
    color: #fff;
}
.topbar .brand { color: #fff; font-weight: 700; font-size: 1.1rem; text-decoration: none; white-space: nowrap; flex-shrink: 0; display: inline-flex; align-items: center; }
.topbar .brand img { display: block; height: 30px; width: auto; }
.topbar nav { display: flex; gap: 0.25rem; overflow-x: auto; scrollbar-width: none; }
.topbar nav a { white-space: nowrap; }
.topbar nav a {
    color: #d6e2f2;
    text-decoration: none;
    padding: 0.4rem 0.75rem;
    border-radius: 4px;
}
.topbar nav a:hover, .topbar nav a.active { background: rgba(255, 255, 255, 0.15); color: #fff; }
.topbar .user { margin-left: auto; display: flex; align-items: center; gap: 0.75rem; font-size: 0.9rem; }
.topbar .user form { margin: 0; }
.topbar .link { color: #d6e2f2; }

/* --- Allgemeine Elemente -------------------------------------------------- */
main { padding: 1.5rem; }
.page-narrow main { max-width: 420px; margin: 3rem auto; width: 100%; }
.page-wide main { max-width: 1200px; margin: 0 auto; width: 100%; }

h1 { font-size: 1.5rem; margin: 0 0 1rem; }
h2 { font-size: 1.2rem; margin: 0 0 0.75rem; }
h3 { font-size: 1rem; margin: 1rem 0 0.5rem; }

.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1.25rem;
    margin-bottom: 1rem;
}
.card > h3:first-child { margin-top: 0; }

.form { display: flex; flex-direction: column; gap: 0.9rem; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); align-items: end; }
.form label, label.block { display: flex; flex-direction: column; gap: 0.3rem; font-weight: 600; font-size: 0.9rem; }
.form small, label small { font-weight: 400; color: var(--muted); }

input, select, button { font: inherit; }
input[type=text], input[type=email], input[type=password], input[type=search], input:not([type]), select,
input[type=tel], input[type=date], input[type=number], input[type=url] {
    padding: 0.5rem 0.6rem;
    border: 1px solid var(--border);
    border-radius: 5px;
    background: var(--input-bg);
    width: 100%;
}

.btn {
    padding: 0.55rem 1.1rem;
    border: 0;
    border-radius: 5px;
    background: var(--primary);
    color: #fff;
    cursor: pointer;
    font-weight: 600;
}
.btn:hover { background: var(--btn-hover); }
.btn:disabled { opacity: 0.6; cursor: wait; }
.btn-secondary { background: var(--tint-grey); color: var(--text); }
.btn-secondary:hover { background: var(--hover-grey); }
.link { background: none; border: 0; padding: 0; color: var(--primary-light); cursor: pointer; text-decoration: underline; }

.flash { padding: 0.7rem 1rem; margin: 0.75rem 1.5rem 0; border-radius: 5px; }
main .flash { margin: 0 0 1rem; }
.flash-success { background: var(--tint-green); color: var(--success); }
.flash-error { background: var(--error-bg); color: var(--error); }
.flash-info { background: var(--tint-blue); color: var(--primary-text); }

.hint { color: var(--muted); font-size: 0.88rem; }
details.hint { margin-top: 1rem; }
details.hint summary { cursor: pointer; }

.table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.table th, .table td { text-align: left; padding: 0.45rem 0.5rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table th { color: var(--muted); font-weight: 600; }
.table tr.muted td { color: var(--muted); }
.table .actions { display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; }
.table .actions form { margin: 0; }
.table .actions form.inline { display: flex; gap: 0.4rem; align-items: center; }
.table .actions input { width: 150px; padding: 0.3rem 0.4rem; }

/* --- Import ----------------------------------------------------------------- */
.stats { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-bottom: 1rem; }
.stat {
    flex: 1 1 120px;
    padding: 0.75rem;
    border-radius: 6px;
    background: var(--bg);
    font-size: 0.85rem;
    color: var(--muted);
}
.stat span { display: block; font-size: 1.6rem; font-weight: 700; color: var(--text); }
.stat-new span { color: var(--green-text); }
.stat-changed span { color: var(--lead); }
.stat-missing span { color: var(--warn-text); }
.stat-skipped span { color: var(--error); }
.actions-row { display: flex; gap: 0.75rem; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 0 1rem; }
.name-list { margin: 0; padding-left: 1.2rem; max-height: 320px; overflow: auto; }
.name-list small { color: var(--muted); }

/* --- Karte ------------------------------------------------------------------- */
.page-map { overflow: hidden; }
.page-map > .flash { margin-bottom: 0.75rem; }
.map-layout { flex: 1; display: flex; min-height: 0; }
.sidebar {
    width: 290px;
    flex-shrink: 0;
    padding: 1rem;
    overflow-y: auto;
    background: var(--card);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 1rem;
}
.sidebar fieldset { border: 0; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 0.35rem; }
.sidebar legend { font-weight: 600; font-size: 0.9rem; margin-bottom: 0.3rem; }
.sidebar fieldset label { display: flex; align-items: center; gap: 0.4rem; cursor: pointer; }
.count { margin: 0; font-weight: 600; }
#map { flex: 1; padding: 0; }

.dot { display: inline-block; width: 12px; height: 12px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 1px #ccc; }
.dot-kunde { background: var(--kunde); }
.dot-lead { background: var(--lead); }
.dot-inaktiv { background: var(--inaktiv); }

.sidebar label.check { display: flex; align-items: center; gap: 0.4rem; font-size: 0.9rem; margin-top: -0.4rem; cursor: pointer; }
.legend { list-style: none; margin: -0.5rem 0 0; padding: 0; font-size: 0.85rem; display: flex; flex-direction: column; gap: 0.2rem; }
.legend li { display: flex; align-items: center; gap: 0.4rem; cursor: default; }
.swatch { display: inline-block; width: 14px; height: 14px; border-radius: 3px; opacity: 0.8; }

.ranges { display: flex; flex-wrap: wrap; gap: 0.3rem; }
.range { background: var(--bg); border-radius: 4px; padding: 1px 6px; font-size: 0.8rem; white-space: nowrap; }
.range-form { display: flex; align-items: center; gap: 0.5rem; margin: 0; }
.range-form select { width: auto; min-width: 180px; padding: 0.25rem 0.4rem; }
.color-form input[type=color] { width: 36px; height: 28px; padding: 0; border: 1px solid var(--border); border-radius: 4px; cursor: pointer; }

.geocode-panel { background: var(--warn-bg); border-radius: 6px; padding: 0.75rem; font-size: 0.9rem; }
.geocode-panel p { margin: 0 0 0.5rem; }
.geocode-panel progress { width: 100%; }

/* Popup */
.popup h3 { margin: 0 0 0.4rem; font-size: 1rem; }
.popup p { margin: 0.5rem 0; }
.popup .details { border-collapse: collapse; font-size: 0.85rem; width: 100%; }
.popup .details th { text-align: left; color: var(--muted); font-weight: 500; padding: 2px 8px 2px 0; vertical-align: top; white-space: nowrap; }
.popup .details td { padding: 2px 0; }
.popup .description { font-size: 0.85rem; background: var(--bg); padding: 0.5rem; border-radius: 4px; max-height: 120px; overflow: auto; }
.cockpit-hero { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1rem; }
.cockpit-figure { display: flex; flex-direction: column; gap: 0.25rem; padding: 1rem; background: var(--bg); border-radius: 8px; }
.cockpit-acquired { background: var(--tint-green); }
.cockpit-label { font-weight: 600; color: var(--muted); }
.cockpit-value { font-size: 2rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.cockpit-note { grid-column: 1 / -1; margin: 0; }
.row-self td { background: var(--tint-blue-light); }
.table tfoot th { border-top: 2px solid var(--border); }
.chart-box.chart-box-tall { height: 340px; }
.change { font-weight: 600; white-space: nowrap; font-variant-numeric: tabular-nums; }
.change.change-up { color: var(--green-text); }
.change.change-down { color: var(--error); }
.change.change-none { color: var(--muted); font-weight: 400; }
.stat span.change { display: inline; font-size: inherit; }
.customer-years { font-size: 0.88rem; }
.customer-years .muted-value { color: var(--ci-grau); }
.chart-box { position: relative; height: 280px; margin: 0.5rem 0 1rem; }
.revenue-table { font-size: 0.8rem; }
.revenue-table td { white-space: nowrap; }
.revenue-table td.negative { color: var(--error); }
.popup-umsatz { background: var(--tint-green); border-radius: 4px; padding: 0.4rem 0.5rem; font-size: 0.85rem; }
.badge { display: inline-block; font-size: 0.75rem; padding: 2px 8px; border-radius: 10px; background: var(--tint-grey); color: var(--badge-text); margin-right: 4px; }
.badge-kunde { background: var(--tint-green); color: var(--green-text); }
.badge-lead { background: var(--tint-blue); color: var(--lead); }
.badge-inaktiv { background: var(--tint-grey); color: var(--muted); }

/* --- Accounts-Liste ------------------------------------------------------------ */
.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.page-head h1 { margin-bottom: 0.4rem; }
.filter-bar { display: flex; flex-wrap: wrap; gap: 0.6rem; align-items: center; padding: 0.9rem 1rem; }
.filter-bar input[type=search] { flex: 1 1 260px; width: auto; }
.filter-bar select { width: auto; max-width: 220px; }
.filter-bar .check { display: flex; align-items: center; gap: 0.35rem; font-size: 0.9rem; white-space: nowrap; }
.table-scroll { overflow-x: auto; }
.table-hover tbody tr { cursor: pointer; }
.table-hover tbody tr:hover td { background: var(--tint-blue-light); }
.table th a { color: inherit; text-decoration: none; white-space: nowrap; }
.table th a:hover { text-decoration: underline; }
.table td a { color: var(--text); text-decoration: none; }
.nowrap { white-space: nowrap; }
.pagination { display: flex; gap: 0.75rem; justify-content: center; margin-top: 1rem; }
.pagination a { text-decoration: none; }

/* --- Account-Detail ------------------------------------------------------------ */
.breadcrumb { margin: 0 0 0.5rem; font-size: 0.9rem; }
.breadcrumb a { text-decoration: none; }
.account-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr); gap: 1rem; align-items: start; }
.fields { display: grid; grid-template-columns: 180px 1fr; gap: 0.45rem 1rem; margin: 0; }
.fields dt { color: var(--muted); font-size: 0.9rem; }
.fields dd { margin: 0; word-break: break-word; }
.fields-compact { grid-template-columns: 110px 1fr; font-size: 0.9rem; }
.description-full { margin: 0; line-height: 1.5; }
.lock { color: var(--warn-text); font-size: 0.7rem; margin-left: 0.3rem; vertical-align: middle; cursor: help; }
.mini-map { height: 240px; border-radius: 6px; margin-bottom: 0.5rem; }
.mini-map.group-map { height: 340px; }
.pre-line { white-space: pre-line; margin: 0; }
.contact-description { margin-top: 0.45rem; }
.cat-icon { cursor: help; }
.file-icon { cursor: default; }
#dateien form.form .btn { align-self: flex-start; } /* Upload-Knopf nicht über die volle Kartenbreite */
.contact-filter { margin: 0 0 0.6rem; } /* auch Aktivitäten-Filter der Company-Seite */
.contact-filter select { width: auto; max-width: 240px; }
.totp-qr { margin: 0.6rem 0; width: 180px; padding: 8px; background: #fff; }
.totp-qr img, .totp-qr canvas { display: block; }
.setup-steps { padding-left: 1.2rem; margin: 0 0 0.8rem; }
.setup-steps li { margin-bottom: 0.6rem; }
.recovery-codes { list-style: none; padding: 0; margin: 0.5rem 0 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 0.3rem; }
.recovery-codes code { font-size: 1rem; letter-spacing: 0.05em; }
.flag-list { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.3rem 1.5rem; }
.flag-list li.on { font-weight: 600; }
.flag-list li.muted { color: var(--muted); }
.field-group { border: 0; padding: 0; margin: 0 0 1rem; }
.field-group legend { font-weight: 700; margin-bottom: 0.6rem; font-size: 1rem; }
.field-group .form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0.8rem; align-items: end; }
.field-group label { display: flex; flex-direction: column; gap: 0.3rem; font-weight: 600; font-size: 0.9rem; }
.field-group label.check { flex-direction: row; align-items: center; gap: 0.4rem; font-weight: 500; }
.span-all { grid-column: 1 / -1; }
textarea { font: inherit; padding: 0.5rem 0.6rem; border: 1px solid var(--border); border-radius: 5px; width: 100%; resize: vertical; background: var(--input-bg); }
.history { list-style: none; margin: 0; padding: 0; font-size: 0.88rem; max-height: 420px; overflow: auto; }
.history li { padding: 0.45rem 0; border-bottom: 1px solid var(--border); }
.history-meta { color: var(--muted); font-size: 0.8rem; }
.history del { color: var(--muted); }

/* --- Kontakte -------------------------------------------------------------------- */
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: 0.5rem; }
.card-head h2 { margin: 0; }
.btn-small { padding: 0.3rem 0.75rem; font-size: 0.85rem; text-decoration: none; }
.contact-list { list-style: none; margin: 0; padding: 0; }
.contact-list li { display: flex; justify-content: space-between; gap: 1rem; padding: 0.6rem 0; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.contact-list li:last-child { border-bottom: 0; }
.contact-list li.muted { opacity: 0.6; }
.contact-list li[hidden], .more-contacts > summary[hidden] { display: none; } /* hidden-Attribut gegen display: flex durchsetzen */
.contact-list a { text-decoration: none; }
.contact-list .hint { margin-top: 0.15rem; }
.contact-reach { display: flex; flex-direction: column; align-items: flex-end; font-size: 0.88rem; gap: 0.1rem; }

/* --- Aktivitäten ----------------------------------------------------------------- */
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { display: flex; gap: 0.75rem; padding: 0.7rem 0; border-bottom: 1px solid var(--border); }
.timeline li:last-child { border-bottom: 0; }
.timeline-icon { flex-shrink: 0; width: 2rem; height: 2rem; border-radius: 50%; background: var(--bg); display: flex; align-items: center; justify-content: center; font-size: 1rem; }
.timeline-body { min-width: 0; flex: 1; }
.timeline-meta { font-size: 0.82rem; color: var(--muted); }
.timeline-meta a { color: var(--muted); }
.timeline-subject { font-weight: 600; color: var(--text); text-decoration: none; }
.timeline-subject:hover { text-decoration: underline; }
.timeline-comment { font-size: 0.88rem; margin-top: 0.25rem; color: var(--comment-text); overflow-wrap: anywhere; }
.table input.input-icon { width: 3.2rem; text-align: center; padding: 0.25rem; }
.table input.input-small { width: 5rem; padding: 0.25rem 0.4rem; }
.more-contacts summary { cursor: pointer; color: var(--primary-light); padding: 0.5rem 0; font-size: 0.9rem; }
#job progress, form[data-chunk-upload] progress { width: 100%; height: 0.9rem; }
.activity-comment { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 0.92rem; line-height: 1.5; max-height: 70vh; overflow: auto;
                    background: var(--bg); padding: 0.9rem; border-radius: 6px; margin: 0; font-family: inherit; }

/* --- Opportunities -------------------------------------------------------------- */
.org-form { display: flex; gap: 0.4rem; align-items: center; }
.org-form input { width: 120px; padding: 0.25rem 0.4rem; }
.org-form select { width: auto; padding: 0.25rem 0.4rem; }
.org-form { flex-wrap: wrap; }
.badge-warn { background: var(--warn-bg-strong); color: var(--warn-text); }
.table .num { text-align: right; }
.entry-form textarea { margin-bottom: 0.5rem; }
.entry-options { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem 1.2rem; font-size: 0.9rem; }
.entry-options .check { display: flex; align-items: center; gap: 0.35rem; font-weight: 500; }
.entry-options input[type=date] { width: auto; padding: 0.25rem 0.4rem; }
.entries { list-style: none; margin: 1rem 0 0; padding: 0; }
.entries li { padding: 0.75rem 0; border-top: 1px solid var(--border); }
.entries li.entry-internal { background: var(--internal-bg); padding-left: 0.6rem; border-left: 3px solid #f0b54d; }
.entry-text { margin-top: 0.3rem; line-height: 1.5; overflow-wrap: anywhere; }
.file-list { list-style: none; margin: 0 0 1rem; padding: 0; }
.file-list li { padding: 0.5rem 0; border-bottom: 1px solid var(--border); overflow-wrap: anywhere; }
.file-list form.inline { display: inline; }

/* --- Bericht ------------------------------------------------------------------------ */
/* volle Fensterbreite, kompakte Filter und Kennzahlen – Platz für die Tabelle */
.page-report main { max-width: none; padding: 1rem 1.25rem; }
.page-report .page-head { margin-bottom: 0.6rem; }
.page-report .page-head h1 { margin-bottom: 0; }
.page-report .filter-bar { padding: 0.6rem 0.8rem; gap: 0.5rem; margin-bottom: 0.6rem; }
.page-report .filter-bar select { max-width: 170px; padding-top: 0.3rem; padding-bottom: 0.3rem; }
.page-report .filter-bar input[type=date] { width: auto; padding-top: 0.3rem; padding-bottom: 0.3rem; }
.page-report .report-summary { padding: 0.6rem 0.8rem; margin-bottom: 0.6rem; }
.page-report .report-summary .stats { margin-bottom: 0; gap: 0.5rem; }
.page-report .report-summary .stat { flex: 0 1 auto; padding: 0.35rem 0.8rem; font-size: 0.82rem; }
.page-report .report-summary .stat span { display: inline; font-size: 1.05rem; margin-right: 0.35rem; }
.page-report .report-group { padding: 0.8rem; }
.page-report .report-group h2 { font-size: 1.05rem; margin-bottom: 0.4rem; }

.report-table { font-size: 0.84rem; }
.report-table th, .report-table td { vertical-align: top; padding: 0.4rem 0.45rem; }
.report-table th { font-size: 0.78rem; line-height: 1.25; background: var(--card); }
.report-table .col-summary { width: 16%; }
.report-table .col-history { width: 30%; }
.report-entry { margin-bottom: 0.45rem; line-height: 1.35; overflow-wrap: anywhere; }
.report-entry:last-child { margin-bottom: 0; }
.print-only { display: none; }

/* breite Bildschirme: Tabelle passt ohne seitliches Scrollen, Kopfzeile bleibt beim Scrollen sichtbar */
@media screen and (min-width: 1100px) {
    .page-report .table-scroll { overflow: visible; }
    .page-report .report-table thead th { position: sticky; top: 0; z-index: 1; box-shadow: inset 0 -1px 0 var(--border); }
}

@media print {
    @page { size: A4 landscape; margin: 10mm; }
    body, .page-report { background: #fff; font-size: 8.5pt; overflow: visible; }
    .topbar, .no-print, .flash { display: none !important; }
    .print-only { display: block; }
    main { padding: 0 !important; max-width: none !important; }
    .card { border: 0; padding: 0; margin: 0 0 6mm; break-inside: auto; }
    .report-summary .stat { padding: 2mm; }
    .report-summary .stat span { font-size: 11pt; }
    .table-scroll { overflow: visible; }
    .report-table { font-size: 7.5pt; }
    .report-table th, .report-table td { padding: 1.2mm 1.5mm; }
    .report-table tr { break-inside: avoid; }
    .report-table thead { display: table-header-group; }
    .report-group h2 { break-after: avoid; font-size: 11pt; }
    .report-table .col-history { min-width: 0; max-width: none; width: 30%; }
    a { color: inherit; text-decoration: none; }
    .badge { border: 1px solid #ccc; }
}

/* --- Schmale Bildschirme ------------------------------------------------------ */
@media (max-width: 720px) {
    .topbar { gap: 0.75rem; }
    .topbar .user { font-size: 0; }
    .topbar .user .link { font-size: 0.85rem; }
    .topbar .user a.user-link .icon { width: 1.4rem; height: 1.4rem; } /* Zahnrad zu den Settings bleibt sichtbar (Name ausgeblendet) */
    .map-layout { flex-direction: column; }
    .sidebar { width: auto; max-height: 40vh; border-right: 0; border-bottom: 1px solid var(--border); }
    #map { min-height: 60vh; }
    main { padding: 1rem; }
    .account-grid { grid-template-columns: 1fr; }
    .fields { grid-template-columns: 1fr; gap: 0.1rem; }
    .fields dd { margin-bottom: 0.5rem; }
    .contact-reach { align-items: flex-start; }
}

/* Werkbank / Aufgaben */
.nav-count { display: inline-block; min-width: 1.2em; padding: 0 5px; margin-left: 2px; border-radius: 9px; background: #e53935; color: #fff; font-size: 0.72rem; font-weight: 700; text-align: center; line-height: 1.5; }
.tabs { display: flex; gap: 0.25rem; border-bottom: 1px solid var(--border); margin-bottom: 1rem; flex-wrap: wrap; }
.tabs a { padding: 0.5rem 0.9rem; text-decoration: none; color: var(--muted); border-bottom: 3px solid transparent; margin-bottom: -1px; }
.tabs a.active { color: var(--primary-text); border-bottom-color: var(--primary-text); font-weight: 600; }
.tab-count { font-size: 0.8rem; background: var(--tint-grey); border-radius: 9px; padding: 0 6px; margin-left: 2px; }
.task-group h2 { margin-top: 0; }
.task-group-ueberfaellig h2 { color: var(--error); }
.task-list { list-style: none; margin: 0; padding: 0; }
.task { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; padding: 0.7rem 0; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.task:last-child { border-bottom: 0; }
.task-main { flex: 1 1 320px; min-width: 0; }
.task-title a { text-decoration: none; }
.task-icon { margin-right: 0.3rem; }
.task-meta { display: flex; flex-wrap: wrap; gap: 0.3rem 0.8rem; margin-top: 0.25rem; font-size: 0.9rem; }
.task-meta a { text-decoration: none; }
.task-desc { margin-top: 0.3rem; font-size: 0.9rem; color: var(--comment-text); }
.task-done .task-title { text-decoration: line-through; opacity: 0.65; }
.badge-overdue { background: var(--error-bg); color: var(--error); font-weight: 600; }
.task-actions { display: flex; flex-direction: column; align-items: flex-end; gap: 0.35rem; }
.task-complete summary { list-style: none; cursor: pointer; }
.task-complete summary::-webkit-details-marker { display: none; }
.task-complete[open] summary { margin-bottom: 0.4rem; }
.task-complete-form { display: flex; flex-direction: column; gap: 0.4rem; width: min(320px, 80vw); }
.task-complete-form textarea { width: 100%; }
.task-postpone { display: flex; gap: 0.6rem; font-size: 0.85rem; }
@media (max-width: 640px) { .task-actions { align-items: flex-start; } }
.form label.check, .task-complete-form label.check { flex-direction: row; align-items: center; gap: 0.4rem; font-weight: 500; display: flex; }

/* Reiseplanung */
.nav-count[hidden] { display: none; }
.nav-count-list { background: #ef6c00; }
.col-check { width: 2.2rem; white-space: nowrap; }
[data-reiseliste].in-list { background: var(--warn-bg-strong); color: var(--warn-text); border-color: var(--warn-border); }
.place-choice { border: 1px solid var(--border); border-radius: 6px; padding: 0.5rem 0.75rem; display: flex; flex-direction: column; gap: 0.35rem; }
.place-choice legend { font-weight: 600; font-size: 0.9rem; }
.place-choice label.check { flex-direction: row; align-items: center; gap: 0.4rem; font-weight: 500; display: flex; flex-wrap: wrap; }
.place-choice input[type=text], .place-choice input:not([type]) { flex: 1; min-width: 200px; }
.plain-list { list-style: none; margin: 0; padding: 0; }
.plain-list li { padding: 0.5rem 0; border-bottom: 1px solid var(--border); }
.plain-list li:last-child { border-bottom: 0; }
.trip-map { height: 440px; border-radius: 8px; margin-bottom: 1rem; border: 1px solid var(--border); }
.trip-marker-wrap { background: none; border: 0; }
.trip-marker { display: flex; align-items: center; justify-content: center; width: 26px; height: 26px; border-radius: 50%; color: #fff; font-weight: 700; font-size: 0.8rem; border: 2px solid #fff; box-shadow: 0 1px 4px rgba(0, 0, 0, 0.4); }
.trip-marker-start, .trip-marker-hotel { background: #fff; color: #333; font-size: 0.9rem; }
.trip-num { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; border-radius: 50%; color: #fff; font-weight: 700; font-size: 0.8rem; }
.trip-leg { margin: 0.4rem 0; }
.trip-table select { max-width: 220px; }
.trip-contact { font-size: 0.85rem; display: flex; flex-direction: column; margin-top: 0.2rem; }
.trip-contact a { text-decoration: none; }
.trip-late td { background: var(--warn-bg); }
.negative { color: var(--error); }
.trip-hotel { background: var(--tint-blue-light); border-radius: 6px; padding: 0.5rem 0.75rem; margin-top: 0.4rem; }
.trip-hotel p { margin: 0.25rem 0; }
.form-inline { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-top: 0.4rem; }
.form-inline input { flex: 1; min-width: 180px; }
.print-only { display: none; }
@media print {
    .topbar, .no-print, .flash { display: none !important; }
    .print-only { display: inline; }
    .trip-map { height: 360px; break-inside: avoid; }
    .trip-day { break-inside: avoid; box-shadow: none; }
}
.time-choice { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem 1rem; } .time-choice label.check { flex-direction: row; align-items: center; gap: 0.35rem; font-weight: 500; display: flex; } .time-choice input[type=time] { width: auto; }
.drag-handle { cursor: grab; color: var(--muted); font-size: 1.1rem; padding: 0 0.3rem 0 0; user-select: none; touch-action: none; }
.drag-ghost { opacity: 0.4; background: var(--tint-blue); }
.trip-newday { border: 2px dashed var(--border); box-shadow: none; }
.trip-newday .drop-hint td { color: var(--muted); text-align: center; padding: 0.9rem; }
.fixed-time { display: inline-flex; align-items: center; gap: 0.2rem; font-size: 0.8rem; margin-top: 0.25rem; }
.fixed-time input { font-size: 0.8rem; padding: 1px 3px; width: 6.5rem; }
.small-link { font-size: 0.8rem; text-decoration: none; }
body.is-saving { cursor: progress; opacity: 0.7; }
.fixed-time { display: flex; width: fit-content; }
.badge-group { background: var(--group-bg); color: var(--primary-text); text-decoration: none; }
.inline-form { display: block; margin-top: 0.15rem; }
/* Akkordeon-Karten (z. B. Company-Seite) */
details.accordion > summary { list-style: none; cursor: pointer; margin-bottom: 0; }
details.accordion > summary::-webkit-details-marker { display: none; }
details.accordion > summary h2::before { content: '▸'; display: inline-block; width: 1.1em; color: var(--muted); transition: transform 0.15s; }
details.accordion[open] > summary h2::before { transform: rotate(90deg); }
details.accordion[open] > summary { margin-bottom: 0.75rem; }
/* Company-Seite kompakt: Feldgruppen in einer Karte, engere Abstände */
.company-compact { grid-template-columns: minmax(0, 1fr); gap: 0; }
.company-compact .card { padding: 0.8rem 1rem; margin-bottom: 0.6rem; }
.company-compact h2 { font-size: 1.05rem; margin-bottom: 0.4rem; }
.company-compact .card-head { margin-bottom: 0.3rem; }
.company-compact details.accordion[open] > summary { margin-bottom: 0.4rem; }
.company-compact .fields { gap: 0.2rem 1rem; }
.field-sheet .description-full { margin: 0; max-height: 15em; overflow-y: auto; padding-right: 0.5rem; } /* höchstens 10 Zeilen (Zeilenhöhe 1.5), dann scrollen */
.status-flags { display: flex; flex-wrap: wrap; gap: 0.3rem 2rem; }
/* Ungültige Eingabe (z. B. E-Mail) schon beim Tippen markieren */
.field-group input:user-invalid { border-color: var(--error); background: var(--error-bg-light); }
/* Oben zwei Spalten (50/50): Stammdaten | Adresse + Konditionen; weitere Gruppen über die volle Breite */
.field-sheet { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: 1.5rem; align-items: start; }
.field-sheet > section { grid-column: 1 / -1; }
.field-sheet > section, .sheet-col > section + section, .sheet-col:nth-child(n+3) { border-top: 1px solid var(--border); margin-top: 0.6rem; padding-top: 0.6rem; }
@media (max-width: 720px) {
    .field-sheet { grid-template-columns: minmax(0, 1fr); }
    .sheet-col + .sheet-col { border-top: 1px solid var(--border); margin-top: 0.6rem; padding-top: 0.6rem; }
}

/* Icons, Flaggen, Login */
.icon { width: 1.2em; height: 1.2em; vertical-align: -0.2em; flex-shrink: 0; }
.flag { width: 2.1rem; height: 1.4rem; object-fit: cover; border-radius: 3px; box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.15); display: block; }
.login-card { max-width: 360px; margin: 3rem auto; }
.login-brand { display: flex; flex-direction: column; align-items: center; gap: 0.4rem; color: var(--primary-text); font-weight: 700; font-size: 1.15rem; margin-bottom: 1.2rem; }
.login-brand .icon { width: 3rem; height: 3rem; }
.login-brand img { display: block; width: 220px; max-width: 100%; height: auto; }
.login-brand img.logo-hell { display: var(--logo-hell); }
.login-brand img.logo-dunkel { display: var(--logo-dunkel); }
.login-form { display: flex; flex-direction: column; gap: 0.8rem; }
.input-icon { display: flex; align-items: center; gap: 0.6rem; border: 1px solid var(--border); border-radius: 6px; padding: 0 0.7rem; background: var(--input-bg); color: var(--muted); }
.input-icon:focus-within { border-color: var(--primary-light); box-shadow: 0 0 0 2px rgba(11, 104, 182, 0.15); }
.input-icon input { border: 0; outline: none; flex: 1; padding: 0.65rem 0; font-size: 1rem; background: transparent; }
.lang-choice { display: flex; justify-content: center; gap: 0.6rem; border: 0; padding: 0; margin: 0.2rem 0; }
.lang-choice label { cursor: pointer; padding: 4px; border-radius: 6px; border: 2px solid transparent; }
.lang-choice input { position: absolute; opacity: 0; pointer-events: none; }
.lang-choice label:has(input:checked) { border-color: var(--primary-light); background: var(--tint-blue); }
.lang-choice label:has(input:focus-visible) { outline: 2px solid var(--primary-light); }
.lang-choice .flag[src$="default.svg"] { object-fit: contain; box-shadow: none; filter: var(--globe-filter); }
.login-actions { display: flex; justify-content: space-between; align-items: center; }
.icon-link { color: var(--muted); padding: 0.4rem; border-radius: 6px; display: inline-flex; }
.icon-link:hover { color: var(--primary-text); background: var(--tint-blue); }
.icon-link .icon, .btn-icon .icon { width: 1.5rem; height: 1.5rem; }
.btn-icon { display: inline-flex; align-items: center; justify-content: center; padding: 0.55rem 1.6rem; }
.topbar .user a.user-link { color: #fff; text-decoration: none; display: inline-flex; align-items: center; gap: 0.35rem; }
.topbar .user .link.icon-only { color: #fff; text-decoration: none; display: inline-flex; padding: 0.2rem; }
.lang-choice-left { justify-content: flex-start; flex-wrap: wrap; } .lang-option { display: flex !important; flex-direction: column; align-items: center; gap: 0.25rem; font-size: 0.8rem; font-weight: 500; min-width: 5rem; text-align: center; }
.topbar .user a.user-link span { white-space: nowrap; }
.theme-choice { border: 0; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem; }
.theme-choice label.check { flex-direction: row; align-items: center; gap: 0.4rem; font-weight: 500; }

/* --- Handy: größere Schrift und Bedienelemente (Fingertipp ca. 44 px) -------------------------------- */
@media (max-width: 720px) {
    html, body { font-size: 17px; }
    input[type=text], input[type=email], input[type=password], input[type=search], input:not([type]), select, textarea,
    .field-group input[type=tel], .field-group input[type=date], input[type=date], input[type=time], input[type=number] {
        font-size: 16px;            /* ab 16 px zoomt iOS beim Antippen nicht mehr hinein */
        min-height: 44px;
    }
    input[type=date], input[type=time], input[type=number] {
        padding: 0.5rem 0.6rem; border: 1px solid var(--border); border-radius: 5px; background: var(--input-bg);
    }
    .input-icon input { font-size: 16px; }
    .btn { min-height: 44px; padding: 0.6rem 1.1rem; }
    .btn-small { min-height: 40px; padding: 0.45rem 0.9rem; font-size: 0.9rem; display: inline-flex; align-items: center; }
    input[type=checkbox], input[type=radio] { width: 1.25rem; height: 1.25rem; flex-shrink: 0; }
    label.check, .filter-bar .check, .sidebar fieldset label, .sidebar label.check { min-height: 40px; font-size: 1rem; }
    .topbar { height: 52px; }
    .topbar nav a { padding: 0.6rem 0.8rem; }
    .topbar .user .link.icon-only, .topbar .user a.user-link { padding: 0.45rem; }
    .topbar .user .link.icon-only .icon { width: 1.4rem; height: 1.4rem; }
    .table { font-size: 0.95rem; }
    .table th, .table td { padding: 0.6rem 0.5rem; }
    .contact-list li, .timeline li, .task, .file-list li, .plain-list li { padding-top: 0.8rem; padding-bottom: 0.8rem; }
    .hint, .history-meta, .timeline-meta, .badge { font-size: 0.85rem; }
    .fields dt { font-size: 0.85rem; }
    details.accordion > summary { padding: 0.3rem 0; }
    .card-head { flex-wrap: wrap; }
    .page-head .actions-row, .actions-row { flex-wrap: wrap; }
    .tabs a { padding: 0.65rem 0.9rem; }
    .breadcrumb a, .pagination a { display: inline-block; padding: 0.35rem 0; }
    input, select, textarea { max-width: 100%; }
    .task-postpone { gap: 1.2rem; font-size: 0.95rem; }
    .task-postpone a, .task-postpone button { display: inline-block; padding: 0.45rem 0; }
}

/* --- Handy-Menü: Knopf ☰ oben links öffnet alle Menüpunkte als große Zeilen (Laptop: Leiste wie bisher) --- */
.nav-toggle { display: none; }
@media (max-width: 720px) {
    .nav-toggle {
        display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
        width: 44px; height: 44px; margin-left: -0.4rem; padding: 0; border: 0; border-radius: 6px;
        background: none; color: #fff; cursor: pointer;
    }
    .nav-toggle:hover, .nav-open .nav-toggle { background: rgba(255, 255, 255, 0.15); }
    .nav-toggle .icon { width: 1.7rem; height: 1.7rem; }
    .nav-toggle .icon:last-child, .nav-open .nav-toggle .icon:first-child { display: none; }
    .nav-open .nav-toggle .icon:last-child { display: block; }
    .topbar { gap: 0.5rem; }
    .topbar nav {
        display: none; position: fixed; top: 52px; left: 0; right: 0; bottom: 0; z-index: 2000; /* über der Karte */
        flex-direction: column; gap: 0; overflow-y: auto; background: var(--card); padding: 0.4rem 0 2rem;
    }
    .nav-open .topbar nav { display: flex; }
    .nav-open body { overflow: hidden; }
    .topbar nav a {
        display: flex; align-items: center; justify-content: space-between; min-height: 56px;
        padding: 0.8rem 1.25rem; border-radius: 0; border-bottom: 1px solid var(--border);
        color: var(--text); font-size: 1.15rem; font-weight: 500;
    }
    .topbar nav a:hover { background: var(--tint-blue-light); color: var(--text); }
    .topbar nav a.active { background: var(--tint-blue); color: var(--primary-text); font-weight: 700; box-shadow: inset 4px 0 0 var(--primary-light); }
    .topbar nav .nav-count { font-size: 0.85rem; padding: 0 8px; }
}

/* --- Karte: Filterleiste ein-/ausklappen ------------------------------------------------------------ */
.sidebar-head { display: flex; align-items: center; justify-content: space-between; gap: 0.6rem; }
.sidebar-head .count { font-size: 0.9rem; text-align: right; }
.sidebar-body { display: flex; flex-direction: column; gap: 1rem; }
.sidebar-toggle {
    display: inline-flex; align-items: center; gap: 0.4rem; flex-shrink: 0; min-height: 40px; padding: 0.4rem 0.75rem;
    border: 0; border-radius: 6px; background: var(--tint-blue); color: var(--primary-text); font-weight: 600; cursor: pointer;
}
.sidebar-toggle:hover { background: var(--tint-blue-light); box-shadow: inset 0 0 0 1px var(--primary-light); }
.sidebar-toggle .icon:last-child { transition: transform 0.15s; transform: rotate(90deg); }
.sidebar.collapsed .sidebar-toggle .icon:last-child { transform: rotate(0deg); }
.sidebar.collapsed .sidebar-body { display: none; }
/* Laptop zugeklappt: schmaler Streifen mit Filter-Symbol, Karte wird breiter */
@media (min-width: 721px) {
    .sidebar { transition: width 0.15s; }
    .sidebar.collapsed { width: 60px; padding: 0.6rem 0.4rem; align-items: center; }
    .sidebar.collapsed .sidebar-head { flex-direction: column; }
    .sidebar.collapsed .sidebar-toggle { flex-direction: column; padding: 0.5rem; }
    .sidebar.collapsed .sidebar-toggle span, .sidebar.collapsed .count { display: none; }
}
/* Handy zugeklappt: nur die Leiste „Filter“ mit Anzahl, die Karte nutzt den restlichen Bildschirm */
@media (max-width: 720px) {
    .sidebar { max-height: 50vh; }
    #map { min-height: 0; } /* Karte füllt den Platz unter der Filterleiste (Seite scrollt nicht) */
    .sidebar.collapsed { max-height: none; padding: 0.5rem 1rem; overflow: visible; }
    .sidebar-toggle { min-height: 44px; font-size: 1rem; }
}
.user-table tbody tr[hidden] { display: none; }
.user-filter { padding: 0 0 0.8rem; }
.user-table .flag { display: inline-block; width: 1.3rem; height: 0.85rem; margin-left: 0.3rem; vertical-align: -0.05em; }
.user-table tbody tr { cursor: pointer; }

/* --- Detailseiten: Kopf in einer Zeile („‹ Companies“ · Name · Badges · Knöpfe) ------------------------------ */
@media (min-width: 721px) {
    main:has(> .breadcrumb + .page-head) {
        display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: 1rem; align-content: start;
    }
    main:has(> .breadcrumb + .page-head) > * { grid-column: 1 / -1; }
    main:has(> .breadcrumb + .page-head) > .breadcrumb {
        grid-column: 1; align-self: start; padding-top: 0.45rem; margin: 0 0 1rem; padding-right: 1rem; border-right: 1px solid var(--border);
        white-space: nowrap; font-size: 0.95rem;
    }
    main:has(> .breadcrumb + .page-head) > .breadcrumb + .page-head { grid-column: 2; align-items: flex-start; flex-wrap: nowrap; }
    main:has(> .breadcrumb + .page-head) > .page-head > div:first-child { flex: 1 1 auto; min-width: 0; }
    main:has(> .breadcrumb + .page-head) > .page-head > .actions-row,
    main:has(> .breadcrumb + .page-head) > .page-head > form { flex: 0 0 auto; }
    .page-head h1 { display: inline; margin: 0 0.6rem 0 0; vertical-align: middle; }
    .page-head h1 + .badge, .page-head h1 ~ .badge { vertical-align: middle; }
    .page-head > div:first-child { display: flex; flex-wrap: wrap; align-items: center; gap: 0.3rem; }
    .page-head > div:first-child > .hint { flex-basis: 100%; margin: 0.2rem 0 0; }
}

/* --- Akkordeons: lange Listen scrollen innerhalb des Akkordeons (Höhe = 10 Einträge, gesetzt von common.js) --- */
.list-scroll { overflow-y: auto; overscroll-behavior: contain; }
.list-scroll thead th { position: sticky; top: 0; z-index: 1; background: var(--card); }
.field-sheet .sheet-col > section.sheet-status { border-top: 0; margin-top: 0.4rem; padding-top: 0; } /* Status ohne Überschrift und Linie */

/* --- Company bearbeiten: wie die Ansicht (field-sheet), Feldname links, Eingabe rechts --------------------------- */
.edit-sheet { margin: 0; }
.edit-fields { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0.3rem; }
.edit-fields-wide { grid-template-columns: repeat(auto-fit, minmax(360px, 1fr)); column-gap: 1.5rem; }
.edit-sheet .edit-row { display: grid; grid-template-columns: 180px minmax(0, 1fr); align-items: center; gap: 1rem; font-weight: 400; }
.edit-sheet .edit-row > span:first-child { color: var(--muted); font-size: 0.9rem; }
.edit-sheet .edit-row input:not([type=checkbox]), .edit-sheet .edit-row select { padding: 0.32rem 0.5rem; }
.edit-sheet .status-flags label.check { font-weight: 400; }
.edit-sheet .edit-row-top { align-items: start; }
.edit-sheet .edit-row-top > span:first-child { padding-top: 0.35rem; }
.edit-sheet > .grid-2 { gap: 0.3rem 2rem; }
.edit-sheet .edit-row input[type=checkbox] { justify-self: start; }
.edit-section h2 { margin: 0.4rem 0 0.5rem; padding-top: 0.7rem; border-top: 1px solid var(--border); font-size: 1rem; }
@media (max-width: 720px) { .edit-sheet .edit-row { grid-template-columns: minmax(0, 1fr); gap: 0.2rem; } }

/* --- Listen: Suchfeld immer sichtbar, Filter aufklappbar (common.js, .filter-collapsible) --------------------- */
.filter-bar.filter-collapsible { flex-direction: column; align-items: stretch; gap: 0.6rem; }
.filter-main { display: flex; gap: 0.5rem; align-items: center; }
.filter-main input[type=search] { flex: 1 1 auto; width: auto; }
.filter-toggle {
    display: inline-flex; align-items: center; gap: 0.35rem; flex-shrink: 0; min-height: 40px; padding: 0.4rem 0.7rem;
    border: 0; border-radius: 6px; background: var(--tint-blue); color: var(--primary-text); cursor: pointer;
}
.filter-toggle:hover { box-shadow: inset 0 0 0 1px var(--primary-light); }
.filter-toggle .icon:last-child { transition: transform 0.15s; transform: rotate(90deg); }
.filter-collapsible.collapsed .filter-toggle .icon:last-child { transform: rotate(0deg); }
.filter-count { min-width: 1.3rem; padding: 0 0.35rem; border-radius: 9px; background: var(--primary-light); color: #fff; font-size: 0.75rem; font-weight: 700; text-align: center; line-height: 1.3rem; }
.filter-more { display: flex; flex-direction: column; gap: 0.6rem; }
.filter-collapsible.collapsed .filter-more { display: none; }
.filter-row { display: flex; flex-wrap: wrap; gap: 0.6rem 1rem; align-items: center; }
.filter-row select { width: auto; max-width: 260px; }
.country-flag { width: 1.33em; line-height: 1em; border-radius: 2px; box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.15); vertical-align: -0.1em; }
.filter-row input[type=date] { width: auto; }

/* PDF-Fenster (common.js): PDF-Links öffnen innerhalb der Seite, Hintergrund halbtransparent */
.pdf-viewer { width: min(1100px, 94vw); height: 92vh; max-width: none; max-height: none; padding: 0; border: 1px solid var(--border);
              border-radius: 10px; background: var(--overlay-panel); color: var(--text); box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
              backdrop-filter: blur(6px); overflow: hidden; }
.pdf-viewer[open] { display: flex; flex-direction: column; }
.pdf-viewer::backdrop { background: var(--overlay); backdrop-filter: blur(2px); }
.pdf-viewer-head { display: flex; align-items: center; gap: 0.5rem; padding: 0.5rem 0.75rem; border-bottom: 1px solid var(--border); }
.pdf-viewer-title { flex: 1; min-width: 0; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pdf-viewer iframe { flex: 1; width: 100%; border: 0; background: var(--card); }
@media (max-width: 640px) { .pdf-viewer { width: 100vw; height: 100vh; border-radius: 0; } .pdf-viewer-head .btn-secondary { display: none; } }
