/* Hausblick – Designsystem
   Hell, kantig, Inter. Akzentfarbe pro Büro über --brand. */
/* Inter (SIL OFL 1.1), lokal eingebunden – keine Verbindung zu Google Fonts */
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 400; font-display: swap; src: url('fonts/inter-latin-ext-400-normal.woff2') format('woff2'); unicode-range: U+0100-02AF,U+0304,U+0308,U+0329,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 400; font-display: swap; src: url('fonts/inter-latin-400-normal.woff2') format('woff2'); 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+2074,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 500; font-display: swap; src: url('fonts/inter-latin-ext-500-normal.woff2') format('woff2'); unicode-range: U+0100-02AF,U+0304,U+0308,U+0329,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 500; font-display: swap; src: url('fonts/inter-latin-500-normal.woff2') format('woff2'); 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+2074,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 600; font-display: swap; src: url('fonts/inter-latin-ext-600-normal.woff2') format('woff2'); unicode-range: U+0100-02AF,U+0304,U+0308,U+0329,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 600; font-display: swap; src: url('fonts/inter-latin-600-normal.woff2') format('woff2'); 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+2074,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 700; font-display: swap; src: url('fonts/inter-latin-ext-700-normal.woff2') format('woff2'); unicode-range: U+0100-02AF,U+0304,U+0308,U+0329,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 700; font-display: swap; src: url('fonts/inter-latin-700-normal.woff2') format('woff2'); 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+2074,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }

:root {
  --bg: #F7F8F9;
  --surface: #FFFFFF;
  --line: #E6E8EB;
  --line-soft: #F0F1F3;
  --ink: #111418;
  --ink-2: #3A3F47;
  --muted: #5B616B;
  --brand: #0B7A6C;
  --brand-ink: #08594F;
  --brand-tint: #E6F4F1;
  --orange: #D9691F;
  --orange-ink: #8A4210;
  --orange-tint: #FDF0E6;
  --purple: #5847C2;
  --purple-tint: #EEEBFB;
  --red: #B42318;
  --red-tint: #FDECEA;
  --r: 4px;
  --r-sm: 2px;
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  /* früher Schreibmaschinenschrift; jetzt Inter mit gleich breiten Ziffern */
  --mono: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --code: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: var(--font); color: var(--ink); background: var(--bg); font-size: 14px; line-height: 1.45; -webkit-font-smoothing: antialiased; }
a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand-ink); text-decoration: underline; }
h1, h2, h3 { margin: 0; letter-spacing: -0.02em; }
button, input, select, textarea { font: inherit; color: inherit; }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.eyebrow { font-size: 11px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

/* ---------- App-Rahmen ---------- */
.app { min-height: 100vh; display: flex; }
.sidebar { width: 232px; flex: 0 0 232px; background: var(--surface); border-right: 1px solid var(--line); padding: 18px 12px; display: flex; flex-direction: column; gap: 20px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.brand { display: flex; align-items: center; gap: 10px; padding: 0 8px; color: var(--ink); }
.brand:hover { text-decoration: none; color: var(--ink); }
.brand-mark { width: 28px; height: 28px; border-radius: var(--r); background: var(--brand); color: #fff; font-weight: 700; display: grid; place-items: center; overflow: hidden; }
.brand-mark img { width: 100%; height: 100%; object-fit: contain; background: #fff; }
.brand-name { font-weight: 600; font-size: 15px; line-height: 1.2; }
.brand-sub { font-size: 12px; color: var(--muted); }
.nav { display: flex; flex-direction: column; gap: 1px; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: var(--r); color: var(--ink-2); font-size: 14px; border-left: 2px solid transparent; }
.nav a:hover { background: var(--bg); text-decoration: none; color: var(--ink); }
.nav a.active { background: var(--brand-tint); color: var(--brand-ink); font-weight: 600; border-left-color: var(--brand); }
.nav svg { width: 18px; height: 18px; flex: none; }
.nav .count { margin-left: auto; background: var(--orange-tint); color: var(--orange-ink); font-family: var(--mono); font-variant-numeric: tabular-nums; font-size: 11px; font-weight: 700; padding: 1px 6px; border-radius: var(--r-sm); }
.nav-sep { height: 1px; background: var(--line); margin: 8px 4px; }
.nav-group { display: flex; flex-direction: column; gap: 1px; margin-top: 10px; }
.nav-group > summary { list-style: none; display: flex; align-items: center; gap: 6px; padding: 6px 12px 4px; cursor: pointer; font-family: var(--mono); font-variant-numeric: tabular-nums; font-size: 10.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted, var(--ink-2)); border-radius: var(--r-sm); user-select: none; }
.nav-group > summary::-webkit-details-marker { display: none; }
.nav-group > summary:hover { color: var(--ink); }
.nav-group > summary:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; }
.nav-group > summary > span:first-child { flex: 1; }
.nav-group > summary svg { width: 14px; height: 14px; transition: transform .15s; transform: rotate(-90deg); }
.nav-group[open] > summary svg { transform: none; }
.nav-group[open] > summary .count { display: none; }
.nav-group > summary .count { margin-left: 0; }
.sidebar-foot { margin-top: auto; display: flex; flex-direction: column; gap: 8px; }
.user-chip { display: flex; align-items: center; gap: 10px; padding: 10px; border: 1px solid var(--line); border-radius: var(--r); }
.avatar { width: 30px; height: 30px; border-radius: var(--r); background: var(--brand-tint); color: var(--brand-ink); font-size: 12px; font-weight: 600; display: grid; place-items: center; flex: none; }
.avatar.orange { background: var(--orange-tint); color: var(--orange-ink); }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 20; background: rgba(247,248,249,.92); backdrop-filter: blur(6px); border-bottom: 1px solid var(--line); padding: 10px 28px; display: flex; align-items: center; gap: 12px; }
.menu-btn { display: none; }
.search-trigger { flex: 1; max-width: 520px; display: flex; align-items: center; gap: 10px; height: 40px; padding: 0 12px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); color: var(--muted); cursor: pointer; text-align: left; }
.search-trigger:hover { border-color: #C9CCD1; }
.search-trigger kbd { margin-left: auto; font-family: var(--mono); font-variant-numeric: tabular-nums; font-size: 11px; border: 1px solid var(--line); border-radius: var(--r-sm); padding: 1px 6px; color: var(--muted); }
.topbar-actions { margin-left: auto; display: flex; gap: 8px; }
.content { padding: 26px 28px 48px; display: flex; flex-direction: column; gap: 20px; max-width: 1600px; width: 100%; }

.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; }
.page-head h1 { font-size: 28px; font-weight: 600; letter-spacing: -0.025em; }
.page-head .eyebrow { font-family: var(--mono); font-variant-numeric: tabular-nums; margin-bottom: 4px; display: block; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

/* ---------- Bausteine ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); }
.card-head { padding: 14px 18px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.card-head h2 { font-size: 15px; font-weight: 600; }
.card-body { padding: 16px 18px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.split { display: flex; flex-wrap: wrap; gap: 20px; align-items: flex-start; }
.split > .grow { flex: 999 1 560px; min-width: 0; }
.split > .side { flex: 1 1 320px; min-width: 0; }

.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); }
.kpi { padding: 14px 18px; border-right: 1px solid var(--line); display: flex; flex-direction: column; gap: 2px; color: var(--ink); }
.kpi:last-child { border-right: 0; }
a.kpi:hover { background: var(--bg); text-decoration: none; color: var(--ink); }
.kpi .label { font-size: 12px; color: var(--muted); }
.kpi .value { font-family: var(--mono); font-variant-numeric: tabular-nums; font-size: 24px; font-weight: 700; letter-spacing: -0.02em; }
.kpi .value.brand { color: var(--brand); }
.kpi .value.orange { color: var(--orange-ink); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; padding: 0 16px; border-radius: var(--r); border: 1px solid var(--line); background: var(--surface); color: var(--ink); font-weight: 500; font-size: 14px; cursor: pointer; white-space: nowrap; text-decoration: none; }
.btn:hover { border-color: #C9CCD1; text-decoration: none; color: var(--ink); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 600; }
.btn.primary:hover { filter: brightness(.94); color: #fff; }
.btn.dark { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.danger { color: var(--red); }
.btn.sm { height: 32px; padding: 0 10px; font-size: 13px; }
.btn.lg { height: 48px; padding: 0 22px; font-size: 15px; }
.btn.icon { width: 40px; padding: 0; }
.btn svg { width: 16px; height: 16px; }

.badge { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 600; padding: 2px 7px; border-radius: var(--r-sm); background: var(--line-soft); color: var(--ink-2); white-space: nowrap; }
.badge.brand { background: var(--brand-tint); color: var(--brand-ink); }
.badge.orange { background: var(--orange-tint); color: var(--orange-ink); }
.badge.purple { background: var(--purple-tint); color: var(--purple); }
.badge.red { background: var(--red-tint); color: var(--red); }
.badge.dark { background: var(--ink); color: #fff; }

/* Formulare */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > label, .field > .label { font-size: 12px; font-weight: 600; color: var(--ink-2); }
.input, select.input, textarea.input { width: 100%; height: 40px; border: 1px solid var(--line); border-radius: var(--r); padding: 0 11px; background: var(--surface); font-size: 14px; }
textarea.input { height: auto; min-height: 96px; padding: 10px 11px; resize: vertical; line-height: 1.5; }
.input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-tint); }
.input-group { display: flex; align-items: stretch; }
.input-group .input { border-radius: var(--r) 0 0 var(--r); }
.input-group .addon { display: flex; align-items: center; padding: 0 10px; border: 1px solid var(--line); border-left: 0; border-radius: 0 var(--r) var(--r) 0; background: var(--bg); color: var(--muted); font-family: var(--mono); font-variant-numeric: tabular-nums; font-size: 12px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; }
.form-grid .full { grid-column: 1 / -1; }
.form-grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px 16px; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; cursor: pointer; }
.check input { width: 18px; height: 18px; margin-top: 1px; accent-color: var(--brand); flex: none; }
.hint { font-size: 12px; color: var(--muted); }

