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

:root {
  --bg: #0b0b0c;
  --surface: #141416;
  --surface-2: #1b1b1e;
  --surface-3: #232327;
  --line: #2a2a2f;
  --line-soft: #1f1f23;
  --text: #f5f5f7;
  --muted: #9b9ba3;
  --faint: #6c6c74;
  --gold: #d29326;
  --gold-hi: #e6a83b;
  --gold-soft: rgba(210, 147, 38, .14);
  --gold-line: rgba(210, 147, 38, .35);
  --purple: #604596;
  --purple-soft: rgba(96, 69, 150, .22);
  --ok: #4fbf7f;
  --warn: #e0a43a;
  --danger: #e5605a;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 20px 60px rgba(0, 0, 0, .45);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 15px/1.5 'Manrope', -apple-system, BlinkMacSystemFont, 'Helvetica Neue', Arial, sans-serif;
  font-feature-settings: 'tnum' 1;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }

/* ---------- Kopfzeile ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 28px;
  padding: 14px max(24px, env(safe-area-inset-left));
  background: rgba(11, 11, 12, .82);
  backdrop-filter: saturate(160%) blur(18px); -webkit-backdrop-filter: saturate(160%) blur(18px);
  border-bottom: 1px solid var(--line-soft);
}
.brand { display: flex; align-items: center; gap: 14px; text-decoration: none; flex-shrink: 0; }
.brand-logo { height: 38px; width: auto; display: block; }
.wordmark { display: flex; flex-direction: column; line-height: .92; font-weight: 800; letter-spacing: .14em; color: var(--gold); font-size: 15px; }
.brand-logo:not([hidden]) + .wordmark { display: none; }
.brand-sub { font-size: 12px; color: var(--muted); letter-spacing: .18em; text-transform: uppercase; padding-left: 14px; border-left: 1px solid var(--line); }
.nav { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; flex: 1; }
.nav::-webkit-scrollbar { display: none; }
.nav a {
  text-decoration: none; color: var(--muted); padding: 8px 14px; border-radius: 999px;
  font-weight: 600; font-size: 14px; white-space: nowrap; transition: color .15s, background .15s;
}
.nav a:hover { color: var(--text); }
.nav a.active { color: #0b0b0c; background: var(--gold); }
.save-state { font-size: 12px; color: var(--faint); white-space: nowrap; min-width: 92px; text-align: right; }
.save-state.saving { color: var(--muted); }
.save-state.error { color: var(--danger); }

/* ---------- Seite ---------- */
.page { max-width: 1240px; margin: 0 auto; padding: 36px 24px 96px; }
.loading { color: var(--muted); padding: 80px 0; text-align: center; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 28px; flex-wrap: wrap; }
.eyebrow { font-size: 12px; letter-spacing: .2em; text-transform: uppercase; color: var(--gold); font-weight: 700; margin: 0 0 8px; }
h1 { font-size: 40px; line-height: 1.1; letter-spacing: -.02em; margin: 0; font-weight: 700; }
h2 { font-size: 20px; letter-spacing: -.01em; margin: 0 0 4px; font-weight: 700; }
h3 { font-size: 15px; margin: 0; font-weight: 700; }
.lead { color: var(--muted); margin: 10px 0 0; max-width: 640px; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: 13px; }
.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.gold { color: var(--gold); }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }
.stack > * + * { margin-top: 16px; }
.section { margin-top: 40px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 14px; flex-wrap: wrap; }

/* ---------- Kacheln ---------- */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.kpi {
  background: var(--surface); border: 1px solid var(--line-soft); border-radius: var(--radius);
  padding: 22px 22px 20px; text-decoration: none; display: block; transition: border-color .15s, transform .15s;
}
a.kpi:hover { border-color: var(--gold-line); transform: translateY(-1px); }
.kpi-label { font-size: 13px; color: var(--muted); font-weight: 600; }
.kpi-value { font-size: 30px; font-weight: 700; letter-spacing: -.02em; margin-top: 6px; }
.kpi-value.gold { color: var(--gold); }
.kpi-foot { font-size: 13px; color: var(--faint); margin-top: 4px; }

.card { background: var(--surface); border: 1px solid var(--line-soft); border-radius: var(--radius); padding: 22px; }
.card-tight { padding: 0; overflow: hidden; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }

/* ---------- Buttons & Felder ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px; justify-content: center;
  border: 1px solid var(--line); background: var(--surface-2); color: var(--text);
  padding: 9px 16px; border-radius: 999px; font-weight: 600; font-size: 14px; cursor: pointer;
  text-decoration: none; transition: background .15s, border-color .15s, color .15s; white-space: nowrap;
}
.btn:hover { border-color: #3a3a40; background: var(--surface-3); }
.btn.primary { background: var(--gold); border-color: var(--gold); color: #0b0b0c; }
.btn.primary:hover { background: var(--gold-hi); border-color: var(--gold-hi); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn.ghost:hover { color: var(--text); background: var(--surface-2); }
.btn.danger { color: var(--danger); }
.btn.danger:hover { border-color: var(--danger); }
.btn.sm { padding: 6px 12px; font-size: 13px; }
.btn.icon { padding: 7px 9px; border-radius: 10px; }
.btn:disabled { opacity: .45; cursor: default; }

.field { display: flex; flex-direction: column; gap: 6px; }
.field > span { font-size: 12px; color: var(--muted); font-weight: 600; letter-spacing: .02em; }
.input, select.input, textarea.input {
  width: 100%; background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 10px 12px; outline: none; transition: border-color .15s, box-shadow .15s; min-width: 0;
}
.input:focus { border-color: var(--gold); box-shadow: 0 0 0 3px var(--gold-soft); }
select.input { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 17px) 50%, calc(100% - 12px) 50%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 32px; }
.input.num { text-align: right; }
.input.cell { background: transparent; border-color: transparent; padding: 6px 8px; border-radius: 8px; }
.input.cell:hover { border-color: var(--line); }
.input.cell:focus { background: var(--bg); }
.search { position: relative; display: block; }
.search .input { padding-left: 36px; border-radius: 999px; background: var(--surface); }
.search svg { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--faint); }
.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; user-select: none; color: var(--muted); font-size: 14px; font-weight: 600; }
.check input { accent-color: var(--gold); width: 16px; height: 16px; }
.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px 16px; }
.form-grid .span-2 { grid-column: span 2; }

/* ---------- Chips ---------- */
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  border: 1px solid var(--line); background: transparent; color: var(--muted);
  padding: 6px 12px; border-radius: 999px; font-size: 13px; font-weight: 600; cursor: pointer;
}
.chip:hover { color: var(--text); }
.chip.active { background: var(--gold-soft); border-color: var(--gold-line); color: var(--gold); }
.badge {
  display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700;
  padding: 3px 9px; border-radius: 999px; background: var(--surface-3); color: var(--muted); white-space: nowrap;
}
.badge.gold { background: var(--gold-soft); color: var(--gold); }
.badge.purple { background: var(--purple-soft); color: #b9a3ea; }
.badge.warn { background: rgba(224, 164, 58, .14); color: var(--warn); }
.badge.danger { background: rgba(229, 96, 90, .14); color: var(--danger); }
.dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; display: inline-block; }

/* ---------- Tabellen ---------- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th {
  text-align: left; font-size: 12px; font-weight: 700; color: var(--faint); letter-spacing: .06em; text-transform: uppercase;
  padding: 12px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; background: var(--surface);
  position: sticky; top: 0;
}
td { padding: 11px 14px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
tbody tr.clickable { cursor: pointer; transition: background .1s; }
tbody tr.clickable:hover { background: var(--surface-2); }
tr.group-row td { background: var(--bg); padding-top: 22px; border-bottom: 1px solid var(--line); }
tr.group-row:first-child td { padding-top: 14px; }
tr.total-row td { font-weight: 700; border-top: 1px solid var(--line); background: var(--surface-2); }
td.serial { font-family: ui-monospace, 'SF Mono', Menlo, monospace; font-size: 13px; color: var(--muted); letter-spacing: .01em; }
td.actions { width: 1%; white-space: nowrap; text-align: right; }
.group-title { display: flex; align-items: center; gap: 10px; justify-content: space-between; }
.group-title h3 { font-size: 14px; letter-spacing: .01em; }
.group-sum { color: var(--muted); font-size: 13px; font-weight: 600; }

/* ---------- Layout Inventar ---------- */
.inv-layout { display: grid; grid-template-columns: 260px 1fr; gap: 20px; align-items: start; }
.side { position: sticky; top: 86px; max-height: calc(100vh - 110px); overflow: auto; padding-right: 4px; }
.side-list { list-style: none; margin: 0; padding: 0; }
.side-list button {
  width: 100%; display: flex; justify-content: space-between; gap: 10px; text-align: left; border: 0; background: none;
  padding: 8px 12px; border-radius: 10px; color: var(--muted); cursor: pointer; font-size: 14px; font-weight: 600;
}
.side-list button:hover { background: var(--surface); color: var(--text); }
.side-list button.active { background: var(--gold-soft); color: var(--gold); }
.side-list .count { color: var(--faint); font-weight: 600; font-size: 12px; }
.side-list button.active .count { color: var(--gold); }
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.toolbar .search { flex: 1; min-width: 220px; }

/* ---------- Kalkulation ---------- */
.tabs { display: inline-flex; background: var(--surface); border: 1px solid var(--line-soft); padding: 4px; border-radius: 999px; gap: 2px; }
.tabs button { border: 0; background: none; color: var(--muted); padding: 8px 18px; border-radius: 999px; font-weight: 600; cursor: pointer; }
.tabs button.active { background: var(--surface-3); color: var(--text); }
.calc { display: grid; grid-template-columns: 1fr 380px; gap: 20px; align-items: start; }
.pick-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.pick {
  position: relative; text-align: left; background: var(--surface); border: 1px solid var(--line-soft);
  border-radius: var(--radius); padding: 18px; cursor: pointer; transition: border-color .15s, background .15s;
}
.pick:hover { border-color: var(--line); }
.pick.active { border-color: var(--gold); background: linear-gradient(180deg, var(--gold-soft), transparent 70%), var(--surface); }
.pick .pick-name { font-weight: 700; font-size: 16px; }
.pick .pick-price { font-size: 22px; font-weight: 700; margin-top: 10px; letter-spacing: -.01em; }
.pick .pick-meta { color: var(--faint); font-size: 12px; margin-top: 2px; }
.pick.small-pick { padding: 14px 16px; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.pick.small-pick .pick-price { font-size: 15px; margin: 0; }
.pick .tick {
  position: absolute; top: 14px; right: 14px; width: 20px; height: 20px; border-radius: 50%;
  border: 1.5px solid var(--line); display: grid; place-items: center;
}
.pick.small-pick .tick { position: static; flex-shrink: 0; }
.pick.active .tick { background: var(--gold); border-color: var(--gold); }
.pick.active .tick::after { content: ''; width: 6px; height: 10px; border: solid #0b0b0c; border-width: 0 2px 2px 0; transform: rotate(45deg) translate(-1px, -1px); }
.addon-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.summary { position: sticky; top: 86px; }
.summary .line { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; color: var(--muted); font-size: 14px; }
.summary .line strong { color: var(--text); font-weight: 600; }
.summary .total { display: flex; justify-content: space-between; align-items: baseline; padding-top: 16px; margin-top: 10px; border-top: 1px solid var(--line); }
.summary .total .val { font-size: 34px; font-weight: 700; color: var(--gold); letter-spacing: -.02em; }
.offer-card .offer-head { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.offer-card .offer-result { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line-soft); }
.offer-card .offer-result div span { display: block; font-size: 12px; color: var(--faint); font-weight: 600; }
.offer-card .offer-result div strong { font-size: 16px; }
.offer-card .offer-result div.final strong { color: var(--gold); font-size: 18px; }
.comp-table td { padding: 6px 8px; }
.comp-table th { padding: 8px; background: transparent; position: static; }

/* ---------- Hinweise ---------- */
.notice { display: flex; gap: 12px; padding: 14px 16px; border-radius: var(--radius-sm); background: rgba(224, 164, 58, .08); border: 1px solid rgba(224, 164, 58, .25); }
.notice + .notice { margin-top: 8px; }
.notice .ico { color: var(--warn); flex-shrink: 0; margin-top: 2px; }
.notice.info { background: var(--surface); border-color: var(--line-soft); }
.notice.info .ico { color: var(--muted); }
.notice b { font-weight: 700; }
.empty { text-align: center; padding: 48px 20px; color: var(--muted); }

/* ---------- Modal ---------- */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(0, 0, 0, .62); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  display: grid; place-items: center; z-index: 50; padding: 20px; animation: fade .15s ease;
}
.modal {
  width: min(640px, 100%); max-height: calc(100vh - 40px); overflow: auto; background: var(--surface);
  border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow); animation: pop .18s ease;
}
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 22px 24px 0; }
.modal-body { padding: 20px 24px; }
.modal-foot { display: flex; gap: 10px; justify-content: flex-end; padding: 16px 24px 22px; border-top: 1px solid var(--line-soft); flex-wrap: wrap; }
.modal-foot .left { margin-right: auto; display: flex; gap: 10px; }
@keyframes fade { from { opacity: 0 } }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.985) } }

.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(20px); opacity: 0;
  background: var(--surface-3); border: 1px solid var(--line); color: var(--text); padding: 11px 18px; border-radius: 999px;
  font-weight: 600; font-size: 14px; z-index: 60; transition: opacity .2s, transform .2s; pointer-events: none; box-shadow: var(--shadow);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

.logo-preview { background: var(--bg); border: 1px dashed var(--line); border-radius: var(--radius-sm); padding: 18px; display: grid; place-items: center; min-height: 90px; }
.logo-preview img { max-height: 70px; max-width: 100%; }

