/* BS-Live! Terminkalender – gemeinsames Stylesheet (öffentlich + Verwaltung) */
:root {
    --accent: #ad1929;
    --accent-dark: #8a1220;
    --accent-soft: #fbeaec;
    --text: #1d1d1f;
    --muted: #6b6b70;
    --line: #e4e4e7;
    --bg: #f6f6f7;
    --card: #fff;
    --ok: #1f7a3a;
    --ok-soft: #e7f5ec;
    --warn: #8a5a00;
    --warn-soft: #fff4dc;
    --err: #b00020;
    --err-soft: #fdecee;
    --radius: 10px;
    --shadow: 0 1px 2px rgba(0,0,0,.05), 0 2px 8px rgba(0,0,0,.04);
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font-size: 16px; line-height: 1.5; }
a { color: var(--accent); }
a:hover { color: var(--accent-dark); }
img { max-width: 100%; height: auto; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 20px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.hp { position: absolute; left: -10000px; top: auto; width: 1px; height: 1px; overflow: hidden; }
.small, small { font-size: .85em; color: var(--muted); }
code, pre { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .9em; }
pre.code { background: #1d1d1f; color: #f5f5f7; padding: 14px 16px; border-radius: var(--radius); overflow-x: auto; white-space: pre-wrap; word-break: break-all; }

/* Header / Footer */
.site-header { background: #fff; border-bottom: 3px solid var(--accent); }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 64px; flex-wrap: wrap; }
.brand { text-decoration: none; color: var(--text); font-size: 1.25rem; }
.brand-mark { color: var(--accent); font-weight: 800; letter-spacing: -.02em; }
.brand-sub { font-weight: 500; }
.site-nav { display: flex; gap: 18px; flex-wrap: wrap; }
.site-nav a { text-decoration: none; color: var(--text); font-weight: 500; }
.site-nav a:hover { color: var(--accent); }
.main { padding-top: 24px; padding-bottom: 48px; }
.site-footer { border-top: 1px solid var(--line); background: #fff; color: var(--muted); font-size: .9rem; }
.site-footer .wrap { display: flex; gap: 18px; flex-wrap: wrap; padding-top: 18px; padding-bottom: 18px; }
.site-footer a { color: var(--muted); }

.page-title { font-size: 1.9rem; margin: 0 0 16px; letter-spacing: -.01em; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 9px 16px; border-radius: 8px; border: 1px solid var(--line); background: #fff; color: var(--text); font: inherit; font-weight: 500; text-decoration: none; cursor: pointer; line-height: 1.2; }
.btn:hover { border-color: #c9c9ce; color: var(--text); background: #fafafa; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-dark); border-color: var(--accent-dark); color: #fff; }
.btn-danger { color: var(--err); border-color: #f0c2c8; }
.btn-danger:hover { background: var(--err-soft); color: var(--err); }
.btn-success { background: var(--ok); border-color: var(--ok); color: #fff; }
.btn-success:hover { background: #17602d; color: #fff; }
.btn-link { border-color: transparent; background: transparent; color: var(--accent); }
.btn-small { padding: 6px 11px; font-size: .9rem; }
.btn-large { padding: 13px 22px; font-size: 1.05rem; }
.btn-icon { padding: 4px 10px; font-size: 1.1rem; }
.btn:disabled { opacity: .55; cursor: not-allowed; }

/* Filter */
.filter-bar { display: flex; flex-wrap: wrap; gap: 10px; background: #fff; padding: 14px; border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 14px; }
.filter-bar > input, .filter-bar > select { flex: 1 1 150px; width: auto; min-width: 0; }
.filter-bar > input[type=search] { flex: 2 1 240px; }
.filter-bar > input[name=plz] { flex: 0 1 140px; }
.filter-bar > select[name=umkreis] { flex: 0 1 120px; }
.filter-bar .btn-link { padding-left: 0; }
.result-info { color: var(--muted); font-size: .92rem; margin: 0 0 8px; }

/* Formularelemente */
input[type=text], input[type=email], input[type=url], input[type=password], input[type=search], input[type=date], input[type=time], input[type=number], input[type=tel], select, textarea {
    width: 100%; padding: 9px 11px; border: 1px solid #d4d4d8; border-radius: 8px; background: #fff; font: inherit; color: inherit;
}
input:focus, select:focus, textarea:focus, .rte-area:focus { outline: 2px solid color-mix(in srgb, var(--accent) 35%, transparent); border-color: var(--accent); }
textarea { resize: vertical; }
.form { background: #fff; padding: 24px; border-radius: var(--radius); box-shadow: var(--shadow); }
.form.narrow { max-width: 640px; }
.form label { display: block; font-weight: 600; font-size: .93rem; margin: 0 0 14px; }
.form label > input, .form label > select, .form label > textarea, .form label > .rte { margin-top: 5px; font-weight: 400; }
.form label.check, .form label.check-inline { font-weight: 400; display: flex; gap: 8px; align-items: flex-start; }
.form label.check-inline { display: inline-flex; margin: 0 16px 8px 0; align-items: center; }
.form fieldset { border: 0; border-top: 1px solid var(--line); margin: 0 0 8px; padding: 18px 0 4px; }
.form fieldset:first-of-type { border-top: 0; padding-top: 0; }
.form legend { font-size: 1.15rem; font-weight: 700; padding: 0; margin-bottom: 10px; }
.form .label { display: block; font-weight: 600; font-size: .93rem; margin-bottom: 6px; }
.checks { margin-bottom: 14px; }
.hint { color: var(--muted); font-size: .88rem; margin: 0 0 12px; }
.field-error { color: var(--err); font-size: .88rem; margin: -8px 0 14px; font-weight: 500; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 18px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0 14px; }
.grid-zip { display: grid; grid-template-columns: 140px 1fr; gap: 0 14px; }
.grid-geo { display: grid; grid-template-columns: 1fr 1fr auto; gap: 0 14px; align-items: end; }
@media (max-width: 720px) { .grid-2, .grid-3, .grid-4, .grid-geo { grid-template-columns: 1fr; } }
.counter { font-size: .8rem; color: var(--muted); font-weight: 400; float: right; }
.counter.over { color: var(--err); font-weight: 600; }
.form-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--line); }
.form-actions .spacer { flex: 1; }
.new-place { background: var(--bg); border-radius: 8px; padding: 12px 14px 2px; margin-bottom: 14px; }
.new-place.is-disabled { opacity: .5; }

/* Termin-Editor */
.tabs { display: flex; gap: 4px; margin-bottom: 12px; }
.tab { border: 1px solid var(--line); background: #fff; padding: 7px 14px; border-radius: 8px; font: inherit; font-weight: 600; cursor: pointer; color: var(--muted); }
.tab.is-active { background: var(--accent); border-color: var(--accent); color: #fff; }
.dates-table { width: 100%; border-collapse: collapse; margin-bottom: 10px; }
.dates-table th { text-align: left; font-size: .82rem; color: var(--muted); font-weight: 600; padding: 0 6px 4px 0; }
.dates-table td { padding: 0 6px 6px 0; }
.dates-table td:last-child { width: 1%; }
@media (max-width: 720px) {
    .dates-table, .dates-table tbody { display: block; }
    .dates-table thead { display: none; }
    .dates-table tr { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr) auto; gap: 6px; border-bottom: 1px solid var(--line); padding: 10px 0; align-items: end; }
    .dates-table td { padding: 0; min-width: 0; }
    .dates-table td::before { content: attr(data-label); display: block; font-size: .75rem; color: var(--muted); font-weight: 600; }
    .dates-table td:nth-child(3) { grid-column: 1; }
    .dates-table td:nth-child(4) { grid-column: 2; }
    .dates-table td:last-child { grid-column: 3; grid-row: 1; width: auto; }
    .tabs { flex-wrap: wrap; }
    .form { padding: 16px; }
    .form-actions .btn { flex: 1 1 auto; }
}
.weekdays { border: 0; padding: 0; margin: 0 0 12px; }
.weekdays legend { font-weight: 600; font-size: .93rem; margin-bottom: 6px; }

/* Einfacher Rich-Text-Editor */
.rte { border: 1px solid #d4d4d8; border-radius: 8px; background: #fff; overflow: hidden; }
.rte-toolbar { display: flex; gap: 2px; padding: 4px; border-bottom: 1px solid var(--line); background: #fafafa; flex-wrap: wrap; }
.rte-toolbar button { border: 0; background: transparent; padding: 5px 9px; border-radius: 6px; cursor: pointer; font: inherit; font-size: .88rem; font-weight: 600; color: var(--text); }
.rte-toolbar button:hover { background: #ececef; }
.rte-area { min-height: 180px; padding: 10px 12px; font-weight: 400; line-height: 1.55; }
.rte-area:empty::before { content: attr(data-placeholder); color: #a1a1aa; }
.rte-area p { margin: 0 0 .7em; }

/* Terminliste */
.day-heading { font-size: 1.05rem; margin: 26px 0 10px; padding-bottom: 6px; border-bottom: 2px solid var(--accent); color: var(--accent); text-transform: none; }
.event-card { display: flex; gap: 16px; background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px; margin-bottom: 10px; }
.event-card.is-highlight { border-left: 4px solid var(--accent); }
.event-card.is-cancelled .event-title a { text-decoration: line-through; color: var(--muted); }
.event-thumb { flex: 0 0 auto; width: var(--thumb-w, 250px); max-width: 34%; aspect-ratio: var(--thumb-ratio, 250 / 120); border-radius: 8px; overflow: hidden; background: #ececef; }
.event-thumb img { width: 100%; height: 100%; object-fit: cover; object-position: center 25%; display: block; }
.event-thumb.is-contain img { object-fit: contain; object-position: center; }
.event-body { min-width: 0; flex: 1; }
.event-when { font-size: .9rem; color: var(--muted); display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.event-title { margin: 3px 0 2px; font-size: 1.12rem; line-height: 1.3; }
.event-title a { color: var(--text); text-decoration: none; }
.event-title a:hover { color: var(--accent); }
.event-where { font-size: .92rem; }
.event-teaser { margin: 6px 0 0; font-size: .93rem; color: #3f3f46; }
@media (max-width: 560px) { .event-card { gap: 12px; } .event-thumb { width: 104px; max-width: 30%; aspect-ratio: 1 / 1; } }
.tag { display: inline-block; font-size: .75rem; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: var(--accent-soft); color: var(--accent-dark); }
.tag-danger { background: var(--err-soft); color: var(--err); }
.tag-ok { background: var(--ok-soft); color: var(--ok); }
.tag-warn { background: var(--warn-soft); color: var(--warn); }
.tag-muted { background: #ececef; color: var(--muted); }
.empty { background: #fff; border-radius: var(--radius); padding: 30px; text-align: center; color: var(--muted); }
.pagination { display: flex; gap: 16px; justify-content: center; align-items: center; margin-top: 22px; flex-wrap: wrap; }
.pagination a, .pagination span.current { padding: 6px 12px; border-radius: 8px; background: #fff; text-decoration: none; box-shadow: var(--shadow); }
.pagination span.current { background: var(--accent); color: #fff; }

/* Detail */
.back-link { text-decoration: none; font-weight: 500; }
.event-detail header h1 { font-size: 2rem; margin: 6px 0 8px; line-height: 1.2; }
.event-detail.is-cancelled header h1 { text-decoration: line-through; color: var(--muted); }
.event-cats { display: flex; gap: 6px; flex-wrap: wrap; }
.lead { font-size: 1.12rem; color: #3f3f46; margin: 0 0 18px; }
.detail-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(260px, 1fr); gap: 24px; align-items: start; }
@media (max-width: 860px) { .detail-grid { grid-template-columns: 1fr; } }
.detail-image { margin: 0 0 18px; }
.detail-image .frame { background: #ececef; border-radius: var(--radius); overflow: hidden; display: flex; justify-content: center; }
.detail-image img { display: block; max-width: 100%; width: auto; height: auto; max-height: min(70vh, 620px); object-fit: contain; }
.detail-image.is-wide img { width: 100%; }
.detail-image figcaption { font-size: .85rem; color: var(--muted); margin-top: 6px; display: flex; flex-wrap: wrap; gap: 4px 12px; justify-content: space-between; }
.detail-image .credit { white-space: nowrap; }
.detail-image .zoom-hint { font-size: .8rem; }
.prose { background: #fff; padding: 20px 22px; border-radius: var(--radius); box-shadow: var(--shadow); }
.prose h2, .prose h3 { margin: 1em 0 .4em; line-height: 1.25; }
.prose > :first-child { margin-top: 0; }
.box { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px 16px; margin-bottom: 14px; }
.box h2 { font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 0 0 6px; }
.box p { margin: 0 0 8px; }
.when-main { font-weight: 600; font-size: 1.05rem; }
.date-list { padding-left: 18px; margin: 8px 0; max-height: 260px; overflow: auto; font-size: .93rem; }
.video { background: #000; border-radius: var(--radius); aspect-ratio: 16 / 9; display: flex; flex-direction: column; align-items: center; justify-content: center; margin-top: 18px; color: #ddd; text-align: center; padding: 16px; }
.video iframe { width: 100%; height: 100%; border: 0; border-radius: var(--radius); }

/* Hinweise */
.alert { padding: 12px 16px; border-radius: 8px; margin: 0 0 16px; }
.alert-success { background: var(--ok-soft); color: var(--ok); }
.alert-error { background: var(--err-soft); color: var(--err); }
.alert-warning { background: var(--warn-soft); color: var(--warn); }
.alert-info { background: #e8f0fb; color: #1b4b8f; }
.error-page { background: #fff; border-radius: var(--radius); padding: 40px; text-align: center; box-shadow: var(--shadow); }

/* Tabellen */
.table { width: 100%; border-collapse: collapse; background: #fff; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.table th, .table td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; font-size: .94rem; }
.table th { background: #fafafa; font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.table tr:last-child td { border-bottom: 0; }
.table tr:hover td { background: #fcfcfd; }
.table .actions { white-space: nowrap; text-align: right; }
.table .num { width: 70px; color: var(--muted); }
.inline-form { display: inline; }

/* ---------------- Verwaltung ---------------- */
body.admin { background: #f3f3f5; }
.admin-shell { display: grid; grid-template-columns: 236px minmax(0, 1fr); min-height: 100vh; }
.admin-nav { background: #18181b; color: #d4d4d8; padding: 18px 12px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.admin-nav .brand { color: #fff; display: block; padding: 0 10px 18px; font-size: 1.1rem; }
.admin-nav .brand-mark { color: #ff4d5e; }
.admin-nav a { display: flex; justify-content: space-between; align-items: center; color: #d4d4d8; text-decoration: none; padding: 8px 10px; border-radius: 8px; font-size: .94rem; }
.admin-nav a:hover, .admin-nav a.is-active { background: #27272a; color: #fff; }
.admin-nav .nav-section { font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; color: #71717a; padding: 16px 10px 6px; }
.admin-nav .badge { background: var(--accent); color: #fff; border-radius: 999px; font-size: .75rem; padding: 1px 8px; font-weight: 700; }
.admin-nav form button { width: 100%; text-align: left; background: transparent; border: 0; color: #d4d4d8; padding: 8px 10px; font: inherit; font-size: .94rem; cursor: pointer; border-radius: 8px; }
.admin-nav form button:hover { background: #27272a; color: #fff; }
.admin-nav .user-box { border-top: 1px solid #27272a; margin-top: 16px; padding: 12px 10px 0; font-size: .85rem; color: #a1a1aa; }
.admin-main { padding: 26px 30px 60px; min-width: 0; }
.admin-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.admin-head h1 { margin: 0; font-size: 1.6rem; }
.admin-head .sub { color: var(--muted); font-weight: 400; font-size: 1.1rem; }
.admin-toggle { display: none; }
@media (max-width: 900px) {
    .admin-shell { grid-template-columns: 1fr; }
    .admin-nav { position: static; height: auto; }
    .admin-nav[data-collapsed] .nav-links { display: none; }
    .admin-toggle { display: inline-block; float: right; background: #27272a; color: #fff; border: 0; border-radius: 6px; padding: 4px 10px; }
    .admin-main { padding: 18px 14px 40px; }
}
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; margin-bottom: 24px; }
.stat { background: #fff; border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); text-decoration: none; color: var(--text); display: block; }
.stat .value { font-size: 1.9rem; font-weight: 700; line-height: 1.1; }
.stat .label { color: var(--muted); font-size: .9rem; }
.stat.attention { border-left: 4px solid var(--accent); }
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: end; background: #fff; padding: 14px; border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 14px; }
.toolbar label { font-size: .82rem; font-weight: 600; color: var(--muted); display: flex; flex-direction: column; gap: 4px; min-width: 140px; }
.toolbar .grow { flex: 1; min-width: 200px; }
.section { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px 20px; margin-bottom: 18px; }
.section h2 { margin: 0 0 12px; font-size: 1.15rem; }
.preview-img { max-width: 220px; border-radius: 8px; display: block; margin: 6px 0; }
.meta-list { display: grid; grid-template-columns: max-content 1fr; gap: 4px 14px; font-size: .92rem; margin: 0; }
.meta-list dt { color: var(--muted); }
.meta-list dd { margin: 0; }
.token-box { background: var(--ok-soft); border: 1px solid #b9e2c6; padding: 14px; border-radius: 8px; word-break: break-all; font-family: ui-monospace, monospace; }
.login-box { max-width: 420px; margin: 8vh auto; }
.login-box .form { padding: 28px; }
.login-box h1 { font-size: 1.4rem; margin: 0 0 18px; }

/* Karte, Lightbox, Druck */
.btn-row { display: flex; gap: 6px; flex-wrap: wrap; }
.map-box { margin: 0 0 14px; }
.map-box .hint { margin-top: 6px; }
.detail-map { margin-top: 10px; }
.detail-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0; }
.lightbox { position: fixed; inset: 0; background: rgba(0,0,0,.85); display: flex; align-items: center; justify-content: center; z-index: 1000; cursor: zoom-out; padding: 20px; }
.lightbox img { max-width: 100%; max-height: 100%; border-radius: 6px; box-shadow: 0 4px 30px rgba(0,0,0,.5); }
img[data-lightbox] { cursor: zoom-in; }
@media print {
    .site-header, .site-footer, .back-link, .detail-actions, .video, .detail-map, .btn, .filter-bar, .pagination { display: none !important; }
    body { background: #fff; font-size: 12pt; }
    .box, .prose, .event-card { box-shadow: none; border: 1px solid #ddd; }
    .detail-grid { grid-template-columns: 1fr; }
    a { color: inherit; text-decoration: none; }
}


/* ---------- Formular-Komfort ---------- */
.error-summary ul { margin: 6px 0 0; padding-left: 20px; }
.error-summary a { color: inherit; }
.error-summary:focus { outline: 2px solid var(--err); outline-offset: 2px; }
label.has-error > input, label.has-error > select, label.has-error > textarea, label.has-error > .rte, .has-error > .upload-drop, .dates-editor.has-error .dates-table input[name$="[date]"] { border-color: var(--err); box-shadow: 0 0 0 2px var(--err-soft); }
label.check.has-error, .checks.has-error { background: var(--err-soft); border-radius: 8px; padding: 8px 10px; }
.form-actions.is-sticky { position: sticky; bottom: 0; background: rgba(255,255,255,.96); backdrop-filter: blur(4px); margin: 18px -24px -24px; padding: 14px 24px; border-radius: 0 0 var(--radius) var(--radius); z-index: 5; box-shadow: 0 -4px 12px rgba(0,0,0,.05); }
@media (max-width: 720px) { .form-actions.is-sticky { margin: 18px -16px -16px; padding: 12px 16px; } }
.btn.is-loading { opacity: .7; cursor: progress; }
.btn.is-loading::before { content: ""; width: 14px; height: 14px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: bsl-spin .7s linear infinite; }
@keyframes bsl-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .btn.is-loading::before { animation: none; } }

/* ---------- Bild-Upload ---------- */
.upload { margin-bottom: 14px; }
.upload-drop { display: flex !important; flex-direction: column; align-items: center; gap: 4px; text-align: center; border: 2px dashed #c9c9ce; border-radius: 10px; padding: 18px 14px; cursor: pointer; background: #fafafa; font-weight: 400 !important; margin: 0 !important; transition: border-color .15s, background .15s; }
.upload-drop:hover, .upload-drop.is-over, .upload-drop:focus-within { border-color: var(--accent); background: var(--accent-soft); }
.upload-drop input[type=file] { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; }
.upload-drop .hint { margin: 0; }
.upload-text strong { color: var(--accent); text-decoration: underline; }
.upload.has-file .upload-drop { display: none !important; }
.upload.is-busy .upload-drop { opacity: .6; cursor: progress; }
.upload-current, .upload-preview { display: flex; gap: 14px; align-items: flex-start; background: var(--bg); border-radius: 10px; padding: 10px; margin-bottom: 8px; }
.upload-preview[hidden] { display: none; }
.upload-current img, .upload-preview img { width: 150px; height: 110px; object-fit: contain; background: repeating-conic-gradient(#e4e4e7 0% 25%, #fff 0% 50%) 50% / 16px 16px; border-radius: 6px; flex: 0 0 auto; display: block; }
.upload-current > div, .upload-preview > div { display: flex; flex-direction: column; gap: 4px; min-width: 0; font-size: .93rem; }
.upload-current .hint, .upload-preview .hint { margin: 0; overflow-wrap: anywhere; }
.upload-current label.check { margin: 4px 0 0; }
.upload-current.is-replaced { opacity: .55; }
.upload-current.is-replaced::after { content: "wird ersetzt"; font-size: .75rem; font-weight: 700; color: var(--warn); background: var(--warn-soft); padding: 2px 8px; border-radius: 99px; margin-left: auto; white-space: nowrap; }
.upload-preview { background: var(--ok-soft); }
.upload-preview .btn { align-self: flex-start; margin-top: 4px; }
.upload-state { color: var(--ok); }
label[data-rights].is-needed { background: var(--warn-soft); border-radius: 8px; padding: 8px 10px; }
@media (max-width: 480px) { .upload-current img, .upload-preview img { width: 96px; height: 80px; } }

/* Vorschaubild in Verwaltungslisten */
.table .thumb-cell { width: 76px; padding-right: 0; }
.table .thumb-cell img, .table .thumb-cell .no-img { width: 64px; height: 48px; object-fit: cover; border-radius: 6px; display: block; background: #ececef; }

/* Mobil: kompakte Speichern-Leiste und einklappbare Filter */
@media (max-width: 720px) {
    .form-actions.is-sticky > :not(.btn-primary):not(form) { display: none; }
    .filter-bar.is-collapsed > [data-filter-extra] { display: none; }
    .filter-bar .filter-toggle { flex: 1 1 100%; }
}
@media (min-width: 721px) { .filter-bar .filter-toggle { display: none; } }

/* Zwei-Faktor-Einrichtung */
.steps { padding-left: 22px; }
.steps > li { margin-bottom: 14px; }
.qr-setup { display: flex; gap: 22px; align-items: flex-start; flex-wrap: wrap; margin-top: 10px; }
.qr-box { flex: 0 0 auto; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: #fff; line-height: 0; }
.qr-box svg { display: block; max-width: 100%; height: auto; }
.qr-setup > div:last-child { flex: 1 1 260px; min-width: 0; }

.filter-bar > label.filter-date { display: flex; align-items: center; gap: 6px; flex: 1 1 170px; font-size: .9rem; color: var(--muted); white-space: nowrap; }
.filter-bar > label.filter-date input { flex: 1; min-width: 0; }

/* ---------- Installationsassistent ---------- */
.install-box { max-width: 760px; margin: 5vh auto; padding: 0 16px 40px; }
.install-box .brand { font-size: 1.3rem; margin: 0 0 14px; }
.install-box .form h1 { font-size: 1.5rem; margin: 0 0 12px; }
.install-box .form h2 { font-size: 1.1rem; margin: 22px 0 8px; }
.install-steps { list-style: none; display: flex; flex-wrap: wrap; gap: 6px 14px; padding: 0; margin: 0 0 16px; font-size: .88rem; color: var(--muted); }
.install-steps li { display: flex; align-items: center; gap: 6px; }
.install-steps .n { display: inline-flex; width: 22px; height: 22px; align-items: center; justify-content: center; border-radius: 50%; background: #e4e4e7; color: #52525b; font-weight: 700; font-size: .78rem; }
.install-steps .is-current { color: var(--text); font-weight: 700; }
.install-steps .is-current .n { background: var(--accent); color: #fff; }
.install-steps .is-done .n { background: var(--ok); color: #fff; }
.check-list { list-style: none; padding: 0; margin: 0 0 8px; }
.check-list li { display: flex; gap: 12px; align-items: flex-start; padding: 8px 0; border-bottom: 1px solid var(--line); }
.check-list li:last-child { border-bottom: 0; }
.check-list .mark { flex: 0 0 24px; height: 24px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: .85rem; color: #fff; }
.check-list .is-ok .mark { background: var(--ok); }
.check-list .is-warn .mark { background: #c98a00; }
.check-list .is-bad .mark { background: var(--err); }
.check-list .is-bad strong { color: var(--err); }
details.help { background: var(--bg); border-radius: 8px; padding: 10px 14px; margin: 0 0 14px; }
details.help summary { cursor: pointer; font-weight: 600; }
details.help ol { margin: 10px 0 4px; padding-left: 20px; }
details.help .grid-2 { margin-top: 10px; }
.summary { background: var(--bg); border-radius: 8px; padding: 14px 16px; overflow-wrap: anywhere; }
