/* Vista Rocha Verwaltung
   Layout: dunkelgrüne Seitenleiste + ruhige Arbeitsfläche; am Telefon Kopfzeile oben, Navigation unten. */
:root {
  --bg: #F6F3EA;            /* warmes Weiß */
  --surface: #FFFEFA;
  --surface-2: #ECF0E6;     /* Salbei, sehr hell */
  --ink: #1D2A23;
  --muted: #55675C;
  --line: #D8D7C8;
  --green: #1F4634;         /* Dunkelgrün: Marke und Hauptaktion */
  --on-green: #F6F3EA;
  --sage: #A7BDA4;          /* Salbeigrün */
  --sage-soft: #E0E8DB;
  --side-bg: #1F4634; --side-ink: #E9EFE4; --side-muted: #B4C7B6; --side-on: #2E5E48;
  --ok: #2B7349; --ok-bg: #DDEFE2; --warn: #7D5200; --warn-bg: #F5E8C6; --crit: #A2352B; --crit-bg: #F6DDD9;
  --info: #285B75; --info-bg: #DBE9F0; --off: #59625B; --off-bg: #E8E8DE; --legal: #76293A; --legal-bg: #F2DDE2;
  --c-meeting: #1F4634; --c-insurance: #285B75; --c-maintenance: #8A6410; --c-payment: #6A3E7B; --c-works: #A8552A; --c-task: #1C7773; --c-other: #6A726C;
  --shadow: 0 1px 2px rgba(29, 42, 35, .06), 0 6px 18px rgba(29, 42, 35, .06);
  --font-body: "Figtree", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-display: "Fraunces", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --r: 12px; --r-sm: 8px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #111814; --surface: #18221C; --surface-2: #1F2C25; --ink: #E8EDE6; --muted: #A3B4A8; --line: #2E3C34;
    --green: #A3D4B6; --on-green: #0F1A14; --sage: #55705C; --sage-soft: #24342A;
    --side-bg: #0D1410; --side-ink: #E3EAE0; --side-muted: #93A698; --side-on: #1F3328;
    --ok: #83D3A0; --ok-bg: #1B3526; --warn: #E8C36F; --warn-bg: #3A2F14; --crit: #F29D92; --crit-bg: #42211D;
    --info: #93C6DF; --info-bg: #17323F; --off: #AAB4AC; --off-bg: #27312B; --legal: #EFA9B8; --legal-bg: #3E1F27;
    --c-meeting: #8FCFA9; --c-insurance: #93C6DF; --c-maintenance: #E2BE62; --c-payment: #CDA5DC; --c-works: #F0A47C; --c-task: #7FD3CE; --c-other: #AAB4AC;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 6px 18px rgba(0, 0, 0, .25);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #111814; --surface: #18221C; --surface-2: #1F2C25; --ink: #E8EDE6; --muted: #A3B4A8; --line: #2E3C34;
  --green: #A3D4B6; --on-green: #0F1A14; --sage: #55705C; --sage-soft: #24342A;
  --side-bg: #0D1410; --side-ink: #E3EAE0; --side-muted: #93A698; --side-on: #1F3328;
  --ok: #83D3A0; --ok-bg: #1B3526; --warn: #E8C36F; --warn-bg: #3A2F14; --crit: #F29D92; --crit-bg: #42211D;
  --info: #93C6DF; --info-bg: #17323F; --off: #AAB4AC; --off-bg: #27312B; --legal: #EFA9B8; --legal-bg: #3E1F27;
  --c-meeting: #8FCFA9; --c-insurance: #93C6DF; --c-maintenance: #E2BE62; --c-payment: #CDA5DC; --c-works: #F0A47C; --c-task: #7FD3CE; --c-other: #AAB4AC;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 6px 18px rgba(0, 0, 0, .25);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
html, body { margin: 0; min-height: 100%; }
body { background: var(--bg); color: var(--ink); font: 400 16px/1.5 var(--font-body); }
h1, h2, h3, p, ul, ol, dl, dd { margin: 0; }
h1 { font: 500 clamp(26px, 4vw, 32px)/1.15 var(--font-display); letter-spacing: -.01em; text-wrap: balance; }
h2 { font: 600 17px/1.3 var(--font-body); text-wrap: balance; }
h3 { font: 600 16px/1.35 var(--font-body); text-wrap: balance; }
a { color: var(--green); text-underline-offset: 3px; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--sage); outline-offset: 2px; border-radius: 6px; }
code { font: 13px/1.4 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; background: var(--surface-2); padding: 2px 6px; border-radius: 6px; overflow-wrap: anywhere; }
.ic { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.ic-sm { width: 15px; height: 15px; vertical-align: -2px; }
.grow { flex: 1 1 auto; }
.small { font-size: 13px; color: var(--muted); }
.nowrap { white-space: nowrap; }

/* ---------- Gerüst ---------- */
#app { display: grid; grid-template-columns: 236px minmax(0, 1fr); min-height: 100vh; }
.side { background: var(--side-bg); color: var(--side-ink); padding: 20px 14px; display: flex; flex-direction: column; gap: 20px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.col { min-width: 0; display: flex; flex-direction: column; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: inherit; padding: 4px 6px; }
.brand-mark { width: 38px; height: 38px; border-radius: 10px; background: var(--sage); color: #1F4634; display: grid; place-items: center; font: 600 15px/1 var(--font-display); letter-spacing: .02em; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text strong { font: 500 19px/1.1 var(--font-display); }
.brand-text small { color: var(--side-muted); font-size: 13px; }
.nav-side { display: flex; flex-direction: column; gap: 2px; }
.nav-link { display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: 10px; color: var(--side-ink); text-decoration: none; font-weight: 500; }
.nav-link:hover { background: var(--side-on); }
.nav-link.on { background: var(--side-on); box-shadow: inset 3px 0 0 var(--sage); }
.side-foot { margin-top: auto; padding: 6px; }
.top { display: flex; align-items: center; gap: 10px; padding: 12px 24px; border-bottom: 1px solid var(--line); background: var(--bg); position: sticky; top: 0; z-index: 5; flex-wrap: wrap; }
.brand-top { display: none; color: var(--ink); }
.brand-top strong { font: 500 18px/1 var(--font-display); }
.top-status { display: none; }
.lang { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; background: var(--surface); }
.lang button { border: 0; background: none; padding: 8px 12px; min-height: 40px; font-weight: 600; font-size: 13px; color: var(--muted); }
.lang button.on { background: var(--green); color: var(--on-green); }
.me { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 14px; max-width: 180px; }
.me span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-mob { display: none; }
#main { flex: 1 1 auto; outline: none; }
.page { max-width: 1120px; margin: 0 auto; padding: 28px 24px 56px; display: flex; flex-direction: column; gap: 20px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.page-head .sub, .sub { color: var(--muted); margin-top: 4px; max-width: 65ch; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.loading { color: var(--muted); padding: 40px 0; }
.back { align-self: flex-start; display: inline-flex; align-items: center; gap: 6px; border: 0; background: none; color: var(--muted); padding: 8px 4px; min-height: 40px; font-weight: 500; }
.back:hover { color: var(--ink); }

/* ---------- Bausteine ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 10px 16px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font-weight: 600; text-decoration: none; line-height: 1.2; }
.btn:hover { border-color: var(--sage); background: var(--surface-2); }
.btn-primary { background: var(--green); border-color: var(--green); color: var(--on-green); }
.btn-primary:hover { background: var(--green); border-color: var(--green); filter: brightness(1.12); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--ink); }
.btn-ghost:hover { background: var(--surface-2); border-color: transparent; }
.btn-danger { background: var(--crit); border-color: var(--crit); color: var(--surface); }
.btn-danger-text { color: var(--crit); }
.btn-sm { min-height: 40px; padding: 7px 12px; font-size: 14px; }
.btn:disabled { opacity: .5; cursor: default; }
.icon-btn { display: inline-grid; place-items: center; width: 42px; height: 42px; flex: none; border: 0; border-radius: 10px; background: transparent; color: var(--muted); text-decoration: none; }
.icon-btn:hover { background: var(--surface-2); color: var(--ink); }
.icon-btn:disabled { opacity: .3; cursor: default; }
.row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.stack { display: flex; flex-direction: column; gap: 10px; }
.pill { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 999px; font-size: 12.5px; font-weight: 600; line-height: 1.35; white-space: nowrap; background: var(--off-bg); color: var(--off); }
.p-ok { background: var(--ok-bg); color: var(--ok); } .p-warn { background: var(--warn-bg); color: var(--warn); } .p-crit { background: var(--crit-bg); color: var(--crit); }
.p-info { background: var(--info-bg); color: var(--info); } .p-off, .p-wait { background: var(--off-bg); color: var(--off); }
.p-sample { background: transparent; color: var(--warn); border: 1px dashed var(--warn); }
.k-legal { background: var(--legal-bg); color: var(--legal); } .k-legal::before { content: "§"; font-weight: 700; }
.k-contract { background: var(--warn-bg); color: var(--warn); } .k-org { background: var(--sage-soft); color: var(--ink); }
.v-official { background: var(--ok-bg); color: var(--ok); } .v-partly { background: var(--info-bg); color: var(--info); } .v-secondary { background: var(--warn-bg); color: var(--warn); }
.c-meeting { --c: var(--c-meeting); } .c-insurance { --c: var(--c-insurance); } .c-maintenance { --c: var(--c-maintenance); } .c-payment { --c: var(--c-payment); }
.c-works { --c: var(--c-works); } .c-task { --c: var(--c-task); } .c-other { --c: var(--c-other); }
.pill[class*="c-"] { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.pill[class*="c-"]::before, .dot { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--c, var(--muted)); flex: none; display: inline-block; }
.sync { font-size: 12px; }
.side .sync { background: var(--side-on); color: var(--side-ink); }
.count { display: inline-grid; place-items: center; min-width: 26px; height: 24px; padding: 0 7px; border-radius: 999px; background: var(--surface-2); color: var(--muted); font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; }
.count.c-crit { background: var(--crit-bg); color: var(--crit); } .count.c-ok { background: var(--ok-bg); color: var(--ok); }
.notice { border: 1px solid var(--line); border-left: 4px solid var(--muted); background: var(--surface); border-radius: var(--r-sm); padding: 12px 14px; display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.n-warn { border-left-color: var(--warn); background: var(--warn-bg); } .n-crit { border-left-color: var(--crit); background: var(--crit-bg); }
.n-info { border-left-color: var(--info); } .n-legal { border-left-color: var(--legal); background: var(--legal-bg); }
.empty { border: 1px dashed var(--line); border-radius: var(--r); padding: 22px; color: var(--muted); display: flex; flex-direction: column; gap: 12px; align-items: flex-start; }
.calm { color: var(--muted); }
.hint { font-size: 13.5px; color: var(--muted); max-width: 70ch; }
.lead { max-width: 65ch; }
.bullets { padding-left: 20px; display: flex; flex-direction: column; gap: 6px; max-width: 70ch; }
.meta { color: var(--muted); font-size: 14px; }
.meta.who::before { content: "· "; }
.ameta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; }

/* ---------- Karten ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 18px; display: flex; flex-direction: column; gap: 12px; box-shadow: var(--shadow); min-width: 0; }
.card-head { display: flex; align-items: center; gap: 8px; min-height: 30px; }
.card-btn { text-align: left; width: 100%; }
.card-btn:hover { border-color: var(--sage); }
.card-link { display: inline-flex; align-items: center; gap: 4px; font-weight: 600; font-size: 14px; text-decoration: none; padding: 6px 0; align-self: flex-start; }
.card-alert { border-color: var(--crit); }
.dash { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; align-items: start; }
.card-wide { grid-column: span 2; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 14px; }
.cards-wide { grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); }
.meeting { display: flex; flex-direction: column; gap: 6px; }
.big-date { font: 500 24px/1.2 var(--font-display); }
.meeting-title { font-weight: 600; }
.countdown { color: var(--green); font-weight: 700; }
.mini { display: flex; flex-direction: column; gap: 5px; text-align: left; border: 1px solid var(--line); background: var(--bg); border-radius: var(--r-sm); padding: 10px 12px; width: 100%; }
.mini:hover { border-color: var(--sage); }
.mini-title { font-weight: 600; }
.mini-text { color: var(--muted); font-size: 14px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.bar { display: block; height: 8px; border-radius: 99px; background: var(--surface-2); overflow: hidden; width: 100%; }
.bar > span { display: block; height: 100%; background: var(--green); border-radius: 99px; min-width: 0; }
.bar-lg { height: 12px; max-width: 420px; }
.progress { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.pending { border-top: 1px solid var(--line); padding-top: 22px; display: flex; flex-direction: column; gap: 10px; }
.pend-list { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 12px; }
.pend-list li { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; border: 1px solid var(--line); border-radius: var(--r-sm); padding: 12px 14px; background: var(--surface); }
.pend-list p { color: var(--muted); font-size: 14px; }

/* ---------- Agenda ---------- */
.alist { display: flex; flex-direction: column; }
.arow { display: flex; gap: 12px; align-items: flex-start; text-align: left; border: 0; border-top: 1px solid var(--line); background: none; padding: 10px 4px; width: 100%; min-height: 56px; }
.arow:first-child { border-top: 0; }
.arow:hover { background: var(--surface-2); }
.adate { flex: none; width: 46px; display: flex; flex-direction: column; align-items: center; line-height: 1.1; padding-top: 2px; }
.adate b { font: 600 20px/1 var(--font-body); font-variant-numeric: tabular-nums; }
.adate small { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
.abody { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.atitle { font-weight: 600; overflow-wrap: anywhere; }
.arow.late .adate b, .rel { color: var(--crit); }
.arow:not(.late) .rel { color: var(--green); font-weight: 600; }
.arow.is-done .atitle { text-decoration: line-through; color: var(--muted); }

/* ---------- Checklisten ---------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); overflow-x: auto; }
.tabs button { border: 0; background: none; padding: 12px 14px; min-height: 46px; font-weight: 600; color: var(--muted); border-bottom: 3px solid transparent; display: inline-flex; gap: 8px; align-items: center; white-space: nowrap; }
.tabs button.on { color: var(--ink); border-bottom-color: var(--green); }
.legend { display: flex; flex-wrap: wrap; gap: 8px 18px; }
.legend span { display: inline-flex; align-items: center; gap: 8px; }
.legend small { color: var(--muted); font-size: 13px; }
.kcount { display: inline-flex; align-items: center; gap: 4px; font-weight: 600; font-size: 14px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 7px; min-height: 40px; padding: 7px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); font-weight: 600; font-size: 14px; color: var(--muted); }
.chip.on { background: var(--sage-soft); border-color: var(--sage); color: var(--ink); }
.chip-cat:not(.on) .dot { opacity: .35; }
.items { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.item { display: flex; align-items: flex-start; gap: 4px; border-top: 1px solid var(--line); padding: 4px 8px 4px 6px; }
.item:first-child { border-top: 0; }
.item.late { box-shadow: inset 4px 0 0 var(--crit); }
.tick { flex: none; width: 46px; height: 46px; margin-top: 3px; border: 0; background: none; display: grid; place-items: center; border-radius: 10px; }
.tick::before { content: ""; grid-area: 1 / 1; width: 26px; height: 26px; border-radius: 8px; border: 2px solid var(--sage); background: var(--surface); }
.tick .ic { grid-area: 1 / 1; z-index: 1; width: 18px; height: 18px; stroke-width: 2.6; color: var(--on-green); }
.st-done .tick::before { background: var(--green); border-color: var(--green); }
.st-na .tick::before { background: var(--off); border-color: var(--off); }
.tick:disabled { cursor: default; opacity: .6; }
.item-main { flex: 1 1 auto; min-width: 0; text-align: left; border: 0; background: none; padding: 10px 6px; display: flex; flex-direction: column; gap: 6px; border-radius: 8px; }
.item-main:hover { background: var(--surface-2); }
.item-title { font-weight: 500; overflow-wrap: anywhere; }
.st-done .item-title, .st-na .item-title { color: var(--muted); text-decoration: line-through; }
.due.late { color: var(--crit); font-weight: 600; }
.tplrows { display: flex; flex-direction: column; gap: 8px; }
.tplrow { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; gap: 8px 10px; align-items: start; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 10px; }
.tplnum { color: var(--muted); font-weight: 700; padding-top: 10px; text-align: center; font-variant-numeric: tabular-nums; }
.tplopts { grid-column: 2; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.tplmove { grid-column: 3; grid-row: 1 / span 2; display: flex; flex-direction: column; }
.inline { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }
.inline input { width: 84px; }
.lawbox { border-top: 1px solid var(--line); padding-top: 12px; display: flex; flex-direction: column; gap: 10px; }
.lawnote { background: var(--legal-bg); border-radius: var(--r-sm); padding: 10px 12px; display: flex; flex-direction: column; gap: 4px; }
.lawnote p { font-size: 14.5px; }
.picklist { display: flex; flex-direction: column; gap: 4px; }

/* ---------- Kalender ---------- */
.cal-bar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.cal-nav { display: flex; align-items: center; gap: 4px; }
.cal-title { font: 500 20px/1.2 var(--font-display); min-width: 170px; text-align: center; text-transform: capitalize; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--surface); }
.seg button { border: 0; background: none; min-height: 42px; padding: 8px 16px; font-weight: 600; color: var(--muted); }
.seg button.on { background: var(--green); color: var(--on-green); }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); background: var(--line); gap: 1px; border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.cal-wd { background: var(--surface-2); text-align: center; padding: 8px 2px; font-size: 12.5px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.day { background: var(--surface); border: 0; min-height: 104px; padding: 6px; display: flex; flex-direction: column; gap: 4px; text-align: left; min-width: 0; }
.day:hover { background: var(--surface-2); }
.day.out { background: var(--bg); } .day.out .dnum { color: var(--muted); opacity: .6; }
.dnum { font-weight: 600; font-variant-numeric: tabular-nums; width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; }
.day.today .dnum { background: var(--green); color: var(--on-green); }
.day.sel { box-shadow: inset 0 0 0 2px var(--green); }
.dlist { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.dent { display: flex; align-items: center; gap: 5px; font-size: 12.5px; line-height: 1.25; min-width: 0; }
.dent .dot { width: 8px; height: 8px; }
.dlabel { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dent.is-done .dlabel { text-decoration: line-through; color: var(--muted); }
.dmore { font-size: 12px; color: var(--muted); font-weight: 600; }
.daybox { margin-top: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 16px 18px; display: flex; flex-direction: column; gap: 6px; }
.cal-list { display: flex; flex-direction: column; gap: 18px; }
.month-group { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 14px 18px; }
.month-group h2 { font: 500 19px/1.2 var(--font-display); text-transform: capitalize; margin-bottom: 4px; }
.zoneinfo { grid-column: 1 / -1; background: var(--info-bg); color: var(--info); border-radius: var(--r-sm); padding: 8px 12px; font-weight: 600; font-variant-numeric: tabular-nums; }
.preview { grid-column: 1 / -1; }
.rembox { display: flex; flex-direction: column; gap: 8px; border-top: 1px solid var(--line); padding-top: 12px; }
.rem-add input { width: 150px; }
.occ { margin-bottom: 12px; }

/* ---------- Listen, Tabellen ---------- */
.rows { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.rowitem { display: flex; align-items: center; gap: 10px; border-top: 1px solid var(--line); padding: 4px 12px 4px 4px; }
.rowitem:first-child { border-top: 0; }
.row-main { flex: 1 1 auto; min-width: 0; text-align: left; border: 0; background: none; padding: 10px; display: flex; flex-direction: column; gap: 5px; border-radius: 8px; }
button.row-main:hover { background: var(--surface-2); }
.searchbar { display: flex; align-items: center; gap: 10px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 0 12px; color: var(--muted); }
.searchbar input { border: 0; background: none; min-height: 46px; flex: 1 1 auto; outline: none; min-width: 0; }
.searchbar:focus-within { border-color: var(--sage); box-shadow: 0 0 0 3px var(--sage-soft); }
.facts { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 4px 14px; font-size: 14.5px; }
.facts dt { color: var(--muted); } .facts dd { white-space: pre-line; overflow-wrap: anywhere; }
.laws { display: flex; flex-direction: column; gap: 12px; }
.law { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 16px 18px; display: flex; flex-direction: column; gap: 8px; }
.law > p { max-width: 75ch; }
.tbl-wrap { overflow-x: auto; }
.tbl { border-collapse: collapse; width: 100%; font-size: 14.5px; }
.tbl th { text-align: left; color: var(--muted); font-size: 12.5px; text-transform: uppercase; letter-spacing: .04em; padding: 6px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; font-variant-numeric: tabular-nums; }
.sets { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 440px), 1fr)); gap: 16px; align-items: start; }
.set h3 { margin-top: 6px; }
.implist { display: flex; gap: 12px; align-items: center; justify-content: space-between; border: 1px solid var(--line); border-radius: var(--r-sm); padding: 10px 12px; flex-wrap: wrap; }

/* ---------- Formulare, Dialoge ---------- */
.form { display: flex; flex-direction: column; gap: 14px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 14px; }
.field { display: flex; flex-direction: column; gap: 5px; grid-column: 1 / -1; min-width: 0; }
.field.half { grid-column: span 1; }
label { font-weight: 600; font-size: 14px; }
input[type="text"], input[type="url"], input[type="email"], input[type="password"], input[type="date"], input[type="time"], input[type="number"], input[type="search"], select, textarea {
  width: 100%; min-height: 46px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--ink); min-width: 0; }
textarea { resize: vertical; line-height: 1.45; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--sage); box-shadow: 0 0 0 3px var(--sage-soft); }
.file { min-height: 46px; padding: 8px 0; }
.check-row { display: flex; gap: 10px; align-items: flex-start; grid-column: 1 / -1; font-weight: 500; font-size: 15px; padding: 6px 0; }
.check-row input { width: 22px; height: 22px; margin-top: 1px; flex: none; accent-color: var(--green); }
.form-err { color: var(--crit); font-weight: 600; min-height: 0; }
.form-err:empty { display: none; }
.doclist { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; border-top: 1px solid var(--line); padding-top: 12px; }
.docrow { display: flex; gap: 8px; align-items: center; width: 100%; flex-wrap: wrap; }
.docrow input { flex: 1 1 180px; }
.dlg-back { position: fixed; inset: 0; background: rgba(15, 26, 20, .5); display: grid; place-items: center; padding: 16px; z-index: 40; overflow-y: auto; }
.dlg { background: var(--surface); color: var(--ink); border-radius: 16px; width: min(100%, 520px); max-height: calc(100vh - 32px); display: flex; flex-direction: column; box-shadow: 0 20px 60px rgba(0, 0, 0, .3); }
.dlg-wide { width: min(100%, 720px); }
.dlg-head { display: flex; align-items: center; gap: 10px; padding: 16px 12px 12px 20px; border-bottom: 1px solid var(--line); }
.dlg-head h2 { flex: 1 1 auto; font: 500 21px/1.2 var(--font-display); }
.dlg-body { padding: 18px 20px; overflow-y: auto; display: flex; flex-direction: column; gap: 14px; }
.dlg-foot { display: flex; align-items: center; gap: 8px; padding: 12px 16px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.dlg-foot:empty { display: none; }
.more-list { display: flex; flex-direction: column; gap: 4px; }
.more-item { display: flex; align-items: center; gap: 14px; padding: 14px 12px; border-radius: 10px; text-decoration: none; color: var(--ink); font-weight: 600; min-height: 52px; }
.more-item:hover, .more-item.on { background: var(--surface-2); }
#toast-root { position: fixed; left: 0; right: 0; bottom: 24px; display: flex; flex-direction: column; align-items: center; gap: 8px; z-index: 60; pointer-events: none; padding: 0 16px; }
.toast { background: var(--ink); color: var(--bg); padding: 12px 18px; border-radius: 12px; font-weight: 600; box-shadow: var(--shadow); transition: opacity .3s, transform .3s; max-width: 100%; }
.toast.bad { background: var(--crit); color: #fff; }
.toast.out { opacity: 0; transform: translateY(8px); }
.login { max-width: 440px; padding-top: 12vh; }
.login h1 { font-size: 26px; }

/* ---------- Tablet und Telefon ---------- */
@media (max-width: 960px) {
  #app { grid-template-columns: minmax(0, 1fr); }
  .side { display: none; }
  .brand-top { display: flex; }
  .brand-top .brand-mark { width: 32px; height: 32px; font-size: 13px; }
  .top { padding: 10px 16px; }
  .top-status { display: inline-flex; }
  .nav-mob { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; background: var(--surface); border-top: 1px solid var(--line); z-index: 20; }
  .mob-link { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-height: 60px; padding: 6px 2px; border: 0; background: none; color: var(--muted); text-decoration: none; font-size: 11.5px; font-weight: 600; min-width: 0; }
  .mob-link span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
  .mob-link.on { color: var(--green); box-shadow: inset 0 3px 0 var(--green); }
  .page { padding: 20px 16px 96px; }
  #toast-root { bottom: 76px; }
  .card-wide { grid-column: auto; }
}
@media (max-width: 640px) {
  .me, .top-status { display: none; }
  .dash, .cards, .cards-wide, .pend-list { grid-template-columns: minmax(0, 1fr); }
  .form-grid { grid-template-columns: minmax(0, 1fr); }
  .field.half { grid-column: 1 / -1; }
  .day { min-height: 58px; padding: 4px 2px; align-items: center; }
  .dlist { flex-direction: row; flex-wrap: wrap; justify-content: center; gap: 3px; }
  .dlabel, .dmore { display: none; }
  .cal-wd { font-size: 11px; padding: 6px 0; }
  .cal-title { min-width: 0; flex: 1 1 auto; font-size: 18px; }
  .cal-nav { flex: 1 1 100%; }
  .chips { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; scrollbar-width: thin; }
  .chip { flex: none; }
  .dlg .chips { flex-wrap: wrap; overflow: visible; }
  .dlg-back { padding: 0; place-items: end center; }
  .dlg, .dlg-wide { width: 100%; max-height: 94vh; border-radius: 18px 18px 0 0; }
  .tplrow { grid-template-columns: 22px minmax(0, 1fr); }
  .tplmove { grid-column: 2; grid-row: auto; flex-direction: row; }
  .page-actions { width: 100%; }
  .page-actions .btn { flex: 1 1 auto; }
  .facts { grid-template-columns: minmax(0, 1fr); gap: 0; } .facts dd { margin-bottom: 6px; }
}
@media (prefers-reduced-motion: reduce) { .toast { transition: none; } }
