/* Adminova – Gestaltung (übernommen aus der Rinova-Plattform, Stand bb0be91)
 * Ruhige, zeitlose Arbeitsoberfläche. Eine Schrift (Inter, selbst gehostet), kühler Stein-Grund,
 * Akzent "Tanne" für Handlungen. Farbe trägt Bedeutung: In der Zeitachse steht Tanne für Nutzung,
 * Sandstein für Eigentum, Schiefer für Verwaltung. Kein Build-Schritt nötig.
 */

@font-face {
  font-family: "Inter";
  src: url("/fonts/inter-latin-wght-normal.woff2") format("woff2");
  font-weight: 100 900; font-style: normal; font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Inter";
  src: url("/fonts/inter-latin-ext-wght-normal.woff2") format("woff2");
  font-weight: 100 900; font-style: normal; font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  --paper: #F4F6F4;        /* Grund: kühler Stein */
  --surface: #FFFFFF;
  --ink: #1B2420;          /* Text */
  --ink-2: #48534E;        /* Nebentext */
  --ink-3: #6E7873;        /* Hinweise */
  --line: #DCE2DE;
  --line-2: #EBEFEC;
  --tanne: #2C5A4B;        /* Akzent, Nutzung */
  --tanne-strong: #224A3D;
  --tanne-soft: #E3EDE8;
  --sandstein: #A6583F;    /* Eigentum */
  --sandstein-soft: #F3E6E1;
  --schiefer: #4B6275;     /* Verwaltung */
  --schiefer-soft: #E4EAF0;
  --warn: #8A5A00;
  --warn-soft: #FBF1DC;
  --danger: #A23B3B;
  --danger-soft: #F8E5E5;
  --ok: #2F6B45;
  --radius-s: 6px;
  --radius: 10px;
  --focus: 0 0 0 3px rgba(44, 90, 75, .28);
  --sidebar: 252px;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; font-family: var(--font); font-size: 15px; line-height: 1.55; color: var(--ink);
  background: var(--paper); font-feature-settings: "cv11", "ss01"; -webkit-font-smoothing: antialiased;
}
a { color: var(--tanne); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
h1, h2, h3 { margin: 0; line-height: 1.25; font-weight: 600; letter-spacing: -0.01em; }
h1 { font-size: 26px; letter-spacing: -0.02em; }
h2 { font-size: 18px; }
h3 { font-size: 15px; }
p { margin: 0 0 .75em; }
.num, td.num, .tabular { font-variant-numeric: tabular-nums; }
.muted { color: var(--ink-2); }
.hint { color: var(--ink-3); font-size: 13px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: var(--radius-s); }
.icon { width: 18px; height: 18px; flex: none; stroke-width: 1.75; }
.icon-s { width: 15px; height: 15px; }

/* ------------------------------------------------------------------ Grundgerüst */
.app { display: grid; grid-template-columns: var(--sidebar) 1fr; min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh; overflow-y: auto; background: var(--surface);
  border-right: 1px solid var(--line); display: flex; flex-direction: column; padding: 20px 14px;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 10px 22px; color: var(--ink); }
.brand:hover { text-decoration: none; }
.brand-mark {
  width: 30px; height: 30px; border-radius: 8px; background: var(--tanne); color: #fff;
  display: grid; place-items: center; font-weight: 700; font-size: 15px;
}
.brand-name { font-weight: 650; font-size: 16px; letter-spacing: -0.01em; }
.brand-sub { display: block; font-size: 12px; color: var(--ink-3); font-weight: 450; }
.nav-group { margin-top: 18px; }
.nav-group-label { font-size: 12.5px; color: var(--ink-3); padding: 0 10px 6px; }
.nav a {
  display: flex; align-items: center; gap: 11px; padding: 8px 10px; border-radius: 8px; color: var(--ink-2);
  font-weight: 500;
}
.nav a:hover { background: var(--paper); color: var(--ink); text-decoration: none; }
.nav a[aria-current="page"] { background: var(--tanne-soft); color: var(--tanne-strong); }
.nav a[aria-current="page"] .icon { color: var(--tanne); }
.sidebar-foot { margin-top: auto; padding: 14px 10px 0; border-top: 1px solid var(--line-2); font-size: 13px; color: var(--ink-3); }
.user-chip { display: flex; align-items: center; gap: 10px; color: var(--ink); }
.avatar {
  width: 30px; height: 30px; border-radius: 50%; background: var(--schiefer-soft); color: var(--schiefer);
  display: grid; place-items: center; font-weight: 600; font-size: 12.5px; flex: none;
}

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 20; background: rgba(244, 246, 244, .92); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line); padding: 12px 32px; display: flex; align-items: center; gap: 16px;
}
.topbar .menu-toggle { display: none; }
.content { padding: 28px 32px 64px; max-width: 1240px; width: 100%; }

