/* Mitarbeiter-App – Oberfläche */
:root {
  --accent: #002c7d;
  --green: #81ba00;
  --accent-soft: color-mix(in srgb, var(--accent) 9%, white);
  --accent-dark: color-mix(in srgb, var(--accent) 80%, black);
  --green-soft: color-mix(in srgb, var(--green) 16%, white);
  --green-text: color-mix(in srgb, var(--green) 55%, black);
  --bg: #f2f4f8;
  --card: #ffffff;
  --text: #1f2937;
  --muted: #6b7280;
  --line: #e5e7eb;
  --ok: var(--green-text);
  --ok-soft: var(--green-soft);
  --err: #b91c1c;
  --err-soft: #fee2e2;
  --warn: #a16207;
  --warn-soft: #fef3c7;
  --info-soft: #dbeafe;
  --radius: 16px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 4px 16px rgba(16, 24, 40, .06);
  --shadow-lg: 0 20px 50px rgba(16, 24, 40, .18);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
@supports not (color: color-mix(in srgb, red 50%, white)) {
  :root { --accent-soft: #e8edf6; --accent-dark: #001f5a; --green-soft: #eef6d9; --green-text: #476600; }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; font-family: var(--font); font-size: 16px; line-height: 1.5;
  color: var(--text); background: var(--bg);
  -webkit-tap-highlight-color: transparent;
}
h1, h2, h3 { line-height: 1.25; margin: 0 0 .5em; }
h1 { font-size: 1.75rem; letter-spacing: -.01em; }
h2 { font-size: 1.2rem; }
h3 { font-size: 1.05rem; }
p { margin: 0 0 1em; }
a { color: var(--accent); }
code { background: #f1f5f9; padding: 1px 6px; border-radius: 6px; font-size: .9em; }
[hidden] { display: none !important; }
.icon { flex-shrink: 0; vertical-align: middle; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.center { text-align: center; }
.error-text { color: var(--err); }
.inline { display: inline; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 10px 18px; border-radius: 12px; border: 1px solid var(--line);
  background: #fff; color: var(--text); font: inherit; font-weight: 600; text-decoration: none;
  cursor: pointer; transition: background .15s, transform .05s, box-shadow .15s; white-space: nowrap;
}
.btn:hover { background: #f9fafb; }
.btn:active { transform: scale(.98); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; box-shadow: 0 2px 8px color-mix(in srgb, var(--accent) 35%, transparent); }
.btn-primary:hover { background: var(--accent-dark); }
.btn-success { background: var(--green); border-color: var(--green); color: var(--accent); box-shadow: 0 2px 10px color-mix(in srgb, var(--green) 45%, transparent); }
.btn-success:hover { background: color-mix(in srgb, var(--green) 88%, black); }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-ghost:hover { background: rgba(0, 0, 0, .05); }
.btn-danger { color: var(--err); border-color: transparent; background: transparent; }
.btn-danger:hover { background: var(--err-soft); }
.btn-sm { min-height: 36px; padding: 6px 12px; font-size: .9rem; border-radius: 10px; }
.btn-lg { min-height: 56px; padding: 14px 28px; font-size: 1.1rem; border-radius: 14px; }
.btn-block { width: 100%; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.link-btn { background: none; border: 0; color: var(--accent); font: inherit; cursor: pointer; padding: 4px; }

/* ---------- Topbar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 50; display: flex; align-items: center; gap: 16px;
  padding: 10px 24px; padding-top: max(10px, env(safe-area-inset-top));
  background: rgba(255, 255, 255, .92); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 3px solid var(--green); min-height: 68px;
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); font-weight: 700; font-size: 1.1rem; min-width: 0; }
.brand-mark { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 11px; background: var(--accent); color: #fff; }
.brand-logo { max-height: 54px; max-width: 200px; object-fit: contain; }
.auth-brand .brand-logo, .brand-logo.lg { max-height: 84px; max-width: 240px; }
.hero-logo { display: block; margin: 0 auto 18px; max-width: min(340px, 80%); max-height: 130px; object-fit: contain; }
.login-hero h1 { color: var(--accent); }
.brand-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.badge-admin { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--green-text); background: var(--green-soft); padding: 3px 8px; border-radius: 999px; }
.topbar-user { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.topbar-username { font-weight: 600; }
.clock { margin-left: auto; font-size: 1.3rem; font-weight: 600; color: var(--muted); font-variant-numeric: tabular-nums; }

/* ---------- Avatare ---------- */
.avatar { display: inline-grid; place-items: center; width: 84px; height: 84px; border-radius: 50%; color: #fff; font-weight: 700; font-size: 1.8rem; flex-shrink: 0; }
.avatar.lg { width: 76px; height: 76px; font-size: 1.6rem; }
.avatar.sm { width: 36px; height: 36px; font-size: .9rem; }
.avatar.xs { width: 28px; height: 28px; font-size: .72rem; }

/* ---------- Layout ---------- */
.kiosk-main { max-width: 1100px; margin: 0 auto; padding: 28px 24px 120px; }
.admin-main { max-width: 1180px; margin: 0 auto; padding: 28px 24px 80px; }
.plain-main { max-width: 760px; margin: 0 auto; padding: 48px 20px; }
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 24px; margin-bottom: 20px; }
.card h2 { margin-bottom: 16px; }
.card h2:not(:first-child) { margin-top: 28px; }
.card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.card-head h2 { margin: 0; }
.narrow { max-width: 480px; margin: 0 auto; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.page-head h1 { margin: 0; color: var(--accent); }
.page-head p { margin: 4px 0 0; }
.back-link { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); text-decoration: none; font-size: .9rem; margin-bottom: 6px; }

/* ---------- Meldungen ---------- */
.alert { padding: 14px 18px; border-radius: 12px; margin-bottom: 18px; font-weight: 500; background: var(--info-soft); color: #1e3a8a; }
.alert-success { background: var(--ok-soft); color: #14532d; }
.alert-error { background: var(--err-soft); color: #7f1d1d; }
.alert-warning { background: var(--warn-soft); color: #713f12; }
.alert a { color: inherit; font-weight: 700; }
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 999px; background: #f1f5f9; color: #475569; font-size: .8rem; font-weight: 600; white-space: nowrap; }
.chip-ok { background: var(--ok-soft); color: var(--ok); }
.chip-error { background: var(--err-soft); color: var(--err); }
.chip-warn { background: var(--warn-soft); color: var(--warn); }
.chip-accent { background: var(--accent-soft); color: var(--accent-dark); }

/* ---------- Anmeldung (Tablet) ---------- */
.login-hero { text-align: center; margin: 20px 0 36px; }
.login-hero h1 { font-size: 2.4rem; margin-bottom: 6px; }
.login-hero p { color: var(--muted); font-size: 1.15rem; }
.people-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 18px; }
.person {
  display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 26px 12px 22px;
  background: #fff; border: 2px solid transparent; border-radius: 20px; box-shadow: var(--shadow);
  font: inherit; cursor: pointer; transition: transform .1s, border-color .15s;
}
.person:active, .person:hover { border-color: var(--green); }
.person:active { transform: scale(.97); }
.person-name { font-weight: 600; font-size: 1.1rem; color: var(--text); text-align: center; }
.admin-link { position: fixed; right: 20px; bottom: max(18px, env(safe-area-inset-bottom)); display: inline-flex; align-items: center; gap: 6px; color: var(--muted); text-decoration: none; font-size: .9rem; padding: 8px 12px; border-radius: 10px; }
.admin-link:hover { background: rgba(0,0,0,.05); }

/* PIN */
.pin-box { text-align: center; max-width: 380px; }
.pin-box h2 { margin: 12px 0 2px; font-size: 1.5rem; }
.pin-dots { display: flex; justify-content: center; gap: 16px; margin: 18px 0 6px; }
.pin-dots span { width: 18px; height: 18px; border-radius: 50%; border: 2px solid #cbd5e1; transition: all .15s; }
.pin-dots span.filled { background: var(--green); border-color: var(--green); transform: scale(1.1); }
.pin-dots.shake { animation: shake .4s; }
.pin-error { min-height: 1.5em; color: var(--err); font-weight: 600; margin: 4px 0 10px; }
.pinpad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.pinpad button {
  height: 72px; border-radius: 18px; border: 0; background: #f1f5f9; font: inherit; font-size: 1.8rem; font-weight: 600;
  color: var(--text); cursor: pointer; transition: background .1s, transform .05s;
}
.pinpad button:active { background: #e2e8f0; transform: scale(.96); }
.pinpad .pin-fn { font-size: 1rem; color: var(--muted); background: transparent; }
.pinpad .pin-fn[data-key="back"] { font-size: 1.6rem; }
@keyframes shake { 0%,100% { transform: translateX(0) } 20%,60% { transform: translateX(-10px) } 40%,80% { transform: translateX(10px) } }

/* ---------- Modal ---------- */
.modal { position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; padding: 20px; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(15, 23, 42, .55); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); }
.modal-box { position: relative; background: #fff; border-radius: 24px; padding: 32px; width: 100%; max-width: 560px; box-shadow: var(--shadow-lg); animation: pop .18s ease-out; max-height: 100%; overflow: auto; }
.modal-close { position: absolute; top: 14px; right: 14px; width: 44px; height: 44px; border: 0; border-radius: 50%; background: #f1f5f9; cursor: pointer; display: grid; place-items: center; color: var(--muted); }
.modal-actions { display: flex; gap: 12px; justify-content: flex-end; margin-top: 20px; flex-wrap: wrap; }
.modal-box.center { text-align: center; }
.modal-box.center .modal-actions { justify-content: center; }
@keyframes pop { from { transform: scale(.94); opacity: 0 } to { transform: none; opacity: 1 } }

/* ---------- Formular-Übersicht (Mitarbeiter) ---------- */
.page-intro { margin: 8px 0 28px; }
.page-intro h1 { font-size: 2rem; margin-bottom: 4px; color: var(--accent); }
.page-intro p { color: var(--muted); font-size: 1.1rem; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); gap: 18px; }
.form-card {
  display: flex; align-items: center; gap: 18px; padding: 22px; background: #fff; border-radius: 20px;
  box-shadow: var(--shadow); text-decoration: none; color: var(--text); border: 2px solid transparent; transition: transform .1s, border-color .15s;
}
.form-card:hover { border-color: var(--green); }
.form-card:active { transform: scale(.98); border-color: var(--green); }
.form-card-icon { display: grid; place-items: center; width: 60px; height: 60px; border-radius: 16px; background: var(--accent-soft); color: var(--accent); flex-shrink: 0; }
.form-card-body { display: flex; flex-direction: column; gap: 4px; flex: 1; min-width: 0; }
.form-card-title { font-weight: 700; font-size: 1.15rem; }
.form-card-desc { color: var(--muted); font-size: .95rem; }
.form-card-meta { margin-top: 4px; }
.form-card-go { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: var(--green); color: var(--accent); flex-shrink: 0; }
.form-card-go .icon { transform: rotate(180deg); }
.empty-state { text-align: center; padding: 48px 20px; color: var(--muted); }
.empty-state .icon { color: #cbd5e1; margin-bottom: 8px; }
.empty-state h2 { color: var(--text); }

/* ---------- Ausfüllen ---------- */
.page-fill .kiosk-main { max-width: 1200px; padding-top: 16px; }
.fill-head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.fill-title h1 { font-size: 1.4rem; margin: 0; }
.fill-title p { margin: 0; color: var(--muted); }
.toolbar {
  position: sticky; top: 68px; z-index: 40; display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  background: #fff; border-radius: 16px; box-shadow: var(--shadow); padding: 8px; margin-bottom: 16px;
}
.tool-group { display: flex; gap: 4px; padding-right: 10px; border-right: 1px solid var(--line); }
.tool-group:nth-last-child(2) { border-right: 0; }
.tool {
  display: inline-flex; align-items: center; gap: 8px; min-height: 48px; padding: 8px 14px; border-radius: 12px;
  border: 0; background: transparent; font: inherit; font-weight: 600; color: var(--text); cursor: pointer;
}
.tool:hover { background: #f3f4f6; }
.tool.active { background: var(--accent); color: #fff; }
.tool.icon-only { padding: 8px 12px; }
.tool-hint { color: var(--muted); font-size: .9rem; padding: 0 8px; flex: 1; min-width: 180px; }
.pdf-stage { position: relative; min-height: 300px; }
.loading { display: flex; align-items: center; justify-content: center; gap: 12px; padding: 80px; color: var(--muted); font-size: 1.1rem; }
.pdf-pages { display: flex; flex-direction: column; align-items: center; gap: 20px; }
.pdf-page { position: relative; background: #fff; box-shadow: 0 2px 12px rgba(0,0,0,.12); border-radius: 4px; overflow: hidden; touch-action: pan-x pan-y pinch-zoom; }
.pdf-page canvas.pdf-canvas { display: block; width: 100%; height: 100%; }
.pdf-page .layer { position: absolute; inset: 0; }
.pdf-page .ink { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
body.tool-pen .pdf-page .ink { pointer-events: auto; touch-action: none; cursor: crosshair; }
body.tool-text .pdf-page .layer { cursor: text; }
body.tool-pen .pdf-page .field-input, body.tool-pen .pdf-page .free-text { pointer-events: none; }
.page-num { position: absolute; right: 8px; bottom: 6px; font-size: .75rem; color: #94a3b8; pointer-events: none; }

.field-input {
  position: absolute; margin: 0; border: 0; padding: 0 3px; font-family: Helvetica, Arial, sans-serif; color: #0f172a;
  background: rgba(59, 130, 246, .10); outline: 1px solid rgba(59, 130, 246, .35); border-radius: 2px; resize: none; line-height: 1.15;
}
.field-input:focus { background: rgba(59, 130, 246, .06); outline: 2px solid #2563eb; }
.field-input.is-filled { background: transparent; outline-color: rgba(59, 130, 246, .2); }
.field-input.is-required { box-shadow: inset 3px 0 0 #dc2626; }
.field-check.is-required { box-shadow: 0 0 0 2px rgba(220, 38, 38, .55); }
.field-input.missing { outline: 2px solid var(--err); background: rgba(220, 38, 38, .1); }
.field-check { display: grid; place-items: center; cursor: pointer; padding: 0; }
.field-check input { position: absolute; opacity: 0; pointer-events: none; }
.field-check span { width: 100%; height: 100%; display: grid; place-items: center; font-weight: 700; color: #0f172a; line-height: 1; }
.field-check input:checked + span::after { content: "✓"; }
.field-check.radio input:checked + span::after { content: "●"; }
select.field-input { -webkit-appearance: none; appearance: none; }
.field-sign { display: grid; place-items: center; color: #2563eb; font-size: 12px; font-weight: 600; cursor: pointer; overflow: hidden; }
.field-sign img { width: 100%; height: 100%; object-fit: contain; }

.free-text { position: absolute; display: flex; align-items: flex-start; }
.free-text input {
  font-family: Helvetica, Arial, sans-serif; color: #0f172a; border: 1px dashed #2563eb; background: rgba(255,255,255,.7);
  padding: 0 2px; margin: 0; min-width: 40px; outline: none; border-radius: 2px; flex-shrink: 0; line-height: 1.2;
}
.free-text input:not(:focus) { border-color: transparent; background: transparent; }
.del-btn { width: 26px; height: 26px; margin-left: 4px; border-radius: 50%; border: 0; background: var(--err); color: #fff; font-size: 16px; line-height: 1; cursor: pointer; flex-shrink: 0; display: grid; place-items: center; padding: 0; }
.free-text:not(:focus-within) .del-btn { display: none; }
.sign-stamp { position: absolute; cursor: move; touch-action: none; border: 1px dashed transparent; }
.sign-stamp.selected { border-color: #2563eb; background: rgba(37,99,235,.05); }
.sign-stamp img { width: 100%; height: 100%; display: block; pointer-events: none; }
.sign-stamp .del-btn { position: absolute; top: -13px; right: -13px; margin: 0; }
.sign-stamp:not(.selected) .del-btn { display: none; }
.sign-stamp .resize { position: absolute; right: -10px; bottom: -10px; width: 22px; height: 22px; border-radius: 50%; background: #2563eb; border: 3px solid #fff; touch-action: none; }
.sign-stamp:not(.selected) .resize { display: none; }
body.placing-signature .pdf-page .layer { cursor: copy; }

.fill-footer {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 60; display: flex; align-items: flex-end; gap: 16px; justify-content: center;
  padding: 14px 24px; padding-bottom: max(14px, env(safe-area-inset-bottom)); background: rgba(255,255,255,.95); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-top: 1px solid var(--line);
}
.note-field { display: flex; flex-direction: column; gap: 2px; flex: 1; max-width: 560px; font-size: .85rem; color: var(--muted); font-weight: 600; }
.note-field input { height: 52px; }
.sign-box { max-width: 720px; }
.sign-pad-wrap { position: relative; border: 2px dashed #cbd5e1; border-radius: 16px; background: #fafafa; height: 260px; }
.sign-pad-wrap canvas { position: relative; z-index: 1; width: 100%; height: 100%; touch-action: none; display: block; }
.sign-line { position: absolute; left: 24px; right: 24px; bottom: 60px; border-bottom: 2px solid #cbd5e1; color: #94a3b8; font-weight: 700; font-size: 1.3rem; pointer-events: none; }
.done-box h2 { font-size: 1.8rem; margin-top: 14px; }
.done-icon { width: 96px; height: 96px; border-radius: 50%; background: var(--green); color: #fff; display: grid; place-items: center; margin: 0 auto; animation: pop .3s ease-out; }
.spinner { display: inline-block; width: 26px; height: 26px; border: 3px solid #e5e7eb; border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; }
.spinner.lg { width: 56px; height: 56px; border-width: 5px; }
@keyframes spin { to { transform: rotate(360deg) } }

/* ---------- Idle-Warnung ---------- */
.idle-warning { position: fixed; inset: 0; z-index: 500; background: rgba(15, 23, 42, .7); display: grid; place-items: center; padding: 20px; }
.idle-box { background: #fff; border-radius: 24px; padding: 36px; text-align: center; max-width: 420px; box-shadow: var(--shadow-lg); }
.idle-icon { width: 72px; height: 72px; margin: 0 auto 12px; border-radius: 50%; background: var(--warn-soft); color: var(--warn); display: grid; place-items: center; }

/* ---------- Formularelemente ---------- */
.stack > * + * { margin-top: 16px; }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; font-weight: 600; font-size: .92rem; }
.field > span { color: #374151; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], select, textarea {
  width: 100%; min-height: 48px; padding: 10px 14px; border: 1px solid #d1d5db; border-radius: 12px;
  font: inherit; font-weight: 400; background: #fff; color: var(--text); transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 20%, transparent); }
input[type=color] { width: 80px; height: 48px; padding: 4px; border: 1px solid #d1d5db; border-radius: 12px; background: #fff; }
input[type=file] { font: inherit; font-weight: 400; }
.pin-input { font-size: 1.6rem !important; letter-spacing: .5em; max-width: 200px; text-align: center; }
.hint { color: var(--muted); font-size: .88rem; margin: -8px 0 16px; }
.narrow-field { max-width: 320px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 20px; }
.grid-2.tight { gap: 0 12px; }
.form-actions { display: flex; justify-content: flex-end; gap: 12px; margin-top: 8px; flex-wrap: wrap; }
.form-layout .form-actions { position: sticky; bottom: 0; background: linear-gradient(transparent, var(--bg) 30%); padding: 20px 0 16px; }

.switch { display: flex; align-items: center; gap: 12px; margin: 12px 0; cursor: pointer; font-weight: 500; }
.switch input { position: absolute; opacity: 0; }
.switch-ui { width: 50px; height: 30px; border-radius: 999px; background: #d1d5db; position: relative; transition: background .2s; flex-shrink: 0; }
.switch-ui::after { content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .2s; }
.switch input:checked + .switch-ui { background: var(--green); }
.switch input:checked + .switch-ui::after { transform: translateX(20px); }
.switch input:focus-visible + .switch-ui { box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 30%, transparent); }

.segmented { display: inline-flex; background: #f1f5f9; border-radius: 14px; padding: 4px; margin-bottom: 18px; flex-wrap: wrap; }
.segmented label { cursor: pointer; }
.segmented input { position: absolute; opacity: 0; }
.segmented span { display: inline-flex; align-items: center; gap: 8px; padding: 10px 18px; border-radius: 10px; font-weight: 600; color: var(--muted); }
.segmented input:checked + span { background: #fff; color: var(--text); box-shadow: 0 1px 4px rgba(0,0,0,.1); }
.segmented input:disabled + span { opacity: .4; }

.check-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; }
.check-item { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; cursor: pointer; transition: border-color .15s, background .15s; }
.check-item:has(input:checked) { border-color: var(--green); background: var(--green-soft); }
.check-item input { width: 22px; height: 22px; accent-color: var(--green-text); flex-shrink: 0; }
.check-item span { display: flex; flex-direction: column; }
.check-item small { color: var(--muted); font-weight: 400; }
.check-item.is-locked { opacity: .7; cursor: default; }
.check-actions { margin-bottom: 10px; font-size: .9rem; color: var(--muted); }
.check-inline { display: flex; align-items: center; gap: 8px; }

/* Rollen-abhängige Felder */
.form-layout:has(input[name=role][value=admin]:checked) .role-employee,
.form-layout:has(input[name=role][value=employee]:checked) .role-admin { display: none; }
.form-layout:has(input[name=assign_mode][value=all]:checked) .assign-some { display: none; }
form:has(input[name=mail_method][value=mail]:checked) .smtp-fields { display: none; }
form:has(input[name=driver][value=sqlite]:checked) .mysql-fields,
form:has(input[name=driver][value=sqlite]:checked) .mysql-only,
form:has(input[name=use_wp]:checked) .mysql-fields { display: none; }
.wp-found { margin-bottom: 16px; }

.dropzone { position: relative; display: flex; align-items: center; gap: 16px; padding: 22px; border: 2px dashed #cbd5e1; border-radius: 16px; cursor: pointer; margin-bottom: 18px; transition: border-color .15s, background .15s; }
.dropzone:hover, .dropzone.drag { border-color: var(--accent); background: var(--accent-soft); }
.dropzone input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.dropzone-icon { width: 56px; height: 56px; border-radius: 14px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; flex-shrink: 0; }
.dropzone-text { display: flex; flex-direction: column; }
.dropzone-text small { color: var(--muted); }
.dropzone-file { margin-left: auto; font-weight: 600; color: var(--green-text); text-align: right; word-break: break-all; }

/* ---------- Admin ---------- */
.admin-topbar { gap: 24px; }
.admin-nav { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.admin-nav a, .admin-nav button {
  display: inline-flex; align-items: center; gap: 8px; padding: 10px 14px; border-radius: 10px; color: var(--muted);
  text-decoration: none; font: inherit; font-weight: 600; font-size: .95rem; border: 0; background: none; cursor: pointer;
}
.admin-nav a:hover, .admin-nav button:hover { background: #f3f4f6; color: var(--text); }
.admin-nav a.active { background: var(--accent-soft); color: var(--accent-dark); }
.nav-logout { margin: 0 0 0 8px; padding-left: 8px; border-left: 1px solid var(--line); }
.nav-toggle { display: none; margin-left: auto; width: 44px; height: 44px; border: 0; background: none; cursor: pointer; flex-direction: column; justify-content: center; gap: 5px; padding: 10px; }
.nav-toggle span { display: block; height: 2px; background: var(--text); border-radius: 2px; }

.stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-bottom: 20px; }
.stat { display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 16px; align-items: center; background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px; text-decoration: none; color: var(--text); }
.stat-icon { grid-row: span 2; width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.stat { border-bottom: 3px solid var(--green); }
.stat-num { font-size: 2rem; font-weight: 800; line-height: 1.1; color: var(--accent); }
.stat-label { color: var(--muted); font-weight: 600; font-size: .9rem; }
.quick-actions { display: flex; gap: 12px; margin-bottom: 20px; flex-wrap: wrap; }

.table-wrap { overflow-x: auto; margin: 0 -8px; }
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); padding: 8px 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 12px 8px; border-bottom: 1px solid #f1f5f9; vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table .actions { text-align: right; white-space: nowrap; }
.table tr.is-inactive td { opacity: .6; }
.actions { display: flex; gap: 4px; align-items: center; justify-content: flex-end; flex-wrap: wrap; }
td.actions { display: table-cell; }
td.actions > * { margin-left: 2px; }
.user-cell { display: flex; align-items: center; gap: 12px; }

.admin-form-list { display: flex; flex-direction: column; gap: 14px; }
.admin-form-item { display: flex; align-items: center; gap: 18px; margin: 0; }
.admin-form-item.is-inactive { opacity: .65; }
.admin-form-body { flex: 1; min-width: 0; }
.admin-form-body h3 { margin: 0 0 4px; }
.admin-form-body p { margin: 0 0 8px; }
.meta-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

.filter-bar { display: flex; gap: 16px; flex-wrap: wrap; padding: 18px 24px 2px; }
.filter-bar .field { min-width: 200px; flex: 1; }
.pager { display: flex; gap: 6px; justify-content: center; margin-top: 18px; flex-wrap: wrap; }
.pager a { min-width: 40px; height: 40px; display: grid; place-items: center; border-radius: 10px; text-decoration: none; color: var(--text); font-weight: 600; }
.pager a.active { background: var(--accent); color: #fff; }
.logo-row { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; margin-bottom: 8px; }
.logo-preview { max-height: 64px; max-width: 220px; border: 1px solid var(--line); border-radius: 10px; padding: 6px; background: #fff; }

/* Anmeldung Verwaltung / Installer */
.auth-card { max-width: 440px; margin: 6vh auto 0; padding: 36px; }
.auth-brand { display: flex; align-items: center; gap: 10px; font-weight: 700; margin-bottom: 24px; font-size: 1.1rem; }
.install-card { padding: 36px; }
.checks { list-style: none; padding: 0; margin: 0 0 20px; display: grid; gap: 6px; }
.checks li { padding: 8px 12px; border-radius: 10px; font-weight: 500; }
.checks .ok { background: var(--ok-soft); color: #14532d; }
.checks .fail { background: var(--err-soft); color: #7f1d1d; }
.steps li { margin-bottom: 8px; }

/* ---------- Responsiv ---------- */
@media (max-width: 900px) {
  .nav-toggle { display: flex; }
  .admin-nav { display: none; position: absolute; top: 100%; left: 0; right: 0; flex-direction: column; align-items: stretch; background: #fff; padding: 10px; border-bottom: 1px solid var(--line); box-shadow: var(--shadow); }
  body.nav-open .admin-nav { display: flex; }
  .nav-logout { margin: 6px 0 0; padding: 6px 0 0; border-left: 0; border-top: 1px solid var(--line); }
  .stat-grid { grid-template-columns: 1fr; }
  .grid-3 { grid-template-columns: 1fr; }
}
@media (max-width: 700px) {
  .kiosk-main, .admin-main { padding: 20px 14px 120px; }
  .topbar { padding-left: 14px; padding-right: 14px; }
  .grid-2 { grid-template-columns: 1fr; }
  .tool span { display: none; }
  .tool-hint { display: none; }
  .topbar-username { display: none; }
  .form-grid { grid-template-columns: 1fr; }
  .people-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
  .table thead { display: none; }
  .table tr { display: block; padding: 12px 0; border-bottom: 1px solid var(--line); }
  .table td { display: flex; justify-content: space-between; gap: 12px; border: 0; padding: 4px 8px; }
  .table td[data-label]::before { content: attr(data-label); color: var(--muted); font-size: .85rem; font-weight: 600; }
  .table td.actions { display: flex; justify-content: flex-start; }
  .admin-form-item { flex-wrap: wrap; }
  .fill-footer { flex-direction: column; align-items: stretch; }
  .note-field { max-width: none; }
}
.page-login .kiosk-topbar .brand { visibility: hidden; }

/* Feld-Regeln (Verwaltung) */
.field-rules { display: flex; flex-direction: column; gap: 6px; }
.field-rule { display: flex; align-items: center; gap: 14px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; flex-wrap: wrap; }
.field-rule-name { flex: 1; min-width: 180px; display: flex; flex-direction: column; }
.field-rule-name small { color: var(--muted); font-size: .8rem; }
.field-rule .segmented { margin: 0; }
.field-rule .segmented span { padding: 7px 14px; font-size: .9rem; }
.field-rule .segmented input[value=required]:checked + span { background: #fee2e2; color: #991b1b; }
.field-rule .segmented input[value=locked]:checked + span { background: #e5e7eb; color: #374151; }

.pin-forgot { margin-top: 14px; font-size: .95rem; }

/* Reiter für Mitarbeiter */
.kiosk-tabs { display: flex; gap: 6px; justify-content: center; padding: 10px 16px 0; background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 71px; z-index: 45; overflow-x: auto; }
.kiosk-tabs a { display: inline-flex; align-items: center; gap: 8px; padding: 12px 20px; font-weight: 700; color: var(--muted); text-decoration: none; border-bottom: 3px solid transparent; white-space: nowrap; font-size: 1.05rem; }
.kiosk-tabs a.active { color: var(--accent); border-bottom-color: var(--green); }
.tab-badge { background: #dc2626; color: #fff; border-radius: 999px; font-size: .75rem; padding: 1px 8px; }
.page-fill .kiosk-tabs { display: none; }
.page-fill .toolbar { top: 71px; }
/* Dokumente & Profil */
.doc-list { display: flex; flex-direction: column; gap: 12px; }
.doc-item { display: flex; align-items: center; gap: 16px; padding: 18px 20px; background: #fff; border-radius: 18px; box-shadow: var(--shadow); text-decoration: none; color: var(--text); border: 2px solid transparent; }
.doc-item:hover { border-color: var(--green); }
.doc-item.unread .doc-title::after { content: "Neu"; margin-left: 10px; font-size: .72rem; background: #dc2626; color: #fff; padding: 2px 8px; border-radius: 999px; vertical-align: middle; }
.doc-title { font-weight: 700; font-size: 1.1rem; display: block; }
.doc-meta { color: var(--muted); font-size: .9rem; }
.profile-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 4px 24px; }
.profile-grid dt { color: var(--muted); font-size: .85rem; font-weight: 600; margin-top: 12px; }
.profile-grid dd { margin: 2px 0 0; font-size: 1.1rem; font-weight: 600; }
.viewer-pages { display: flex; flex-direction: column; align-items: center; gap: 16px; }
.viewer-pages canvas { max-width: 100%; box-shadow: 0 2px 12px rgba(0,0,0,.12); background: #fff; border-radius: 4px; }
.reset-card { max-width: 440px; margin: 6vh auto 0; text-align: center; }
/* Kalender */
.page-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.seg-tabs { display: flex; gap: 6px; background: #e8ebf1; border-radius: 16px; padding: 5px; margin-bottom: 18px; width: fit-content; max-width: 100%; }
.seg-tabs a { display: inline-flex; align-items: center; gap: 8px; padding: 12px 22px; border-radius: 12px; font-weight: 700; color: var(--muted); text-decoration: none; font-size: 1.05rem; white-space: nowrap; }
.seg-tabs a.active { background: #fff; color: var(--accent); box-shadow: 0 1px 4px rgba(0,0,0,.12); }
.cal-toolbar { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.cal-title { margin: 0 6px; min-width: 190px; text-align: center; font-size: 1.4rem; color: var(--accent); }
.icon-btn { padding: 10px 12px; }
.cal-mine { margin-left: auto; }
.cal { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.cal-head, .cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.cal-head div { padding: 10px 8px; font-size: .8rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; border-bottom: 1px solid var(--line); }
.cal-day { min-height: 104px; padding: 6px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.cal-day:nth-child(7n) { border-right: 0; }
.cal-day.weekend { background: #fafbfc; }
.cal-day.other { background: #f6f7f9; }
.cal-day.other .cal-num { color: #c0c4cc; }
.cal-num { font-size: .85rem; font-weight: 700; color: var(--muted); width: 26px; height: 26px; display: grid; place-items: center; border-radius: 50%; }
.cal-day.today .cal-num { background: var(--accent); color: #fff; }
.cal-chip { display: block; font-size: .78rem; font-weight: 600; line-height: 1.25; padding: 3px 7px; border-radius: 6px; background: color-mix(in srgb, var(--c) 16%, white); color: color-mix(in srgb, var(--c) 70%, black); border-left: 3px solid var(--c); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-decoration: none; }
.cal-chip.mine { background: var(--c); color: #fff; }
.cal-more { font-size: .72rem; color: var(--muted); padding-left: 4px; }
.cal-list { margin-top: 26px; }
.cal-list h2 { font-size: 1.15rem; margin: 0 0 12px; }
.cal-rows { display: flex; flex-direction: column; gap: 8px; }
.cal-row { display: flex; align-items: center; gap: 14px; padding: 12px 16px; background: #fff; border-radius: 14px; box-shadow: var(--shadow); color: var(--text); text-decoration: none; }
.cal-row.mine { outline: 2px solid var(--green); }
.cal-row-main { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.cal-row-go { color: var(--muted); }
.site-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.site-card { display: flex; flex-direction: column; gap: 6px; padding: 16px 18px; background: #fff; border-radius: 16px; box-shadow: var(--shadow); border-left: 6px solid var(--c); color: var(--text); text-decoration: none; }
.site-card.mine { outline: 2px solid var(--green); }
.site-kind { font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--c, var(--accent)); }
.site-name { font-size: 1.15rem; }
.site-meta { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: .92rem; }
.site-team { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.team-chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px 3px 3px; background: #f1f5f9; border-radius: 999px; font-size: .85rem; font-weight: 600; }
.team-chip .avatar.xs { width: 24px; height: 24px; font-size: .65rem; }
.site-team.big .team-chip { font-size: 1rem; padding: 4px 14px 4px 4px; }
.site-team.big .team-chip .avatar.xs { width: 32px; height: 32px; font-size: .8rem; }
.team-chip.me { background: var(--green-soft); }
.site-detail { border-left: 8px solid var(--c); }
.site-detail h1 { margin: 4px 0 6px; color: var(--accent); }
.site-note { margin-top: 16px; padding: 14px 16px; background: var(--warn-soft); border-radius: 12px; line-height: 1.5; }
.map-link { margin-top: 8px; }
.color-picks { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 6px; }
.color-picks input { position: absolute; opacity: 0; }
.color-picks span { display: block; width: 36px; height: 36px; border-radius: 50%; cursor: pointer; box-shadow: inset 0 0 0 3px #fff; border: 3px solid transparent; }
.color-picks input:checked + span { border-color: var(--text); }
.color-picks input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.zip-city { grid-template-columns: 140px 1fr; }
.warn-text { color: var(--warn) !important; font-weight: 600; }
.narrow-form { max-width: 720px; }
.danger-zone { margin-top: 24px; }
textarea { font: inherit; }
@media (max-width: 700px) {
  .cal-day { min-height: 64px; padding: 3px; }
  .cal-chip { font-size: 0; padding: 0; height: 6px; border-left: 0; background: var(--c); }
  .cal-more { font-size: .65rem; }
  .cal-title { min-width: 0; font-size: 1.15rem; }
  .seg-tabs a { padding: 10px 14px; font-size: .95rem; }
  .cal-mine { margin-left: 0; }
  .zip-city { grid-template-columns: 1fr; }
}
/* Verwaltung: Menü passt auch mit Kalender in eine Zeile */
.admin-topbar .brand { flex-shrink: 0; }
@media (min-width: 901px) and (max-width: 1400px) {
  .admin-topbar { gap: 12px; }
  .badge-admin { display: none; }
  .admin-nav a, .admin-nav button { padding-left: 10px; padding-right: 10px; }
}
@media (min-width: 901px) and (max-width: 1180px) {
  .admin-nav a svg { display: none; }
  .admin-topbar .brand-logo { max-width: 150px; }
}
@media (max-width: 1040px) {
  .nav-toggle { display: flex; }
  .admin-nav { display: none; position: absolute; top: 100%; left: 0; right: 0; flex-direction: column; align-items: stretch; background: #fff; padding: 10px; border-bottom: 1px solid var(--line); box-shadow: var(--shadow); }
  .admin-nav a svg { display: inline; }
  body.nav-open .admin-nav { display: flex; }
  .nav-logout { margin: 6px 0 0; padding: 6px 0 0; border-left: 0; border-top: 1px solid var(--line); }
}
/* Eigene Dokumente: Herunterladen / per E-Mail */
.doc-actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.doc-actions form { margin: 0; }
.doc-hint { margin: 0 0 14px; }
@media (max-width: 700px) { .fill-head { flex-wrap: wrap; } .doc-actions { margin-left: 0; width: 100%; } }
/* Baustelle: Reiter, Bilder, Aufmaß/Abnahme */
.site-tabs { margin-top: 6px; }
.seg-count { background: var(--accent-soft); color: var(--accent); border-radius: 999px; font-size: .75rem; padding: 1px 8px; }
.seg-tabs a.active .seg-count { background: var(--green-soft); color: var(--green-text); }
.photo-upload { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.photo-pick { cursor: pointer; }
.upload-progress { width: 100%; max-width: 520px; }
.progress-bar { height: 10px; background: #e5e7eb; border-radius: 999px; overflow: hidden; }
.progress-bar span { display: block; height: 100%; width: 0; background: var(--green); transition: width .2s; }
.photo-day { margin: 26px 0; }
.photo-day-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; border-bottom: 2px solid var(--line); padding-bottom: 6px; margin-bottom: 10px; }
.photo-day-head h2 { margin: 0; font-size: 1.15rem; color: var(--accent); }
.photo-day-head h2 .muted { font-weight: 500; font-size: .95rem; }
.photo-who { display: flex; align-items: center; gap: 8px; font-weight: 700; margin: 14px 0 8px; }
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.photo { margin: 0; background: #fff; border-radius: 12px; overflow: hidden; box-shadow: var(--shadow); }
.photo > a { display: block; aspect-ratio: 4 / 3; background: #e5e7eb; }
.photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo figcaption { display: flex; align-items: center; gap: 6px; padding: 6px 8px; font-size: .8rem; color: var(--muted); }
.photo figcaption form { margin: 0; }
.photo-btn { margin-left: auto; display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 8px; border: 0; background: #f1f5f9; color: var(--text); cursor: pointer; }
.photo-btn + form .photo-btn, .photo-btn + .photo-btn { margin-left: 0; }
.photo-btn.danger { color: var(--err); }
.lightbox { position: fixed; inset: 0; z-index: 200; background: rgba(10, 14, 24, .92); display: flex; align-items: center; justify-content: center; }
.lightbox[hidden] { display: none; }
.lightbox img { max-width: 92vw; max-height: 84vh; object-fit: contain; border-radius: 6px; }
.lightbox-close { position: absolute; top: 14px; right: 14px; }
.lightbox-close, .lightbox-nav { background: rgba(255,255,255,.14); color: #fff; border: 0; border-radius: 999px; width: 52px; height: 52px; display: grid; place-items: center; cursor: pointer; }
.lightbox-nav { position: absolute; top: 50%; transform: translateY(-50%); }
.lightbox-nav.prev { left: 12px; }
.lightbox-nav.next { right: 12px; }
.lightbox-caption { position: absolute; bottom: 14px; left: 0; right: 0; text-align: center; color: #e5e7eb; margin: 0; }
.measure-list { display: flex; flex-direction: column; gap: 10px; }
.measure-item { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 14px; flex-wrap: wrap; }
.measure-main { display: flex; flex-direction: column; gap: 3px; flex: 1; min-width: 200px; }
.measure-main .chip { align-self: flex-start; }
.measure-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.measure-actions form { margin: 0; }
.measure-upload { margin-bottom: 16px; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.tool[hidden] { display: none; }
.measure-mode .pdf-page .layer { background: rgba(15, 23, 42, .035); }
.area-text { padding: 2px 3px; overflow: hidden; }
.area-text::placeholder { color: #60a5fa; }
/* Verwaltung: Bereiche festlegen */
.area-editor { display: flex; flex-direction: column; align-items: center; gap: 18px; margin-top: 14px; }
.area-page { position: relative; background: #fff; box-shadow: 0 2px 12px rgba(0,0,0,.14); max-width: 100%; }
.area-page canvas { display: block; width: 100%; height: 100%; }
.area-layer { position: absolute; inset: 0; cursor: crosshair; touch-action: none; }
.area-box { position: absolute; background: rgba(129, 186, 0, .18); outline: 2px solid var(--green); border-radius: 2px; cursor: move; touch-action: none; }
.area-box.sign { background: rgba(37, 99, 235, .14); outline-color: #2563eb; }
.area-box.selected { outline-width: 3px; box-shadow: 0 0 0 3px rgba(0, 44, 125, .25); }
.area-box.draft { outline-style: dashed; pointer-events: none; }
.area-badge { position: absolute; top: -11px; left: -11px; min-width: 22px; height: 22px; border-radius: 999px; background: var(--green-text); color: #fff; font-size: .72rem; font-weight: 700; display: grid; place-items: center; padding: 0 5px; }
.area-box.sign .area-badge { background: #2563eb; }
.area-box .resize { position: absolute; right: -7px; bottom: -7px; width: 16px; height: 16px; border-radius: 50%; background: #fff; border: 3px solid var(--accent); cursor: nwse-resize; }
.area-list { display: flex; flex-direction: column; gap: 8px; }
.area-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 8px 10px; border: 1px solid var(--line); border-radius: 12px; }
.area-row.selected { border-color: var(--accent); background: var(--accent-soft); }
.area-row .segmented { margin: 0; }
.area-row input[type=text] { flex: 1; min-width: 180px; }
@media (max-width: 700px) {
  .photo-grid { grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 6px; }
  .photo figcaption { padding: 4px 6px; }
  .site-tabs { width: 100%; }
  .site-tabs a { padding: 10px 10px; font-size: .88rem; gap: 5px; }
  .site-tabs a svg { display: none; }
  .measure-actions { width: 100%; }
}
/* Reiterleisten: auf schmalen Bildschirmen alle Reiter erreichbar (nicht links abgeschnitten) */
.kiosk-tabs { justify-content: flex-start; }
.kiosk-tabs a:first-child { margin-left: auto; }
.kiosk-tabs a:last-child { margin-right: auto; }
@media (max-width: 700px) {
  .kiosk-tabs { padding: 6px 8px 0; gap: 0; }
  .kiosk-tabs a { padding: 10px 12px; font-size: .95rem; }
  .photo-pick { width: 100%; justify-content: center; white-space: normal; text-align: center; }
  .site-tabs { display: flex; }
  .site-tabs { gap: 2px; padding: 4px; }
  .site-tabs a { flex: 1 1 auto; min-width: 0; justify-content: center; white-space: normal; text-align: center; line-height: 1.15; padding: 9px 4px; font-size: .84rem; flex-wrap: wrap; }
}
/* Felder auf dem PDF: allgemeine Eingabe-Stile (48 px hoch, Rahmen) nicht übernehmen,
   damit jedes Feld genau so groß ist wie im PDF */
.pdf-page input.field-input, .pdf-page textarea.field-input, .pdf-page select.field-input {
  min-height: 0; padding: 0 3px; border: 0; border-radius: 2px; box-shadow: none; transition: none;
  background: rgba(59, 130, 246, .10); color: #0f172a; font-family: Helvetica, Arial, sans-serif; font-weight: 400;
}
.pdf-page textarea.field-input { padding: 2px 3px; }
.pdf-page input.field-input:focus, .pdf-page textarea.field-input:focus, .pdf-page select.field-input:focus { background: rgba(59, 130, 246, .06); outline: 2px solid #2563eb; box-shadow: none; }
.pdf-page .field-input.is-filled { background: transparent; }
.pdf-page .field-input.is-required { box-shadow: inset 3px 0 0 #dc2626; }
.pdf-page .field-input.missing { outline: 2px solid var(--err); background: rgba(220, 38, 38, .1); }
.pdf-page .free-text input { min-height: 0; padding: 0 2px; border-radius: 2px; transition: none; font-weight: 400; }

/* Button Zeiterfassung (externe Seite) in der Logo-Farbe */
.kiosk-tabs a.tab-timeclock { align-self: center; background: var(--accent); color: #fff; border: 0; border-radius: 12px; padding: 10px 18px; margin-right: 10px; margin-bottom: 6px; box-shadow: 0 2px 6px rgba(0,0,0,.15); }
.kiosk-tabs a.tab-timeclock:hover, .kiosk-tabs a.tab-timeclock:active { filter: brightness(1.1); color: #fff; }
@media (max-width: 700px) { .kiosk-tabs a.tab-timeclock { padding: 8px 12px; margin-right: 6px; } }
/* Meine Daten: Urlaub/Krankheit und Krankmeldungen */
.year-stats { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; margin: 6px 0 10px; }
.ys { background: var(--accent-soft); border-radius: 14px; padding: 14px 12px; display: flex; flex-direction: column; gap: 2px; text-align: center; }
.ys-num { font-size: 1.9rem; font-weight: 800; color: var(--accent); line-height: 1.1; }
.ys-label { font-size: .85rem; font-weight: 600; color: var(--muted); }
.ys-main { background: var(--accent); }
.ys-main .ys-num, .ys-main .ys-label { color: #fff; }
.ys-sick { background: #fff4e6; }
.ys-sick .ys-num { color: #b45309; }
.sick-list-title { margin: 20px 0 8px; font-size: 1rem; }
.sick-list { display: flex; flex-direction: column; gap: 8px; }
.sick-item { display: flex; align-items: center; gap: 12px; padding: 10px; border: 1px solid var(--line); border-radius: 12px; }
.sick-item img { width: 56px; height: 56px; object-fit: cover; border-radius: 8px; background: #f1f5f9; }
.sick-body { flex: 1; display: flex; flex-direction: column; gap: 4px; align-items: flex-start; }
.year-form { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
@media (max-width: 760px) {
  .year-stats { grid-template-columns: repeat(3, 1fr); }
  .year-form { grid-template-columns: 1fr 1fr; }
}
.sent-list { display: flex; flex-direction: column; }
.sent-item { display: flex; align-items: center; gap: 10px; padding: 10px 2px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.sent-item:last-child { border-bottom: 0; }
.sent-item strong { flex: 1; min-width: 160px; }
.sent-icon { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--ok-soft); color: var(--ok); }
/* Wetter auf der Startseite */
#weather-box { display: flex; justify-content: center; margin: -16px 0 26px; }
.weather { display: inline-flex; align-items: center; gap: 14px; background: #fff; border-radius: 18px; box-shadow: var(--shadow); padding: 10px 22px 10px 14px; }
.weather-icon { flex: none; }
.weather-text { display: flex; flex-direction: column; text-align: left; }
.weather-temp { font-size: 2rem; font-weight: 800; color: var(--accent); line-height: 1.1; }
.weather-label { color: var(--muted); font-weight: 600; }
#weather-box:empty { display: none; }
/* Startseite: Begrüßung und News */
.start-hero { margin: 8px 0 22px; }
.start-hero h1 { font-size: 2.3rem; color: var(--accent); margin-bottom: 4px; }
.start-hero p { color: var(--muted); font-size: 1.2rem; }
.news-section h2 { display: flex; align-items: center; gap: 8px; color: var(--accent); }
.news-list { display: flex; flex-direction: column; gap: 14px; }
.news-item { display: flex; gap: 18px; align-items: flex-start; background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; border-left: 5px solid var(--green); }
.news-list.admin .news-item { box-shadow: none; border: 1px solid var(--line); border-left: 5px solid var(--green); flex-wrap: wrap; }
.news-img { width: 120px; height: 120px; object-fit: cover; border-radius: 12px; flex: none; background: #f1f5f9; }
.news-body { flex: 1; min-width: 0; }
.news-body h3 { margin: 2px 0 6px; font-size: 1.25rem; }
.news-date { font-size: .85rem; font-weight: 700; color: var(--green-text); }
.news-text { color: var(--text); line-height: 1.5; overflow-wrap: anywhere; }
.news-actions { display: flex; gap: 6px; align-items: center; }
.news-edit-img { display: flex; align-items: center; gap: 14px; margin-bottom: 10px; }
.news-edit-img img { width: 90px; height: 90px; object-fit: cover; border-radius: 10px; }
@media (max-width: 600px) {
  .news-item { gap: 12px; padding: 14px; }
  .news-img { width: 76px; height: 76px; }
  .start-hero h1 { font-size: 1.8rem; }
}
/* Baustellen-Chat */
.chat-card { display: flex; flex-direction: column; gap: 12px; }
.chat-list { height: min(58vh, 560px); overflow-y: auto; display: flex; flex-direction: column; gap: 8px; padding: 6px 4px; background: #f6f7fa; border-radius: 14px; }
.chat-empty { margin: auto; text-align: center; }
.chat-day { align-self: center; font-size: .8rem; font-weight: 700; color: var(--muted); background: #e8ebf1; padding: 3px 12px; border-radius: 999px; margin: 6px 0; }
.chat-msg { display: flex; padding: 0 6px; }
.chat-msg.mine { justify-content: flex-end; }
.chat-bubble { max-width: min(78%, 560px); background: #fff; border-radius: 16px 16px 16px 4px; padding: 8px 12px 6px; box-shadow: 0 1px 2px rgba(0,0,0,.08); display: flex; flex-direction: column; }
.chat-msg.mine .chat-bubble { background: var(--accent); color: #fff; border-radius: 16px 16px 4px 16px; }
.chat-name { font-size: .8rem; font-weight: 700; color: var(--green-text); }
.chat-text { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.4; }
.chat-time { align-self: flex-end; font-size: .72rem; opacity: .7; margin-top: 2px; }
.chat-del { align-self: flex-end; background: none; border: 0; font: inherit; font-size: .72rem; color: inherit; opacity: .6; text-decoration: underline; cursor: pointer; padding: 2px 0 0; }
.chat-msg:not(.mine) .chat-del { color: var(--danger, #dc2626); }
.chat-form { display: flex; gap: 10px; align-items: flex-end; }
.chat-form textarea { flex: 1; resize: vertical; min-height: 52px; }
@media (max-width: 600px) { .chat-form .btn { padding: 12px 14px; } .chat-bubble { max-width: 88%; } }
/* Verwaltung: Baustellen-Liste */
.sites-toolbar { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.sites-toolbar .seg-tabs { margin: 0; }
.sites-toolbar input[type=search] { flex: 1; min-width: 220px; }
.sites-list { display: flex; flex-direction: column; gap: 10px; }
.site-row { display: flex; gap: 16px; align-items: center; background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px 18px; border-left: 6px solid var(--c); text-decoration: none; color: var(--text); }
.site-row:hover { box-shadow: 0 4px 14px rgba(0,0,0,.12); }
.site-row[hidden] { display: none; }
.site-row-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.site-row-top { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: 1.1rem; }
.site-row .site-meta { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); font-size: .9rem; flex-wrap: wrap; }
.site-row-counts { display: flex; gap: 12px; color: var(--muted); font-weight: 600; font-size: .9rem; }
.site-row-counts span { display: inline-flex; align-items: center; gap: 3px; }
@media (max-width: 700px) { .site-row { flex-direction: column; align-items: flex-start; } }
/* Verwaltung: mehr Menüpunkte (Baustellen, News) – kompakter, Burger-Menü früher */
@media (min-width: 1041px) and (max-width: 1720px) {
  .admin-nav a svg, .admin-nav button svg { display: none; }
  .admin-nav { gap: 0; }
  .admin-nav a, .admin-nav button { padding-left: 9px; padding-right: 9px; font-size: .95rem; }
}
@media (max-width: 1240px) {
  .nav-toggle { display: flex; }
  .admin-nav { display: none; position: absolute; top: 100%; left: 0; right: 0; flex-direction: column; align-items: stretch; background: #fff; padding: 10px; border-bottom: 1px solid var(--line); box-shadow: var(--shadow); }
  .admin-nav a svg, .admin-nav button svg { display: inline; }
  .admin-nav a, .admin-nav button { font-size: 1rem; padding: 12px 14px; }
  body.nav-open .admin-nav { display: flex; }
  .nav-logout { margin: 6px 0 0; padding: 6px 0 0; border-left: 0; border-top: 1px solid var(--line); }
}
input[type=search] { width: 100%; min-height: 48px; padding: 10px 14px; border: 1px solid #d1d5db; border-radius: 12px; font: inherit; background: #fff; color: var(--text); }
/* News: Editor und große Bildansicht */
.rte { border: 1px solid #d1d5db; border-radius: 12px; background: #fff; }
.rte:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.rte-bar { display: flex; flex-wrap: wrap; gap: 4px; padding: 6px; border-bottom: 1px solid var(--line); background: #f8fafc; border-radius: 11px 11px 0 0;
  position: sticky; top: var(--rte-top, 72px); z-index: 20; }
.rte-bar.stuck { border-radius: 0; box-shadow: 0 6px 14px rgba(15, 23, 42, .12); }
.rte-bar button { min-width: 40px; height: 38px; padding: 0 10px; border: 1px solid transparent; border-radius: 8px; background: transparent; font: inherit; font-size: .95rem; color: var(--text); cursor: pointer; }
.rte-bar button:hover { background: #e8ebf1; }
.rte-bar button.on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.rte-sep { width: 1px; background: var(--line); margin: 4px 4px; }
.rte-area { min-height: 160px; padding: 12px 14px; outline: none; font-weight: 400; color: var(--text); }
.rte-area:empty::before { content: attr(data-placeholder); color: #9ca3af; }
.news-text h3, .news-text h4 { font-size: 1.1rem; margin: 10px 0 4px; color: var(--accent); }
.news-text p { margin: 0 0 8px; }
.news-text ul, .news-text ol { margin: 4px 0 8px; padding-left: 24px; }
.news-text > :last-child { margin-bottom: 0; }
.news-img[role=button] { cursor: zoom-in; }
#news-lightbox img { max-width: 96vw; max-height: 90vh; }

/* 1.15: Links im Text grün und unterstrichen, beim Drüberfahren blau */
.prose a, .info-text a, .news-text a, .rte-area a { color: var(--green-text); font-weight: 600; text-decoration: underline; text-decoration-color: var(--green); text-decoration-thickness: 2px; text-underline-offset: 3px; }
.prose a:hover, .info-text a:hover, .news-text a:hover, .rte-area a:hover { color: var(--accent); text-decoration-color: var(--accent); }
.link-dlg { width: min(520px, calc(100vw - 32px)); border: 0; border-radius: 18px; padding: 22px; box-shadow: 0 20px 60px rgba(15, 23, 42, .3); }
.link-dlg::backdrop { background: rgba(15, 23, 42, .45); }
.link-dlg h3 { margin: 0 0 6px; color: var(--accent); }
.link-dlg .field { display: block; margin-top: 12px; }
.link-dlg select, .link-dlg input { width: 100%; }
.link-dlg .form-actions { display: flex; gap: 8px; align-items: center; margin-top: 18px; flex-wrap: wrap; }

/* 1.17: Kostenrechner-Baukasten (Verwaltung) */
.calc-field > span { display: block; margin-bottom: 8px; }
.calc-help { margin-bottom: 14px; font-weight: 400; }
.calc-grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.calc-base { padding: 14px; border: 1px solid var(--line); border-radius: 14px; background: #f8fafc; margin-bottom: 14px; }
.calc-step { border: 1px solid var(--line); border-left: 4px solid var(--green); border-radius: 14px; padding: 14px; margin-bottom: 14px; background: #fff; }
.calc-step-head { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 10px; }
.calc-step-no { font-weight: 800; color: var(--accent); }
.calc-step-head select { width: auto; min-height: 40px; }
.calc-step-btns { margin-left: auto; display: flex; gap: 6px; }
.calc-opts { width: 100%; border-collapse: collapse; margin: 6px 0 10px; }
.calc-opts th { text-align: left; font-size: .8rem; color: var(--muted); font-weight: 600; padding: 4px 6px; }
.calc-opts td { padding: 4px 6px; vertical-align: middle; }
.calc-opts td:nth-child(3) { width: 170px; }
.calc-opts td:nth-child(4) { width: 120px; }
.calc-opts td:nth-child(5) { width: 44px; }
.calc-opts input, .calc-opts select { width: 100%; min-height: 40px; }
.calc-add { display: flex; gap: 8px; flex-wrap: wrap; }
@media (max-width: 760px) {
  .calc-grid3 { grid-template-columns: 1fr 1fr; }
  .calc-opts thead { display: none; }
  .calc-opts tr { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; padding: 8px 0; border-bottom: 1px solid var(--line); }
  .calc-opts td { padding: 0; width: auto !important; }
  .calc-opts td:first-child { grid-column: 1 / -1; }
}

/* 1.19 Statistik & Google */
.stat-grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.stat-num .trend { font-size: .85rem; font-weight: 700; vertical-align: middle; padding: 2px 8px; border-radius: 999px; background: #f1f5f9; color: var(--muted); }
.stat-num .trend.up { background: var(--ok-soft); color: var(--ok); }
.stat-num .trend.down { background: var(--warn-soft); color: var(--warn); }
.stats-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.stats-toolbar .seg-tabs { margin: 0; }
.stats-range a { padding: 9px 16px; font-size: .95rem; }
.live-dot { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; color: var(--muted); }
.live-dot::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: #cbd5e1; }
.live-dot.on::before { background: var(--green); box-shadow: 0 0 0 0 rgba(129, 186, 0, .6); animation: livepulse 1.8s infinite; }
@keyframes livepulse { 70% { box-shadow: 0 0 0 10px rgba(129, 186, 0, 0); } 100% { box-shadow: 0 0 0 0 rgba(129, 186, 0, 0); } }
.bar-chart { display: grid; grid-template-columns: auto 1fr; gap: 8px; height: 260px; }
.bar-axis { display: flex; flex-direction: column; justify-content: space-between; text-align: right; font-size: .75rem; color: var(--muted); padding-bottom: 22px; line-height: 1; transform: translateY(-.4em); }
.bar-plot { position: relative; display: flex; align-items: stretch; gap: 2px; padding-bottom: 22px; }
.bar-grid { position: absolute; inset: 0 0 22px 0; display: flex; flex-direction: column; justify-content: space-between; pointer-events: none; }
.bar-grid span { border-top: 1px solid #eef0f4; }
.bar-grid span:last-child { border-top-color: #cbd5e1; }
.bar-col { position: relative; flex: 1 1 0; min-width: 0; display: flex; align-items: flex-end; outline: none; }
.bar-col .bar { display: block; width: 100%; max-width: 46px; margin: 0 auto; background: var(--accent); border-radius: 4px 4px 0 0; min-height: 0; transition: background .15s; }
.bar-col:hover .bar, .bar-col:focus .bar { background: var(--green); }
.bar-x { position: absolute; left: 50%; bottom: -20px; transform: translateX(-50%); font-size: .72rem; color: var(--muted); white-space: nowrap; }
.bar-col:hover::after, .bar-col:focus::after { content: attr(data-tip); position: absolute; bottom: calc(100% - 30px); left: 50%; transform: translateX(-50%); background: #0f172a; color: #fff; font-size: .8rem; font-weight: 600; padding: 6px 10px; border-radius: 8px; white-space: nowrap; z-index: 5; pointer-events: none; }
.bar-col:first-child:hover::after, .bar-col:nth-child(2):hover::after, .bar-col:nth-child(3):hover::after { left: 0; transform: none; }
.bar-col:last-child:hover::after, .bar-col:nth-last-child(2):hover::after { left: auto; right: 0; transform: none; }
.table-toggle { margin-top: 12px; }
.table-toggle summary { cursor: pointer; color: var(--muted); font-weight: 600; font-size: .9rem; }
.stats-grid { margin-bottom: 20px; }
.hbar-list { display: grid; grid-template-columns: minmax(0, 1fr); gap: 4px; margin-bottom: 14px; }
.hbar { position: relative; display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 8px 10px 14px; border-radius: 10px; text-decoration: none; color: var(--text); }
a.hbar:hover { background: #f8fafc; }
.hbar::before { content: ""; position: absolute; left: 10px; right: 10px; bottom: 6px; height: 6px; border-radius: 3px; background: #eef1f6; }
.hbar-fill { position: absolute; left: 10px; bottom: 6px; height: 6px; width: calc((100% - 20px) * var(--w, 0)); border-radius: 3px; background: var(--accent); z-index: 1; }
a.hbar:hover .hbar-fill { background: var(--green); }
.hbar-label, .hbar-num { position: relative; z-index: 1; }
.hbar-label { font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hbar-num { font-weight: 700; white-space: nowrap; color: var(--accent); }
.hbar-num small { font-weight: 600; color: var(--muted); }
.device-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.device { display: grid; justify-items: center; gap: 2px; padding: 14px 8px; background: #f8fafc; border-radius: 12px; color: var(--accent); }
.device strong { font-size: 1.4rem; }
.device span { color: var(--muted); font-size: .85rem; font-weight: 600; }
.seo-checks { list-style: none; padding: 0; margin: 14px 0 18px; display: grid; gap: 8px; }
.seo-checks li { display: flex; gap: 10px; align-items: flex-start; }
.seo-checks .icon { color: var(--green); flex-shrink: 0; margin-top: 2px; }
.howto { background: #f8fafc; border-radius: 12px; padding: 12px 16px; margin-top: 8px; }
.howto summary { cursor: pointer; font-weight: 700; color: var(--accent); display: flex; align-items: center; gap: 8px; }
.howto ol { margin: 12px 0; padding-left: 22px; display: grid; gap: 6px; }
.seo-group { margin: 22px 0 8px; color: var(--accent); font-size: 1rem; text-transform: uppercase; letter-spacing: .05em; }
.seo-item { border: 1px solid var(--line); border-radius: 12px; margin-bottom: 8px; background: #fff; }
.seo-item[open] { border-color: #c7d2e7; box-shadow: var(--shadow); }
.seo-item summary { display: flex; align-items: center; gap: 10px; padding: 12px 14px; cursor: pointer; flex-wrap: wrap; }
.seo-name { font-weight: 700; }
.seo-url { margin-left: auto; color: var(--muted); font-size: .82rem; overflow-wrap: anywhere; }
.seo-edit { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; padding: 4px 14px 16px; }
.seo-fields .field { display: block; margin-bottom: 10px; }
.seo-fields input, .seo-fields textarea { width: 100%; }
.seo-count { font-weight: 600; margin-left: 6px; color: var(--muted); }
.seo-count.ok { color: var(--ok); }
.seo-count.long { color: var(--err); }
.serp { border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; font-family: Arial, sans-serif; background: #fff; align-self: start; }
.serp-label { display: block; color: var(--muted); font-family: inherit; margin-bottom: 8px; font-size: .75rem; text-transform: uppercase; letter-spacing: .05em; }
.serp-site { display: flex; gap: 10px; align-items: center; font-size: 14px; color: #202124; line-height: 1.25; }
.serp-site img { border-radius: 50%; background: #f1f3f4; padding: 3px; width: 26px; height: 26px; }
.serp-site small { color: #4d5156; font-size: 12px; }
.serp-title { color: #1a0dab; font-size: 20px; line-height: 1.3; margin: 8px 0 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.serp-desc { color: #4d5156; font-size: 14px; line-height: 1.58; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.sticky-save { position: sticky; bottom: 0; background: rgba(242, 244, 248, .95); padding: 12px 0; z-index: 4; }
.redirect-form { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.redirect-form .field { display: block; }
.redirect-form input, .redirect-form select { width: 100%; }
.redirect-form .form-actions { grid-column: 1 / -1; }
.inline-redirect { display: inline-flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.inline-redirect select { max-width: 220px; }
.inline-redirect input { max-width: 200px; }
@media (max-width: 1100px) { .stat-grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .seo-edit { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 700px) {
  .stat-grid-4 { grid-template-columns: 1fr; }
  .bar-chart { height: 200px; }
  .redirect-form { grid-template-columns: 1fr; }
  .seo-url { margin-left: 0; width: 100%; }
  .stats-range { flex-wrap: wrap; }
  .stats-range a { padding: 8px 10px; font-size: .88rem; }
  .portal-grid.stats-grid { grid-template-columns: minmax(0, 1fr); }
  .stats-toolbar .seg-tabs { width: 100%; }
}

/* 1.20 Sicherheits-Check */
.sec-checks { list-style: none; padding: 0; margin: 0 0 24px; display: grid; gap: 8px; }
.sec-checks li { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: 10px; background: #f8fafc; }
.sec-checks li .icon { flex-shrink: 0; margin-top: 2px; color: var(--green); }
.sec-checks li.bad { background: var(--warn-soft); }
.sec-checks li.bad .icon { color: var(--warn); }
.sec-checks small { display: block; color: var(--text); margin-top: 4px; font-size: .88rem; }

/* 1.21: Allgemeine Dokumente */
.card-head-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.card-head-row h2 { margin: 0; display: flex; align-items: center; gap: 8px; }
.sd-h { margin: 18px 0 10px; font-size: 1rem; }
.vis-choice { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 6px 0 16px; }
.vis-choice label { cursor: pointer; }
.vis-choice input { position: absolute; opacity: 0; }
.vis-choice span { display: grid; grid-template-columns: auto 1fr; column-gap: 10px; row-gap: 2px; align-items: center; padding: 14px 16px; border: 2px solid var(--line); border-radius: 14px; background: #fff; height: 100%; transition: border-color .15s, background .15s; }
.vis-choice span svg { grid-row: span 2; color: var(--muted); }
.vis-choice small { color: var(--muted); grid-column: 2; }
.vis-choice input:checked + span { border-color: var(--green); background: var(--green-soft); }
.vis-choice input:checked + span svg { color: var(--green-text); }
.vis-choice input:focus-visible + span { box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 30%, transparent); }
.sd-filter { width: 100%; margin-bottom: 10px; }
.sd-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); gap: 8px; margin-bottom: 14px; }
.sd-proj { display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; cursor: pointer; background: #fff; min-width: 0; }
.sd-proj span { min-width: 0; overflow-wrap: anywhere; }
.sd-proj input { margin-top: 3px; width: 18px; height: 18px; accent-color: var(--green); flex-shrink: 0; }
.sd-proj small { color: var(--muted); }
.sd-proj:has(input:checked) { border-color: var(--green); background: var(--green-soft); }
.sd-proj.is-all { cursor: default; opacity: .85; }
.sd-proj.is-archived b { color: var(--muted); }
.doc-section-title { display: flex; align-items: center; gap: 8px; margin: 30px 0 2px; font-size: 1.15rem; }
.doc-section-sub { margin: 0 0 12px; }
@media (max-width: 640px) { .vis-choice { grid-template-columns: minmax(0, 1fr); } }

/* 1.22: Chat-Nachrichten löschen (Verwaltung) */
.chat-foot { display: flex; align-items: center; justify-content: flex-end; gap: 8px; margin-top: 2px; }
.chat-foot .chat-time { margin-top: 0; }
.chat-foot .chat-del { padding: 2px; text-decoration: none; display: inline-flex; opacity: .55; }
.chat-foot .chat-del:hover { opacity: 1; }
.chat-msg:not(.mine) .chat-foot .chat-del { color: var(--err); }

/* 1.22: Markierung wie ein Pinselstrich (Gelb / Grün) */
mark.hl-yellow, mark.hl-green { color: #1f2937; background-color: transparent; background-repeat: no-repeat; background-size: 100% 88%; background-position: 50% 60%;
  padding: .1em .4em; margin: 0 -.15em; border-radius: 0; -webkit-box-decoration-break: clone; box-decoration-break: clone; }
mark.hl-yellow { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 300 60' preserveAspectRatio='none'%3E%3Cpath fill='%23ffe04f' d='M10 9c12-3 26 1 40-2 20-3 44 1 66-1 26-2 52 2 78-1 24-3 50 0 76 1 8 0 14 2 22 1l-6 5 8 3-7 4 9 3-8 4 7 4-8 3 9 4-9 3 8 4-7 3c-12 2-24 0-36 1-28 2-56-1-84 1-26 2-52-1-78 1-22 2-44 1-64 3-6 1-12 0-18 1l5-4-9-3 7-4-8-3 8-4-9-3 8-4-7-4 8-3-6-4 8-3z'/%3E%3Cpath fill='%23ffd000' opacity='.7' d='M18 15c50-3 110-1 160-3 40-1 75 0 105 1-40 2-80 3-120 3-50 1-100 1-145-1zM14 30c60-1 130 1 190 0 30 0 60 0 80 1-50 2-100 2-150 2-40 0-80-1-120-3zM22 45c45-2 95 0 140-1 40-1 80-1 118 0-45 3-90 3-135 3-41 0-83 0-123-2z'/%3E%3Cpath fill='%23fff3a6' opacity='.5' d='M30 22c40-1 80 0 120-1 35 0 70 0 100 1-35 1-70 2-105 2-38 0-77 0-115-2zM40 38c50-1 100 0 150-1 25 0 50 0 70 1-40 1-80 2-120 2-34 0-67 0-100-2z'/%3E%3C/svg%3E"); }
mark.hl-green { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 300 60' preserveAspectRatio='none'%3E%3Cpath fill='%23b5df62' d='M10 9c12-3 26 1 40-2 20-3 44 1 66-1 26-2 52 2 78-1 24-3 50 0 76 1 8 0 14 2 22 1l-6 5 8 3-7 4 9 3-8 4 7 4-8 3 9 4-9 3 8 4-7 3c-12 2-24 0-36 1-28 2-56-1-84 1-26 2-52-1-78 1-22 2-44 1-64 3-6 1-12 0-18 1l5-4-9-3 7-4-8-3 8-4-9-3 8-4-7-4 8-3-6-4 8-3z'/%3E%3Cpath fill='%2394cc2e' opacity='.7' d='M18 15c50-3 110-1 160-3 40-1 75 0 105 1-40 2-80 3-120 3-50 1-100 1-145-1zM14 30c60-1 130 1 190 0 30 0 60 0 80 1-50 2-100 2-150 2-40 0-80-1-120-3zM22 45c45-2 95 0 140-1 40-1 80-1 118 0-45 3-90 3-135 3-41 0-83 0-123-2z'/%3E%3Cpath fill='%23d6f0a0' opacity='.5' d='M30 22c40-1 80 0 120-1 35 0 70 0 100 1-35 1-70 2-105 2-38 0-77 0-115-2zM40 38c50-1 100 0 150-1 25 0 50 0 70 1-40 1-80 2-120 2-34 0-67 0-100-2z'/%3E%3C/svg%3E"); }
.rte-bar button.rte-hl mark { pointer-events: none; font-weight: 600; }
.rte-bar .rte-danger { color: var(--err); }
.rte-tbl { display: inline-flex; flex-wrap: wrap; gap: 4px; align-items: center; padding-left: 8px; margin-left: 4px; border-left: 2px solid var(--green); }
.rte-tbl[hidden] { display: none; }
.rte-tbl-label { font-size: .85rem; font-weight: 700; color: var(--green-text); padding-right: 2px; }
/* Tabellen im Text */
.tbl-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 14px 0; border-radius: 12px; border: 1px solid var(--line); background: #fff; }
.tbl-wrap table, .rte-area table { width: 100%; border-collapse: collapse; font-size: .97em; line-height: 1.45; }
.tbl-wrap th, .tbl-wrap td, .rte-area th, .rte-area td { padding: 10px 14px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
.tbl-wrap th, .rte-area th { background: var(--accent); color: #fff; font-weight: 700; white-space: nowrap; }
.tbl-wrap tbody tr:nth-child(even) td, .rte-area tbody tr:nth-child(even) td { background: #f6f8fb; }
.tbl-wrap tbody tr:last-child td { border-bottom: 0; }
.tbl-wrap td + td, .tbl-wrap th + th { border-left: 1px solid var(--line); }
.tbl-wrap th + th { border-left-color: rgba(255,255,255,.18); }
.rte-area table { margin: 10px 0; border: 1px solid #cbd5e1; }
.rte-area td, .rte-area th { border: 1px solid #cbd5e1; min-width: 60px; }
.rte-area td:focus-within, .rte-area th:focus-within { outline: 2px solid var(--green); outline-offset: -2px; }
.section-navy .tbl-wrap, .section-deep .tbl-wrap, .comic .tbl-wrap { color: var(--text); }
@media (max-width: 600px) { .tbl-wrap th, .tbl-wrap td { padding: 8px 10px; } }

/* 1.24: Status-Farben (Anfragen, Kunden) */
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; vertical-align: middle; font-style: normal; }
.dot-orange { background: #f97316; }
.dot-red { background: #dc2626; }
.dot-yellow { background: #eab308; }
.dot-blue { background: #2563eb; }
.dot-green { background: #65a30d; }
.dot-grey { background: #9ca3af; }
.chip-orange { background: #ffedd5; color: #c2410c; }
.btn-orange { background: #f97316; border-color: #f97316; color: #fff; }
.btn-orange:hover { background: #ea580c; border-color: #ea580c; color: #fff; }
.btn-red { background: #dc2626; border-color: #dc2626; color: #fff; }
.btn-red:hover { background: #b91c1c; border-color: #b91c1c; color: #fff; }
.inq-status-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line); }
.inq-status-label { font-weight: 700; margin-right: 4px; }
.inq-status-row .btn:not(.is-current) { opacity: .55; }
.inq-status-row .btn:not(.is-current):hover { opacity: 1; }
.inq-status-row .btn.is-current { box-shadow: 0 0 0 3px #fff, 0 0 0 5px currentColor; opacity: 1; }
.inq-status-row .btn-success.is-current { box-shadow: 0 0 0 3px #fff, 0 0 0 5px var(--green); }
.inq-status-row .btn-orange.is-current { box-shadow: 0 0 0 3px #fff, 0 0 0 5px #f97316; }
.inq-status-row .btn-red.is-current { box-shadow: 0 0 0 3px #fff, 0 0 0 5px #dc2626; }
.inq-filter { flex-wrap: wrap; }
.inq-filter a { display: inline-flex; align-items: center; gap: 6px; }
tr.inq-open td:first-child { box-shadow: inset 4px 0 0 #f97316; }
tr.inq-rejected td:first-child { box-shadow: inset 4px 0 0 #dc2626; }
.inq-filter a { padding: 10px 16px; font-size: 1rem; }
.phase-filter { flex-wrap: wrap; margin-top: 14px; }
.phase-filter a { padding: 9px 14px; font-size: .95rem; }
.phase-cell { white-space: nowrap; }
.phase-item { display: inline-flex; align-items: center; gap: 6px; margin-right: 6px; }
.phase-item .dot { width: 12px; height: 12px; box-shadow: 0 0 0 2px #fff, 0 0 0 3px rgba(0,0,0,.06); }
.phase-label { font-size: .9rem; font-weight: 600; }
.steps-rejected { display: flex; align-items: center; gap: 14px; padding: 16px 18px; border-radius: 14px; background: var(--err-soft); color: var(--err); margin-top: 18px; }
.steps-rejected span { display: flex; flex-direction: column; }
.steps-rejected small { color: var(--text); opacity: .8; font-size: .9rem; margin-top: 2px; }
.plan-box.rejected { background: var(--err-soft); color: var(--err); }
.img-stats { display: flex; flex-wrap: wrap; gap: 10px 22px; margin: 4px 0 16px; }
.img-stats span { background: #f6f7fa; border-radius: 12px; padding: 10px 14px; }
.img-stats strong { font-size: 1.15rem; margin-right: 4px; }
.img-todo { color: #c2410c; }
.img-ok { color: var(--green-text); display: inline-flex; align-items: center; gap: 6px; font-weight: 600; }
/* 1.25: Links im Chat */
.chat-text a { color: var(--green-text); font-weight: 600; text-decoration: underline; text-underline-offset: 2px; overflow-wrap: anywhere; }
.chat-msg.mine .chat-text a { color: #fff; text-decoration-color: var(--green); }