/* ---------- Responsive ---------- */
@media (max-width: 1000px) {
  .inv-layout, .calc { grid-template-columns: 1fr; }
  .side, .summary { position: static; max-height: none; }
  .side-list { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 6px; }
  .side-list li { flex-shrink: 0; }
  .side-list button { white-space: nowrap; }
  .offer-card .offer-result { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 760px) {
  .topbar { flex-wrap: wrap; gap: 10px 16px; padding: 12px 16px; }
  .nav { order: 3; flex-basis: 100%; }
  .brand-sub { display: none; }
  .page { padding: 24px 16px 80px; }
  h1 { font-size: 30px; }
  .grid-2, .grid-3, .form-grid, .pick-grid, .addon-grid { grid-template-columns: 1fr; }
  .form-grid .span-2 { grid-column: auto; }
  .hide-sm { display: none; }
  td, th { padding: 10px; }
}

/* ---------- Druck (Versicherungsliste) ---------- */
@media print {
  @page { size: A4 landscape; margin: 12mm; }
  body { background: #fff; color: #000; font-size: 10pt; }
  .topbar, .no-print, #toast { display: none !important; }
  .page { padding: 0; max-width: none; }
  .card { background: #fff; border: 0; padding: 0; }
  th { background: #fff; color: #000; border-bottom: 1px solid #000; position: static; }
  td { border-bottom: 1px solid #ccc; color: #000; padding: 4px 6px; }
  td.serial { color: #000; }
  .eyebrow, .gold { color: #000; }
  .print-only { display: block !important; }
}
.print-only { display: none; }
.show-sm { display: none; }
@media (max-width: 760px) { .show-sm { display: block; } .serial-sm { font-family: ui-monospace, 'SF Mono', Menlo, monospace; } }

/* Gruppe umbenennen in der Seitenleiste */
.side-item { position: relative; }
.side-item .side-edit {
  position: absolute; right: 30px; top: 50%; transform: translateY(-50%); width: 26px; height: 26px; padding: 0;
  display: grid; place-items: center; border-radius: 8px; background: var(--surface-3); color: var(--muted); opacity: 0; border: 0; cursor: pointer;
}
.side-item:hover .side-edit, .side-item .side-edit:focus-visible { opacity: 1; }
.side-item:hover > button:first-child > span:first-child { padding-right: 34px; }
.side-item .side-edit:hover { color: var(--gold); }
@media (hover: none) { .side-item .side-edit { display: none; } }
.ins-table th { position: static; white-space: normal; vertical-align: bottom; line-height: 1.35; text-transform: none; letter-spacing: 0; font-size: 12px; color: var(--muted); }
.ins-table th, .ins-table td { padding-left: 10px; padding-right: 10px; }
.ins-table td { font-size: 14px; }
.ins-table th.num { min-width: 104px; max-width: 120px; }
.ins-table td:nth-child(2) { min-width: 200px; }
.ins-table td.serial { font-size: 12px; }
.ins-table td:nth-child(4) { text-align: center; }
.th-sub { font-weight: 600; text-transform: none; letter-spacing: 0; color: var(--faint); font-size: 11px; margin-top: 2px; }
.ins-table td:nth-child(1) { white-space: nowrap; }

/* Unterreiter im Rechner */
.subtabs { display: flex; width: max-content; max-width: 100%; overflow-x: auto; scrollbar-width: none; margin-bottom: 28px; }
.subtabs::-webkit-scrollbar { display: none; }
.subtabs a { color: var(--muted); padding: 8px 16px; border-radius: 999px; font-weight: 600; font-size: 14px; text-decoration: none; white-space: nowrap; }
.subtabs a:hover { color: var(--text); }
.subtabs a.active { background: var(--surface-3); color: var(--text); }
.grid-auto { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px 16px; align-items: end; }

/* ---------- Buchhaltung ---------- */
.quick-add { display: grid; grid-template-columns: 150px minmax(180px, 1fr) auto 130px auto; gap: 12px; align-items: end; }
.quick-add.trip { grid-template-columns: 150px 130px 110px 110px auto minmax(220px, 1fr) auto; }
.quick-add .field { margin: 0; }
.quick-add .tabs.seg { margin: 0; }
.tabs.seg { display: inline-flex; gap: 2px; padding: 3px; background: var(--surface-2, #18181b); border: 1px solid var(--line, #2a2a2f); border-radius: 10px; }
.tabs.seg button { border: 0; background: transparent; color: var(--muted); font: inherit; font-size: 14px; font-weight: 600; padding: 8px 12px; border-radius: 7px; cursor: pointer; white-space: nowrap; }
.tabs.seg button.active { background: var(--gold-soft); color: var(--gold); }
.month-table { width: 100%; border-collapse: collapse; margin-top: 10px; }
.month-table td { padding: 6px 4px; border-bottom: 1px solid var(--line, #2a2a2f); }
.month-table tfoot td { border-bottom: 0; padding-top: 10px; font-weight: 700; }
.badge.warn { background: rgba(229, 96, 90, .14); color: var(--danger); }
.bars { display: flex; flex-direction: column; gap: 3px; }
.bars .bar { height: 6px; border-radius: 3px; min-width: 2px; }
.bars .bar.in { background: var(--ok); }
.bars .bar.out { background: var(--gold); opacity: .7; }
.matrix td, .matrix th { white-space: nowrap; }
.num.gold, td.gold { color: var(--gold); }
@media (max-width: 900px) {
  .quick-add, .quick-add.trip { grid-template-columns: 1fr 1fr; }
  .quick-add > .btn, .quick-add .grow { grid-column: 1 / -1; }
}

/* ---------- Archiv & Aufklappen ---------- */
.stack-sm { display: flex; flex-direction: column; gap: 8px; }
.archive-chip { display: inline-flex; align-items: center; gap: 6px; }
.archive-chip .chev { transition: transform .15s; font-size: 11px; }
.archive-chip.open .chev { transform: rotate(180deg); }
.archive-row .chip { opacity: .75; }
tr.fold { cursor: pointer; user-select: none; }
tr.fold:hover td { background: var(--surface-2); }
tr.fold .chev { display: inline-block; width: 16px; color: var(--gold); transition: transform .15s; }
tr.fold.open .chev { transform: rotate(90deg); }
tr.fold.archive h3 { color: var(--muted); }

/* ---------- Übersicht: Finanzstand ---------- */
.finance { display: grid; grid-template-columns: 1fr 300px; gap: 14px; align-items: stretch; }
.fin-months { display: grid; grid-template-rows: 1fr 1fr; gap: 14px; }
.fin-top { display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; margin-bottom: 14px; }
.hero { font-size: 38px; font-weight: 800; letter-spacing: -.02em; color: var(--gold); margin: 4px 0; }
.hero.neg, .kpi-value.neg { color: var(--danger); }
.fin-split { display: flex; gap: 28px; align-items: flex-end; }
.fin-split strong { font-size: 20px; display: block; margin-top: 4px; }
.legend, .mini-split span { display: inline-flex; align-items: center; gap: 7px; color: var(--muted); font-size: 13px; }
.legend i, .mini-split i, .chart-tip i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.mini-split { display: flex; gap: 16px; margin-top: 10px; flex-wrap: wrap; }
.chart-wrap { position: relative; }
.chart-wrap svg { width: 100%; height: auto; display: block; }
.chart-wrap .ax { fill: var(--faint); font-size: 11px; font-family: inherit; }
.chart-wrap .ax.now { fill: var(--gold); font-weight: 700; }
.chart-wrap .hit:hover { fill: rgba(255, 255, 255, .035); }
.chart-tip { position: absolute; pointer-events: none; background: var(--surface-3); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; font-size: 13px; min-width: 190px; box-shadow: 0 8px 24px rgba(0,0,0,.4); z-index: 5; }
.chart-tip > div { display: flex; align-items: center; gap: 7px; margin-top: 5px; }
.chart-tip span { margin-left: auto; font-variant-numeric: tabular-nums; font-weight: 600; }
.chart-tip .res { border-top: 1px solid var(--line); padding-top: 5px; font-weight: 700; }
@media (max-width: 900px) { .finance { grid-template-columns: 1fr; } .fin-months { grid-template-rows: none; grid-template-columns: 1fr 1fr; } .hero { font-size: 30px; } }
@media (max-width: 520px) { .fin-months { grid-template-columns: 1fr; } }
@media (max-width: 520px) { .chart-wrap .ax { font-size: 22px; } }

/* ---------- AfA ↔ Inventar ---------- */
.afa-box { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 14px; display: flex; flex-direction: column; gap: 10px; background: var(--surface-2); }
.afa-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; font-size: 13px; font-weight: 600; color: var(--muted); margin: 4px 0 6px; }
.afa-head a { color: var(--gold); text-decoration: none; font-weight: 600; }
.afa-info { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px 16px; }
.afa-info span { display: block; font-size: 12px; color: var(--faint); }
.afa-info b { font-variant-numeric: tabular-nums; }
.link-list { display: flex; flex-direction: column; gap: 6px; margin-bottom: 8px; max-height: 220px; overflow: auto; }
.link-item { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; }
.link-note { color: var(--gold); opacity: .85; margin-top: 2px; }
@media (max-width: 520px) { .afa-info { grid-template-columns: 1fr 1fr; } }
.notice.check .check-body { flex: 1; display: flex; justify-content: space-between; gap: 12px; align-items: center; flex-wrap: wrap; }
.check-actions { gap: 8px; flex-wrap: nowrap; }
.notice.muted-check { opacity: .6; }
.btn-reset { background: none; color: inherit; font: inherit; cursor: pointer; width: 100%; }
.btn-reset:hover { border-color: var(--gold-line); }

/* ---------- Kalkulation: ein Rechner mit Auswahl ---------- */
.offer-select { display: none; }
.offer-layout .side { top: 86px; }
@media (max-width: 900px) {
  .offer-select { display: flex; }
  .offer-list { display: none; }
  .offer-layout .side { position: static; max-height: none; }
}
.offer-layout > * { min-width: 0; } .offer-layout .card { overflow: hidden; }

/* ---------- Logo & installierte App ---------- */
.brand-logo { height: 42px; width: auto; }
.install-steps { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; }
.install-steps > div { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; }
.install-steps span { color: var(--muted); font-size: 13px; }
@media (display-mode: standalone) {
  .topbar { padding-top: calc(14px + env(safe-area-inset-top)); }
  body { padding-bottom: env(safe-area-inset-bottom); }
}

/* ---------- Kalkulation – Geräte ---------- */
.dev-layout { grid-template-columns: 380px 1fr; }
.dev-layout > * { min-width: 0; }
.dev-pick { position: sticky; top: 86px; }
.dev-list { margin-top: 12px; max-height: calc(100vh - 330px); min-height: 240px; overflow: auto; display: flex; flex-direction: column; gap: 4px; padding-right: 2px; }
.dev-sub { font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--gold); font-weight: 700; margin: 10px 0 4px; }
.dev-row { display: grid; grid-template-columns: 1fr auto 20px; gap: 10px; align-items: center; text-align: left; width: 100%; padding: 9px 10px; border-radius: 9px;
  border: 1px solid transparent; background: none; color: var(--text); font: inherit; cursor: pointer; }
.dev-row:hover { background: var(--surface-2); }
.dev-row.active { border-color: var(--gold-line); background: var(--gold-soft); }
.dev-name { font-weight: 600; font-size: 14px; }
.dev-price { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.dev-row .tick { width: 18px; height: 18px; border-radius: 50%; border: 1.5px solid var(--line); display: grid; place-items: center; }
.dev-row.active .tick { background: var(--gold); border-color: var(--gold); }
.dev-row.active .tick::after { content: ''; width: 5px; height: 9px; border: solid #0b0b0c; border-width: 0 2px 2px 0; transform: rotate(45deg) translate(-1px, -1px); }
.dev-results .offer-result { display: flex; flex-direction: column; gap: 0; margin-top: 14px; border-top: 1px solid var(--line-soft); }
.dev-results .offer-result div { display: flex; justify-content: space-between; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line-soft); color: var(--muted); font-size: 14px; }
.dev-results .offer-result div strong { color: var(--text); font-variant-numeric: tabular-nums; }
.dev-results .offer-result div.final strong { color: var(--gold); font-size: 20px; }
@media (max-width: 1100px) { .dev-layout { grid-template-columns: 1fr; } .dev-pick { position: static; } .dev-list { max-height: 360px; } }

/* ---------- Offline ---------- */
.save-state.offline { color: var(--warn); }
.save-state.offline::before { content: ''; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--warn); margin-right: 6px; vertical-align: 1px; }

/* ---------- Mac-App-Fenster ---------- */
.topbar { -webkit-app-region: drag; padding-left: 92px; }
.topbar a, .topbar button, .topbar input, .topbar .save-state { -webkit-app-region: no-drag; }
@media (max-width: 760px) { .topbar { padding-left: 84px; } }
.nav a.nav-end { margin-left: auto; }

/* ---------- Pakete & Preise ---------- */
.base-card summary { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; cursor: pointer; list-style: none; flex-wrap: wrap; }
.base-card summary::-webkit-details-marker { display: none; }
.base-card summary h2::before { content: '▸'; color: var(--gold); display: inline-block; width: 18px; transition: transform .15s; }
.base-card[open] summary h2::before { transform: rotate(90deg); }
.pk-layout { grid-template-columns: 300px 1fr; }
.pk-layout > * { min-width: 0; }
.pk-side { position: sticky; top: 86px; max-height: calc(100vh - 110px); overflow: auto; }
.pk-filter { margin: 12px 0 8px; gap: 6px; }
.pk-filter .chip { padding: 5px 10px; font-size: 12px; }
.pk-list button { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.pk-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pk-badges { display: inline-flex; gap: 3px; flex-shrink: 0; }
.use-dot { font-size: 10px; font-weight: 700; letter-spacing: .02em; padding: 2px 6px; border-radius: 999px; background: var(--surface-3); color: var(--muted); }
.use-dot.use-paket { background: var(--gold-soft); color: var(--gold); }
.use-dot.use-addon { background: rgba(79, 191, 127, .14); color: var(--ok); }
.use-dot.use-vermietung { background: var(--purple-soft); color: #b9a3ea; }
.pk-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.pk-title { font-size: 20px; font-weight: 700; max-width: 420px; }
.use-toggles { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.use-toggles > .small { margin-right: 4px; }
.use-toggle { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface-2); color: var(--muted); font: inherit; font-weight: 600; font-size: 14px; cursor: pointer; }
.use-toggle .tick { width: 16px; height: 16px; border-radius: 50%; border: 1.5px solid var(--line); display: grid; place-items: center; }
.use-toggle.on { border-color: var(--gold-line); background: var(--gold-soft); color: var(--gold); }
.use-toggle.on .tick { background: var(--gold); border-color: var(--gold); }
.use-toggle.on .tick::after { content: ''; width: 4px; height: 8px; border: solid #0b0b0c; border-width: 0 2px 2px 0; transform: rotate(45deg) translate(-1px, -1px); }
.calc-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; align-items: stretch; }
.calc-card { display: flex; flex-direction: column; }
.calc-card-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.calc-card-head h3 { font-size: 16px; }
.calc-fields { display: grid; grid-template-columns: 1fr; gap: 10px; }
.calc-lines { margin-top: 14px; border-top: 1px solid var(--line-soft); flex: 1; }
.calc-line { display: flex; justify-content: space-between; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--line-soft); font-size: 13px; color: var(--muted); }
.calc-line strong { color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.calc-line.muted strong { color: var(--muted); }
.calc-price { margin-top: 14px; padding: 14px; border-radius: 10px; background: var(--gold-soft); display: grid; grid-template-columns: 1fr auto; align-items: baseline; gap: 2px 10px; }
.calc-price span { font-size: 12px; color: var(--muted); font-weight: 600; }
.calc-price strong { grid-row: span 2; font-size: 24px; color: var(--gold); letter-spacing: -.01em; }
.calc-price small { font-size: 11px; color: var(--faint); }
@media (max-width: 900px) { .pk-layout { grid-template-columns: 1fr; } .pk-side { position: static; max-height: none; } .pk-list { display: none; } }

/* Fenster-Ziehbereich darf Dialoge nicht blockieren (Schließen-X oben rechts) */
.modal-backdrop, .modal-backdrop *, .bv-backdrop, .bv-backdrop *, .search-overlay, .search-overlay *, .combo-list, .combo-list * { -webkit-app-region: no-drag; }
/* Liegt etwas über der Titelleiste (Dialog, Belegvorschau, Suche), darf sie keine Klicks mehr schlucken */
body:has(#modalRoot > *) .topbar, body:has(#belViewer) .topbar, body:has(.search-overlay) .topbar, body:has(.combo-list) .topbar { -webkit-app-region: no-drag; }

/* ---------- Anmeldung ---------- */
body.auth-mode .nav, body.auth-mode .top-actions, body.auth-mode .brand { visibility: hidden; }
.auth-wrap { min-height: calc(100vh - 160px); display: grid; place-items: center; padding: 24px 0; }
.auth-card { width: 100%; max-width: 420px; background: var(--surface); border: 1px solid var(--line-soft); border-radius: 18px; padding: 32px 28px; text-align: left; }
.auth-logo { height: 54px; display: block; margin: 0 auto 18px; }
.auth-card h1 { font-size: 24px; text-align: center; margin-bottom: 4px; }
.auth-card > p.muted { text-align: center; margin: 0 0 18px; font-size: 14px; }
.auth-card form { margin-top: 6px; }
.btn.wide { width: 100%; justify-content: center; padding: 12px; }
.btn.busy { opacity: .6; pointer-events: none; }
.link-btn { background: none; border: 0; color: var(--gold); font: inherit; font-size: 14px; cursor: pointer; padding: 4px; }
.auth-error { display: none; background: rgba(229, 96, 90, .12); color: var(--danger); border: 1px solid rgba(229, 96, 90, .3); border-radius: 10px; padding: 10px 12px; font-size: 14px; margin: 8px 0; }
.pw-rules { list-style: none; padding: 0; margin: -4px 0 4px; display: flex; flex-wrap: wrap; gap: 6px; }
.pw-rules li { font-size: 12px; padding: 3px 9px; border-radius: 999px; background: var(--surface-3); color: var(--faint); }
.pw-rules li.ok { background: rgba(79, 191, 127, .14); color: var(--ok); }
.pw-rules li.ok::before { content: '✓ '; }
.code-input { font-size: 22px; letter-spacing: .3em; text-align: center; font-variant-numeric: tabular-nums; }
.setup-steps { padding-left: 18px; margin: 0; }
.setup-steps li { margin: 3px 0; }
.qr { background: #fff; border-radius: 12px; padding: 8px; width: 200px; height: 200px; margin: 6px auto; }
.qr svg { width: 100%; height: 100%; display: block; }
.secret { text-align: center; }
.secret code { display: block; font-size: 15px; letter-spacing: .08em; color: var(--text); margin-top: 2px; word-break: break-all; }
.codes { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 6px 0 4px; }
.codes code { background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px; padding: 8px; text-align: center; font-size: 15px; letter-spacing: .06em; color: var(--text); }

/* ---------- Oben rechts: Beträge ausblenden & Sperren ---------- */
.top-actions { display: flex; align-items: center; gap: 6px; -webkit-app-region: no-drag; }
.top-icon { width: 34px; height: 34px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--muted); display: grid; place-items: center; cursor: pointer; }
.top-icon:hover { color: var(--text); border-color: #3a3a40; }
.top-icon.on { color: #0b0b0c; background: var(--gold); border-color: var(--gold); }
body.privacy .chart-wrap svg, body.privacy .bars, body.privacy input.num, body.privacy .qr { filter: blur(7px); }
body.privacy input.num { pointer-events: none; }
@media (max-width: 760px) { .top-actions .save-state { display: none; } }

/* ---------- Mitteilungen ---------- */
.top-icon.bell { position: relative; }
.bell-badge { position: absolute; top: -5px; right: -5px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 999px; background: var(--gold); color: #0b0b0c; font-size: 10px; font-weight: 800; display: grid; place-items: center; }
.bell-badge.urgent { background: var(--danger); color: #fff; }
.notif-panel { position: fixed; top: 70px; right: 16px; width: min(400px, calc(100vw - 32px)); max-height: calc(100vh - 100px); overflow: auto; z-index: 60;
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 18px 48px rgba(0,0,0,.5); padding: 8px; -webkit-app-region: no-drag; }
.notif-head { display: flex; justify-content: space-between; align-items: center; padding: 8px 10px 6px; }
.notif-head a { color: var(--gold); font-size: 13px; text-decoration: none; font-weight: 600; }
.notif-group { font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--faint); font-weight: 700; padding: 10px 10px 4px; }
.notif-item { display: grid; grid-template-columns: 10px 1fr; gap: 10px; width: 100%; text-align: left; background: none; border: 0; border-radius: 10px; padding: 9px 10px; color: var(--text); font: inherit; cursor: pointer; }
.notif-item:hover { background: var(--surface-2); }
.notif-dot { width: 8px; height: 8px; border-radius: 50%; margin-top: 6px; background: var(--muted); }
.lvl-warn .notif-dot { background: var(--warn); } .lvl-danger .notif-dot { background: var(--danger); } .lvl-info .notif-dot { background: var(--muted); }
.notif-title { font-weight: 600; font-size: 14px; }
.notif-text { font-size: 12px; color: var(--muted); margin-top: 2px; }
.notif-empty { padding: 18px 12px; color: var(--muted); text-align: center; }

/* ---------- Aufgaben ---------- */
.todo-add { grid-template-columns: 1fr 180px auto; }
.todo-list { padding: 4px 0; }
.todo-bucket { font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--faint); font-weight: 700; padding: 14px 18px 6px; }
.todo-bucket.danger { color: var(--danger); }
.todo-row { display: grid; grid-template-columns: 24px 1fr auto; gap: 12px; align-items: center; padding: 10px 18px; border-top: 1px solid var(--line-soft); }
.todo-check { width: 22px; height: 22px; border-radius: 50%; border: 1.5px solid var(--line); background: none; cursor: pointer; display: grid; place-items: center; padding: 0; }
.todo-check:hover { border-color: var(--gold); }
.todo-check.on { background: var(--gold); border-color: var(--gold); }
.todo-check.on::after { content: ''; width: 5px; height: 10px; border: solid #0b0b0c; border-width: 0 2px 2px 0; transform: rotate(45deg) translate(-1px, -1px); }
.todo-main { cursor: pointer; min-width: 0; }
.todo-title { font-weight: 600; }
.todo-row.done .todo-title { text-decoration: line-through; color: var(--faint); }
.todo-meta { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin-top: 4px; }
.sub-row { display: grid; grid-template-columns: 20px 1fr 34px; gap: 8px; align-items: center; }
.check.rem { align-items: flex-start; padding: 10px 0; border-bottom: 1px solid var(--line-soft); }
.check.rem:last-child { border-bottom: 0; }
.input.mini { padding: 3px 8px; font-size: 12px; width: auto; display: inline-block; }
@media (max-width: 760px) { .todo-add { grid-template-columns: 1fr; } }
.check.rem { display: flex; width: 100%; gap: 10px; }

/* ---------- Menüleiste scrollbar ---------- */
.nav-wrap { position: relative; flex: 1; min-width: 0; display: flex; align-items: center; }
.nav-wrap .nav { flex: 1; min-width: 0; scroll-behavior: smooth; }
.nav-arrow { position: absolute; top: 50%; transform: translateY(-50%); z-index: 2; width: 30px; height: 30px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface-2); color: var(--text);
  font-size: 20px; line-height: 1; display: none; place-items: center; cursor: pointer; padding: 0 0 2px; -webkit-app-region: no-drag; box-shadow: 0 0 0 6px rgba(11,11,12,.85); }
.nav-arrow.show { display: grid; }
.nav-arrow.left { left: 0; } .nav-arrow.right { right: 0; }
.nav-arrow:hover { border-color: var(--gold-line); color: var(--gold); }
.top-actions { flex-shrink: 0; }
.brand { flex-shrink: 0; }
.modal.modal-wide { width: min(1180px, 100%); }

/* ---------- Kontoauszug-Import ---------- */
.bank-sum { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.bank-sum > div { background: var(--surface-2); border: 1px solid var(--line-soft); border-radius: 12px; padding: 10px 14px; display: flex; flex-direction: column; }
.bank-sum span { font-size: 12px; color: var(--faint); font-weight: 600; }
.bank-sum b { font-size: 20px; margin: 2px 0; font-variant-numeric: tabular-nums; }
.bank-sum small { font-size: 12px; color: var(--muted); }
.bank-tools { justify-content: space-between; flex-wrap: wrap; gap: 8px; }
.bank-tools .chip { padding: 5px 11px; font-size: 13px; }
.bank-table { max-height: 52vh; overflow: auto; border: 1px solid var(--line-soft); border-radius: 12px; }
.bank-table table { min-width: 860px; }
.bank-table th { position: sticky; top: 0; z-index: 1; background: var(--surface); }
.bank-table td { vertical-align: top; padding-top: 8px; padding-bottom: 8px; }
.bank-table tr.off td { opacity: .45; }
.bank-table tr.off td:first-child { opacity: 1; }
.bank-purpose { max-width: 420px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin: 3px 0; }
.bank-table .badge { margin-right: 4px; }
.type-pill { border: 0; border-radius: 999px; padding: 5px 10px; font: inherit; font-size: 12px; font-weight: 700; cursor: pointer; white-space: nowrap; }
.type-pill.in { background: rgba(79, 191, 127, .15); color: var(--ok); }
.type-pill.out { background: var(--surface-3); color: var(--muted); }
.input.kz-auto { border-color: rgba(224, 164, 58, .45); }
@media (max-width: 760px) { .bank-sum { grid-template-columns: 1fr; } }
.paste-wrap { position: relative; display: flex; align-items: center; }
.paste-wrap .input { padding-right: 86px; }
.paste-btn { position: absolute; right: 6px; border: 1px solid var(--line); background: var(--surface-2); color: var(--muted); border-radius: 8px; padding: 5px 9px; font: inherit; font-size: 12px; font-weight: 600; cursor: pointer; }
.paste-btn:hover { color: var(--gold); border-color: var(--gold-line); }

/* ---------- Suche überall ---------- */
.search-overlay { position: fixed; inset: 0; z-index: 80; background: rgba(0,0,0,.55); backdrop-filter: blur(3px); display: flex; justify-content: center; align-items: flex-start; padding: 70px 16px 16px; -webkit-app-region: no-drag; }
.search-box { width: min(720px, 100%); max-height: calc(100vh - 100px); display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 24px 60px rgba(0,0,0,.55); overflow: hidden; }
.search-field { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--line-soft); color: var(--faint); }
.search-input { flex: 1; background: none; border: 0; outline: none; color: var(--text); font: inherit; font-size: 18px; }
.search-field kbd { font-size: 11px; color: var(--faint); border: 1px solid var(--line); border-radius: 6px; padding: 2px 6px; }
.search-results { overflow: auto; padding: 6px 8px 10px; }
.search-group { display: flex; justify-content: space-between; align-items: center; font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--gold); font-weight: 700; padding: 12px 8px 4px; }
.search-group .link-btn { font-size: 12px; text-transform: none; letter-spacing: 0; }
.search-item { display: block; width: 100%; text-align: left; background: none; border: 0; border-radius: 10px; padding: 8px 10px; color: var(--text); font: inherit; cursor: pointer; }
.search-item.sel { background: var(--gold-soft); }
.search-title { font-weight: 600; font-size: 14px; }
.search-sub { font-size: 12px; color: var(--muted); margin-top: 1px; }
.search-more, .search-hint { font-size: 12px; color: var(--faint); padding: 6px 10px; }
.search-hint { padding: 22px 12px; text-align: center; font-size: 14px; }

/* ---------- Durchsuchbare Auswahlfelder ---------- */
.combo { position: relative; display: block; width: 100%; }
.combo-input { padding-right: 34px; text-overflow: ellipsis; }
.combo-caret { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); color: var(--faint); pointer-events: none; display: inline-flex; }
.combo-list { position: fixed; z-index: 200; max-height: 300px; overflow: auto; background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 16px 40px rgba(0,0,0,.5); padding: 4px; -webkit-app-region: no-drag; }
.combo-opt { padding: 8px 10px; border-radius: 8px; cursor: pointer; font-size: 14px; }
.combo-opt.sel { background: var(--gold-soft); color: var(--gold); }
.combo-opt.cur { font-weight: 700; }
.combo-empty { padding: 8px 10px; color: var(--faint); font-size: 13px; }
.george-steps { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 8px; }
.george-steps li { line-height: 1.45; }

/* ---------- Geräte-Akte ---------- */
.usage { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px 14px; background: var(--surface-2); }
.usage-row { display: grid; grid-template-columns: 96px 1fr 16px; gap: 10px; align-items: baseline; width: 100%; text-align: left; padding: 7px 4px; border: 0; border-top: 1px solid var(--line-soft); background: none; color: var(--text); font: inherit; font-size: 13px; }
.usage-row:first-of-type { border-top: 0; }
button.usage-row { cursor: pointer; border-radius: 6px; }
button.usage-row:hover { background: var(--surface-3); }
.usage-row b { color: var(--muted); font-size: 12px; font-weight: 700; }
.usage-row.warn span { color: var(--warn); }
.usage-go { color: var(--gold); }

/* ---------- Belege ---------- */
.belegbox { border: 1px dashed var(--line); border-radius: var(--radius-sm); padding: 10px 12px; transition: border-color .15s, background .15s; }
.belegbox.drop { border-color: var(--gold); background: var(--surface-2); }
.beleg-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 3px 0; }
.beleg-row .link-btn { text-align: left; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
details.section > summary { cursor: pointer; font-weight: 700; margin-bottom: 8px; }

/* ---------- Aufgeräumt (Okt 2026) ---------- */
.top-actions { gap: 8px; }
.top-actions .save-state { min-width: 0; margin-right: 6px; }
.grid-2 { align-items: start; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.card-head h3 { margin: 0; font-size: 15px; }
.chart-legend { display: flex; gap: 16px; font-size: 12px; color: var(--muted); }
.chart-legend span { display: inline-flex; align-items: center; gap: 6px; }
.chart-legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.chart-legend i.line { width: 16px; height: 2px; border-radius: 1px; background: var(--text); }
.kpi-value.neg { color: var(--danger); }
.folder-list { display: grid; margin-top: 4px; }
.folder-row { display: grid; grid-template-columns: 64px minmax(0, 1fr) auto; column-gap: 12px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line-soft, var(--line)); }
.folder-row:first-child { border-top: 0; }
.folder-label { font-weight: 700; font-size: 13px; }
.folder-path { font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.folder-path.warn { color: var(--warn); }
.folder-actions { display: flex; gap: 6px; }
.folder-sub { grid-column: 2 / 4; margin-top: 2px; }
.settings-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; align-items: start; }
.settings-cols .col { display: grid; gap: 14px; align-content: start; }
@media (max-width: 900px) { .settings-cols { grid-template-columns: 1fr; } }
.notice.check .check-body { display: grid; grid-template-columns: minmax(0, 1fr) auto; flex-wrap: nowrap; }
details.fold > summary { cursor: pointer; font-weight: 700; font-size: 15px; padding: 10px 0; list-style: none; display: flex; align-items: center; gap: 8px; }
details.fold > summary::-webkit-details-marker { display: none; }
details.fold > summary::before { content: '›'; color: var(--gold); display: inline-block; transition: transform .15s; font-size: 18px; line-height: 1; }
details.fold[open] > summary::before { transform: rotate(90deg); }
.inv-table { table-layout: fixed; width: 100%; }
.inv-table th:nth-child(1) { width: 19%; } .inv-table th:nth-child(2) { width: 33%; } .inv-table th:nth-child(3) { width: 17%; } .inv-table th:nth-child(4) { width: 15%; } .inv-table th:nth-child(5) { width: 11%; } .inv-table th:nth-child(6) { width: 5%; }
.inv-table td { overflow-wrap: anywhere; }
tr.inactive td { opacity: .55; }
.badge.status-verkauft { color: var(--ok); border-color: currentColor; }
.badge.status-ausgeschieden { color: var(--muted); }
.status-box { border-top: 1px solid var(--line); padding-top: 12px; margin-top: 4px; }
/* ---------- Import / Export ---------- */
.top-btn { height: 34px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--muted); display: inline-flex; align-items: center; gap: 6px; font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
.top-btn:hover { color: var(--text); border-color: #3a3a40; }
@media (max-width: 1380px) { .top-btn span { display: none; } .top-btn { width: 34px; padding: 0; justify-content: center; } }
.xfer-big { display: grid; }
.xfer-card { display: grid; gap: 4px; text-align: left; padding: 16px 18px; border-radius: var(--radius-sm); border: 1px solid var(--gold); background: rgba(210,147,38,.08); color: var(--text); font: inherit; cursor: pointer; }
.xfer-card b { font-size: 15px; color: var(--gold); }
.xfer-card span { font-size: 13px; color: var(--muted); }
.xfer-card:hover { background: rgba(210,147,38,.14); }
.xfer-sep { font-size: 12px; color: var(--faint); text-transform: uppercase; letter-spacing: .08em; margin-top: 6px; }
.xfer-list { display: grid; gap: 8px; }
.xfer-group { font-size: 12px; color: var(--gold); text-transform: uppercase; letter-spacing: .08em; margin: 8px 0 0; font-weight: 700; }
.xfer-opt { display: grid; grid-template-columns: 18px 1fr auto; gap: 12px; align-items: center; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius-sm); cursor: pointer; }
.xfer-opt.on { border-color: var(--gold); background: var(--surface-2); }
.xfer-opt input { accent-color: var(--gold); }
.xfer-fmts { font-size: 12px; color: var(--muted); white-space: nowrap; }
.xfer-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; padding-top: 6px; }

.inv-layout > * { min-width: 0; }
/* gespeichert = ruhiger grüner Punkt, nur Speichern/Fehler als Text */
.top-actions .save-state:not(.saving):not(.error):not(.offline) { font-size: 0; width: 8px; height: 8px; border-radius: 50%; background: var(--ok); opacity: .7; margin: 0 6px; padding: 0; }
.inv-table td, .inv-table th { overflow: hidden; }
.inv-table th:nth-child(1) { width: 18%; } .inv-table th:nth-child(6) { width: 6%; }
@media (max-width: 1000px) { .inv-table { table-layout: auto; } .inv-table th { width: auto !important; } }
@media (max-width: 900px) { .nav a { padding: 7px 11px; font-size: 13px; } .top-actions { gap: 5px; } .top-actions .save-state { display: none; } }
@media (max-width: 760px) { .inv-table th:nth-child(2), .inv-table td:nth-child(2) { width: 100% !important; } .inv-table td:nth-child(5) { white-space: nowrap; } }
.touch-btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; border-color: var(--gold); color: var(--gold); }
.auth-or { text-align: center; font-size: 12px; color: var(--faint); margin: 2px 0; }
body.auth-mode .nav-arrow, body.auth-mode .nav-wrap { visibility: hidden; }
.kpis-5 { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.kpis-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 1100px) { .kpis-4 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 820px) { .kpis-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 520px) { .kpis-4 { grid-template-columns: 1fr; } }

/* Übersicht: Posteingang */
.kpis-5c { grid-template-columns: repeat(5, minmax(0, 1fr)); }
@media (max-width: 1250px) { .kpis-5c { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 820px) { .kpis-5c { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 520px) { .kpis-5c { grid-template-columns: 1fr; } }
.inbox-count { display: inline-block; margin-left: 10px; min-width: 26px; padding: 2px 9px; border-radius: 999px; background: var(--surface-2); color: var(--text); font-size: 14px; font-weight: 700; text-align: center; vertical-align: middle; }
.inbox-count.urgent { background: var(--danger); color: #fff; }
.inbox-grid { columns: 340px 3; column-gap: 16px; }
.inbox-card { padding: 0 0 6px; overflow: hidden; break-inside: avoid; margin-bottom: 16px; display: inline-block; width: 100%; }
.inbox-head { display: flex; align-items: center; gap: 10px; padding: 14px 18px 10px; border-bottom: 1px solid var(--line-soft); }
.inbox-head b { font-size: 15px; } .inbox-head a { margin-left: auto; color: var(--muted); text-decoration: none; } .inbox-head a:hover { color: var(--text); }
.inbox-row { display: grid; grid-template-columns: 24px 1fr 14px; gap: 12px; align-items: center; padding: 4px 12px 4px 18px; border-top: 1px solid var(--line-soft); }
.inbox-head + .inbox-row { border-top: 0; }
.inbox-row .notif-dot { justify-self: center; margin-top: 0; }
.inbox-row.lvl-danger .notif-title { color: var(--danger); }
.inbox-main { background: none; border: 0; text-align: left; font: inherit; color: var(--text); padding: 9px 0; cursor: pointer; min-width: 0; }
.inbox-main .notif-title { overflow-wrap: anywhere; }
.inbox-go { color: var(--faint); font-size: 18px; }
.inbox-row:hover { background: var(--surface-2); }
.inbox-more { display: block; width: 100%; background: none; border: 0; border-top: 1px solid var(--line-soft); padding: 10px 18px; color: var(--muted); font: inherit; font-size: 13px; text-align: left; cursor: pointer; }
.inbox-more:hover { color: var(--text); }
.inbox-empty { color: var(--muted); }

/* Aufgaben-Fenster rechts (dauerhaft) */
:root { --act-w: 330px; --act-mini: 48px; }
.activity { display: none; }
body.act-on .activity { display: flex; flex-direction: column; position: fixed; right: 0; top: var(--topbar-h, 67px); bottom: 0; width: var(--act-w); z-index: 15;
  background: var(--surface); border-left: 1px solid var(--line-soft); }
body.act-on.act-closed .activity { width: var(--act-mini); align-items: center; padding-top: 10px; }
body.act-on #app.page { margin-left: max(0px, calc((100vw - var(--act-w) - 1240px) / 2)); margin-right: calc(var(--act-w) + max(0px, calc((100vw - var(--act-w) - 1240px) / 2))); }
body.act-on.act-closed #app.page { margin-left: auto; margin-right: auto; padding-right: calc(24px + var(--act-mini)); }
@media (max-width: 1100px) {   /* schmales Fenster: Inhalt rückt neben die Leiste statt darunter zu liegen */
  :root { --act-w: 290px; }
  body.act-on:not(.act-closed) #app.page { margin-left: 0; margin-right: var(--act-w); }
  body.act-on.act-closed #app.page { margin-left: auto; margin-right: auto; padding-right: calc(24px + var(--act-mini)); }
}
.act-toggle { position: relative; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface-2); color: var(--muted); cursor: pointer; flex-shrink: 0; }
.act-toggle:hover { color: var(--text); }
.act-badge { position: absolute; top: -6px; right: -6px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--gold, #c9a227); color: #000; font-size: 11px; font-weight: 700; display: grid; place-items: center; }
.act-badge.urgent { background: var(--danger); color: #fff; }
.act-head { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--line-soft); }
.act-head b { font-size: 14px; flex: 1; }
.act-clear { background: none; border: 0; color: var(--faint); font: inherit; font-size: 12px; cursor: pointer; } .act-clear:hover { color: var(--text); }
.act-body { flex: 1; overflow-y: auto; padding: 4px 10px 16px; }
.act-group { font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--faint); font-weight: 700; padding: 14px 4px 6px; }
.act-job { border: 1px solid var(--line-soft); border-radius: 12px; background: var(--surface-2); margin-bottom: 8px; overflow: hidden; }
.act-job-head { display: grid; grid-template-columns: 10px 1fr auto; gap: 10px; align-items: center; width: 100%; background: none; border: 0; padding: 10px 12px; color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.act-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.act-job.st-wait .act-dot, .act-job.st-run .act-dot { background: var(--gold, #c9a227); } .act-job.st-fail .act-dot { background: var(--danger); } .act-job.st-done .act-dot { background: var(--ok, #3fb950); }
.act-title { font-weight: 600; font-size: 13px; } .act-sub { font-size: 12px; color: var(--muted); margin-top: 1px; }
.act-spin { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--line); border-top-color: var(--gold, #c9a227); animation: actspin .8s linear infinite; }
@keyframes actspin { to { transform: rotate(360deg); } }
.act-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding: 0 12px 10px; }
.act-items { border-top: 1px solid var(--line-soft); max-height: 340px; overflow-y: auto; }
.act-item { display: grid; grid-template-columns: 1fr auto; gap: 8px; padding: 8px 12px; border-top: 1px solid var(--line-soft); font-size: 12px; }
.act-item:first-child { border-top: 0; }
.act-names { min-width: 0; } .act-from, .act-to { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.act-from { color: var(--muted); } .act-to { color: var(--text); font-weight: 600; }
.act-meta { color: var(--faint); font-size: 11px; margin-top: 2px; }
.act-item.st-skip .act-to, .act-item.st-cancel .act-to { text-decoration: line-through; color: var(--faint); }
.act-item.st-fail .act-st { color: var(--danger); font-weight: 600; } .act-item.st-done .act-st { color: var(--ok, #3fb950); }
.act-err { margin-top: 6px; padding: 7px 9px; border-radius: 8px; background: rgba(255, 80, 80, .08); color: var(--text); font-size: 12px; line-height: 1.4; }
.act-err b { color: var(--danger); display: block; margin-bottom: 2px; }
.act-x { width: 24px; height: 24px; border-radius: 6px; border: 1px solid var(--line); background: var(--surface); color: var(--muted); cursor: pointer; font-size: 14px; line-height: 1; align-self: start; }
.act-x:hover { color: var(--text); }
.act-note { margin: 10px 0 4px; padding: 10px 12px; border-radius: 12px; border: 1px solid rgba(201,162,39,.35); background: rgba(201,162,39,.08); font-size: 12px; color: var(--muted); }
.act-note b { color: var(--text); display: block; margin-bottom: 2px; font-size: 13px; }
.act-empty { text-align: center; color: var(--muted); padding: 40px 12px 20px; font-size: 13px; }
.act-empty .small { margin-top: 8px; line-height: 1.5; }
.act-empty-ico { display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; background: var(--surface-2); margin-bottom: 10px; color: var(--faint); }
.act-foot { margin-top: 16px; padding: 0 4px; font-size: 11px; color: var(--faint); line-height: 1.5; }
@media print { .activity { display: none !important; } body.act-on #app.page { margin: 0 auto !important; padding-right: 24px !important; } }

/* Posteingang als Kanban + Prioritäten (auch in der Glocke) */
.prio-p1 { --pc: var(--faint); } .prio-p2 { --pc: #6aa0ff; } .prio-p3 { --pc: var(--warn); } .prio-p4 { --pc: var(--danger); }
.kb { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; align-items: start; }
@media (max-width: 1150px) { .kb { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 620px) { .kb { grid-template-columns: 1fr; } }
.kb-col { background: var(--surface); border: 1px solid var(--line-soft); border-top: 3px solid var(--pc); border-radius: var(--radius); padding: 10px; min-height: 120px; transition: background .15s, border-color .15s; }
.kb-col.over { background: var(--surface-2); border-color: var(--pc); }
.kb-head { display: flex; align-items: center; gap: 8px; padding: 4px 4px 10px; }
.kb-head b { font-size: 14px; flex: 1; }
.kb-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--pc); flex-shrink: 0; display: inline-block; }
.kb-card { background: var(--surface-2); border: 1px solid var(--line-soft); border-radius: 12px; padding: 10px 10px 6px 12px; margin-bottom: 8px; cursor: grab; position: relative; }
.kb-card:hover { border-color: var(--line); }
.kb-card.dragging { opacity: .45; cursor: grabbing; }
.kb-top { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.kb-top .todo-check { width: 18px; height: 18px; flex-shrink: 0; }
.kb-tag { font-size: 11px; letter-spacing: .04em; color: var(--faint); text-transform: uppercase; font-weight: 600; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kb-manual { background: none; border: 0; color: var(--faint); cursor: pointer; font-size: 13px; padding: 0 2px; } .kb-manual:hover { color: var(--text); }
.kb-main { display: block; width: 100%; background: none; border: 0; padding: 0; text-align: left; color: var(--text); font: inherit; cursor: pointer; }
.kb-main .notif-title { font-size: 13.5px; overflow-wrap: anywhere; } .kb-main .notif-text { overflow-wrap: anywhere; }
.kb-move { display: flex; justify-content: space-between; margin-top: 4px; opacity: 0; transition: opacity .15s; }
.kb-card:hover .kb-move, .kb-card:focus-within .kb-move { opacity: 1; }
@media (hover: none) { .kb-move { opacity: 1; } }
.kb-move button { width: 26px; height: 22px; border-radius: 6px; border: 1px solid var(--line); background: var(--surface); color: var(--muted); cursor: pointer; line-height: 1; font-size: 15px; }
.kb-move button:hover { color: var(--text); border-color: var(--pc, var(--line)); }
.kb-empty { color: var(--faint); font-size: 12px; text-align: center; padding: 18px 0; border: 1px dashed var(--line-soft); border-radius: 10px; }
.notif-group[class*="prio-"] { display: flex; align-items: center; gap: 8px; color: var(--pc); }
.notif-item[class*="prio-"] .notif-dot { background: var(--pc); }

.act-sug { margin-top: 6px; font-size: 12px; color: var(--text); line-height: 1.45; } .act-ok { color: var(--ok); }
.act-actions.inline { padding: 8px 0 2px; }
.act-from.link-btn { background: none; border: 0; padding: 0; font: inherit; color: var(--muted); cursor: pointer; text-align: left; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; }
.act-from.link-btn:hover { color: var(--text); text-decoration: underline; }
.act-job.st-ask .act-dot { background: #6aa0ff; } .act-item.st-ask .act-st { color: #6aa0ff; font-weight: 600; } .act-item.st-linked .act-st { color: var(--ok); }
.act-item.st-linked .act-to { white-space: normal; }

/* ---- Belegbetrachter (über allen Dialogen) */
.bv-backdrop { position: fixed; inset: 0; z-index: 70; background: rgba(0,0,0,.62); display: grid; place-items: center; padding: 16px; animation: fade .15s ease; }
.bv { width: min(1040px, 100%); height: min(94vh, 100%); background: var(--surface); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); display: flex; flex-direction: column; overflow: hidden; }
.bv-head { display: flex; align-items: center; gap: 12px; padding: 10px 12px 10px 18px; border-bottom: 1px solid var(--line-soft); }
.bv-title { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.bv-title b { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bv-title span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bv-tools { display: flex; align-items: center; gap: 4px; flex-shrink: 0; }
.bv-zoom { min-width: 46px; text-align: center; }
.bv-body { flex: 1; overflow: auto; background: #2b2b30; padding: 20px 24px; display: flex; flex-direction: column; align-items: center; gap: 14px; }
.bv-page { background: #fff; box-shadow: 0 4px 18px rgba(0,0,0,.35); border-radius: 2px; flex-shrink: 0; }
.bv-img { max-width: none; background: #fff; box-shadow: 0 4px 18px rgba(0,0,0,.35); }
@media (max-width: 620px) { .bv-tools .btn:not(.icon) { display: none; } }

/* ---- Kalender in der Aufgabenliste */
.cal-card.loading { opacity: .6; }
.cal-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.cal-nav { display: flex; align-items: center; gap: 2px; }
.cal-month { background: none; border: 0; color: var(--text); font: inherit; font-size: 13.5px; font-weight: 600; cursor: pointer; padding: 4px 6px; border-radius: 8px; min-width: 112px; }
.cal-month:hover { background: var(--surface-2); }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; text-align: center; }
.cal-wd { font-size: 10.5px; color: var(--faint); font-weight: 600; padding: 2px 0 4px; letter-spacing: .03em; }
.cal-d { position: relative; background: none; border: 0; color: var(--text); font: inherit; font-size: 12.5px; aspect-ratio: 1; border-radius: 50%; cursor: pointer; display: grid; place-items: center; }
.cal-d:hover { background: var(--surface-2); }
.cal-d.past { color: var(--faint); }
.cal-d.busy::after { content: ''; position: absolute; bottom: 3px; left: 50%; width: 4px; height: 4px; margin-left: -2px; border-radius: 50%; background: var(--gold); }
.cal-d.today { background: var(--gold); color: #111; font-weight: 700; }
.cal-d.today.busy::after { background: #111; }
.cal-d.sel:not(.today) { outline: 1.5px solid var(--gold); outline-offset: -1.5px; }
.cal-d.cal-blank { cursor: default; }
.cal-list { margin-top: 12px; border-top: 1px solid var(--line-soft); padding-top: 10px; }
.cal-list-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 2px; }
.cal-day { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--faint); font-weight: 600; margin: 10px 0 4px; }
.cal-ev { display: flex; align-items: baseline; gap: 8px; width: 100%; background: none; border: 0; color: var(--text); font: inherit; text-align: left; padding: 5px 6px; border-radius: 8px; cursor: pointer; }
.cal-ev:hover { background: var(--surface-2); }
.cal-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; display: inline-block; transform: translateY(-1px); }
.cal-ev-time { font-size: 12px; color: var(--muted); min-width: 76px; flex-shrink: 0; font-variant-numeric: tabular-nums; }
.cal-ev-title { font-size: 13px; overflow-wrap: anywhere; }
.cal-feed-row { display: flex; gap: 8px; align-items: center; margin-top: 10px; }
.cal-color { width: 34px; height: 34px; padding: 0; border: 1px solid var(--line); border-radius: 8px; background: none; cursor: pointer; flex-shrink: 0; }
.calc > aside { min-width: 0; }
.cal-card { min-width: 0; max-width: 100%; overflow: hidden; }
.cal-grid > * { min-width: 0; }
.cal-ev { white-space: normal; min-width: 0; }
.cal-ev-title { min-width: 0; flex: 1; }

/* Beleg neben dem Dialog (Buchung aus Beleg anlegen) */
.bv-backdrop.docked { background: none; pointer-events: none; place-items: stretch start; padding: 16px; }
.bv-backdrop.docked .bv { pointer-events: auto; width: calc(52vw - 24px); height: calc(100vh - 32px); }
body.bv-docked .modal-backdrop { justify-items: end; padding-right: 2vw; background: rgba(0,0,0,.55); }
body.bv-docked .modal { width: min(560px, 44vw); }
@media (max-width: 900px) { .bv-backdrop.docked { display: none; } body.bv-docked .modal-backdrop { justify-items: center; } }

.act-body .cal-card { padding: 12px 12px 10px; margin: 0 0 6px; }
.act-body .cal-head { justify-content: center; }
.act-body .cal-d { font-size: 12px; }
.act-body .cal-ev-time { min-width: 68px; }
.act-body .cal-d { aspect-ratio: auto; height: 30px; width: 30px; justify-self: center; }
.act-body .cal-d.busy::after { bottom: 1px; }
.act-body .cal-grid { row-gap: 1px; }
.cal-grid span.cal-d.cal-blank { aspect-ratio: auto !important; height: auto !important; min-height: 0; }

.act-tabs { display: flex; gap: 2px; background: var(--surface-2); border-radius: 10px; padding: 3px; flex: 1; min-width: 0; }
.act-tab { flex: 1; background: none; border: 0; color: var(--muted); font: inherit; font-size: 12.5px; font-weight: 600; padding: 6px 8px; border-radius: 8px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 6px; white-space: nowrap; }
.act-tab:hover { color: var(--text); }
.act-tab.active { background: var(--surface); color: var(--gold); box-shadow: 0 1px 3px rgba(0,0,0,.25); }
.act-tab-badge { font-size: 10.5px; background: var(--gold); color: #111; border-radius: 999px; padding: 0 6px; line-height: 16px; }
.act-tab-badge.urgent { background: var(--danger); color: #fff; }

/* ---- Übersicht: Posteingang (nach Priorität) | Aufgaben */
.home-inbox { padding: 0; overflow: hidden; }
.home-tabs { display: flex; gap: 4px; padding: 10px 12px 0; border-bottom: 1px solid var(--line-soft); }
.home-tab { background: none; border: 0; color: var(--muted); font: inherit; font-size: 16px; font-weight: 700; padding: 10px 14px 12px; cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; display: inline-flex; align-items: center; }
.home-tab:hover { color: var(--text); }
.home-tab.active { color: var(--text); border-bottom-color: var(--gold); }
.home-tab .inbox-count { font-size: 12px; margin-left: 8px; min-width: 22px; padding: 1px 7px; }
.home-inbox-body { padding: 8px 16px 16px; }
.inbox-group { margin-top: 10px; }
.inbox-ghead { display: flex; align-items: center; gap: 8px; padding: 6px 2px; font-size: 13px; text-transform: uppercase; letter-spacing: .05em; }
.inbox-ghead b { color: var(--pc); font-weight: 700; }
.inbox-row { display: flex; align-items: center; gap: 8px; border-radius: 10px; border-left: 3px solid var(--pc); background: var(--surface-2); margin-bottom: 6px; padding-right: 6px; }
.inbox-row:hover { background: var(--surface-3); }
.inbox-main { flex: 1; min-width: 0; display: grid; grid-template-columns: 10px 1fr; gap: 10px; background: none; border: 0; color: var(--text); font: inherit; text-align: left; padding: 10px 10px 10px 12px; cursor: pointer; }
.inbox-main .notif-dot { background: var(--pc); margin-top: 6px; }
.inbox-tag { font-size: 10.5px; letter-spacing: .05em; text-transform: uppercase; color: var(--faint); font-weight: 600; }
.inbox-prio { display: flex; gap: 2px; opacity: 0; transition: opacity .15s; }
.inbox-row:hover .inbox-prio, .inbox-row:focus-within .inbox-prio { opacity: 1; }
@media (hover: none) { .inbox-prio { opacity: 1; } }
.inbox-prio button { background: none; border: 0; color: var(--faint); cursor: pointer; font-size: 11px; padding: 4px 6px; border-radius: 6px; }
.inbox-prio button:hover { color: var(--text); background: var(--surface); }
.inbox-empty { color: var(--ok); margin: 14px 2px 4px; }
.home-todo-add { display: flex; gap: 8px; margin: 10px 0 6px; }
.home-todo-add .input { flex: 1; }

.home-split { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 14px; align-items: start; }
@media (max-width: 1000px) { .home-split { grid-template-columns: 1fr; } }
.home-card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 16px 18px 10px; border-bottom: 1px solid var(--line-soft); }
.home-card-head h2 { font-size: 18px; display: flex; align-items: center; }
.home-card-head .inbox-count { font-size: 12px; margin-left: 10px; min-width: 22px; padding: 1px 7px; }
.home-inbox-body { max-height: 380px; overflow-y: auto; overscroll-behavior: contain; }
.home-inbox-body.open { max-height: none; overflow: visible; }
.home-todo-body { max-height: 460px; }

.home-inbox { container-type: inline-size; }
.home-todo-head { padding: 4px 16px 0; border-bottom: 1px solid var(--line-soft); }
.home-todo-add { display: grid !important; grid-template-columns: 1fr 140px auto; gap: 6px; align-items: center; }
.home-todo-add .input { min-width: 0; }
.home-todo-add .btn { height: 38px; }
@container (max-width: 440px) { .home-todo-add { grid-template-columns: 1fr auto; } .home-todo-due { grid-column: 1 / -1; grid-row: 2; } }
.home-rem { background: var(--surface-2); border-radius: 12px; padding: 8px 12px; margin-bottom: 8px; }
.home-todo-body .todo-list { border: 0; }

/* Klickflächen: kleine Symbol-Buttons bekommen mindestens 34 × 34 px */
.btn.icon { min-width: 34px; min-height: 34px; display: inline-grid; place-items: center; }
.btn.sm.icon { min-width: 30px; min-height: 30px; }
.bv-tools .btn.icon:last-child { min-width: 40px; min-height: 40px; margin-left: 4px; }
/* Unsichtbar vergrößerte Trefferfläche für Mini-Schalter – auch „leicht daneben“ zählt */
.todo-check, .act-x, .inbox-prio button, .chip, .modal-x { position: relative; }
.todo-check::after, .act-x::after { content: ''; position: absolute; inset: -8px; }
.inbox-prio button::after { content: ''; position: absolute; inset: -6px 0; }
.inbox-prio button { padding: 6px 8px; font-size: 12px; }

/* Inhalt richtet sich nach der tatsächlich verfügbaren Breite (Seitenleiste offen = weniger Platz) – nichts rutscht mehr unter die Seitenleiste */
#app.page { container-type: inline-size; container-name: page; }
@container page (max-width: 900px) {
  .quick-add, .quick-add.trip { grid-template-columns: 1fr 1fr; }
  .quick-add > .btn, .quick-add .grow { grid-column: 1 / -1; }
  .inv-layout, .calc { grid-template-columns: 1fr; }
  .side, .summary { position: static; max-height: none; }
}
@container page (max-width: 760px) { .home-split { grid-template-columns: 1fr; } }
.calc > *, .inv-layout > *, .finance > * { min-width: 0; }

/* Größere Trefferflächen für Symbol-Buttons (abgerundete Ecken zählen mit) */
.btn.icon { position: relative; }
.btn.icon::after { content: ''; position: absolute; inset: -3px; }
.bv-tools .btn.icon:last-child::after { inset: -8px; }
.modal-head .btn.icon::after { inset: -8px; }
.home-rem select.input.mini { padding: 3px 26px 3px 8px; width: auto; }
.rem-row { display: grid; grid-template-columns: 20px 1fr auto; gap: 8px; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--line-soft); }
.rem-row:last-of-type { border-bottom: 0; }
.rem-row.off .rem-main { opacity: .5; }
.rem-main { background: none; border: 0; color: inherit; text-align: left; cursor: pointer; padding: 4px 0; font: inherit; min-width: 0; }
.rem-main b { font-size: 13.5px; }
.rem-row input[type=checkbox] { accent-color: var(--gold); width: 16px; height: 16px; cursor: pointer; }

/* Statistik nach Auftragstyp */
.ev-rows { display: flex; flex-direction: column; gap: 10px; }
.ev-row { display: grid; grid-template-columns: 150px 1fr 90px; grid-template-rows: auto auto; column-gap: 12px; align-items: center; }
.ev-name { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ev-name i, .ev-dot { width: 10px; height: 10px; border-radius: 3px; flex-shrink: 0; display: inline-block; }
.ev-dot { margin-right: 8px; vertical-align: -1px; }
.ev-bar { height: 12px; background: var(--surface-2); border-radius: 6px; overflow: hidden; }
.ev-bar span { display: block; height: 100%; border-radius: 6px; }
.ev-sum { text-align: right; font-weight: 600; }
.ev-meta { grid-column: 2 / 4; margin-top: 2px; }
@container page (max-width: 560px) { .ev-row { grid-template-columns: 110px 1fr 80px; } }

.kb.kb-auf { grid-template-columns: repeat(4, minmax(135px, 1fr)) minmax(120px, .6fr); overflow-x: auto; padding-bottom: 4px; }
@media (max-width: 1150px) { .kb.kb-auf { grid-template-columns: repeat(5, minmax(190px, 1fr)); } }
.kb-archive { background: transparent; border-style: dashed; }
.auf-card .kb-main { text-decoration: none; }
.auf-card .kb-main:hover .notif-title { color: var(--gold); }
.badge.ok { background: rgba(63, 170, 107, .14); color: #5fc98a; }
.badge.muted { opacity: .65; }
.auf-status { margin-top: 4px; }
.auf-info { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; border-bottom: 1px solid var(--line-soft); font-size: 14px; }
.auf-info span { color: var(--muted); } .auf-info b { font-weight: 600; text-align: right; }
.modal:has(.doc-editor) { width: min(980px, calc(100vw - 32px)); max-width: none; }
.doc-lines { display: flex; flex-direction: column; gap: 6px; }
.doc-line { display: grid; grid-template-columns: minmax(0, 1fr) 80px 90px 110px 100px 36px; gap: 8px; align-items: start; }
.doc-line > div:first-child { display: flex; flex-direction: column; gap: 4px; }
.doc-line .input.small { font-size: 12.5px; padding-top: 6px; padding-bottom: 6px; }
.doc-line-head { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--faint); font-weight: 600; }
.doc-line-head span:nth-child(n+2):nth-child(-n+5) { text-align: right; }
.doc-sum { padding-top: 10px; font-weight: 600; }
.doc-totals { margin-left: auto; width: min(360px, 100%); display: flex; flex-direction: column; gap: 4px; }
.doc-totals > div { display: flex; justify-content: space-between; font-size: 14px; }
.doc-totals > div span { color: var(--muted); }
.doc-totals .grand { border-top: 2px solid var(--gold); padding-top: 8px; margin-top: 4px; font-size: 16px; }
.doc-totals .grand span { color: var(--text); font-weight: 600; } .doc-totals .grand b { color: var(--gold); }
@media (max-width: 760px) { .doc-line { grid-template-columns: 1fr 1fr 1fr; } .doc-line > div:first-child { grid-column: 1 / -1; } .doc-line-head { display: none; } }
.auf-detail { display: grid; grid-template-columns: minmax(250px, 1fr) minmax(0, 1.7fr); gap: 14px; align-items: start; }
@media (max-width: 1100px) { .auf-detail { grid-template-columns: 1fr; } }
.table-scroll { overflow-x: auto; }
.auf-detail .actions .btn { margin-top: 2px; }
/* Aufträge wie Kreativ.Management */
.auf-states { display: flex; gap: 8px; flex-wrap: wrap; }
.auf-state { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; min-width: 104px; padding: 10px 14px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); color: var(--muted); cursor: pointer; font: inherit; position: relative; }
.auf-state b { font-size: 20px; color: var(--text); }
.auf-state span { font-size: 12.5px; }
.auf-state::before { content: ''; position: absolute; left: 0; top: 10px; bottom: 10px; width: 3px; border-radius: 3px; background: var(--sc, var(--gold)); }
.auf-state.active { border-color: var(--sc, var(--gold)); background: var(--surface-2); }
.badge.auf-st { color: var(--sc); border: 1px solid color-mix(in srgb, var(--sc) 45%, transparent); background: color-mix(in srgb, var(--sc) 12%, transparent); }
.auf-otabs .chip { display: inline-flex; align-items: center; gap: 7px; text-decoration: none; }
.auf-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--sc); flex-shrink: 0; }
.auf-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 12px; }
@container page (max-width: 620px) { .auf-grid2 { grid-template-columns: 1fr; } }
.auf-req { margin-top: 12px; background: var(--surface-2); border-radius: 12px; padding: 10px 12px; }
.auf-req summary { cursor: pointer; font-weight: 600; font-size: 13px; }
.auf-req[open] summary { margin-bottom: 6px; }
.auf-stsel { color: var(--sc); border-color: color-mix(in srgb, var(--sc) 50%, transparent); font-weight: 600; padding-right: 26px; }
.auf-todo { display: flex; gap: 10px; align-items: flex-start; padding: 7px 0; border-bottom: 1px solid var(--line-soft); }
.auf-todo input[type=checkbox] { accent-color: var(--gold); width: 16px; height: 16px; margin-top: 3px; }
.auf-todo.done .grow > div:first-child { text-decoration: line-through; color: var(--faint); }
.auf-todo .grow { flex: 1; min-width: 0; }
.auf-items td { vertical-align: top; }
.auf-items .input.mini { width: 100%; }

.auf-items { width: 100%; table-layout: fixed; }
.auf-items td { padding: 8px 6px; }
.auf-items td:first-child { width: 48px !important; }
.auf-items td:nth-child(3), .auf-items td:nth-child(4) { width: 96px !important; white-space: nowrap; }
.km-prog { height: 6px; background: var(--surface-2); border-radius: 4px; overflow: hidden; }
.km-prog span { display: block; height: 100%; background: var(--gold); transition: width .4s; }

/* Anpassbare Tabellen */
.tc-card { position: relative; }
.tc-bar { display: flex; justify-content: flex-end; gap: 6px; padding: 6px 8px 0; }
.tc-th { cursor: pointer; user-select: none; white-space: nowrap; }
.tc-th:hover { color: var(--text); }
.tc-sorted { color: var(--gold); }
.tc-arrow { font-size: 10px; }
.tc-time { line-height: 1.35; white-space: nowrap; }
.tc-list { display: flex; flex-direction: column; gap: 4px; }
.tc-row { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel, transparent); }
.tc-row.off { opacity: .55; }
.tc-row.dragging { opacity: .35; }
.tc-row.over { border-color: var(--gold); }
.tc-grip { cursor: grab; color: var(--faint, #888); letter-spacing: -2px; padding: 0 4px; }

/* Location-Suche & Route */
.loc-wrap { position: relative; }
.loc-sug { display: flex; flex-direction: column; margin-top: 4px; border-radius: 10px; overflow: hidden; }
.loc-sug:empty { display: none; }
.loc-item { text-align: left; padding: 8px 10px; background: var(--panel2, rgba(255,255,255,.04)); border: 0; border-bottom: 1px solid var(--line); color: inherit; font: inherit; cursor: pointer; }
button.loc-item:hover { background: rgba(210,147,38,.15); }
.auf-route { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }

/* Kalender lesen (iCloud) */
.cal-read { display: flex; flex-direction: column; gap: 4px; }
.cal-read-row { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 10px; }
.cal-dot { width: 10px; height: 10px; border-radius: 50%; flex: none; }

/* Auftrag: Statusleiste, Eckdaten, Reiter */
.auf-flow { display: flex; gap: 4px; margin: 14px 0 4px; }
.auf-step { flex: 1 1 0; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: flex; flex-direction: column; align-items: flex-start; gap: 6px; padding: 0 0 2px; background: none; border: 0; color: var(--faint, #888); font: inherit; font-size: 12px; cursor: pointer; text-align: left; }
.auf-step i { display: block; width: 100%; height: 5px; border-radius: 3px; background: var(--line); }
.auf-step.done i { background: var(--sc); opacity: .45; }
.auf-step.done { color: var(--muted, #aaa); }
.auf-step.cur i { background: var(--sc); box-shadow: 0 0 0 1px var(--sc); }
.auf-step.cur { color: var(--text); font-weight: 600; }
.auf-step:hover span { color: var(--text); }
.auf-flow-off { margin: 14px 0 4px; padding: 8px 12px; border-radius: 10px; border: 1px solid var(--sc); color: var(--sc); font-size: 13px; }
.auf-facts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px 16px; margin-top: 14px; }
.auf-fact b { display: block; font-size: 15px; line-height: 1.35; }
.auf-fact.wide { grid-column: span 2; }
.auf-fact.warn b { color: var(--gold); }
@container page (max-width: 760px) { .auf-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.auf-tabs { margin: 16px 0 -6px; }
.auf-tabn { display: inline-block; min-width: 18px; padding: 0 5px; margin-left: 6px; border-radius: 9px; background: var(--line); font-size: 11px; line-height: 18px; text-align: center; }
.auf-olist { display: flex; flex-direction: column; gap: 2px; margin-top: 4px; }
.auf-oitem { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; color: inherit; text-decoration: none; }
.auf-oitem:hover { background: rgba(255,255,255,.04); }
.auf-oitem.active { background: rgba(210,147,38,.12); }
.auf-oitem .auf-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--sc); flex: none; }
.auf-log { padding: 5px 0; border-bottom: 1px solid var(--line); }
.auf-tabs a { padding-left: 13px; padding-right: 13px; }

/* Verträge & Fragebögen */
.rt { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.rt-bar { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; padding: 6px; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.03); position: sticky; top: 0; z-index: 2; }
.rt-bar select { max-width: 240px; margin-left: auto; }
.rt-edit, .rt-view { padding: 18px 22px; min-height: 160px; max-height: 58vh; overflow: auto; background: #fbfaf7; color: #1b1b1b; font-size: 14px; line-height: 1.55; outline: none; }
.rt-view { border-radius: 12px; border: 1px solid var(--line); }
.rt-edit h1, .rt-view h1 { font-size: 22px; text-align: center; margin: 4px 0 0; color: #111; }
.rt-edit .sub, .rt-view .sub { text-align: center; color: #666; margin: 0 0 14px; }
.rt-edit h3, .rt-view h3 { font-size: 15px; margin: 16px 0 4px; color: #111; }
.rt-edit p, .rt-view p { margin: 0 0 7px; }
.rt-view .sig { display: flex; gap: 30px; margin-top: 24px; } .rt-view .sig > div { flex: 1; } .rt-view .sig img { max-height: 70px; }
.rt-view .sig .line { border-top: 1px solid #333; font-size: 12px; color: #555; padding-top: 3px; } .rt-view .sig .pl { font-size: 12px; color: #555; }
.rt-view .app { border-top: 2px dashed #ccc; margin-top: 24px; padding-top: 12px; }
.ph-miss { background: #ffe7a3; border-radius: 3px; padding: 0 2px; color: #7a5200; }
.f-row { display: flex; align-items: center; gap: 12px; padding: 10px 8px; border-bottom: 1px solid var(--line); cursor: pointer; border-radius: 8px; }
.f-row:hover { background: rgba(255,255,255,.04); }

.f-pick { display: flex; flex-direction: column; gap: 6px; }
.q-form { max-width: 820px; }
.q-info { padding: 12px 14px; border-radius: 12px; background: rgba(210,147,38,.08); border: 1px solid rgba(210,147,38,.25); font-size: 14px; line-height: 1.55; }
.q-info p { margin: 0 0 8px; } .q-info ul { margin: 4px 0 8px 18px; }
.q-sec { margin: 14px 0 0; font-size: 16px; color: var(--gold); }
.q-item { display: flex; flex-direction: column; gap: 6px; }
.q-l { font-weight: 600; }
.q-opts { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.q-opt { display: inline-flex; align-items: center; gap: 7px; padding: 7px 12px; border: 1px solid var(--line); border-radius: 999px; cursor: pointer; font-size: 13px; }
.q-opt.on { border-color: var(--gold); background: rgba(210,147,38,.12); }
.q-opt input { accent-color: var(--gold); }
.sig-wrap { display: flex; flex-direction: column; gap: 6px; }
.sig-pad { width: 100%; height: auto; aspect-ratio: 760 / 220; border-radius: 12px; border: 1px solid var(--line); background: #fff; touch-action: none; cursor: crosshair; }
.qt-row { display: flex; flex-direction: column; gap: 6px; padding: 10px; border: 1px solid var(--line); border-radius: 12px; }
.qt-head { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
/* Auftrag: Reiter oben, schmale Kopfzeile */
.auf-tabs.auf-tabs-top { margin: 0 0 2px; }
.auf-slim { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 12px 18px !important; }
.auf-slim .grow { flex: 1; min-width: 0; }
.auf-slim .badge { background: color-mix(in srgb, var(--sc) 18%, transparent); color: var(--sc); }
.folder-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding: 10px 0; border-bottom: 1px solid var(--line, rgba(255,255,255,.08)); }
.folder-row:last-child { border-bottom: 0; }
.folder-row .grow { flex: 1; min-width: 200px; }
.folder-row code { font-size: 12px; word-break: break-all; }
.rt-edit table { border-collapse: collapse; width: 100%; margin: 6px 0; font-size: 13px; }
.rt-edit td { border-bottom: 1px solid var(--line); padding: 5px 6px; vertical-align: top; }
.rt-edit hr { border: 0; border-top: 1px solid var(--line); margin: 10px 0; }
.rt-edit ul { margin: 4px 0 6px 18px; padding: 0; }
.prod-row { padding: 10px 0; border-bottom: 1px solid var(--line); }
.prod-row:last-child { border-bottom: 0; }
.prod-row.off { opacity: .55; }
.prod-main { display: flex; flex-direction: column; gap: 6px; }
.icon-btn { min-width: 30px; min-height: 30px; display: inline-grid; place-items: center; border-radius: 8px; }
.icon-btn:hover { background: var(--surface-2); }
.f-ic { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: var(--surface-2); color: var(--gold); flex: none; }
.f-ic svg { width: 18px; height: 18px; }
.ic { vertical-align: -3px; margin-right: 2px; }
/* Fahrtenbuch-Schnelleingabe: bei mittlerer Breite zweizeilig statt über den Rand */
@container page (max-width: 1060px) {
  .quick-add.trip { grid-template-columns: 150px 150px 120px 120px minmax(200px, 1fr); }
  .quick-add.trip > .field:nth-child(6) { grid-column: 1 / 5; }
  .quick-add.trip > .field:last-child { grid-column: 5; justify-self: end; }
}
@container page (max-width: 760px) { .quick-add.trip { grid-template-columns: 1fr 1fr 1fr; } .quick-add.trip > .field:nth-child(6) { grid-column: 1 / -1; } .quick-add.trip > .field:last-child { grid-column: 1 / -1; justify-self: start; } }

/* ------------------------------------------------------------------ Dashboard */
.dash-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.dash-tabs { margin: 0; flex-wrap: wrap; }
.dash-tab-add { background: none; border: 1px dashed var(--line); color: var(--muted); border-radius: 999px; padding: 6px 12px; font: inherit; font-size: 13px; cursor: pointer; display: inline-flex; gap: 4px; align-items: center; margin-left: 4px; }
.dash-tab-add:hover { color: var(--text); border-color: var(--gold); }
.dash-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; align-items: start; grid-auto-flow: row dense; }
.d-tile { margin: 0; display: flex; flex-direction: column; min-width: 0; padding: 18px 20px; }
.d-s { grid-column: span 1; } .d-m { grid-column: span 2; } .d-l { grid-column: span 3; } .d-xl { grid-column: 1 / -1; }
@container page (max-width: 980px) { .dash-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .d-m, .d-l, .d-xl { grid-column: 1 / -1; } }
@container page (max-width: 560px) { .dash-grid { grid-template-columns: 1fr; } .d-s { grid-column: 1 / -1; } }
.d-head { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; min-height: 26px; }
.d-title { font-weight: 600; font-size: 15px; color: var(--text); text-decoration: none; display: inline-flex; align-items: center; gap: 8px; flex: 1; min-width: 0; }
a.d-title:hover { color: var(--gold); }
.d-badge { font-size: 11px; font-weight: 700; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--surface-2); color: var(--muted); display: inline-grid; place-items: center; }
.d-open { font-size: 12px; color: var(--muted); text-decoration: none; display: inline-flex; align-items: center; gap: 4px; padding: 4px 8px; border-radius: 8px; white-space: nowrap; }
.d-open:hover { color: var(--gold); background: var(--surface-2); }
.d-body { flex: 1; min-width: 0; }
.d-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
.d-stat { display: block; padding: 12px 14px; border-radius: 12px; background: var(--surface-2); color: inherit; text-decoration: none; min-width: 0; }
a.d-stat:hover { outline: 1px solid var(--line); }
.d-stat-label { font-size: 12px; color: var(--muted); }
.d-stat-value { font-size: 24px; font-weight: 700; margin-top: 4px; letter-spacing: -.01em; }
.d-stat.gold .d-stat-value { color: var(--gold); } .d-stat.neg .d-stat-value, .d-big.neg { color: var(--danger); } .d-stat.warn .d-stat-value, .d-big.warn { color: var(--gold); }
.d-stat-foot { font-size: 12px; color: var(--faint); margin-top: 4px; }
.d-big { font-size: 26px; font-weight: 700; letter-spacing: -.01em; }
.d-bar { height: 6px; border-radius: 3px; background: var(--surface-2); overflow: hidden; margin: 10px 0 8px; }
.d-bar i { display: block; height: 100%; background: var(--gold); border-radius: 3px; }
.d-month { display: block; color: inherit; text-decoration: none; }
.d-month .mini-split { margin-top: 8px; }
.d-list { display: flex; flex-direction: column; }
.d-row { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; background: none; border: 0; border-top: 1px solid var(--line-soft); padding: 9px 2px; color: inherit; font: inherit; text-decoration: none; cursor: pointer; }
.d-row:first-child { border-top: 0; }
.d-row:hover .d-row-title { color: var(--gold); }
.d-row.warn .d-row-sub { color: var(--danger); }
.d-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.d-row-main { flex: 1; min-width: 0; }
.d-row-title { font-size: 14px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.d-row-sub { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.d-row-right { font-size: 13px; text-align: right; white-space: nowrap; }
.d-more { display: block; margin-top: 6px; padding: 8px 2px 0; border: 0; border-top: 1px solid var(--line-soft); background: none; color: var(--gold); font: inherit; font-size: 13px; text-align: left; cursor: pointer; text-decoration: none; width: 100%; }
.d-empty { color: var(--muted); font-size: 14px; margin: 4px 0; }
.d-cal .card { border: 0; padding: 0; background: none; box-shadow: none; margin: 0; }
.d-charts > div > .card:first-child { margin-top: 0; }
.d-todos .home-todo-add { margin-bottom: 4px; }
.d-cat { font-size: 12px; text-transform: uppercase; letter-spacing: .1em; color: var(--faint); margin: 10px 0 2px; }
.d-cat-row.on { border-color: rgba(210,147,38,.4); }
/* Bearbeiten */
.dash-grid.editing .d-tile { outline: 1px dashed var(--line); cursor: grab; }
.dash-grid.editing .d-body { pointer-events: none; opacity: .55; max-height: 220px; overflow: hidden; }
.dash-grid.editing .d-tile.dragging { opacity: .4; }
.dash-grid.editing .d-tile.over { outline: 2px solid var(--gold); }
.d-grip { color: var(--faint); letter-spacing: -2px; cursor: grab; user-select: none; }
.d-edit { display: flex; align-items: center; gap: 4px; }
.d-sizes { display: inline-flex; background: var(--surface-2); border-radius: 8px; padding: 2px; margin-right: 4px; }
.d-sizes button { background: none; border: 0; color: var(--muted); font: inherit; font-size: 11px; font-weight: 700; min-width: 28px; height: 26px; border-radius: 6px; cursor: pointer; }
.d-sizes button.on { background: var(--gold); color: #000; }
.d-ic { width: 28px; height: 28px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); color: var(--muted); cursor: pointer; display: inline-grid; place-items: center; font-size: 16px; line-height: 1; }
.d-ic:hover:not(:disabled) { color: var(--text); border-color: var(--gold); }
.d-ic:disabled { opacity: .35; cursor: default; }
.d-emptytile { text-align: center; padding: 40px 20px; }
.d-title-t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.d-s .d-open-t { display: none; }
.d-s .d-open { padding: 6px; }
.dash-grid.editing .d-head { flex-wrap: wrap; row-gap: 8px; }
.dash-grid.editing .d-edit { margin-left: auto; }
.dash-grid.editing .d-s .d-edit { width: 100%; justify-content: space-between; }
/* Einheitliche Kachelgrößen: S = 1 Raster-Zeile, M/L = 2, XL = 1 (Diagramme größer) – alle Kacheln einer Größe sind gleich hoch */
.dash-grid { --row: 214px; grid-auto-rows: var(--row); align-items: stretch; }
.d-tile { height: 100%; overflow: hidden; }
.d-s, .d-xl { grid-row: span 1; }
.d-m, .d-l { grid-row: span 2; }
.d-tile[style*="--rows"] { grid-row: span var(--rows); }
.d-body { min-height: 0; overflow: auto; scrollbar-width: thin; }
@container page (max-width: 980px) { .d-xl { grid-row: span 2; } }
@container page (max-width: 560px) { .dash-grid { grid-auto-rows: auto; } .d-tile { height: auto; } .d-s, .d-m, .d-l, .d-xl, .d-tile[style*="--rows"] { grid-row: auto; } }
.arch-toggle { font-size: 13px; color: var(--muted); white-space: nowrap; margin: 0; }
.arch-row td { padding: 10px 14px !important; }

/* ------------------------------------------------------------------ Mail */
.nav-badge { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px; margin-left: 6px; border-radius: 999px; background: var(--gold); color: #000; font-size: 11px; font-weight: 700; }
.mail-bar { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 14px; }
.mail-h1 { font-size: 30px; margin: 0; }
.mail-cols { display: grid; grid-template-columns: 210px minmax(240px, 340px) minmax(0, 1fr); gap: 14px; align-items: start; }
.mail-side { display: flex; flex-direction: column; gap: 6px; position: sticky; top: 84px; }
.mail-acc { border: 1px solid var(--line-soft); border-radius: 12px; background: var(--surface); padding: 4px; position: relative; }
.mail-acc.cur { border-color: rgba(210,147,38,.45); }
.mail-acc-head { display: flex; flex-direction: column; align-items: flex-start; width: 100%; background: none; border: 0; color: inherit; font: inherit; text-align: left; padding: 8px 10px; cursor: pointer; border-radius: 8px; }
.mail-acc-head .small { overflow: hidden; text-overflow: ellipsis; max-width: 100%; white-space: nowrap; }
.mail-folder { display: flex; justify-content: space-between; align-items: center; width: 100%; background: none; border: 0; color: var(--muted); font: inherit; font-size: 13px; padding: 7px 10px; border-radius: 8px; cursor: pointer; text-align: left; }
.mail-folder:hover { color: var(--text); background: var(--surface-2); }
.mail-folder.active { color: var(--text); background: var(--surface-2); font-weight: 600; }
.mail-n { min-width: 20px; height: 18px; padding: 0 6px; border-radius: 999px; background: var(--gold); color: #000; font-size: 11px; font-weight: 700; display: inline-grid; place-items: center; }
.mail-n.acc { position: absolute; right: 10px; top: 12px; }
.mail-add { font-size: 13px; color: var(--muted); padding: 8px 10px; text-decoration: none; display: inline-flex; align-items: center; gap: 4px; }
.mail-add:hover { color: var(--gold); }
.mail-list { border: 1px solid var(--line-soft); border-radius: 14px; background: var(--surface); overflow: hidden; max-height: calc(100vh - 190px); overflow-y: auto; }
.mail-item { display: block; width: 100%; text-align: left; background: none; border: 0; border-bottom: 1px solid var(--line-soft); padding: 11px 14px; color: inherit; font: inherit; cursor: pointer; }
.mail-item:hover { background: var(--surface-2); }
.mail-item.active { background: rgba(210,147,38,.10); }
.mail-item-top { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; }
.mail-item-top b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; color: var(--muted); }
.mail-item.unseen .mail-item-top b { color: var(--text); font-weight: 700; }
.mail-item.unseen { box-shadow: inset 3px 0 0 var(--gold); }
.mail-item-subj { font-size: 13px; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); }
.mail-item:not(.unseen) .mail-item-subj { color: var(--muted); }
.mail-cust { font-size: 11px; color: var(--gold); margin-top: 3px; }
.mail-read { border: 1px solid var(--line-soft); border-radius: 14px; background: var(--surface); min-height: 420px; min-width: 0; }
.mail-empty { display: grid; place-items: center; align-content: center; gap: 6px; min-height: 420px; color: var(--faint); }
.mail-empty svg { width: 34px; height: 34px; }
.mail-view { padding: 16px 18px; min-width: 0; }
.mail-actions { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.mail-subj { font-size: 20px; margin: 0 0 8px; }
.mail-meta { display: flex; flex-direction: column; gap: 2px; margin-bottom: 10px; }
.mail-custbar { font-size: 13px; padding: 8px 10px; border-radius: 10px; background: rgba(210,147,38,.08); border: 1px solid rgba(210,147,38,.25); margin-bottom: 10px; display: flex; align-items: center; flex-wrap: wrap; gap: 2px; }
.mail-atts { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.mail-att { display: inline-flex; align-items: center; gap: 4px; padding: 6px 10px; border-radius: 8px; border: 1px solid var(--line); font-size: 12px; color: var(--text); text-decoration: none; }
.mail-att:hover { border-color: var(--gold); }
.mail-imgs { padding: 8px 10px; border-radius: 8px; background: var(--surface-2); margin-bottom: 8px; color: var(--muted); }
.mail-frame { width: 100%; min-height: 200px; border: 0; border-radius: 10px; background: #fff; display: block; }
.mail-compose .rt-edit { min-height: 260px; }
.mail-attach { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.modal.modal-wide { width: min(1000px, 96vw); max-width: none; }
.mail-orow.unseen .d-row-title { color: var(--gold); }
.mail-dir { width: 22px; height: 22px; border-radius: 6px; display: inline-grid; place-items: center; font-size: 13px; flex: none; background: var(--surface-2); }
.mail-dir.in { color: #6aa0ff; } .mail-dir.out { color: var(--ok); }
.wa-tpl { display: flex; flex-direction: column; gap: 6px; padding: 10px 0; border-bottom: 1px solid var(--line-soft); }
/* Mail: Postfach-Menü oben, Ordner als Reiter */
.mail-accs { margin: 0; }
.mail-accs button { display: inline-flex; align-items: center; gap: 6px; }
.mail-folders { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; padding: 6px; margin-bottom: 14px; border: 1px solid var(--line-soft); border-radius: 14px; background: var(--surface); }
.mail-ftab { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 9px; border: 1px solid transparent; background: none; color: var(--muted); font: inherit; font-size: 13px; cursor: pointer; white-space: nowrap; }
.mail-ftab:hover { color: var(--text); background: var(--surface-2); }
.mail-ftab.active { color: var(--text); background: var(--surface-2); font-weight: 600; }
.mail-ftab.drop { border-color: var(--gold); background: rgba(210,147,38,.15); color: var(--text); }
.mail-ftab.add { color: var(--faint); border: 1px dashed var(--line); }
.mail-cols { grid-template-columns: minmax(260px, 380px) minmax(0, 1fr); }
@container page (max-width: 820px) { .mail-cols { grid-template-columns: 1fr; } }
.mail-search { margin-bottom: 8px; width: 100%; }
.mail-item.dragging { opacity: .45; }
.mail-item[draggable="true"] { cursor: pointer; }
.mail-menu { position: fixed; z-index: 200; width: 240px; max-height: 60vh; overflow-y: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 18px 40px rgba(0,0,0,.45); padding: 6px; display: flex; flex-direction: column; }
.mail-menu button { background: none; border: 0; color: var(--text); font: inherit; font-size: 13px; text-align: left; padding: 8px 10px; border-radius: 8px; cursor: pointer; }
.mail-menu button:hover { background: var(--surface-2); }
.mail-assign { display: flex; flex-direction: column; gap: 6px; max-height: 50vh; overflow-y: auto; }


/* Aufträge aus Kreativ.Management – nur Anzeige */
.auf-flow.ro .auf-step { cursor: default; }
.auf-flow.ro .auf-step:hover { transform: none; }
.auf-notes { white-space: pre-wrap; font-size: 13.5px; line-height: 1.55; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--line-soft); }
.auf-chk { width: 18px; height: 18px; flex: none; border: 1.5px solid var(--muted); border-radius: 5px; display: inline-flex; align-items: center; justify-content: center; font-size: 12px; color: #111; margin-top: 2px; }
.auf-chk.on { background: var(--gold); border-color: var(--gold); }
.auf-appt { display: flex; gap: 14px; padding: 9px 0; border-bottom: 1px solid var(--line-soft); }
.auf-appt:last-child { border-bottom: 0; }
.auf-appt.past { opacity: .55; }
.auf-appt-when { flex: 0 0 190px; font-size: 13px; font-weight: 500; }
@container page (max-width: 640px) { .auf-appt { flex-direction: column; gap: 2px; } .auf-appt-when { flex: none; } }

/* Belege direkt bei der Buchung */
.bel-sug { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--radius-sm); margin-bottom: 6px; background: var(--surface-2); }
.bel-sug-main { min-width: 0; overflow: hidden; }
.bel-sug-main .link-btn { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; display: inline-block; text-align: left; }
.bel-prog { width: 140px; height: 4px; border-radius: 4px; background: var(--surface-3); overflow: hidden; }
.bel-prog span { display: block; height: 100%; background: var(--gold); }
.bel-panel .fold summary { cursor: pointer; font-weight: 600; font-size: 13px; padding: 4px 0; }
.bel-panel table td { padding: 6px 8px; }
.badge.ok { color: var(--ok); border-color: var(--ok); }

/* Kennzahlen in den Menüs: eine schlanke Zeile statt großer Kästen (die großen Kacheln gibt es nur am Dashboard) */
.kpis, .kpis.kpis-4, .kpis.kpis-5, .kpis.kpis-5c { display: flex !important; flex-wrap: wrap; gap: 0; background: var(--surface); border: 1px solid var(--line-soft); border-radius: var(--radius-sm); padding: 2px 4px; margin-top: 14px !important; }
.kpis .kpi { background: none; border: 0; border-radius: 0; padding: 9px 16px; display: flex; align-items: baseline; gap: 8px; transform: none !important; border-right: 1px solid var(--line-soft); }
.kpis .kpi:last-child { border-right: 0; }
.kpis .kpi-label { font-size: 12px; font-weight: 600; }
.kpis .kpi-value { font-size: 16px; margin: 0; letter-spacing: 0; white-space: nowrap; }
.kpis .kpi-foot { display: none; }
@media (max-width: 700px) { .kpis .kpi { border-right: 0; padding: 6px 10px; } }
.top-btn.on { color: #0b0b0c; background: var(--gold); border-color: var(--gold); }
.auf-info .btn { white-space: nowrap; flex: none; }
/* Status-Leiste Aufträge: kompakt in einer Zeile (alle Kacheln gleich breit, bei schmalem Fenster seitlich scrollbar) */
.auf-states { flex-wrap: nowrap; gap: 6px; overflow-x: auto; scrollbar-width: none; }
.auf-states::-webkit-scrollbar { display: none; }
.auf-state { flex: 1 1 auto; min-width: 0; padding: 7px 9px 7px 11px; border-radius: 11px; gap: 0; }
.auf-state b { font-size: 16px; line-height: 1.2; }
.auf-state span { font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.auf-state::before { top: 8px; bottom: 8px; }

/* Hilfe */
.help-layout { display: grid; grid-template-columns: 240px 1fr; gap: 20px; align-items: start; margin-top: 8px; }
.help-nav { position: sticky; top: calc(var(--topbar-h, 70px) + 12px); display: flex; flex-direction: column; gap: 10px; }
.help-nav .side-item a { display: block; padding: 8px 12px; border-radius: 10px; color: var(--muted); text-decoration: none; font-weight: 600; font-size: 14px; }
.help-nav .side-item a.active, .help-nav .side-item a:hover { background: var(--surface-2); color: var(--text); }
.help-body { padding: 24px 28px; }
.help-chap h2 { margin: 0 0 4px; }
.help-chap + .help-chap { margin-top: 28px; padding-top: 20px; border-top: 1px solid var(--line-soft); }
.help-sec { margin-top: 18px; }
.help-sec h3 { margin: 0 0 6px; font-size: 15px; }
.help-sec p, .help-sec li { line-height: 1.6; color: var(--text); font-size: 14px; }
.help-sec ul { margin: 6px 0 0; padding-left: 20px; }
.help-sec li { margin-bottom: 4px; }
.help-tip { margin-top: 8px; padding: 10px 12px; border-left: 3px solid var(--gold); background: var(--surface-2); border-radius: 8px; font-size: 13.5px; }
.help-print { display: none; }
@media (max-width: 820px) { .help-layout { grid-template-columns: minmax(0, 1fr); } .help-layout > * { min-width: 0; } .help-nav { position: static; } .help-body { padding: 16px; } }
@media print {
  body.print-help .help-print { display: block; color: #000; }
  body.print-help .help-print * { color: #000 !important; background: none !important; }
  body.print-help .page-head, body.print-help .help-layout { display: none !important; }
  body.print-help .help-chap { break-inside: auto; }
  body.print-help .help-sec { break-inside: avoid; }
}
.help-chap h2 a { color: inherit; text-decoration: none; } .help-chap h2 a:hover { color: var(--gold); }

body.on-server .desk-only { display: none !important; }

/* KM-Anmeldung aus der Ferne (NAS) */
.modal.km-remote{width:min(760px,96vw)}
.km-remote-view{display:block;width:100%;height:auto;border:1px solid var(--line,#ddd);border-radius:8px;cursor:pointer;background:#fff;touch-action:manipulation}
.km-form{border:1px solid var(--line);border-radius:12px;padding:14px;background:var(--surface-2)}
.km-form-title{font-weight:700;margin-bottom:8px}
.km-prev summary{cursor:pointer;color:var(--muted);font-size:13px;padding:4px 0}
.km-remote-view:focus{outline:2px solid var(--gold);outline-offset:2px}

/* ---------- Online (NAS) & Handy ---------- */
body.on-server .topbar { -webkit-app-region: no-drag; padding-left: max(24px, env(safe-area-inset-left)); }
@media (max-width: 700px) {
  .topbar, body.on-server .topbar { flex-wrap: nowrap; gap: 8px; padding: calc(8px + env(safe-area-inset-top)) 12px 8px; backdrop-filter: none; -webkit-backdrop-filter: none; background: #0b0b0c; }
  .brand-logo { height: 30px; }
  .top-actions { gap: 4px; margin-left: auto; }
  .top-actions .save-state, #lockBtn { display: none; }
  .top-icon, .top-btn { flex-shrink: 0; }
  .top-icon, .top-btn { width: 36px; height: 36px; }
  /* Menü als Leiste unten */
  .nav-wrap { position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; padding: 4px 4px calc(4px + env(safe-area-inset-bottom));
    background: rgba(11, 11, 12, .94); backdrop-filter: saturate(160%) blur(18px); -webkit-backdrop-filter: saturate(160%) blur(18px); border-top: 1px solid var(--line-soft); }
  .nav-arrow { display: none !important; }
  .nav { order: 0; flex-basis: auto; gap: 2px; justify-content: space-between; }
  .nav a { flex: 1 1 0; text-align: center; padding: 10px 2px; font-size: 11.5px; border-radius: 10px; }
  .page, body.act-on #app.page, body.act-on.act-closed #app.page, body.act-on:not(.act-closed) #app.page { margin: 0; padding: 18px 14px calc(84px + env(safe-area-inset-bottom)); max-width: none; }
  h1 { font-size: 26px; }
  .page-head { margin-bottom: 18px; gap: 12px; }
  /* Fenster bildschirmfüllend */
  .modal-backdrop { padding: 0; place-items: stretch; }
  .modal, .modal.modal-wide, .modal.km-remote, .modal:has(.doc-editor) { width: 100vw; max-width: 100vw; height: 100dvh; max-height: 100dvh; border-radius: 0; border: 0; display: flex; flex-direction: column; }
  .modal-head { padding: calc(14px + env(safe-area-inset-top)) 16px 0; }
  .modal-body { padding: 14px 16px; flex: 1; overflow: auto; }
  .modal-foot { padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); }
  .modal-foot .btn { flex: 1 1 auto; }
  /* Tabellen seitlich wischen statt quetschen */
  .card { min-width: 0; }
  .card > table, .table-wrap > table { min-width: 560px; }
  .card:has(> table) { overflow-x: auto; }
  #toast { bottom: calc(84px + env(safe-area-inset-bottom)); }
  input, select, textarea, .input { font-size: 16px; }   /* kein automatisches Zoomen am iPhone */
  .btn { min-height: 40px; }
  /* Aufgaben-Fenster als Overlay; eingeklappt als runder Knopf */
  body.act-on .activity { top: 0; bottom: 0; width: 100vw; z-index: 45; padding-top: env(safe-area-inset-top); padding-bottom: env(safe-area-inset-bottom); }
  body.act-on.act-closed .activity { top: auto; bottom: calc(76px + env(safe-area-inset-bottom)); right: 14px; width: auto; background: none; border: 0; padding: 0; }
  body.act-on.act-closed .act-toggle { width: 48px; height: 48px; border-radius: 50%; background: var(--surface); box-shadow: var(--shadow); }
}

/* Eigene Termine */
.cal-head{display:flex;align-items:center;justify-content:space-between;gap:8px;flex-wrap:wrap}
.cal-actions{display:flex;gap:6px}
.appt-rep{border:1px solid var(--line-soft);border-radius:12px;padding:12px;display:flex;flex-direction:column;gap:10px}
.appt-inline{display:flex;align-items:center;gap:8px;flex-wrap:wrap}.appt-inline .input{width:auto}
.appt-days{display:flex;gap:6px;flex-wrap:wrap}
.appt-day{min-width:42px;height:34px;border-radius:999px;border:1px solid var(--line);background:var(--surface);color:var(--muted);font:inherit;font-weight:600;cursor:pointer}
.appt-day.on{background:var(--gold);border-color:var(--gold);color:#0b0b0c}
.appt-row{display:flex;gap:10px;align-items:center;padding:10px 12px;border:1px solid var(--line-soft);border-radius:12px;flex-wrap:wrap}
.appt-badge{display:inline-block;margin-left:8px;padding:1px 8px;border-radius:999px;background:var(--gold-soft,rgba(210,147,38,.15));color:var(--gold);font-size:11px;font-weight:700;vertical-align:1px}

.kv{display:flex;flex-direction:column;gap:4px}