/* Autosave-Status */
.save-state { font-size: 12px; color: var(--muted); display: inline-flex; align-items: center; gap: 6px; min-height: 18px; }
.save-state.saving::before { content: ''; width: 8px; height: 8px; border: 1.5px solid var(--muted); border-top-color: transparent; border-radius: 50%; animation: spin .8s linear infinite; }
.save-state.saved { color: var(--brand-ink); }
.save-state.error { color: var(--red); }
.field.is-saved .input { border-color: var(--brand); }
@keyframes spin { to { transform: rotate(360deg); } }

/* Chips / Segmented */
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); padding: 2px; }
.seg a, .seg button { border: 0; background: transparent; padding: 0 12px; min-height: 34px; display: inline-flex; align-items: center; border-radius: var(--r-sm); color: var(--muted); font-size: 13px; cursor: pointer; }
.seg a:hover { text-decoration: none; color: var(--ink); }
.seg .on { background: var(--ink); color: #fff; font-weight: 500; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 6px; min-height: 34px; padding: 0 12px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); color: var(--ink-2); font-size: 13px; cursor: pointer; }
.chip:hover { text-decoration: none; border-color: #C9CCD1; color: var(--ink); }
.chip.on { border-color: var(--brand); background: var(--brand-tint); color: var(--brand-ink); font-weight: 600; }
.chip .n { font-family: var(--mono); font-variant-numeric: tabular-nums; font-size: 11px; color: var(--muted); }

/* Tabellen */
.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-size: 11px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; padding: 10px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 11px 14px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr.clickable { cursor: pointer; }
.table tbody tr.clickable:hover { background: #FBFCFC; }
.table .num { text-align: right; font-family: var(--mono); font-variant-numeric: tabular-nums; white-space: nowrap; }
.table tfoot td { border-top: 1.5px solid var(--ink); font-weight: 700; }

.empty { padding: 36px 18px; text-align: center; color: var(--muted); display: flex; flex-direction: column; align-items: center; gap: 10px; }
.empty b { color: var(--ink); font-size: 15px; }

/* Tabs */
.tabs { display: flex; flex-wrap: wrap; gap: 2px; border-bottom: 1px solid var(--line); }
.tabs a { padding: 11px 14px; color: var(--muted); font-size: 14px; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs a:hover { text-decoration: none; color: var(--ink); }
.tabs a.on { color: var(--ink); font-weight: 600; border-bottom-color: var(--brand); }
.tabs .n { font-family: var(--mono); font-variant-numeric: tabular-nums; font-size: 12px; margin-left: 4px; }

/* Status-Leiste */
.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 4px; }
.steps li { display: flex; flex-direction: column; gap: 6px; }
.steps button { all: unset; cursor: pointer; display: flex; flex-direction: column; gap: 6px; }
.steps .bar { height: 4px; background: var(--line); }
.steps .done .bar, .steps .now .bar { background: var(--brand); }
.steps .lbl { font-size: 12px; color: var(--muted); }
.steps .now .lbl { color: var(--brand-ink); font-weight: 600; }

/* Liste mit Zeilen */
.rows > * { display: flex; align-items: center; gap: 12px; padding: 10px 18px; border-bottom: 1px solid var(--line-soft); color: var(--ink); }
.rows > *:last-child { border-bottom: 0; }
.rows > a:hover { background: #FBFCFC; text-decoration: none; color: var(--ink); }
.rows .grow { flex: 1; min-width: 0; }
.rows .title { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rows .sub { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.time { font-family: var(--mono); font-variant-numeric: tabular-nums; font-size: 13px; white-space: nowrap; }

/* Timeline */
.timeline { display: flex; flex-direction: column; }
.timeline .item { display: grid; grid-template-columns: 112px 1fr; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line-soft); font-size: 13px; }
.timeline .item:last-child { border-bottom: 0; }
.timeline .when { font-family: var(--mono); font-variant-numeric: tabular-nums; font-size: 12px; color: var(--muted); }

/* Kanban */
.board { display: grid; grid-template-columns: repeat(4, minmax(220px, 1fr)); gap: 12px; min-width: 900px; }
.col-head { display: flex; justify-content: space-between; align-items: center; padding: 0 2px 7px; border-bottom: 2px solid var(--ink); margin-bottom: 8px; }
.col-head b { font-size: 13px; }
.col-head .n { font-family: var(--mono); font-variant-numeric: tabular-nums; font-size: 12px; color: var(--muted); }
.col { display: flex; flex-direction: column; gap: 8px; min-height: 120px; border-radius: var(--r); }
.col.drop { background: var(--brand-tint); outline: 1px dashed var(--brand); }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 11px 12px; display: flex; flex-direction: column; gap: 6px; color: var(--ink); cursor: grab; }
.tile:hover { border-color: #C9CCD1; text-decoration: none; color: var(--ink); }
.tile.sel { outline: 1.5px solid var(--ink); }
.tile .top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.tile .name { font-weight: 600; }

/* Kalender */
.cal-toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: space-between; }
.cal { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); overflow-x: auto; }
.cal-inner { min-width: 760px; }
.cal-head, .cal-body { display: grid; }
.cal-head > div { padding: 10px; border-left: 1px solid var(--line-soft); display: flex; align-items: baseline; gap: 6px; border-bottom: 1px solid var(--line); }
.cal-head > div:first-child { border-left: 0; }
.cal-head .d { font-family: var(--mono); font-variant-numeric: tabular-nums; font-size: 18px; font-weight: 700; }
.cal-head .today { color: var(--brand); box-shadow: inset 0 -2px 0 var(--brand); }
.cal-times { position: relative; font-family: var(--mono); font-variant-numeric: tabular-nums; font-size: 11px; color: var(--muted); }
.cal-times span { position: absolute; right: 8px; transform: translateY(-50%); }
.cal-col { position: relative; border-left: 1px solid var(--line-soft); cursor: copy; }
.cal-col.today { background-color: #FBFCFC; }
.cal-ev { position: absolute; left: 3px; right: 3px; border-radius: var(--r-sm); padding: 4px 6px; font-size: 12px; overflow: hidden; line-height: 1.3; color: var(--ink); cursor: pointer; border-left: 2px solid; }
.cal-ev:hover { text-decoration: none; color: var(--ink); filter: brightness(.97); }
.cal-ev.einzel { background: var(--brand-tint); border-color: var(--brand); }
.cal-ev.sammel { background: var(--orange-tint); border-color: var(--orange); }
.cal-ev.eigentuemer { background: var(--purple-tint); border-color: var(--purple); }
.cal-ev.slot { background: #fff; border: 1px dashed var(--brand); color: var(--brand-ink); }
.cal-ev .t { font-family: var(--mono); font-variant-numeric: tabular-nums; font-weight: 700; }
.cal-now { position: absolute; left: 0; right: 0; height: 1px; background: var(--orange); z-index: 2; pointer-events: none; }
.cal-now::before { content: ''; position: absolute; left: -4px; top: -3px; width: 7px; height: 7px; background: var(--orange); }
.month { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.month .dh { padding: 8px 10px; font-size: 12px; color: var(--muted); border-bottom: 1px solid var(--line); }
.month .day { min-height: 112px; border-right: 1px solid var(--line-soft); border-bottom: 1px solid var(--line-soft); padding: 6px; display: flex; flex-direction: column; gap: 3px; cursor: copy; }
.month .day:nth-child(7n) { border-right: 0; }
.month .day.other { background: #FBFCFC; color: var(--muted); }
.month .day .dn { font-family: var(--mono); font-variant-numeric: tabular-nums; font-size: 12px; font-weight: 700; }
.month .day.today .dn { color: #fff; background: var(--brand); padding: 0 5px; align-self: flex-start; }
.month .mev { font-size: 11px; padding: 2px 5px; border-radius: var(--r-sm); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; border-left: 2px solid; color: var(--ink); }
.month .mev.einzel { background: var(--brand-tint); border-color: var(--brand); }
.month .mev.sammel { background: var(--orange-tint); border-color: var(--orange); }
.month .mev.eigentuemer { background: var(--purple-tint); border-color: var(--purple); }
.legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: 12px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 10px; height: 10px; display: inline-block; }

/* Dialog / Panels */
dialog { border: 1px solid var(--line); border-radius: var(--r); padding: 0; width: min(560px, calc(100vw - 32px)); box-shadow: 0 24px 64px rgba(17,20,24,.18); color: var(--ink); }
dialog::backdrop { background: rgba(17,20,24,.35); }
dialog .d-head { padding: 16px 20px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; }
dialog .d-head h2 { font-size: 17px; font-weight: 600; }
dialog .d-body { padding: 18px 20px; display: flex; flex-direction: column; gap: 14px; max-height: 70vh; overflow-y: auto; }
dialog .d-foot { padding: 14px 20px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 8px; }

/* Globale Suche */
.cmdk { width: min(640px, calc(100vw - 24px)); margin-top: 10vh; }
.cmdk-input { display: flex; align-items: center; gap: 10px; padding: 0 16px; border-bottom: 1px solid var(--line); }
.cmdk-input input { flex: 1; border: 0; outline: none; height: 56px; font-size: 16px; }
.cmdk-results { max-height: 60vh; overflow-y: auto; padding: 6px 0; }
.cmdk-group { padding: 8px 16px 4px; font-size: 11px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.cmdk-item { display: flex; align-items: center; gap: 12px; padding: 9px 16px; color: var(--ink); }
.cmdk-item:hover, .cmdk-item.active { background: var(--brand-tint); text-decoration: none; color: var(--ink); }
.cmdk-item .ic { width: 30px; height: 30px; border-radius: var(--r); background: var(--line-soft); display: grid; place-items: center; flex: none; font-size: 12px; font-weight: 600; }
.cmdk-item .t { font-weight: 600; }
.cmdk-item .s { font-size: 12px; color: var(--muted); }
.cmdk-foot { border-top: 1px solid var(--line); padding: 8px 16px; font-size: 12px; color: var(--muted); display: flex; gap: 14px; }

/* Vorschlagsfeld (Combobox) */
.combo { position: relative; }
.combo-list { position: absolute; z-index: 30; left: 0; right: 0; top: calc(100% + 4px); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: 0 12px 32px rgba(17,20,24,.12); max-height: 280px; overflow-y: auto; display: none; }
.combo.open .combo-list { display: block; }
.combo-opt { padding: 9px 12px; cursor: pointer; display: flex; flex-direction: column; }
.combo-opt.active, .combo-opt:hover { background: var(--brand-tint); }
.combo-opt small { color: var(--muted); font-size: 12px; }
.combo-opt.new { color: var(--brand-ink); font-weight: 600; border-top: 1px solid var(--line-soft); }

/* Hinweise */
.flash-stack { position: fixed; right: 20px; bottom: 20px; z-index: 100; display: flex; flex-direction: column; gap: 8px; max-width: min(420px, calc(100vw - 40px)); }
.flash { background: var(--ink); color: #fff; border-radius: var(--r); padding: 12px 16px; font-size: 14px; box-shadow: 0 12px 32px rgba(17,20,24,.2); display: flex; gap: 12px; align-items: flex-start; animation: up .2s ease-out; }
.flash.error { background: var(--red); }
.flash button { all: unset; cursor: pointer; margin-left: auto; opacity: .7; }
@keyframes up { from { transform: translateY(8px); opacity: 0; } }
.alert { border: 1px solid var(--line); border-left: 3px solid var(--orange); border-radius: var(--r); background: var(--surface); padding: 12px 14px; font-size: 13px; }
.alert.brand { border-left-color: var(--brand); }
.alert.red { border-left-color: var(--red); }

/* Budgetbalken */
.meter { height: 8px; background: var(--line-soft); border-radius: var(--r-sm); overflow: hidden; }
.meter > i { display: block; height: 100%; background: var(--brand); }
.meter.warn > i { background: var(--orange); }

.sum-row { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; font-size: 14px; }
.sum-row span:last-child { font-family: var(--mono); font-variant-numeric: tabular-nums; white-space: nowrap; }
.sum-row.minus { color: var(--muted); }
.sum-row.total { border-top: 1.5px solid var(--ink); margin-top: 6px; padding-top: 12px; font-weight: 700; align-items: baseline; }
.sum-row.total span:last-child { font-size: 20px; color: var(--brand-ink); }

/* Öffentliche Seiten */
.public { min-height: 100vh; background: var(--bg); }
.public-head { background: var(--surface); border-bottom: 1px solid var(--line); }
.public-head .in { max-width: 960px; margin: 0 auto; padding: 14px 20px; display: flex; align-items: center; gap: 10px; }
.public-main { max-width: 960px; margin: 0 auto; padding: 24px 20px 64px; display: flex; flex-direction: column; gap: 20px; }
.legal-box { background: var(--bg); border: 1px solid var(--line); border-radius: var(--r); padding: 12px 14px; font-size: 13px; max-height: 180px; overflow-y: auto; white-space: pre-line; color: var(--ink-2); }
.slot-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; }
.bslot { display: flex; justify-content: space-between; align-items: center; gap: 10px; min-height: 54px; padding: 0 14px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); cursor: pointer; text-align: left; }
.bslot:hover { border-color: var(--brand); }
.bslot input { position: absolute; opacity: 0; }
.bslot:has(input:checked) { border: 1.5px solid var(--brand); background: var(--brand-tint); }
.bslot.full { border-style: dashed; color: var(--muted); cursor: not-allowed; background: var(--bg); }
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.login-card { width: min(400px, 100%); }

/* ---------- Responsiv ---------- */
@media (max-width: 1100px) {
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .sidebar { position: fixed; left: 0; top: 0; z-index: 50; transform: translateX(-100%); transition: transform .2s; box-shadow: 0 0 48px rgba(17,20,24,.18); }
  .app.nav-open .sidebar { transform: none; }
  /* iPhone: 100vh ist höher als der sichtbare Bereich – sonst lässt sich das Menü nicht bis unten scrollen */
  .sidebar { height: 100vh; height: 100dvh; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; padding-bottom: calc(18px + env(safe-area-inset-bottom)); }
  .sidebar-foot { margin-top: 12px; }
  .app.nav-open { overflow: hidden; }
  html.nav-lock, html.nav-lock body { overflow: hidden; }
  .menu-btn { display: inline-flex; }
  .topbar { padding: 10px 16px; }
  .content { padding: 18px 16px 88px; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi:nth-child(2) { border-right: 0; }
  .kpi:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .grid-2, .grid-3, .form-grid, .form-grid-3 { grid-template-columns: minmax(0, 1fr); }
  .steps { grid-template-columns: repeat(3, minmax(0, 1fr)); row-gap: 10px; }
  .page-head h1 { font-size: 24px; }
  .search-trigger kbd { display: none; }
  .tabbar { display: grid; }
}
.tabbar { display: none; position: fixed; bottom: 0; left: 0; right: 0; z-index: 40; background: var(--surface); border-top: 1px solid var(--line); grid-template-columns: repeat(4, minmax(0, 1fr)); padding: 4px 4px calc(6px + env(safe-area-inset-bottom)); }
.tabbar a { display: flex; flex-direction: column; align-items: center; gap: 3px; min-height: 50px; justify-content: center; font-size: 11px; color: var(--muted); }
.tabbar a.on { color: var(--brand); font-weight: 600; box-shadow: inset 0 2px 0 var(--brand); }
.tabbar svg { width: 21px; height: 21px; }
@media print { .sidebar, .topbar, .tabbar, .actions { display: none !important; } }
.hide-sm{} @media (max-width:600px){.hide-sm{display:none}}

/* Korrekturen nach Sichtprüfung */
.btn.menu-btn { display: none; }
@media (max-width: 900px) { .btn.menu-btn { display: inline-flex; } }
.cal-ev.short { white-space: nowrap; text-overflow: ellipsis; padding-top: 3px; }
.cal-ev.short br, .cal-ev.short .extra { display: none; }
.board { grid-template-columns: repeat(4, minmax(190px, 1fr)); min-width: 800px; }
.search-trigger span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.rows .title, .rows .sub { display: block; }
@media (max-width: 900px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  .kpi { border-bottom: 1px solid var(--line); }
  .kpi:nth-child(2n) { border-right: 0; }
}
.search-trigger { min-width: 0; }
.cal-ev.short { line-height: 16px; }

/* ---------- Medien: Upload, Raster, Galerie ---------- */
.input.sm { height: 32px; font-size: 13px; padding: 0 8px; }
.dropzone { display: flex; align-items: center; gap: 14px; padding: 18px; border: 1.5px dashed #C9CDD3; border-radius: var(--r); background: var(--bg); cursor: pointer; color: var(--ink-2); position: relative; transition: border-color .15s, background .15s; }
.dropzone:hover, .dropzone.over { border-color: var(--brand); background: var(--brand-tint); color: var(--brand-ink); }
.dropzone:focus-within { outline: 2px solid var(--brand); outline-offset: 2px; }
.dropzone.busy { pointer-events: none; opacity: .75; }
.dropzone .progress { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: var(--line); }
.dropzone .progress i { display: block; height: 100%; width: 0; background: var(--brand); transition: width .2s; }
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.mtile { margin: 0; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); position: relative; display: flex; flex-direction: column; cursor: grab; }
.mtile.dragging { opacity: .4; }
.mtile .ph { display: block; aspect-ratio: 4/3; background: var(--line-soft); overflow: hidden; border-radius: var(--r) var(--r) 0 0; }
.mtile .ph img { width: 100%; height: 100%; object-fit: cover; display: block; }
.mtile .cover { position: absolute; top: 8px; left: 8px; }
.mtile figcaption { padding: 8px; display: flex; flex-direction: column; gap: 6px; }
.tile-tools { display: flex; align-items: center; gap: 2px; flex-wrap: wrap; }
.tile-tools select { width: auto; flex: 1; min-width: 92px; }
.doc-table td { vertical-align: middle; }

.gallery { display: grid; grid-template-columns: 2fr 1fr 1fr; grid-template-rows: 1fr 1fr; gap: 6px; height: 380px; border-radius: var(--r); overflow: hidden; }
.gallery a { position: relative; display: block; background: var(--line-soft); overflow: hidden; }
.gallery a:first-child { grid-row: span 2; }
.gallery img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .3s; }
.gallery a:hover img { transform: scale(1.03); }
.gallery .more { position: absolute; inset: 0; background: rgba(17,20,24,.55); color: #fff; display: grid; place-items: center; font-weight: 600; font-size: 18px; }
.gallery.n1 { grid-template-columns: 1fr; }
.gallery.n2 { grid-template-columns: 2fr 1fr; }
.gallery.n2 a:first-child, .gallery.n1 a:first-child { grid-row: span 2; }
.gallery.n3 { grid-template-columns: 2fr 1fr; }
.gallery-all { position: absolute; right: 12px; bottom: 12px; }
.no-photo { height: 220px; background: var(--line-soft); border: 1px solid var(--line); border-radius: var(--r); display: grid; place-items: center; color: var(--muted); }
.floorplans { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.floorplans a { border: 1px solid var(--line); border-radius: var(--r); background: #fff; padding: 8px; display: block; }
.floorplans img { width: 100%; height: 200px; object-fit: contain; display: block; }
.doc-list { display: flex; flex-direction: column; }
.doc-list a, .doc-list .locked { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line-soft); color: var(--ink); }
.doc-list a:last-child, .doc-list .locked:last-child { border-bottom: 0; }
.doc-list .locked { color: var(--muted); }
.lightbox { border: 0; padding: 0; margin: 0; width: 100vw; height: 100vh; max-width: 100vw; max-height: 100vh; background: rgba(10,12,14,.94); color: #fff; }
.lightbox[open] { display: grid; grid-template-columns: 64px 1fr 64px; align-items: center; }
.lightbox::backdrop { background: rgba(10,12,14,.94); }
.lightbox figure { margin: 0; display: flex; flex-direction: column; align-items: center; gap: 10px; height: 100%; justify-content: center; padding: 48px 0; min-width: 0; }
.lightbox img { max-width: 100%; max-height: calc(100vh - 120px); object-fit: contain; }
.lightbox figcaption { font-size: 14px; color: #D5D8DC; }
.lightbox button { background: none; border: 0; color: #fff; font-size: 40px; cursor: pointer; height: 100%; }
.lightbox button:hover { background: rgba(255,255,255,.06); }
.lightbox .lb-x { position: absolute; top: 10px; right: 14px; font-size: 22px; height: 44px; width: 44px; }
.lightbox .lb-n { position: absolute; top: 20px; left: 20px; font-size: 13px; color: #A9AEB5; }
@media (max-width: 700px) {
  .gallery { height: 260px; grid-template-columns: 1fr 1fr; grid-template-rows: 2fr 1fr; }
  .gallery a:first-child { grid-row: auto; grid-column: span 2; }
  .gallery a:nth-child(n+4) { display: none; }
  .gallery.n1 a:first-child { grid-row: span 2; }
  .lightbox[open] { grid-template-columns: 40px 1fr 40px; }
  .lightbox button { font-size: 30px; }
  .dropzone { padding: 14px; }
}

/* ---------- Eigentümerportal ---------- */
.portal-hero { display: flex; justify-content: space-between; gap: 20px; align-items: flex-end; flex-wrap: wrap; }
.bars { display: flex; align-items: flex-end; gap: 6px; height: 120px; padding-top: 10px; }
.bars .b { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; height: 100%; justify-content: flex-end; }
.bars .b i { display: block; width: 100%; background: var(--brand); border-radius: var(--r-sm) var(--r-sm) 0 0; min-height: 2px; }
.bars .b span { font-size: 10px; color: var(--muted); font-family: var(--mono); font-variant-numeric: tabular-nums; }
.bars .b b { font-size: 11px; font-family: var(--mono); font-variant-numeric: tabular-nums; }
.hbar { display: grid; grid-template-columns: 130px 1fr 36px; gap: 10px; align-items: center; font-size: 13px; padding: 4px 0; }
.hbar .track { height: 8px; background: var(--line-soft); border-radius: var(--r-sm); overflow: hidden; }
.hbar .track i { display: block; height: 100%; background: var(--brand); }
.msgs { display: flex; flex-direction: column; gap: 10px; max-height: 360px; overflow-y: auto; }
.msg { max-width: 85%; padding: 10px 12px; border-radius: var(--r); background: var(--line-soft); white-space: pre-line; }
.msg.me { align-self: flex-end; background: var(--brand-tint); }
.msg .meta { display: block; font-size: 11px; color: var(--muted); margin-top: 4px; }
.prop-thumb { width: 64px; height: 48px; object-fit: cover; border-radius: var(--r-sm); background: var(--line-soft); display: block; flex: none; }
.prop-cell { display: flex; gap: 12px; align-items: center; }
.timeline .item .eye { color: #B7BCC3; margin-left: auto; flex: none; }
.timeline .item .eye.on { color: var(--brand); }
.timeline .item { grid-template-columns: 112px 1fr auto; align-items: start; }
.tile-tools { flex-wrap: nowrap; }
.tile-tools select { min-width: 0; }
.mtile .make-cover { position: absolute; top: 8px; right: 8px; height: 26px; font-size: 12px; opacity: 0; transition: opacity .15s; }
.mtile:hover .make-cover, .mtile:focus-within .make-cover { opacity: 1; }
.mtile:first-child .make-cover { display: none; }
@media (hover: none) { .mtile .make-cover { opacity: 1; } }
.gallery a[hidden] { display: none !important; }
.public-main.wide, body.wide .public-head .in { max-width: 1080px; }
.side .timeline .item { grid-template-columns: 76px 1fr auto; gap: 8px; }
@media (max-width: 700px) {
  .media-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .tile-tools { flex-wrap: wrap; }
  .tile-tools select { flex-basis: 100%; order: 5; }
  .tile-tools [data-delete] { margin-left: auto; }
  .mtile .make-cover { display: inline-flex; }
  .mtile:first-child .make-cover { display: none; }
  .tabs { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .tabs a { white-space: nowrap; flex: none; }
}

/* Kalender: Ziehen */
.cal-ev { touch-action: manipulation; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.cal-ev .rz { position: absolute; left: 0; right: 0; bottom: 0; height: 7px; cursor: ns-resize; }
.cal-ev .rz::after { content: ''; position: absolute; left: 50%; bottom: 2px; width: 18px; margin-left: -9px; height: 2px; border-radius: 1px; background: currentColor; opacity: 0; }
.cal-ev:hover .rz::after { opacity: .35; }
.cal-ev.dragging { z-index: 30; box-shadow: 0 6px 18px rgba(17,20,24,.18); opacity: .95; cursor: grabbing; filter: none; }
.cal-ev .drag-tip { position: absolute; right: 4px; top: 3px; background: var(--ink); color: #fff; font-size: 11px; padding: 1px 5px; border-radius: var(--r-sm); }
.mev[draggable] { cursor: grab; }
.mev.dragging { opacity: .4; }
.month .day.drop { background: var(--brand-tint); outline: 2px dashed var(--brand); outline-offset: -2px; }
.flash .flash-act { background: none; border: 0; color: #9EE6D9; font-weight: 600; cursor: pointer; padding: 0 6px; font: inherit; font-weight: 600; white-space: nowrap; }
.flash > span:first-child { flex: 1; } .flash .flash-act { margin-left: 0; opacity: 1; color: #9EE6D9; }

/* ---------- Website-Bausteine ---------- */
body.embed { background: transparent; }
body.embed .public-main { padding-top: 4px; padding-bottom: 12px; }
.lead-main { max-width: 760px; }
.lead-h1 { font-size: 30px; letter-spacing: -0.03em; margin: 0; line-height: 1.15; }
.wizard { padding: 0; overflow: hidden; }
.wizard fieldset { border: 0; margin: 0; padding: 22px 24px; display: flex; flex-direction: column; gap: 16px; }
.wizard legend { font-size: 19px; font-weight: 600; padding: 0; margin-bottom: 14px; float: left; width: 100%; }
.wizard legend + * { clear: both; }
.wiz-progress { height: 4px; background: var(--line); }
.wiz-progress i { display: block; height: 100%; width: 20%; background: var(--brand); transition: width .25s; }
.wiz-nav { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 14px 24px; border-top: 1px solid var(--line); background: var(--bg); }
.js .wizard .wstep:not(.on) { display: none; }
.js .wizard [data-wiz-submit] { display: none; }
.js .wizard.last [data-wiz-submit] { display: inline-flex; }
.js .wizard.last [data-wiz-next] { display: none; }
.js .wizard.first [data-wiz-back] { visibility: hidden; }
.wizard:not(.js-ready) [data-wiz-next], .wizard:not(.js-ready) [data-wiz-back] { display: none; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }
.tile-opt input { position: absolute; opacity: 0; pointer-events: none; }
.tile-opt span { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; height: 120px; border: 1.5px solid var(--line); border-radius: var(--r); background: var(--surface); cursor: pointer; color: var(--ink-2); transition: border-color .15s, background .15s; }
.tile-opt span:hover { border-color: #C9CDD3; }
.tile-opt input:checked + span { border-color: var(--brand); background: var(--brand-tint); color: var(--brand-ink); }
.tile-opt input:focus-visible + span { outline: 2px solid var(--brand); outline-offset: 2px; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.seg input { position: absolute; opacity: 0; }
.seg span { display: block; padding: 9px 22px; cursor: pointer; font-weight: 500; }
.seg input:checked + span { background: var(--ink); color: #fff; }
.seg input:focus-visible + span { outline: 2px solid var(--brand); outline-offset: -2px; }
.lead-result { font-size: 34px; font-weight: 700; letter-spacing: -0.02em; color: var(--brand-ink); }
.lead-steps { display: flex; flex-direction: column; gap: 8px; }
.lead-steps div { display: flex; gap: 12px; align-items: flex-start; }
.lead-steps b { width: 24px; height: 24px; flex: none; display: grid; place-items: center; background: var(--brand); color: #fff; border-radius: var(--r-sm); font-size: 12px; }
.pcards { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px; }
.pcard { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; color: var(--ink); transition: box-shadow .15s, transform .15s; }
.pcard:hover { text-decoration: none; color: var(--ink); box-shadow: 0 8px 24px rgba(17,20,24,.08); transform: translateY(-1px); }
.pcard .ph { position: relative; aspect-ratio: 4/3; background: var(--line-soft); display: grid; place-items: center; }
.pcard .ph img { width: 100%; height: 100%; object-fit: cover; position: absolute; inset: 0; }
.pcard .bd { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 3px; }
.pcard .price { font-size: 16px; font-weight: 700; color: var(--brand-ink); margin-top: 4px; }
.cta-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.cta { padding: 18px; display: flex; flex-direction: column; gap: 6px; align-items: flex-start; color: var(--ink); }
.cta:hover { text-decoration: none; color: var(--ink); border-color: var(--brand); }
.code-box { font-family: var(--mono); font-variant-numeric: tabular-nums; font-size: 12px; background: var(--bg); border: 1px solid var(--line); border-radius: var(--r); padding: 10px; white-space: pre-wrap; word-break: break-all; }
@media (max-width: 700px) {
  .lead-h1 { font-size: 24px; }
  .wizard fieldset { padding: 18px 16px; }
  .wiz-nav { padding: 12px 16px; }
  .tiles { grid-template-columns: 1fr 1fr; }
  .tile-opt span { height: 96px; }
  .cta-row { grid-template-columns: 1fr; }
  .lead-result { font-size: 26px; }
}
body.embed .public-main { max-width: none; padding-left: 2px; padding-right: 2px; }
.switch { position: relative; display: inline-block; width: 36px; height: 20px; flex: none; }
.switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; z-index: 1; }
.switch span { position: absolute; inset: 0; background: #D5D8DC; border-radius: 10px; transition: background .15s; }
.switch span::after { content: ''; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; background: #fff; border-radius: 50%; transition: transform .15s; box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.switch input:checked + span { background: var(--brand); }
.switch input:checked + span::after { transform: translateX(16px); }
.switch input:focus-visible + span { outline: 2px solid var(--brand); outline-offset: 2px; }
.ai-btn { border-color: #CFC8F3; color: var(--purple); }
.ai-btn:hover { background: var(--purple-tint); color: var(--purple); }
.spin { width: 12px; height: 12px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; display: inline-block; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.ki-block { border: 1px solid var(--line); border-radius: var(--r); padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.ki-block .chip { text-align: left; height: auto; padding: 6px 10px; }
.ki-h { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.ki-t { white-space: pre-line; line-height: 1.55; font-size: 14px; }
.ki-wait { padding: 18px; text-align: center; color: var(--muted); background: var(--purple-tint); border-radius: var(--r); }
.flash-in { box-shadow: 0 0 0 3px var(--purple-tint) !important; border-color: var(--purple) !important; }

/* ---------- Kennzahlen ---------- */
.kpis.kpi5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.delta { font-size: 12px; font-weight: 600; font-family: var(--mono); font-variant-numeric: tabular-nums; margin-left: 6px; vertical-align: middle; }
.delta.up { color: var(--brand-ink); }
.delta.down { color: var(--orange-ink); }
.bars.tall { height: 180px; }
.funnel { display: flex; flex-direction: column; gap: 14px; }
.f-row { display: flex; flex-direction: column; gap: 4px; }
.f-lbl { display: flex; justify-content: space-between; font-size: 13px; }
.f-row .track { height: 10px; background: var(--line-soft); border-radius: var(--r-sm); overflow: hidden; }
.f-row .track i { display: block; height: 100%; background: var(--brand); }
.f-row:nth-child(2) .track i { opacity: .8; } .f-row:nth-child(3) .track i { opacity: .65; } .f-row:nth-child(4) .track i { opacity: .5; }
@media (max-width: 900px) { .kpis.kpi5 { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; } .kpis.kpi5 .kpi:last-child { grid-column: span 2; } }

/* ---------- Exposé-Editor ---------- */
.designs { display: flex; gap: 10px; flex-wrap: wrap; }
.design-opt input { position: absolute; opacity: 0; }
.design-opt > span { display: flex; flex-direction: column; gap: 2px; padding: 10px 14px; border: 1.5px solid var(--line); border-radius: var(--r); background: var(--surface); cursor: pointer; min-width: 180px; }
.design-opt input:checked + span { border-color: var(--brand); background: var(--brand-tint); }
.design-opt input:focus-visible + span { outline: 2px solid var(--brand); outline-offset: 2px; }
.ex-wrap { display: grid; grid-template-columns: 270px minmax(0, 1fr) 330px; gap: 20px; align-items: start; }
.ex-pages, .ex-props { position: sticky; top: 76px; max-height: calc(100vh - 96px); display: flex; flex-direction: column; }
.ex-props .card-body { overflow-y: auto; }
.ex-list { list-style: none; margin: 0; padding: 6px; overflow-y: auto; flex: 1; }
.ex-list li { display: flex; align-items: center; gap: 8px; padding: 6px; border-radius: var(--r); cursor: pointer; border: 1px solid transparent; }
.ex-list li:hover { background: var(--bg); }
.ex-list li.on { background: var(--brand-tint); border-color: var(--brand); }
.ex-list li.off { opacity: .5; }
.ex-list li.dragging { opacity: .3; }
.ex-list .num { width: 18px; font-size: 11px; color: var(--muted); text-align: right; flex: none; }
.ex-list img, .ex-list .nt { width: 34px; height: 46px; object-fit: cover; border: 1px solid var(--line); border-radius: 2px; flex: none; background: #fff; }
.ex-list .nt { display: grid; place-items: center; font-weight: 700; color: var(--muted); font-size: 12px; }
.ex-list .lbl { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.ex-list .lbl b { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ex-list .tools { display: flex; gap: 0; opacity: 0; transition: opacity .1s; }
.ex-list li:hover .tools, .ex-list li.on .tools { opacity: 1; }
.ex-list .tools button { all: unset; cursor: pointer; width: 20px; text-align: center; font-size: 12px; color: var(--muted); }
.ex-list .tools button:hover { color: var(--ink); }
.ex-stage { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.ex-paper { position: relative; width: 100%; max-width: 794px; margin: 0 auto; overflow: hidden; box-shadow: 0 4px 24px rgba(17,20,24,.12); background: #fff; }
.ex-paper iframe { position: absolute; top: 0; left: 0; width: 794px; height: 1123px; border: 0; transform-origin: 0 0; background: #fff; }
.ex-nav { display: flex; justify-content: center; gap: 12px; align-items: center; }
.ex-imgs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.ex-imgs button { all: unset; position: relative; aspect-ratio: 1; cursor: pointer; border-radius: 2px; overflow: hidden; outline: 1px solid var(--line); }
.ex-imgs button img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ex-imgs button.on { outline: 3px solid var(--brand); outline-offset: -1px; }
.ex-imgs b { position: absolute; top: 3px; right: 3px; background: var(--brand); color: #fff; font-size: 11px; min-width: 18px; height: 18px; display: grid; place-items: center; border-radius: 9px; }
.ex-imgs i { position: absolute; left: 3px; bottom: 3px; background: rgba(0,0,0,.6); color: #fff; font-size: 9px; font-style: normal; padding: 0 3px; border-radius: 2px; }
.lh-prev { width: 100%; aspect-ratio: 210/297; border: 1px solid var(--line); background: #fff center/cover no-repeat; border-radius: 2px; }
@media (max-width: 1200px) { .ex-wrap { grid-template-columns: 240px minmax(0, 1fr); } .ex-props { grid-column: 1 / -1; position: static; max-height: none; } }
@media (max-width: 760px) { .ex-wrap { grid-template-columns: 1fr; } .ex-pages { position: static; max-height: 300px; } .ex-list .tools { opacity: 1; } }

/* ---------- E-Mails ---------- */
.mail-list { display: flex; flex-direction: column; }
.mail { border-bottom: 1px solid var(--line-soft); }
.mail:last-child { border-bottom: 0; }
.mail summary { list-style: none; display: flex; gap: 12px; padding: 12px 18px; cursor: pointer; align-items: flex-start; }
.mail summary::-webkit-details-marker { display: none; }
.mail summary:hover { background: var(--bg); }
.mail[open] summary { background: var(--bg); }
.mail .dir { width: 26px; height: 26px; flex: none; display: grid; place-items: center; border-radius: var(--r-sm); font-weight: 700; }
.mail.in .dir { background: var(--brand-tint); color: var(--brand-ink); }
.mail.out .dir { background: var(--line-soft); color: var(--ink-2); }
.mail .subj { display: block; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mail .meta { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mail .snip { display: block; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mail[open] .snip { display: none; }
.mail .when { text-align: right; color: var(--muted); flex: none; }
.mail-body { padding: 0 18px 14px 56px; display: flex; flex-direction: column; gap: 10px; }
.mail-frame { width: 100%; height: 220px; border: 1px solid var(--line); border-radius: var(--r); background: #fff; }
.compose-grid { display: grid; grid-template-columns: 70px 1fr; gap: 8px 10px; align-items: center; }
.compose-atts { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; border-top: 1px solid var(--line); padding-top: 12px; }
@media (max-width: 700px) { .compose-grid { grid-template-columns: 1fr; } .mail-body { padding-left: 18px; } }
[hidden] { display: none !important; }
.mail summary > .grow { flex: 1; }
.mail .when { width: 64px; }
.mail-frame { height: 60px; }

/* ---------- Team ---------- */
.team-photo { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--brand-tint); color: var(--brand-ink); font-weight: 600; overflow: hidden; flex: none; font-size: 14px; }
.team-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.team-photo.sm { width: 30px; height: 30px; font-size: 11px; }
.team-photo.lg { width: 64px; height: 64px; font-size: 20px; }
.team-photo.xl { width: 100%; height: auto; aspect-ratio: 1; border-radius: 0; font-size: 42px; }
.team-photo.xxl { width: 148px; height: 148px; font-size: 44px; }
.team-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.team-card { overflow: hidden; display: flex; flex-direction: column; }
.team-card .team-photo.xl:hover img { transform: scale(1.03); transition: transform .3s; }
.profile-head { display: flex; gap: 24px; align-items: center; padding: 24px; flex-wrap: wrap; }
.staff-row { display: flex; align-items: center; gap: 10px; padding: 6px 0; }
.staff-row .grow { min-width: 0; }
.staff-row .role { height: 28px; font-size: 12px; padding: 0 6px; width: 120px; }
@media (max-width: 700px) { .team-photo.xxl { width: 110px; height: 110px; } .profile-head { padding: 18px; gap: 16px; } }

/* ---------- Glocke ---------- */
.topbar-actions { display: flex; gap: 8px; align-items: center; margin-left: auto; }
.dot-count { position: absolute; top: 2px; right: 2px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px; background: var(--brand); color: #fff; font-size: 10px; font-weight: 700; display: grid; place-items: center; line-height: 1; }
.dot-count.orange { background: var(--orange); }
.bell { position: relative; }
.bell > .btn { position: relative; }
.bell-panel { position: absolute; right: 0; top: 46px; width: min(380px, calc(100vw - 24px)); z-index: 60; box-shadow: 0 18px 48px rgba(17,20,24,.18); }
.bell-list { max-height: 420px; overflow-y: auto; }
.bell-item { display: flex; flex-direction: column; gap: 2px; padding: 10px 16px; border-bottom: 1px solid var(--line-soft); color: var(--ink); }
.bell-item:hover { background: var(--bg); text-decoration: none; color: var(--ink); }
.bell-item.unread { border-left: 3px solid var(--brand); padding-left: 13px; background: #FBFDFC; }
@media (max-width: 700px) { .bell-panel { position: fixed; top: 58px; right: 12px; } }

/* ---------- Aufgaben ---------- */
.task-quick { display: grid; gap: 10px; }
.task-quick-row { display: flex; gap: 8px; }
.task-quick-row .input { flex: 1; min-width: 0; }
.task-quick-opts { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: space-between; }
.task-quick-more { display: flex; flex-wrap: wrap; gap: 6px; }
.task-quick-more .input { width: auto; min-width: 150px; min-height: 34px; padding-top: 4px; padding-bottom: 4px; font-size: 13px; }
.task-quick.compact { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.task-quick.compact .task-quick-more .input { min-width: 0; }
.chip-date { position: relative; padding-right: 6px; }
.chip-date input { border: 0; background: transparent; font: inherit; color: inherit; width: 118px; padding: 0; }
.input-time { width: 96px !important; min-height: 34px; font-size: 13px; padding: 4px 8px; }
.chip-danger { color: var(--red); }
.task-list { display: grid; }
.card.task-list { padding: 4px 0; }
.task { display: flex; gap: 12px; padding: 10px 14px; border-bottom: 1px solid var(--line); align-items: flex-start; }
.task:last-child { border-bottom: 0; }
.task-check { flex: none; width: 22px; height: 22px; margin-top: 1px; border: 1.5px solid #B8BCC3; border-radius: 50%; background: var(--surface); color: transparent; display: grid; place-items: center; cursor: pointer; padding: 0; }
.task-check:hover { border-color: var(--brand); color: var(--brand); }
.task.done .task-check { background: var(--brand); border-color: var(--brand); color: #fff; }
.task.done .task-title { text-decoration: line-through; color: var(--muted); }
.task-body { flex: 1; min-width: 0; }
.task-title { border: 0; background: none; padding: 0; text-align: left; font: inherit; font-weight: 500; color: var(--ink); cursor: pointer; overflow-wrap: anywhere; }
.task-meta { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 12.5px; color: var(--muted); margin-top: 2px; align-items: center; }
.task-meta a { color: var(--ink-2); display: inline-flex; gap: 4px; align-items: center; }
.task.over .task-due { color: var(--red); font-weight: 600; }
.task.prio .task-check { border-color: #D97706; }
.task-edit { margin-top: 10px; display: grid; gap: 8px; }
.task-edit-row { display: flex; flex-wrap: wrap; gap: 6px; }
.task-edit-row .input { width: auto; flex: 1 1 140px; min-height: 34px; font-size: 13px; padding: 4px 8px; }
.task-group { margin-top: 18px; }
.task-group-title { font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin: 0 0 6px 2px; font-weight: 600; }
.task-group-title .n { font-family: var(--mono); font-variant-numeric: tabular-nums; font-weight: 400; }
.task-group-ueberfaellig .task-group-title { color: var(--red); }
.task-empty { padding: 4px 0; }
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; justify-content: space-between; align-items: center; margin-top: 16px; }
.search-inline .input { min-width: 220px; }
.flash-hl { animation: hl 2s ease-out; }
@keyframes hl { from { background: var(--brand-tint); } to { background: transparent; } }
@media (max-width: 640px) { .hide-sm { display: none; } .search-inline, .search-inline .input { width: 100%; min-width: 0; } .task-quick-more .input { flex: 1 1 45%; min-width: 0; } }
.card-body .task { padding-left: 0; padding-right: 0; }
.auto-head { display: flex; gap: 14px; align-items: flex-start; }
.auto-head .switch { margin-top: 2px; }
.auto-rule.on { border-color: var(--brand); }
.auto-edit[hidden] { display: none !important; }
.chip input[type=checkbox] { margin: 0; accent-color: var(--brand); }
.auto-head .grow { flex: 1; min-width: 0; }
/* ---------- Import & Dubletten ---------- */
.import-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.dropzone-sm { position: relative; display: flex; align-items: center; justify-content: center; min-height: 64px; border: 1.5px dashed #C9CCD1; border-radius: var(--r); color: var(--ink-2); cursor: pointer; font-weight: 500; }
.dropzone-sm:hover { border-color: var(--brand); color: var(--brand); }
.dropzone-sm input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.dropzone-sm span { display: inline-flex; gap: 6px; align-items: center; }
.import-map select { min-width: 220px; }
.import-map tr.mapped td:first-child { box-shadow: inset 3px 0 0 var(--brand); }
.import-sample { max-width: 420px; overflow-wrap: anywhere; }
.radio-list { display: grid; gap: 8px; }
.radio-list label { display: flex; gap: 8px; align-items: center; cursor: pointer; }
.radio-list input { accent-color: var(--brand); }
.dup-list { display: grid; }
.dup-item { display: flex; gap: 12px; align-items: flex-start; padding: 12px 18px; border-top: 1px solid var(--line); cursor: pointer; }
.dup-item:first-of-type { border-top: 0; }
.dup-item input { margin-top: 4px; accent-color: var(--brand); }
.dup-body { flex: 1; display: grid; gap: 2px; min-width: 0; overflow-wrap: anywhere; }
.dup-keep { display: none; }
.dup-item:has(input:checked) { background: var(--brand-tint); }
.dup-item:has(input:checked) .dup-keep { display: inline-flex; }
/* ---------- Social Media ---------- */
.sm-sug { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; padding: 14px 18px 18px; }
.sm-sugcard button, .sm-card { display: flex; gap: 12px; align-items: center; width: 100%; text-align: left; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); padding: 8px; cursor: pointer; font: inherit; color: inherit; }
.sm-sugcard button:hover, .sm-card:hover, .sm-card.is-pre { border-color: var(--brand); background: var(--brand-tint); }
.sm-thumb { flex: none; width: 72px; height: 72px; border-radius: var(--r-sm, 6px); overflow: hidden; background: var(--line-soft, #F2F3F5); display: grid; place-items: center; font-size: 26px; }
.sm-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.sm-txt { display: grid; gap: 3px; min-width: 0; }
.sm-txt strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sm-txt small { color: var(--muted); font-size: 12.5px; }
.sm-txt .badge { justify-self: start; }
.sm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; }
.sm-post { display: flex; flex-direction: column; overflow: hidden; color: inherit; }
.sm-post:hover { text-decoration: none; border-color: var(--brand); }
.sm-img { position: relative; display: grid; place-items: center; background: #1B1F24; aspect-ratio: 4/5; }
.sm-img.sm-r-square { aspect-ratio: 1; } .sm-img.sm-r-story { aspect-ratio: 9/16; }
.sm-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.sm-count { position: absolute; right: 8px; top: 8px; background: rgba(17,20,24,.75); color: #fff; font: 600 11px/1 var(--mono); padding: 4px 6px; border-radius: 4px; }
.sm-meta { display: grid; gap: 4px; padding: 10px 12px 12px; }
.sm-meta .badge { justify-self: start; }
.sm-meta strong { font-size: 14px; line-height: 1.3; }
.sm-meta small { font-size: 12px; }
.sm-create { display: grid; gap: 22px; }
.sm-h { display: flex; gap: 10px; align-items: center; font-size: 17px; margin-bottom: 12px; }
.sm-h > span:first-child { width: 26px; height: 26px; border-radius: 50%; background: var(--ink); color: #fff; display: grid; place-items: center; font-size: 13px; }
.sm-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.sm-tile { position: relative; display: grid; gap: 4px; justify-items: start; padding: 14px; border: 1.5px solid var(--line); border-radius: var(--r); background: var(--surface); cursor: pointer; }
.sm-tile input, .sm-format input { position: absolute; opacity: 0; }
.sm-tile:has(input:checked), .sm-format:has(input:checked) { border-color: var(--brand); background: var(--brand-tint); }
.sm-tile:has(input:focus-visible), .sm-format:has(input:focus-visible) { outline: 2px solid var(--brand); outline-offset: 2px; }
.sm-ico { font-size: 24px; line-height: 1; }
.sm-tile small, .sm-format small { color: var(--muted); font-size: 12px; }
.sm-row { display: flex; flex-wrap: wrap; gap: 14px; }
.sm-formats { display: flex; flex-wrap: wrap; gap: 8px; }
.sm-format { position: relative; display: grid; justify-items: center; gap: 4px; min-width: 104px; padding: 12px 10px; border: 1.5px solid var(--line); border-radius: var(--r); background: var(--surface); cursor: pointer; text-align: center; font-size: 13px; }
.sm-format i { display: block; border: 2px solid currentColor; border-radius: 3px; opacity: .7; }
.sf-portrait { width: 20px; height: 25px; } .sf-story { width: 16px; height: 28px; } .sf-square { width: 24px; height: 24px; } .sf-carousel { width: 20px; height: 25px; box-shadow: 4px -4px 0 -1px var(--surface), 4px -4px 0 1px currentColor; }
.sd-foto { width: 26px; height: 26px; background: linear-gradient(transparent 55%, currentColor 55%); }
.sd-rahmen { width: 26px; height: 26px; background: linear-gradient(currentColor 60%, transparent 60%); }
.sd-fakten { width: 26px; height: 26px; background: radial-gradient(circle, currentColor 25%, transparent 26%); }
.sm-more summary { cursor: pointer; font-size: 13px; color: var(--muted); margin-top: 10px; }
.sm-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.sm-busy { position: fixed; inset: 0; background: rgba(255,255,255,.85); display: grid; place-items: center; z-index: 100; }
.sm-busy > div { display: grid; gap: 6px; justify-items: center; text-align: center; }
.spinner { width: 34px; height: 34px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--brand); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
/* ---------- Schaufenster ---------- */
.tv-layout { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 16px; align-items: start; }
@media (max-width: 1100px) { .tv-layout { grid-template-columns: 1fr; } }
.tv-preview { position: relative; aspect-ratio: 16/9; background: #0E1114; border-radius: var(--r) var(--r) 0 0; overflow: hidden; }
.tv-preview.hoch { aspect-ratio: 9/16; max-height: 70vh; margin: 0 auto; }
.tv-preview iframe, .tv-thumb iframe { position: absolute; left: 0; top: 0; width: 1920px; height: 1080px; border: 0; transform-origin: 0 0; pointer-events: none; }
.tv-preview.hoch iframe { width: 1080px; height: 1920px; }
.tv-thumb { position: relative; display: block; aspect-ratio: 16/9; background: #0E1114; overflow: hidden; }
.tv-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tv-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 8px; max-height: 520px; overflow: auto; padding: 2px; }
.tv-item { display: flex; gap: 10px; align-items: center; text-align: left; border: 1.5px solid var(--line); border-radius: var(--r); background: var(--surface); padding: 6px; cursor: pointer; font: inherit; color: inherit; }
.tv-item.on { border-color: var(--brand); background: var(--brand-tint); }
.tv-item .sm-txt { flex: 1; }
.tv-pos { flex: none; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font: 600 12px/1 var(--mono); }
.tv-item.on .tv-pos { background: var(--brand); color: #fff; }
.tv-code { display: grid; gap: 2px; justify-items: start; }
.tv-code b { font-size: 16px; }
.tv-codebig { font-size: 28px !important; letter-spacing: .14em; color: var(--brand); }
.tv-qr { flex: none; width: 104px; height: 104px; }
.tv-qr svg { width: 100%; height: 100%; }
.seg label { position: relative; }
/* ---------- Dokumente & Unterschrift ---------- */
.doc-paper { background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 44px 52px; box-shadow: 0 1px 2px rgba(0,0,0,.04); font-family: Inter, system-ui, sans-serif; font-size: 14.5px; line-height: 1.6; color: #111418; }
.doc-paper h1 { font-size: 22px; margin-bottom: 14px; }
.doc-body h2 { font-size: 16px; margin: 18px 0 6px; } .doc-body h3 { font-size: 14.5px; margin: 12px 0 4px; }
.doc-body p { margin: 0 0 8px; } .doc-body ul, .doc-body ol { margin: 0 0 8px 22px; }
.doc-body table { border-collapse: collapse; width: 100%; margin: 6px 0 10px; } .doc-body td, .doc-body th { padding: 6px 8px; border-bottom: 1px solid #E6E8EB; text-align: left; } .doc-body .num { text-align: right; }
.doc-body .muted { color: #5B616B; } .doc-body .small { font-size: 12.5px; } .doc-body .box { border: 1px solid #D5D8DC; padding: 10px; }
.doc-body[contenteditable] { outline: none; min-height: 300px; }
.doc-body[contenteditable]:focus { box-shadow: 0 0 0 2px var(--brand-tint); border-radius: 4px; }
@media (max-width: 640px) { .doc-paper { padding: 22px 18px; font-size: 14px; } }
.sig-pad { position: relative; border: 1.5px dashed #B8BCC3; border-radius: var(--r); background: #FBFCFD; height: 180px; touch-action: none; }
.sig-pad canvas { position: absolute; inset: 0; width: 100%; height: 100%; cursor: crosshair; }
.sig-hint { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); color: #B8BCC3; pointer-events: none; font-size: 15px; }
.sig-pad::after { content: ""; position: absolute; left: 24px; right: 24px; bottom: 40px; border-bottom: 1px solid #D5D8DC; pointer-events: none; }
.check-row { display: flex; gap: 10px; align-items: flex-start; font-size: 13.5px; } .check-row input { margin-top: 3px; accent-color: var(--brand); }
.doc-tools { display: flex; gap: 4px; flex-wrap: wrap; padding: 6px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--surface); z-index: 2; }
.doc-tools button { border: 1px solid transparent; background: none; border-radius: 6px; min-width: 32px; height: 30px; cursor: pointer; font: inherit; font-size: 13px; }
.doc-tools button:hover { border-color: var(--line); }
.ph-list { display: flex; flex-wrap: wrap; gap: 4px; } .ph-list button { font: 500 11.5px/1 var(--mono); border: 1px solid var(--line); background: var(--surface); border-radius: 4px; padding: 5px 6px; cursor: pointer; }
.doc-title { font-size: 22px; font-weight: 700; border: 0; padding: 0; margin-bottom: 14px; background: none; }
.doc-title:focus { box-shadow: none; outline: none; border-bottom: 1px dashed var(--line); }
.doc-sigs { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; margin-top: 30px; }
.doc-sigs div { display: flex; flex-direction: column; justify-content: flex-end; min-height: 90px; }
.doc-sigs img { max-height: 70px; max-width: 220px; object-fit: contain; align-self: flex-start; }
.doc-sigs span { border-top: 1px solid #111418; padding-top: 4px; font-size: 12px; color: #5B616B; }
/* ---------- Abschluss ---------- */
.offer-new { display: grid; grid-template-columns: 1.4fr 1fr 1.2fr auto; gap: 8px; border-top: 1px solid var(--line); }
@media (max-width: 760px) { .offer-new { grid-template-columns: 1fr 1fr; } }
.offer-act { position: relative; } .offer-act summary { list-style: none; } .offer-act summary::-webkit-details-marker { display: none; }
.offer-pop { position: absolute; right: 0; top: 38px; z-index: 20; width: 270px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: 0 16px 40px -18px rgba(0,0,0,.35); padding: 12px; display: grid; gap: 8px; white-space: normal; }
.notary-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; } .notary-grid .wide, .sa-form .wide { grid-column: 1 / -1; }
@media (max-width: 640px) { .notary-grid, .sa-form { grid-template-columns: 1fr !important; } }
.notary-docs { display: flex; flex-wrap: wrap; gap: 6px; }
.sa-form { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.app-row { display: flex; gap: 12px; align-items: flex-start; padding: 12px 18px; border-bottom: 1px solid var(--line-soft, #F0F1F3); }
.app-row .grow { display: grid; gap: 3px; min-width: 0; } .app-row .sub { font-size: 12.5px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 4px 10px; }
.app-score { flex: none; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; font: 700 14px/1 var(--mono); background: var(--line); }
.app-score.ok { background: #D1FADF; color: #05603A; } .app-score.mid { background: #FEF0C7; color: #93370D; } .app-score.low { background: #FEE4E2; color: #912018; }
.sa-grid { display: grid; grid-template-columns: auto 1fr; gap: 3px 12px; margin-top: 6px; }
/* ---------- Schlüssel ---------- */
.key-row { display: flex; gap: 10px; align-items: center; padding-bottom: 10px; border-bottom: 1px solid var(--line-soft, #F0F1F3); }
.key-row .grow { flex: 1; min-width: 0; }
.key-new { display: flex; gap: 6px; } .key-new .input { min-height: 34px; padding: 4px 8px; font-size: 13px; }
.key-board { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 8px; padding: 14px 18px 18px; }
.key-slot { display: grid; gap: 2px; padding: 10px; border: 1.5px solid var(--line); border-radius: var(--r); color: inherit; background: var(--surface); }
.key-slot:hover { text-decoration: none; border-color: var(--brand); }
.key-slot.out { border-style: dashed; background: #FFF8EC; }
.key-slot small { color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* ---------- Einrichtung ---------- */
.setup-bar { height: 8px; border-radius: 8px; background: var(--line); overflow: hidden; } .setup-bar span { display: block; height: 100%; background: var(--brand); }
.setup-list { display: grid; }
.setup-step { display: flex; gap: 14px; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--line-soft, #F0F1F3); }
.setup-step .grow { flex: 1; min-width: 0; }
.setup-n { flex: none; width: 30px; height: 30px; border-radius: 50%; border: 1.5px solid var(--line); display: grid; place-items: center; font: 600 13px/1 var(--mono); }
.setup-step.ok .setup-n { background: var(--brand); border-color: var(--brand); color: #fff; }
.setup-step.ok b { color: var(--muted); }
.setup-card { border-color: var(--brand); margin-bottom: 16px; }
.plan-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; margin-top: 16px; }
.plan.on { border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand); }
.trial-banner { background: #FFF8EC; border-bottom: 1px solid #F5D9A8; padding: 8px 20px; font-size: 13.5px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

/* ---------- Rechnungen & Buchhaltung ---------- */
.fin-items { display: flex; flex-direction: column; }
.fin-item { display: grid; grid-template-columns: 26px minmax(0, 1fr) 80px 96px 120px 82px 110px 64px; gap: 8px; align-items: start; padding: 10px 18px; border-bottom: 1px solid var(--line-soft); }
.fin-item-head { font-size: 11px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; padding-top: 10px; padding-bottom: 6px; align-items: end; }
.fin-item .pos { padding-top: 11px; color: var(--muted); font-size: 12px; }
.fin-item .num, .fin-item-head .num { text-align: right; }
.fin-title { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.fin-title textarea { height: auto; min-height: 40px; padding: 8px 11px; font-size: 13px; resize: vertical; }
.fin-cell { display: block; min-width: 0; }
.fin-lbl { display: none; font-size: 11px; color: var(--muted); margin-bottom: 4px; }
.fin-total { padding-top: 11px; text-align: right; white-space: nowrap; font-weight: 600; }
.fin-tools { display: flex; gap: 2px; justify-content: flex-end; padding-top: 4px; }
.fin-add { display: flex; gap: 8px; flex-wrap: wrap; border-top: 1px solid var(--line); }
.fin-add select { flex: 1 1 220px; width: auto; min-width: 0; max-width: 100%; }
.fin-sums { border-top: 1px solid var(--line); max-width: 420px; margin-left: auto; width: 100%; }
.fin-upload { display: flex; flex-direction: column; gap: 10px; }
.fin-camera { display: none; align-self: flex-start; cursor: pointer; }
.fin-receipt { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.fin-preview { position: sticky; top: 16px; overflow: hidden; min-height: 320px; }
.fin-preview iframe { width: 100%; height: calc(100vh - 150px); min-height: 520px; border: 0; display: block; }
.fin-preview img { width: 100%; display: block; }
.fin-txrow { align-items: flex-start !important; flex-wrap: wrap; }
.fin-txrow .time { width: 52px; flex: none; font-size: 12px; }
.fin-txrow .grow { display: flex; flex-direction: column; gap: 3px; flex: 1 1 260px; }
.fin-txrow .sub { white-space: normal !important; }
.fin-amt { text-align: right; min-width: 110px; font-weight: 600; color: var(--ink); }
.fin-amt.pos { color: var(--brand-ink); }
.fin-actions { display: flex; gap: 6px; align-items: center; flex: none; }
.fin-sug { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 4px; padding: 6px 8px; background: var(--brand-tint); border-radius: var(--r-sm); }
.fin-cands { display: flex; flex-direction: column; gap: 4px; max-height: 320px; overflow-y: auto; }
.fin-cand { padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--r); }
.fin-cand:has(input:checked) { border-color: var(--brand); background: var(--brand-tint); }
.fin-settings { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; align-items: start; }
.fin-nr { display: grid; grid-template-columns: 110px 100px 130px 1fr; gap: 8px; align-items: center; }
.fin-accadd { display: grid; grid-template-columns: 2fr 1.4fr 1fr auto; gap: 8px; }
@media (max-width: 1100px) { .fin-settings { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 900px) {
  .fin-receipt { grid-template-columns: minmax(0, 1fr); }
  .fin-preview { position: static; }
  .fin-preview iframe { height: 60vh; min-height: 360px; }
  .fin-camera { display: inline-flex; }
  .fin-item { grid-template-columns: 1fr 1fr; padding: 12px 14px; }
  .fin-item-head { display: none; }
  .fin-item .pos { display: none; }
  .fin-title { grid-column: 1 / -1; }
  .fin-lbl { display: block; }
  .fin-total { grid-column: 1; text-align: left; padding-top: 6px; }
  .fin-tools { grid-column: 2; }
  .fin-nr, .fin-accadd { grid-template-columns: 1fr 1fr; }
  .fin-amt { min-width: 0; }
  .fin-actions { width: 100%; justify-content: flex-end; }
}