/* ------------------------------------------------------------------ Suche & Stichtag */
.search { position: relative; flex: 1; max-width: 560px; }
.search input {
  width: 100%; padding: 9px 12px 9px 38px; border: 1px solid var(--line); border-radius: 999px;
  background: var(--surface); font: inherit; color: var(--ink);
}
.search input:focus { outline: none; border-color: var(--tanne); box-shadow: var(--focus); }
.search .icon { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--ink-3); }
.search-results {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: 0 12px 32px rgba(27, 36, 32, .12); padding: 6px; display: none; max-height: 70vh; overflow-y: auto;
}
.search-results[data-open] { display: block; }
.search-results a { display: flex; gap: 10px; align-items: center; padding: 8px 10px; border-radius: 8px; color: var(--ink); }
.search-results a:hover, .search-results a[aria-selected="true"] { background: var(--paper); text-decoration: none; }
.search-results .kind { margin-left: auto; font-size: 12.5px; color: var(--ink-3); }
.search-results .empty { padding: 10px; color: var(--ink-3); font-size: 14px; }

.stichtag { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.stichtag label { font-size: 13px; color: var(--ink-2); white-space: nowrap; }
.stichtag input { padding: 6px 8px; border: 1px solid var(--line); border-radius: 8px; font: inherit; font-size: 14px; background: var(--surface); }
.stichtag[data-past] input { border-color: var(--sandstein); background: var(--sandstein-soft); }
.stichtag-reset { font-size: 13px; }

/* ------------------------------------------------------------------ Kopf einer Seite */
.crumbs { display: flex; gap: 6px; align-items: center; font-size: 13.5px; color: var(--ink-3); margin-bottom: 10px; flex-wrap: wrap; }
.crumbs a { color: var(--ink-2); }
.page-head { display: flex; align-items: flex-start; gap: 24px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head .titles { flex: 1; min-width: 260px; }
.page-head .facts { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 8px; color: var(--ink-2); font-size: 14px; }
.page-head .facts span { display: inline-flex; align-items: center; gap: 6px; }
.page-head .actions { display: flex; gap: 8px; flex-wrap: wrap; }
.code-tag {
  display: inline-block; font-size: 13px; font-weight: 600; letter-spacing: .02em; color: var(--tanne-strong);
  background: var(--tanne-soft); border-radius: 6px; padding: 2px 8px; margin-left: 10px; vertical-align: 4px;
}

/* ------------------------------------------------------------------ Bausteine */
.btn {
  display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 8px; border: 1px solid var(--line);
  background: var(--surface); color: var(--ink); font: inherit; font-weight: 550; font-size: 14px; cursor: pointer; white-space: nowrap;
}
.btn:hover { border-color: #c5ccc8; text-decoration: none; }
.btn-primary { background: var(--tanne); border-color: var(--tanne); color: #fff; }
.btn-primary:hover { background: var(--tanne-strong); border-color: var(--tanne-strong); }
.btn-quiet { border-color: transparent; background: transparent; color: var(--tanne); padding-left: 8px; padding-right: 8px; }
.btn-quiet:hover { background: var(--tanne-soft); }
.btn-danger { color: var(--danger); }
.btn-s { padding: 5px 10px; font-size: 13px; }

.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.panel + .panel, .panel + .grid, .grid + .panel { margin-top: 20px; }
.panel-head { display: flex; align-items: center; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line-2); }
.panel-head h2 { font-size: 16px; }
.panel-head .hint { margin-left: auto; }
.panel-body { padding: 18px 20px; }
.panel-body.flush { padding: 0; }

.grid { display: grid; gap: 20px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid .full { grid-column: 1 / -1; }
.grid > .panel, .grid > div > .panel { margin-top: 0; }

.badge {
  display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; font-weight: 550; padding: 2px 8px;
  border-radius: 999px; background: var(--line-2); color: var(--ink-2); white-space: nowrap;
}
.badge-usage { background: var(--tanne-soft); color: var(--tanne-strong); }
.badge-ownership { background: var(--sandstein-soft); color: #7E3F2B; }
.badge-management { background: var(--schiefer-soft); color: #3A4F60; }
.badge-warn { background: var(--warn-soft); color: var(--warn); }
.badge-danger { background: var(--danger-soft); color: var(--danger); }

/* Tabelle */
.table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.table th { text-align: left; font-weight: 550; color: var(--ink-2); font-size: 13px; padding: 10px 14px; border-bottom: 1px solid var(--line); background: #FAFBFA; }
.table td { padding: 11px 14px; border-bottom: 1px solid var(--line-2); vertical-align: top; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr[data-href] { cursor: pointer; }
.table tbody tr[data-href]:hover td { background: #F8FAF9; }
.table .num { text-align: right; }
.table .strong { font-weight: 600; }
.table-wrap { overflow-x: auto; }

/* Merkmalsliste */
.facts-list { display: grid; grid-template-columns: minmax(140px, 220px) 1fr; gap: 0; margin: 0; }
.facts-list dt { color: var(--ink-2); padding: 9px 0; border-bottom: 1px solid var(--line-2); font-size: 14px; }
.facts-list dd { margin: 0; padding: 9px 0; border-bottom: 1px solid var(--line-2); }
.facts-list dt:last-of-type, .facts-list dd:last-of-type { border-bottom: 0; }

/* Reiter */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 22px; overflow-x: auto; }
.tabs a {
  padding: 10px 12px; color: var(--ink-2); font-weight: 550; font-size: 14.5px; border-bottom: 2px solid transparent;
  margin-bottom: -1px; white-space: nowrap; display: inline-flex; gap: 7px; align-items: center;
}
.tabs a:hover { color: var(--ink); text-decoration: none; }
.tabs a[aria-current="page"] { color: var(--tanne-strong); border-bottom-color: var(--tanne); }
.tabs .count { font-size: 12px; background: var(--line-2); color: var(--ink-2); border-radius: 999px; padding: 0 7px; }

/* Leerer Zustand */
.empty-state { padding: 34px 24px; text-align: center; color: var(--ink-2); }
.empty-state .icon { width: 28px; height: 28px; color: var(--ink-3); margin-bottom: 8px; }
.empty-state h3 { color: var(--ink); margin-bottom: 4px; }
.empty-state p { max-width: 440px; margin: 0 auto 14px; }

/* Hinweise */
.notice { display: flex; gap: 12px; padding: 12px 16px; border-radius: var(--radius); border: 1px solid; margin-bottom: 18px; align-items: flex-start; }
.notice .icon { margin-top: 2px; }
.notice-ok { background: #E8F2EC; border-color: #C9DFD1; color: #1F4A30; }
.notice-warn { background: var(--warn-soft); border-color: #EBD6A8; color: #5C3D00; }
.notice-danger { background: var(--danger-soft); border-color: #E7C2C2; color: #6E2222; }
.notice-info { background: var(--schiefer-soft); border-color: #CBD6E0; color: #2E3F4D; }

/* Prüfliste auf der Startseite */
.todo { list-style: none; margin: 0; padding: 0; }
.todo li { display: flex; gap: 12px; align-items: flex-start; padding: 12px 20px; border-bottom: 1px solid var(--line-2); }
.todo li:last-child { border-bottom: 0; }
.todo .what { flex: 1; }
.todo .where { color: var(--ink-3); font-size: 13.5px; }

/* Objektliste */
.objects { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); }
.object-card { display: block; padding: 18px 18px 16px; color: var(--ink); }
.object-card:hover { text-decoration: none; border-color: #BFC9C3; }
.object-card .title { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; }
.object-card .name { font-weight: 600; font-size: 16px; }
.object-card .code { font-size: 12.5px; font-weight: 600; color: var(--tanne-strong); }
.object-card .addr { color: var(--ink-2); font-size: 14px; margin: 2px 0 14px; }
.occupancy { display: flex; height: 6px; border-radius: 3px; overflow: hidden; background: var(--line-2); }
.occupancy span { display: block; height: 100%; }
.occupancy .used { background: var(--tanne); }
.occupancy .own { background: var(--sandstein); }
.occupancy .open { background: repeating-linear-gradient(45deg, #D8DDD9 0 4px, #EDF0EE 4px 8px); }
.object-card .meta { display: flex; gap: 4px 14px; margin-top: 10px; font-size: 13px; color: var(--ink-2); flex-wrap: wrap; }

/* ------------------------------------------------------------------ Zeitachse (das Kennzeichen der Plattform) */
.timeline { padding: 8px 20px 20px; }
.tl-scale { position: relative; height: 26px; margin-left: 150px; border-bottom: 1px solid var(--line); }
.tl-scale span { position: absolute; bottom: 4px; transform: translateX(-50%); font-size: 12px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.tl-row { display: grid; grid-template-columns: 150px 1fr; align-items: center; min-height: 44px; border-bottom: 1px solid var(--line-2); }
.tl-row:last-child { border-bottom: 0; }
.tl-label { font-size: 13.5px; color: var(--ink-2); font-weight: 550; padding-right: 12px; }
.tl-track { position: relative; height: 44px; }
.tl-bar {
  position: absolute; top: 9px; height: 26px; border-radius: 6px; padding: 0 8px; display: flex; align-items: center;
  font-size: 12.5px; font-weight: 550; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; color: #fff;
  border: 1px solid rgba(0,0,0,.06);
}
.tl-bar:hover { text-decoration: none; filter: brightness(1.08); }
.tl-bar.usage { background: var(--tanne); }
.tl-bar.vacancy { background: repeating-linear-gradient(45deg, #CBD2CE 0 5px, #E3E7E4 5px 10px); color: var(--ink-2); }
.tl-bar.ownership { background: var(--sandstein); }
.tl-bar.management { background: var(--schiefer); }
.tl-bar.measure { background: var(--surface); color: var(--ink); border: 1px solid var(--line); font-weight: 500; }
.tl-bar.open-end { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.tl-marker { position: absolute; top: 0; bottom: 0; width: 0; border-left: 2px solid var(--ink); z-index: 2; pointer-events: none; }
.tl-marker.today { border-left: 1px dashed var(--ink-3); }
.tl-marker::after {
  content: attr(data-label); position: absolute; top: -22px; left: 4px; font-size: 11.5px; color: var(--ink-2);
  background: var(--surface); padding: 0 4px; white-space: nowrap;
}
.tl-body { position: relative; }
.tl-body .tl-markers { position: absolute; top: 0; bottom: 0; left: 150px; right: 0; pointer-events: none; }
.tl-legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 13px; color: var(--ink-2); padding: 0 20px 16px; }
.tl-legend i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; vertical-align: -1px; margin-right: 6px; }

/* ------------------------------------------------------------------ Formulare */
.form { max-width: 760px; }
.form-section { padding: 20px; border-bottom: 1px solid var(--line-2); }
.form-section:last-of-type { border-bottom: 0; }
.form-section > h2 { font-size: 16px; margin-bottom: 4px; }
.form-section > .hint { margin-bottom: 14px; }
.fields { display: grid; gap: 14px 16px; grid-template-columns: repeat(6, minmax(0, 1fr)); }
.field { grid-column: span 6; display: flex; flex-direction: column; gap: 5px; }
.field.w1 { grid-column: span 1; } .field.w2 { grid-column: span 2; } .field.w3 { grid-column: span 3; } .field.w4 { grid-column: span 4; }
.field label, .field .label { font-weight: 550; font-size: 14px; }
.field .optional { color: var(--ink-3); font-weight: 450; }
.field input[type=text], .field input[type=email], .field input[type=date], .field input[type=number], .field input[type=tel], .field input[type=time],
.field select, .field textarea {
  font: inherit; padding: 9px 11px; border: 1px solid #CDD5D0; border-radius: var(--radius-s); background: var(--surface); color: var(--ink); width: 100%;
}
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--tanne); box-shadow: var(--focus); }
.field .help { font-size: 13px; color: var(--ink-3); }
.field .error { font-size: 13px; color: var(--danger); }
.field.has-error input, .field.has-error select { border-color: var(--danger); }
.choices { display: flex; flex-wrap: wrap; gap: 8px; }
.choice {
  display: flex; gap: 9px; align-items: flex-start; padding: 10px 12px; border: 1px solid #CDD5D0; border-radius: 8px; cursor: pointer;
  background: var(--surface); flex: 1 1 210px;
}
.choice:has(input:checked) { border-color: var(--tanne); background: var(--tanne-soft); }
.choice input { margin-top: 3px; accent-color: var(--tanne); }
.choice small { display: block; color: var(--ink-3); font-size: 12.5px; }
.form-actions { display: flex; gap: 10px; padding: 16px 20px; background: #FAFBFA; border-top: 1px solid var(--line); border-radius: 0 0 var(--radius) var(--radius); }
.repeat-row { display: grid; gap: 10px; grid-template-columns: 2fr 1fr 1fr auto; align-items: end; padding: 12px 0; border-bottom: 1px dashed var(--line); }
.preview { margin-top: 12px; padding: 12px 14px; border-radius: 8px; background: var(--paper); font-size: 14px; color: var(--ink-2); }

/* Personenauswahl */
.picker { position: relative; }
.picker-list { position: absolute; z-index: 30; left: 0; right: 0; top: calc(100% + 4px); background: var(--surface); border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 10px 28px rgba(27,36,32,.12); display: none; max-height: 280px; overflow-y: auto; }
.picker-list[data-open] { display: block; }
.picker-list button { display: block; width: 100%; text-align: left; border: 0; background: none; padding: 9px 12px; font: inherit; cursor: pointer; }
.picker-list button:hover, .picker-list button[aria-selected="true"] { background: var(--paper); }
.picker-list .sub { color: var(--ink-3); font-size: 13px; }
.picker-chosen { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--tanne); background: var(--tanne-soft); border-radius: var(--radius-s); }
.picker-chosen button { margin-left: auto; }
.picker-new { margin-top: 10px; padding: 12px; border: 1px dashed #BFC9C3; border-radius: 8px; display: none; }
.picker-new[data-open] { display: block; }

/* Verlauf */
.history { list-style: none; margin: 0; padding: 0; }
.history li { padding: 12px 20px; border-bottom: 1px solid var(--line-2); display: grid; grid-template-columns: 150px 1fr; gap: 12px; }
.history li:last-child { border-bottom: 0; }
.history time { color: var(--ink-3); font-size: 13.5px; font-variant-numeric: tabular-nums; }
.history .who { color: var(--ink-3); font-size: 13px; }
.history details summary { cursor: pointer; color: var(--tanne); font-size: 13px; }
.history pre { white-space: pre-wrap; font-size: 12.5px; background: var(--paper); padding: 10px; border-radius: 6px; }

/* Anmeldung */
.guest { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login { width: 100%; max-width: 420px; padding: 34px; text-align: left; }
.login .brand { padding: 0 0 26px; }
.login h1 { font-size: 22px; margin-bottom: 8px; }
.login .btn { width: 100%; justify-content: center; padding: 11px 14px; margin-top: 18px; }

/* ------------------------------------------------------------------ Kleine Bildschirme */
@media (max-width: 980px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: fixed; z-index: 40; width: 280px; left: 0; transform: translateX(-100%); transition: transform .2s ease; }
  .sidebar[data-open] { box-shadow: 0 0 40px rgba(0,0,0,.15); }
  .sidebar[data-open] { transform: none; }
  .topbar .menu-toggle { display: inline-flex; }
  .topbar { padding: 10px 16px; flex-wrap: wrap; }
  .search { order: 3; flex-basis: 100%; max-width: none; }
  .content { padding: 20px 16px 48px; }
  .grid { grid-template-columns: 1fr; }
  .facts-list { grid-template-columns: 1fr; }
  .facts-list dt { border-bottom: 0; padding-bottom: 0; }
  .field.w1, .field.w2, .field.w3, .field.w4 { grid-column: span 6; }
  .tl-scale { margin-left: 92px; }
  .tl-row { grid-template-columns: 92px 1fr; }
  .tl-body .tl-markers { left: 92px; }
  .history li { grid-template-columns: 1fr; gap: 2px; }
  .repeat-row { grid-template-columns: 1fr 1fr; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* ---------------------------------------------------------------- Stammdaten einlesen */
.steps { list-style: none; margin: 0 0 18px; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.steps li { display: flex; gap: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.steps p { margin: 4px 0 10px; color: var(--ink-2); font-size: 14px; }
.step-no { flex: none; width: 28px; height: 28px; border-radius: 50%; background: var(--tanne-soft); color: var(--tanne-strong); display: grid; place-items: center; font-weight: 600; }
.dropzone { margin: 20px 20px 0; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 32px 16px; border: 2px dashed var(--line); border-radius: var(--radius); cursor: pointer; text-align: center; transition: border-color .15s, background .15s; }
.dropzone:hover, .dropzone[data-over] { border-color: var(--tanne); background: var(--tanne-soft); }
.dropzone .icon { width: 32px; height: 32px; color: var(--tanne); }
.dropzone input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.error-text { color: var(--danger); margin: 8px 20px 0; }
.grid-import { grid-template-columns: minmax(260px, 1fr) 2fr; align-items: start; }
.table-compact td, .table-compact th { padding-top: 7px; padding-bottom: 7px; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.issue-sheet { font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-3); margin: 16px 20px 6px; }
.issues { list-style: none; margin: 0; padding: 0 20px 8px; }
.issue { display: grid; grid-template-columns: 18px 150px 1fr; gap: 8px; align-items: baseline; padding: 7px 0; border-bottom: 1px solid var(--line-2); font-size: 14px; }
.issue:last-child { border-bottom: 0; }
.issue-error .icon { color: var(--danger); }
.issue-warning .icon { color: var(--warn); }
.issue-where { color: var(--ink-2); white-space: nowrap; }
.issue-where .code-tag { margin-left: 4px; font-size: 12px; }
@media (max-width: 860px) {
  .steps, .grid-import { grid-template-columns: 1fr; }
  .issue { grid-template-columns: 18px 1fr; }
  .issue > span:last-child { grid-column: 2; }
}

/* ---------------------------------------------------------------- Kleinkram */
ul.plain { margin: 6px 0 0; padding-left: 18px; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13px; background: var(--line-2); padding: 1px 5px; border-radius: 4px; }
.panel-head .actions { display: flex; gap: 8px; margin-left: auto; }
.nowrap { white-space: nowrap; }

/* ---------------------------------------------------------------- Prüfberichte, Ergänzungen K1.3 */
.check-object { padding: 14px 20px; border-top: 1px solid var(--line-2); }
.check-object:first-of-type { border-top: 0; }
.check-head { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.meter { display: inline-block; width: 120px; height: 8px; border-radius: 4px; background: var(--line-2); overflow: hidden; }
.meter > span { display: block; height: 100%; background: var(--tanne); }
.checklist { list-style: none; margin: 10px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 4px 20px; font-size: 14px; }
.checklist li { display: flex; gap: 8px; align-items: baseline; }
.checklist li.ok { color: var(--ink-3); }
.checklist li.ok .icon { color: var(--ok); }
.checklist li.open .icon { color: var(--warn); }
.add-panel > summary { list-style: none; cursor: pointer; padding: 14px 20px; color: var(--tanne); font-weight: 500; display: flex; gap: 8px; align-items: center; }
.add-panel > summary::-webkit-details-marker { display: none; }
.add-panel[open] > summary { border-bottom: 1px solid var(--line-2); }
hr.sep { border: 0; border-top: 1px solid var(--line-2); margin: 18px 0; }
.inline-action { display: inline-block; text-align: left; }
.inline-action[open] form { position: absolute; right: 24px; z-index: 5; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; box-shadow: 0 6px 24px rgba(0,0,0,.08); display: grid; gap: 8px; }
tr.muted td { color: var(--ink-3); }

/* Modul Vorgänge */
.case-overdue { color: var(--danger); font-weight: 550; }
.case-entry-body { white-space: pre-wrap; margin-top: 4px; }
.case-entry-kind { font-weight: 550; }
.grid > .case-col > .panel + .panel { margin-top: 20px; }
@media (max-width: 980px) { .case-col.case-side { order: -1; } }   /* Status und Zuständigkeit vor dem langen Verlauf */
.case-side form + form { margin-top: 12px; }
.case-order + .case-order { border-top: 1px solid var(--line-2); }
.case-order-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.case-order-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-start; margin-top: 12px; }
.inline-form { display: flex; gap: 6px; align-items: center; }
.inline-form select { min-height: 32px; }
.case-letter-body { font-family: inherit; line-height: 1.5; }
@media print {
  .sidebar, .topbar, .crumbs, .page-head .actions, .print-hide, .notice { display: none !important; }
  .app { display: block; } .case-letter { border: 0; box-shadow: none; }
  .case-letter textarea, .case-letter input { border: 0; resize: none; }
}
.inline-form select { padding: 5px 8px; border: 1px solid var(--line); border-radius: 6px; background: #fff; font: inherit; font-size: 13.5px; }
.case-order-head .tabular { white-space: nowrap; }
.case-mail summary { cursor: pointer; list-style: none; }
.case-mail summary::-webkit-details-marker { display: none; }

/* ---------------------------------------------------------------- Hilfe & Rückmeldungen (docs/HILFE-KONZEPT.md 3) */
.help-btn { margin-left: 4px; }
.help-btn .icon { color: var(--tanne); }
.sidebar-help { display: grid; gap: 2px; margin: 0 -10px 12px; }
.sidebar-help-link { display: flex; align-items: center; gap: 9px; padding: 6px 10px; border-radius: 8px; color: var(--ink-2); font-size: 13.5px; }
.sidebar-help-link:hover { background: var(--paper); color: var(--ink); text-decoration: none; }
.sidebar-help-link .count { margin-left: auto; font-size: 12px; font-weight: 600; background: var(--sandstein); color: #fff; border-radius: 999px; padding: 0 7px; }
.help-banner { align-items: center; }
.help-banner-text { flex: 1; }
.help-banner-actions { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }

/* Seitenpanel */
.drawer-backdrop { position: fixed; inset: 0; background: rgba(27, 36, 32, .28); z-index: 60; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(520px, 100vw); z-index: 61; background: var(--surface);
  box-shadow: -12px 0 40px rgba(27, 36, 32, .16); display: flex; flex-direction: column; outline: none;
}
.drawer-head { display: flex; align-items: center; gap: 8px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.drawer-head h2 { flex: 1; display: flex; gap: 8px; align-items: center; font-size: 16px; }
.drawer-head h2 .icon { color: var(--tanne); }
.drawer-body { padding: 18px 20px 28px; overflow-y: auto; flex: 1; }
body.drawer-open { overflow: hidden; }

/* Hilfe-Inhalte */
.prose { max-width: 72ch; }
.prose h2 { font-size: 17px; margin: 1.4em 0 .5em; }
.prose h3 { font-size: 15px; margin: 1.2em 0 .4em; }
.prose > :first-child { margin-top: 0; }
.prose ul, .prose ol { padding-left: 22px; margin: 0 0 .9em; }
.prose li { margin: 3px 0; }
.prose ol > li::marker { color: var(--tanne); font-weight: 600; }
.prose strong { font-weight: 600; }
.prose table { border-collapse: collapse; margin: 0 0 1em; font-size: 14px; }
.prose th, .prose td { border: 1px solid var(--line); padding: 6px 10px; text-align: left; vertical-align: top; }
.prose th { background: #FAFBFA; font-weight: 550; }
.prose details { border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; margin: 0 0 .9em; }
.prose details summary { cursor: pointer; color: var(--tanne); font-weight: 550; }
.prose details[open] summary { margin-bottom: 6px; }
.help-lead { font-size: 16px; color: var(--ink-2); margin-bottom: 14px; }
.help-term { border-bottom: 1px dotted var(--tanne); }
.help-term:hover { text-decoration: none; border-bottom-style: solid; }
.help-page-ref { font-weight: 550; }
.callout { border-radius: 8px; padding: 10px 14px; margin: 0 0 1em; border-left: 3px solid; }
.callout > :last-child { margin-bottom: 0; }
.callout-title { display: flex; gap: 6px; align-items: center; font-weight: 600; font-size: 13.5px; margin-bottom: 4px; }
.callout-so-gehts { background: var(--tanne-soft); border-color: var(--tanne); }
.callout-gut-zu-wissen { background: var(--schiefer-soft); border-color: var(--schiefer); }
.callout-achtung { background: var(--warn-soft); border-color: var(--warn); }
.callout-achtung .callout-title { color: var(--warn); }

.help-search { position: relative; display: flex; gap: 8px; margin-bottom: 20px; max-width: 720px; }
.help-search .icon { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--ink-3); }
.help-search input { flex: 1; padding: 10px 12px 10px 38px; border: 1px solid #CDD5D0; border-radius: 8px; font: inherit; background: var(--surface); }
.help-search input:focus { outline: none; border-color: var(--tanne); box-shadow: var(--focus); }
.help-tiles { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); margin-bottom: 20px; }
.help-tiles > .panel, .help-modules > .panel { margin-top: 0; }
.help-tile { display: flex; flex-direction: column; gap: 4px; padding: 16px 18px; color: var(--ink); }
.help-tile:hover { text-decoration: none; border-color: #BFC9C3; }
.help-tile .icon { color: var(--tanne); width: 22px; height: 22px; margin-bottom: 4px; }
.help-tile span { color: var(--ink-2); font-size: 14px; }
.help-tile-start { background: var(--tanne-soft); border-color: #C7DCD2; }
.help-list { list-style: none; margin: 0; padding: 0; }
.help-list li { padding: 8px 0; border-bottom: 1px solid var(--line-2); }
.help-list li:last-child { border-bottom: 0; }
.help-list a { font-weight: 550; }
.help-list .badge { margin-left: 6px; }
.help-modules { margin-top: 20px; }
.help-page { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 20px; align-items: start; }
.help-aside > .panel + .panel { margin-top: 20px; }
.help-rate { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; padding: 14px 20px; border-top: 1px solid var(--line-2); background: #FAFBFA; border-radius: 0 0 var(--radius) var(--radius); }
.help-rate-form { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.help-context-page + .help-context-page { border-top: 1px solid var(--line-2); padding-top: 14px; margin-top: 14px; }
.help-context-page h2 { font-size: 17px; margin-bottom: 8px; }
.help-context-more { font-size: 13.5px; }
.help-context-head { display: flex; gap: 6px; align-items: center; margin: 18px 0 4px; font-size: 14px; color: var(--ink-2); }
.help-context-foot { margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--line-2); }
.help-context-foot .help-search { margin-bottom: 8px; }
.help-feedback-cta { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.help-feedback-cta > .icon { color: var(--tanne); width: 24px; height: 24px; }
.help-feedback-cta > div { flex: 1; min-width: 240px; }
.help-feedback-cta p { margin: 2px 0 0; }
.help-az { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 14px; }
.help-az a { min-width: 30px; text-align: center; padding: 4px 6px; border-radius: 6px; background: var(--surface); border: 1px solid var(--line); font-weight: 550; }
.help-az-group { padding: 14px 20px; border-bottom: 1px solid var(--line-2); }
.help-az-group:last-child { border-bottom: 0; }
.help-az-group h2 { font-size: 15px; color: var(--ink-3); margin-bottom: 6px; }
.help-terms { margin: 0; display: grid; grid-template-columns: minmax(160px, 240px) 1fr; gap: 6px 16px; }
.help-terms dt { font-weight: 550; }
.help-terms dd { margin: 0; color: var(--ink-2); }
.help-release + .help-release { margin-top: 20px; }

/* Feld-Erklärung */
.help-tip { position: relative; display: inline-flex; vertical-align: middle; margin-left: 4px; }
.help-tip-btn { border: 0; background: none; padding: 2px; color: var(--ink-3); cursor: pointer; border-radius: 50%; line-height: 0; }
.help-tip-btn:hover, .help-tip-btn[aria-expanded="true"] { color: var(--tanne); }
.help-tip-box {
  position: absolute; z-index: 35; top: calc(100% + 6px); left: -8px; width: min(320px, 80vw); padding: 10px 12px;
  background: var(--ink); color: #fff; border-radius: 8px; font-size: 13.5px; font-weight: 400; line-height: 1.45;
  box-shadow: 0 10px 28px rgba(27, 36, 32, .2);
}
.help-tip-box a { color: #BFE3D3; margin-left: 4px; }

/* Rückmeldungen */
.feedback-kinds .choice { flex-basis: 230px; }
.feedback-kinds .choice .icon { vertical-align: -2px; color: var(--tanne); }
.feedback-filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.feedback-filters select { padding: 6px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); font: inherit; font-size: 14px; }
.feedback-grid { grid-template-columns: minmax(0, 1fr) 340px; align-items: start; }
.feedback-grid aside > .panel + .panel { margin-top: 20px; }
.feedback-grid > div > .panel + .panel { margin-top: 20px; }
.feedback-body { white-space: pre-wrap; }
.feedback-files { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.feedback-file { display: flex; flex-direction: column; gap: 4px; width: 160px; font-size: 13px; color: var(--ink-2); }
.feedback-file img { width: 160px; height: 110px; object-fit: cover; border: 1px solid var(--line); border-radius: 6px; }
.feedback-actions { display: flex; gap: 12px; align-items: center; margin-top: 10px; flex-wrap: wrap; }
.feedback-internal { background: #FBFAF4; }
.feedback-faq, .feedback-link { border-top: 1px solid var(--line-2); }
@media (max-width: 980px) {
  .help-page, .feedback-grid { grid-template-columns: 1fr; }
  .help-btn-label { display: none; }
  .help-terms { grid-template-columns: 1fr; }
  .help-terms dd { margin-bottom: 8px; }
}
@media print { .help-btn, .sidebar-help, .help-rate, .help-banner { display: none !important; } }
.picker-quick { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 6px; }
.picker-quick[hidden] { display: none; }
/* Rolle „Nur lesen“: Schreiben ausblenden (Bedienung; die Rechte prüft der Server). Selbstbedienung mit data-readonly-ok. */
.role-readonly form[method="post"]:not([data-readonly-ok]), .role-readonly form[method="POST"]:not([data-readonly-ok]),
.role-readonly .page-head .actions a.btn:not([data-readonly-ok]), .role-readonly [data-write] { display: none !important; }

/* ---------------------------------------------------------------- Einstellungen: Briefkopf DIN 5008 Form B (Konzept 3.1) */
.letterhead { background: #fff; width: 210mm; max-width: 100%; min-height: 297mm; margin: 0 auto; padding: 0 20mm 0 25mm; position: relative; box-shadow: 0 1px 3px rgba(0,0,0,.08); font-size: 11pt; color: #111; }
.lh-head { height: 45mm; display: flex; align-items: center; justify-content: flex-end; border-bottom: 2px solid var(--accent); }
.lh-logo { max-height: 25mm; max-width: 70mm; }
.lh-name { font-size: 18pt; font-weight: 600; color: var(--accent); }
.lh-address { width: 85mm; height: 45mm; margin-top: 0; }
.lh-sender { font-size: 7pt; border-bottom: 1px solid #999; padding: 5mm 0 1mm; margin-bottom: 3mm; }
.lh-date { text-align: right; margin-top: 8mm; }
.lh-subject { font-size: 11pt; font-weight: 700; margin: 8mm 0 6mm; }
.lh-foot { position: absolute; left: 25mm; right: 20mm; bottom: 10mm; display: grid; grid-template-columns: repeat(3, 1fr); gap: 6mm; font-size: 7.5pt; color: #444; border-top: 1px solid var(--accent); padding-top: 3mm; }
@media print {
  @page { size: A4; margin: 0; }
  .content { padding: 0 !important; }
  .letterhead { box-shadow: none; width: 210mm; min-height: 297mm; }
}
/* Druckansicht Auftragsschreiben (Einstellungen 4.8): Briefkopf nur im Druck, Formular nur am Bildschirm */
.print-only { display: none; }
@media print {
  .print-only { display: block; }
  .letterhead.print-only + *, .case-letter.print-hide { display: none !important; }
  .lh-recipient { font-size: 11pt; line-height: 1.35; }
}
.var-list { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 10px; }
.var-list button { font-size: 12px; }
.tpl-preview { white-space: pre-line; border: 1px solid var(--line, #ddd); border-radius: 6px; padding: 12px; background: #fff; }
