/* kundenverwaltung.eu – Demo */
:root {
  --bg: #F4F6F9; --card: #FFFFFF; --line: #E3E8EF; --line-soft: #EEF2F7;
  --text: #1F2937; --strong: #111827; --muted: #5B6474; --text2: #3D4656;
  --blue: #2563EB; --blue-d: #1D5FD1; --blue-dd: #174EA8; --blue-l: #E6F0FC; --blue-b: #CFE0F8;
  --green: #1E7A46; --green-l: #E3F4EA; --orange: #A4520B; --orange-l: #FDF0E1;
  --red: #B42318; --red-l: #FDECEA; --purple: #6941C6; --purple-l: #F1ECFD;
  --card2: #FFFFFF; --soft: #F9FAFC; --line2: #D3DAE4; --col: #EAEFF5;
  --orange-b: #F5D3AE; --red-b: #F3B6B0; --green-b: #BFE5CC; --orange-t: #6B3A08; --green-t: #14532D;
  --r: 12px; --shadow: 0 1px 2px rgba(17,24,39,.04), 0 8px 24px rgba(17,24,39,.08);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* ---------- Dunkles Design (data-theme="dark" oder Systemeinstellung bei „Automatisch“) ---------- */
:root { color-scheme: light; }
:root[data-theme="dark"] {
  --bg: #0E131A; --card: #161C25; --card2: #1B222C; --soft: #1A212B; --line: #29323F; --line-soft: #212934; --line2: #354152; --col: #121820;
  --text: #D5DCE6; --strong: #F2F5F9; --muted: #95A1B3; --text2: #B6C0CE;
  --blue: #3B7BF0; --blue-d: #7FB0FF; --blue-dd: #A9CAFF; --blue-l: #172539; --blue-b: #294266;
  --green: #5CCB8A; --green-l: #12271B; --green-b: #23503A; --green-t: #A4E3BE;
  --orange: #EFA25B; --orange-l: #2A1E11; --orange-b: #5B3E1B; --orange-t: #F4C694;
  --red: #F2867B; --red-l: #2D1716; --red-b: #5E2B27; --purple: #B9A2F7; --purple-l: #231D38;
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.35);
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root[data-theme="auto"] {
  --bg: #0E131A; --card: #161C25; --card2: #1B222C; --soft: #1A212B; --line: #29323F; --line-soft: #212934; --line2: #354152; --col: #121820;
  --text: #D5DCE6; --strong: #F2F5F9; --muted: #95A1B3; --text2: #B6C0CE;
  --blue: #3B7BF0; --blue-d: #7FB0FF; --blue-dd: #A9CAFF; --blue-l: #172539; --blue-b: #294266;
  --green: #5CCB8A; --green-l: #12271B; --green-b: #23503A; --green-t: #A4E3BE;
  --orange: #EFA25B; --orange-l: #2A1E11; --orange-b: #5B3E1B; --orange-t: #F4C694;
  --red: #F2867B; --red-l: #2D1716; --red-b: #5E2B27; --purple: #B9A2F7; --purple-l: #231D38;
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.35);
  color-scheme: dark;
  }
}
* , *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); font-size: 15px; line-height: 1.5; color: var(--text); background: var(--bg); }
a { color: var(--blue-d); text-underline-offset: 3px; }
a:hover { color: var(--blue-dd); }
h1, h2, h3 { color: var(--strong); line-height: 1.25; margin: 0; letter-spacing: -0.01em; }
h1 { font-size: 26px; }
h2 { font-size: 16px; font-weight: 600; }
h3 { font-size: 15px; font-weight: 600; }
p { margin: 0 0 .8em; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.center { text-align: center; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.mt { margin-top: 16px; }
.mt-lg { margin-top: 28px; }
.grow { flex: 1; min-width: 0; }
.inline { display: inline; }
:focus-visible { outline: 3px solid #93B8F3; outline-offset: 2px; border-radius: 6px; }
svg { flex: none; }

/* ---------- Demo-Leiste ---------- */
.link-btn { background: none; border: 0; color: #C9D3E1; font: inherit; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; padding: 4px 0; }
.link-btn:hover { color: #fff; }

/* ---------- Grundlayout ---------- */
.app { display: flex; min-height: calc(100vh - 37px); }
.sidebar { width: 252px; flex: none; background: var(--card); border-right: 1px solid var(--line); padding: 18px 14px; display: flex; flex-direction: column; gap: 18px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--strong); font-weight: 750; font-size: 17px; padding: 4px 8px; letter-spacing: -0.02em; }
.brand:hover { color: var(--strong); }
.brand .tld { color: var(--blue-d); }
.sidebar nav { display: flex; flex-direction: column; gap: 2px; }
.nav-link { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 8px; text-decoration: none; color: var(--text2); font-weight: 500; min-height: 42px; }
.nav-link:hover { background: var(--bg); color: var(--strong); }
.nav-link.active { background: var(--blue-l); color: var(--blue-d); font-weight: 600; }
.nav-link .count { margin-left: auto; font-size: 12px; font-weight: 600; background: var(--blue-l); color: var(--blue-d); border-radius: 10px; padding: 1px 8px; }
.nav-link.active .count { background: var(--card); }
.nav-link.locked { opacity: .6; }
.nav-link .nav-lock { margin-left: auto; display: inline-flex; color: var(--text2); }
.locked-card { max-width: 640px; margin: 40px auto; text-align: center; padding: 36px 32px; }
.locked-card h1 { font-size: 22px; margin: 12px 0 8px; }
.locked-card .form-actions { justify-content: center; flex-wrap: wrap; }
.locked-icon { width: 56px; height: 56px; border-radius: 50%; background: var(--blue-l); color: var(--blue-d); display: inline-flex; align-items: center; justify-content: center; }
.sidebar-bottom { margin-top: auto; display: flex; flex-direction: column; gap: 12px; }
.plan { background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; display: flex; flex-direction: column; gap: 2px; font-size: 13px; }
.plan b { color: var(--strong); }
.plan span { color: var(--muted); font-size: 12px; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { position: relative; display: flex; align-items: center; gap: 12px; padding: 16px 28px; }
.search { position: relative; flex: 1 1 260px; max-width: 460px; }
.search svg { position: absolute; left: 13px; top: 13px; color: var(--muted); }
.search input { width: 100%; height: 44px; border: 1px solid var(--line2); border-radius: 10px; padding: 0 14px 0 40px; font: inherit; background: var(--card); color: var(--text); }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.menu-btn, .icon-btn.menu-btn { display: none; }
.content { padding: 4px 28px 48px; display: flex; flex-direction: column; gap: 20px; }

@media (max-width: 900px) {
  .sidebar { position: fixed; z-index: 40; top: 0; bottom: 0; left: 0; transform: translateX(-105%); transition: transform .2s; box-shadow: var(--shadow); overflow-y: auto; }
  .sidebar.open { transform: none; }
  .menu-btn, .icon-btn.menu-btn { display: inline-flex; }
  .topbar { padding: 12px 16px; }
  .content { padding: 4px 16px 40px; }
  .topbar .btn span { display: none; }
}

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; padding: 0 16px; border-radius: 10px; border: 1px solid var(--line2); background: var(--card); color: var(--strong); font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; white-space: nowrap; }
.btn:hover { border-color: #AFC3DE; color: var(--blue-d); }
.btn-primary { background: var(--blue); border-color: var(--blue); color: #fff; }
.btn-primary:hover { background: var(--blue-d); border-color: var(--blue-d); color: #fff; }
.btn-danger { color: var(--red); }
.btn-danger:hover { border-color: var(--red-b); color: var(--red); background: var(--red-l); }
.btn-sm { min-height: 34px; padding: 0 12px; font-size: 13px; border-radius: 8px; }
.btn-lg { min-height: 50px; padding: 0 24px; font-size: 16px; }
.icon-btn { width: 42px; height: 42px; border: 1px solid var(--line2); border-radius: 10px; background: var(--card); color: var(--text2); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.icon-btn:hover { color: var(--blue-d); }
.icon-btn-sm { width: 32px; height: 32px; border-radius: 8px; }

.dropdown { position: relative; }
.dropdown summary { list-style: none; }
.dropdown summary::-webkit-details-marker { display: none; }
.dropdown-menu { position: absolute; right: 0; top: calc(100% + 6px); z-index: 30; background: var(--card); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); padding: 6px; min-width: 200px; display: flex; flex-direction: column; }
.dropdown-menu a { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 8px; color: var(--text); text-decoration: none; }
.dropdown-menu a:hover { background: var(--bg); color: var(--blue-d); }

/* ---------- Bausteine ---------- */
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px; }
.page-head p { margin: 4px 0 0; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 20px 22px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.card-head a { font-size: 13px; font-weight: 600; text-decoration: none; }
.card-flush { padding: 0; overflow: hidden; }
.card-blue { background: var(--blue-l); border-color: var(--blue-b); }
.row { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-start; }
.col-2 { flex: 2 1 420px; min-width: 0; }
.col-1 { flex: 1 1 300px; min-width: 0; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 16px; }
.kpi { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 18px 20px; display: flex; flex-direction: column; gap: 6px; text-decoration: none; color: inherit; }
a.kpi:hover { border-color: var(--blue-b); color: inherit; }
.kpi .label { font-size: 13px; color: var(--muted); font-weight: 500; }
.kpi .value { font-size: 26px; font-weight: 700; color: var(--strong); letter-spacing: -0.02em; }
.kpi .sub { font-size: 13px; color: var(--text2); }
.flash { background: var(--green-l); color: var(--green-t); border: 1px solid var(--green-b); border-radius: 10px; padding: 11px 14px; display: flex; gap: 10px; align-items: center; }
.empty { padding: 32px 20px; text-align: center; color: var(--muted); }
.notice { background: var(--blue-l); border: 1px solid var(--blue-b); border-radius: 10px; padding: 12px 16px; color: var(--text2); font-size: 14px; }
.notice-orange { background: var(--orange-l); border-color: var(--orange-b); color: var(--orange-t); }

.badge { display: inline-block; font-size: 12px; font-weight: 600; border-radius: 6px; padding: 2px 8px; white-space: nowrap; }
.badge-gray { color: var(--text2); background: var(--line-soft); }
.badge-blue { color: var(--blue-d); background: var(--blue-l); }
.badge-green { color: var(--green); background: var(--green-l); }
.badge-orange { color: var(--orange); background: var(--orange-l); }
.badge-red { color: var(--red); background: var(--red-l); }
.badge-purple { color: var(--purple); background: var(--purple-l); }

.avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--blue-l); color: var(--blue-d); font-size: 12px; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; flex: none; }
.avatar-lg { width: 40px; height: 40px; font-size: 14px; }
.avatar-xl { width: 64px; height: 64px; font-size: 22px; font-weight: 700; }

/* ---------- Tabellen ---------- */
.table-box { position: relative; overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-size: 12px; font-weight: 600; color: var(--muted); background: var(--soft); padding: 11px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 11px 12px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: var(--soft); }
.table th:first-child, .table td:first-child { padding-left: 18px; }
.table th:last-child, .table td:last-child { padding-right: 18px; }
.table .num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.table tfoot td { font-weight: 700; color: var(--strong); background: var(--soft); border-top: 1px solid var(--line); }
.name-cell { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--strong); font-weight: 600; }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.chip { display: inline-flex; align-items: center; min-height: 34px; padding: 0 13px; border: 1px solid var(--line2); border-radius: 17px; background: var(--card); color: var(--text2); font-size: 13px; text-decoration: none; }
.chip:hover { border-color: var(--blue-b); color: var(--blue-d); }
.chip.active { background: var(--blue-l); border-color: var(--blue-b); color: var(--blue-d); font-weight: 600; }

/* ---------- Formulare ---------- */
.field { display: flex; flex-direction: column; gap: 6px; }
.field label, .field .label { font-size: 13px; font-weight: 600; color: var(--text2); }
input[type=text], input[type=email], input[type=password], input[type=url], input[type=tel], input[type=number], input[type=date], input[type=month], input[type=time], input[type=search]:not(.search input), input:not([type]), select, textarea {
  font: inherit; color: var(--text); background: var(--card); border: 1px solid var(--line2); border-radius: 9px; padding: 9px 12px; min-height: 42px; width: 100%;
}
textarea { min-height: 90px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-l); }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.span-2 { grid-column: span 2; }
.span-all, .span-3 { grid-column: 1 / -1; }
.form-section { font-size: 14px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin: 22px 0 10px; padding-top: 14px; border-top: 1px solid var(--line); }
.form-section:first-of-type { border-top: 0; padding-top: 0; margin-top: 8px; }
.req { color: var(--red); }
@media (max-width: 700px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } .span-2, .span-3 { grid-column: auto; } }
.check { display: flex; align-items: center; gap: 10px; font-weight: 500 !important; color: var(--text) !important; font-size: 14px !important; min-height: 42px; }
.check input { width: 18px; height: 18px; accent-color: var(--blue); }
.form-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 18px; }
.form-actions .right-side { margin-left: auto; }
fieldset { border: 0; margin: 0; padding: 0; }

/* ---------- Dashboard ---------- */
.bars { display: flex; flex-direction: column; gap: 12px; }
.bar-row { display: grid; grid-template-columns: 110px minmax(0, 1fr) 120px; align-items: center; gap: 12px; font-size: 13px; }
.bar { height: 10px; border-radius: 6px; background: var(--line-soft); overflow: hidden; }
.bar i { display: block; height: 100%; border-radius: 6px; }
.task-list { display: flex; flex-direction: column; }
.task-item { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line-soft); }
.task-item:last-child { border-bottom: 0; }
.task-item input { width: 18px; height: 18px; accent-color: var(--blue); flex: none; }
.task-item .t { flex: 1; min-width: 0; }
.task-item.done .t-title { color: var(--muted); text-decoration: line-through; }
.task-item .t-meta { font-size: 12px; color: var(--muted); }
.feed { display: flex; flex-direction: column; gap: 14px; }
.feed-item { display: flex; gap: 12px; align-items: flex-start; }
.feed-ic { width: 32px; height: 32px; border-radius: 8px; display: flex; align-items: center; justify-content: center; flex: none; background: var(--line-soft); color: var(--text2); }
.feed-ic.blue { background: var(--blue-l); color: var(--blue-d); }
.feed-ic.green { background: var(--green-l); color: var(--green); }
.feed-ic.orange { background: var(--orange-l); color: var(--orange); }
.feed-text { font-size: 14px; color: var(--text); }
.feed-meta { font-size: 12px; color: var(--muted); margin-top: 2px; }

/* ---------- Pipeline ---------- */
.board-wrap { position: relative; overflow-x: auto; padding-bottom: 8px; }
.board { display: grid; grid-template-columns: repeat(6, minmax(250px, 1fr)); gap: 14px; min-width: 1560px; }
.column { background: var(--col); border-radius: 12px; padding: 10px; display: flex; flex-direction: column; gap: 10px; min-height: 240px; }
.column.drop { outline: 2px dashed var(--blue); outline-offset: -2px; background: var(--blue-l); }
.column-head { display: flex; justify-content: space-between; align-items: center; padding: 4px 4px 0; }
.column-head h2 { font-size: 14px; }
.column-line { height: 4px; border-radius: 2px; }
.deal-card { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 12px 13px; display: flex; flex-direction: column; gap: 6px; cursor: grab; text-decoration: none; color: inherit; }
.deal-card:hover { border-color: var(--blue-b); color: inherit; box-shadow: var(--shadow); }
.deal-card.dragging { opacity: .5; }
.deal-card .d-title { font-weight: 600; color: var(--strong); font-size: 14px; text-decoration: none; }
.deal-card .d-title:hover { color: var(--blue-d); text-decoration: underline; }
.deal-card .d-firm { font-size: 13px; color: var(--text2); }
.deal-card .d-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 12px; color: var(--muted); }
.deal-card .d-value { font-weight: 700; color: var(--strong); font-size: 14px; }
.stage-select { display: none; }
@media (hover: none) { .stage-select { display: block; } }

/* ---------- Kontakt-Detail ---------- */
.profile { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; }
.dl { display: grid; gap: 12px; }
.dl div { display: flex; flex-direction: column; gap: 2px; }
.dl dt { font-size: 12px; color: var(--muted); }
.dl dd { margin: 0; font-size: 14px; color: var(--text); overflow-wrap: anywhere; }
.tabs { position: relative; display: flex; gap: 4px; border-bottom: 1px solid var(--line); overflow-x: auto; padding: 0 12px; }
.tabs a { padding: 13px 12px; text-decoration: none; color: var(--text2); border-bottom: 2px solid transparent; white-space: nowrap; font-size: 14px; }
.tabs a.active { color: var(--blue-d); border-bottom-color: var(--blue); font-weight: 600; }
.note-box { background: var(--soft); border: 1px solid var(--line-soft); border-radius: 9px; padding: 9px 12px; margin-top: 6px; white-space: pre-line; }

/* ---------- Kalender ---------- */
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.cal-h { font-size: 12px; font-weight: 600; color: var(--muted); padding: 8px 10px; background: var(--soft); border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.cal-d { min-height: 112px; padding: 6px 8px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--card); display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.cal-d.other { background: var(--soft); }
.cal-d.other .cal-n { color: var(--muted); opacity: .7; }
.cal-n { font-size: 13px; font-weight: 600; color: var(--text2); }
.cal-d.today .cal-n { background: var(--blue); color: #fff; border-radius: 10px; padding: 0 7px; align-self: flex-start; }
.cal-e { font-size: 12px; border-radius: 5px; padding: 2px 6px; background: var(--blue-l); color: var(--blue-dd); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-e.task { background: var(--orange-l); color: var(--orange-t); }
@media (max-width: 760px) { .cal-d { min-height: 70px; } .cal-e { font-size: 10px; } }

/* ---------- Belege ---------- */
.items td { vertical-align: top; }
.items input, .items select { min-height: 38px; padding: 7px 9px; }
.items .w-qty { width: 90px; }
.items .w-unit { width: 100px; }
.items .w-price { width: 130px; }
.items .w-vat { width: 100px; }
.totals { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; padding: 16px 22px; }
.totals div { display: flex; gap: 32px; }
.totals span:last-child { min-width: 120px; text-align: right; font-variant-numeric: tabular-nums; }
.totals .grand { font-size: 18px; font-weight: 700; color: var(--strong); border-top: 1px solid var(--line); padding-top: 8px; }
.radio-card { display: flex; gap: 12px; align-items: flex-start; border: 1px solid var(--line2); border-radius: 10px; padding: 11px 13px; cursor: pointer; }
.radio-card input { margin-top: 3px; width: 17px; height: 17px; accent-color: var(--blue); }
.radio-card:has(input:checked) { border: 2px solid var(--blue); padding: 10px 12px; background: var(--blue-l); }
.radio-card b { display: block; color: var(--strong); font-size: 14px; }
.radio-card small { color: var(--text2); font-size: 12px; }

/* ---------- Berichte ---------- */
.vbars { display: flex; align-items: flex-end; gap: 10px; height: 200px; padding-top: 10px; }
.vbar { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 6px; height: 100%; min-width: 0; }
.vbar i { display: block; width: 100%; max-width: 46px; background: var(--blue); border-radius: 6px 6px 0 0; min-height: 2px; }
.vbar i.light { background: #A9C8F5; }
.vbar span { font-size: 11px; color: var(--muted); white-space: nowrap; }
.vbar b { font-size: 11px; color: var(--text2); font-weight: 600; white-space: nowrap; }
.legend { display: flex; gap: 16px; font-size: 12px; color: var(--muted); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }

/* ---------- Automationen ---------- */
.auto { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; padding: 18px 22px; border-bottom: 1px solid var(--line-soft); }
.auto:last-child { border-bottom: 0; }
.auto .flow { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 13px; color: var(--text2); margin-top: 6px; }
.switch { position: relative; width: 46px; height: 26px; flex: none; }
.switch input { position: absolute; inset: 0; opacity: 0; cursor: pointer; margin: 0; }
.switch span { position: absolute; inset: 0; background: var(--line2); border-radius: 13px; transition: background .15s; pointer-events: none; }
.switch span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: transform .15s; box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.switch input:checked + span { background: var(--blue); }
.switch input:checked + span::after { transform: translateX(20px); }
.switch input:focus-visible + span { box-shadow: 0 0 0 3px #93B8F3; }

/* ---------- Einrichtung ---------- */
.setup-body { background: linear-gradient(var(--card), var(--bg) 320px); }
.setup { max-width: 820px; margin: 0 auto; padding: 40px 20px 60px; display: flex; flex-direction: column; gap: 16px; }
.brand-lg { font-size: 22px; padding: 0; align-self: flex-start; margin-bottom: 12px; }
.setup h1 { font-size: 30px; }
.setup-card { padding: 8px 28px 28px; box-shadow: var(--shadow); }
.step { display: flex; gap: 16px; padding: 22px 0; border-bottom: 1px solid var(--line-soft); }
.step h2 { margin-bottom: 10px; font-size: 17px; }
.step-no { width: 30px; height: 30px; border-radius: 50%; background: var(--blue-l); color: var(--blue-d); font-weight: 700; display: flex; align-items: center; justify-content: center; flex: none; }
.choice-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.choice { position: relative; }
.choice input { position: absolute; opacity: 0; }
.choice label { display: flex; align-items: center; gap: 10px; border: 1px solid var(--line2); border-radius: 10px; padding: 12px 14px; cursor: pointer; font-weight: 500; min-height: 50px; height: 100%; }
.choice input:checked + label { border: 2px solid var(--blue); background: var(--blue-l); padding: 11px 13px; color: var(--blue-dd); }
.choice input:focus-visible + label { box-shadow: 0 0 0 3px var(--blue-l); }
.setup-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; padding-top: 22px; }

/* ---------- Hilfe ---------- */
.help-btn { background: var(--card); }
.help-btn svg { color: var(--blue); }
.help-panel { width: min(400px, calc(100vw - 32px)); max-height: min(70vh, 560px); overflow-y: auto; padding: 18px 18px 12px; font-size: 14px; line-height: 1.55; color: var(--text); display: block; }
.help-panel h2 { font-size: 16px; margin: 0 0 6px; }
.help-panel p { margin: 0 0 10px; }
.help-steps { margin: 0 0 12px; padding-left: 1.3em; display: grid; gap: 6px; }
.help-steps li::marker { color: var(--blue); font-weight: 700; }
.help-tip { display: flex; gap: 8px; align-items: flex-start; background: var(--blue-l); color: var(--blue-dd); border-radius: 10px; padding: 9px 11px; font-size: 13px; }
.help-tip svg { flex: none; margin-top: 2px; }
.dropdown-menu a.help-all { border-top: 1px solid var(--line); border-radius: 0; margin-top: 4px; padding: 10px 0 4px; color: var(--blue-d); font-weight: 600; }
.help-index { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; align-items: start; }
.help-item { border: 1px solid var(--line); border-radius: 10px; background: var(--card); }
.help-item summary { cursor: pointer; padding: 10px 14px; font-weight: 600; list-style: none; display: flex; justify-content: space-between; align-items: center; }
.help-item summary::-webkit-details-marker { display: none; }
.help-item summary::after { content: "+"; color: var(--blue); font-size: 18px; font-weight: 500; }
.help-item[open] summary::after { content: "–"; }
.help-body { padding: 0 14px 12px; font-size: 14px; line-height: 1.55; }
.help-body > p { margin: 0 0 8px; }
@media (max-width: 760px) { .help-btn span { display: none; } .help-drop { position: static; } .help-drop .dropdown-menu { left: 12px; right: 12px; top: calc(100% - 4px); width: auto; max-height: 72vh; } }

/* ---------- Anmeldung, Einrichtung ---------- */
.auth-body { background: linear-gradient(var(--card), var(--bg) 360px); min-height: 100vh; }
.auth { max-width: 440px; margin: 0 auto; padding: 48px 16px 40px; display: flex; flex-direction: column; gap: 16px; }
.auth-wide { max-width: 720px; }
.auth-brand { display: flex; align-items: center; gap: 12px; justify-content: center; font-weight: 800; font-size: 22px; color: var(--strong); letter-spacing: -.01em; margin-bottom: 4px; }
.auth-brand .tld { color: var(--blue); }
.auth-card { padding: 28px; box-shadow: var(--shadow); }
.auth-card h1 { font-size: 24px; margin: 0 0 6px; }
.auth-card h2 { font-size: 16px; margin: 6px 0 12px; }
.auth-card section { border-top: 1px solid var(--line-soft); padding-top: 14px; }
.auth-card > p.muted { margin: 0 0 18px; }
.auth-icon { width: 56px; height: 56px; border-radius: 50%; background: var(--blue-l); color: var(--blue); display: flex; align-items: center; justify-content: center; margin: 0 auto 12px; }
.auth-foot { text-align: center; font-size: 12px; color: var(--muted); margin: 6px 0 0; }
.center { text-align: center; }
.btn-block { width: 100%; justify-content: center; }
.form-error { background: var(--red-l); color: var(--red); border: 1px solid var(--red-b); border-radius: 10px; padding: 10px 14px; font-size: 14px; margin-bottom: 14px; }
.hint { display: block; font-size: 12.5px; color: var(--muted); margin-top: 6px; line-height: 1.45; }
.mono, .secret { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; letter-spacing: .04em; }
.code-input { font-size: 26px; letter-spacing: .3em; text-align: center; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; padding: 12px; }
.notice { display: flex; gap: 10px; align-items: flex-start; }
.notice svg { flex: none; margin-top: 2px; color: var(--blue); }
.checks { border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; margin: 0 0 16px; font-size: 14px; }
.checks summary { cursor: pointer; display: flex; align-items: center; gap: 8px; font-weight: 600; }
.checks ul { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 6px; }
.checks li { display: flex; align-items: center; gap: 8px; }
.checks li.ok svg { color: var(--green); } .checks li.bad { color: var(--red); }

/* ---------- Konto, Zwei-Faktor ---------- */
.codes-box { border: 1px solid var(--orange-b); background: var(--orange-l); border-radius: 12px; padding: 16px 18px; margin-bottom: 16px; }
.codes-box h3 { display: flex; align-items: center; gap: 8px; margin: 0 0 6px; font-size: 16px; }
.codes { list-style: none; padding: 0; margin: 12px 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 15px; }
.codes li { background: var(--card); border: 1px solid var(--orange-b); border-radius: 8px; padding: 8px 10px; text-align: center; letter-spacing: .05em; }
.setup-steps { padding-left: 1.3em; margin: 0 0 12px; display: grid; gap: 6px; }
.qr-wrap { display: flex; flex-wrap: wrap; gap: 18px; align-items: center; margin: 4px 0 18px; }
.qr { border: 1px solid var(--line); border-radius: 12px; padding: 6px; background: var(--card); line-height: 0; }
.qr svg { width: 200px; height: 200px; }
.secret { display: inline-block; background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; font-size: 14px; word-break: break-all; }
.card .link-btn, .auth .link-btn { color: var(--blue-d); padding: 0; }
.card .link-btn:hover { color: var(--blue-dd); text-decoration: underline; }
.log-list { list-style: none; padding: 0; margin: 0 0 12px; display: grid; gap: 8px; }
.log-list li { display: flex; flex-direction: column; border-left: 3px solid var(--green); padding-left: 10px; }
.log-list li.warn { border-left-color: var(--orange); }

/* ---------- Benutzer ---------- */
.row-muted td { opacity: .6; }
.roles { margin: 0; display: grid; gap: 4px; font-size: 13.5px; }
.roles dt { font-weight: 700; margin-top: 6px; }
.roles dd { margin: 0; color: var(--muted); }
.notice-card { border-color: var(--blue-b); background: var(--soft); margin-bottom: 16px; }
.notice-card h2 { display: flex; align-items: center; gap: 8px; margin: 0 0 6px; }
.notice-card input { width: 100%; }
.danger-card { border-color: var(--red-b); }
.danger-card h2 { color: var(--red); margin: 0 0 6px; }

/* ---------- Benutzermenü ---------- */
.user-drop summary { list-style: none; cursor: pointer; }
.user-drop summary::-webkit-details-marker { display: none; }
.user-btn { display: block; border-radius: 50%; }
.user-head { padding: 8px 12px 10px; border-bottom: 1px solid var(--line-soft); margin-bottom: 4px; display: flex; flex-direction: column; }
.user-head span { font-size: 12.5px; color: var(--muted); }
.dropdown-menu form { margin: 0; }
.dropdown-menu form button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 12px; border: 0; background: none; border-radius: 8px; font: inherit; color: var(--text); cursor: pointer; text-align: left; }
.dropdown-menu form button:hover { background: var(--bg); color: var(--red); }
@media print { .sidebar, .topbar, .card:not(.codes-print) { box-shadow: none; } .sidebar, .topbar, form, .btn { display: none !important; } }

/* ---------- Belege ---------- */
.checklist { background: var(--orange-l); border: 1px solid var(--orange-b); border-radius: 10px; padding: 10px 12px; color: var(--orange-t); }
.checklist ul { list-style: none; margin: 6px 0 0; padding: 0; display: grid; gap: 6px; font-size: 13px; }
.checklist li { display: flex; gap: 6px; align-items: flex-start; }
.checklist li svg { flex: none; margin-top: 2px; }
.danger-zone { border-top: 1px solid var(--line-soft); padding-top: 10px; margin-top: 4px; }
.danger-zone summary { cursor: pointer; font-size: 13px; color: var(--muted); }
.danger-zone[open] summary { margin-bottom: 8px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.logo-preview { display: flex; align-items: center; gap: 14px; margin: 4px 0 8px; }
.logo-preview img { max-height: 48px; max-width: 200px; border: 1px solid var(--line); border-radius: 8px; padding: 4px; background: var(--card); }
.notice-orange svg { color: var(--orange); }
.card-head h2 svg { vertical-align: -3px; color: var(--blue); }

/* ---------- Belegeingang ---------- */
[hidden] { display: none !important; }
.upload-card { padding: 0; overflow: hidden; margin-bottom: 16px; }
.dropzone { border: 2px dashed var(--blue-b); border-radius: 14px; margin: 16px; padding: 26px 18px; text-align: center; background: var(--soft); transition: background .15s, border-color .15s; }
.dropzone.drag { background: var(--blue-l); border-color: var(--blue); }
.dz-icon { color: var(--blue); margin-bottom: 6px; }
.dz-title { font-weight: 700; font-size: 16px; margin: 0 0 4px; color: var(--strong); }
.dropzone .actions { margin-top: 12px; }
.dropzone label.btn { cursor: pointer; }
.camera-btn { display: none; }
@media (hover: none) and (pointer: coarse) { .camera-btn { display: inline-flex; } }
.progress { margin: 16px auto 0; max-width: 520px; text-align: left; }
.progress .bar { height: 8px; background: var(--line-soft); border-radius: 6px; overflow: hidden; }
.progress .bar i { display: block; height: 100%; width: 0; background: var(--blue); transition: width .2s; }
.progress span { font-size: 13px; color: var(--muted); display: block; margin-top: 6px; }
.upload-log { list-style: none; margin: 10px auto 0; padding: 0; max-width: 620px; max-height: 180px; overflow: auto; text-align: left; }
.upload-log li { padding: 3px 0; border-bottom: 1px solid var(--line-soft); }
.upload-log li.ok { color: var(--green); }
.upload-log li.skip { color: var(--orange); }
.inbox-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 18px; border-top: 1px solid var(--line-soft); background: var(--bg); }
.learned { display: inline-block; font-size: 11px; font-weight: 600; color: var(--purple); background: var(--purple-l); border-radius: 6px; padding: 1px 6px; vertical-align: 1px; }
.trunc { max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: inline-block; vertical-align: bottom; }
#receipts-table .name-cell { display: inline-flex; }
#receipts-table td > .small { display: block; margin-left: 26px; }
.receipt-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.receipt-preview { position: sticky; top: 12px; height: calc(100vh - 120px); min-height: 480px; background: var(--card); display: flex; align-items: center; justify-content: center; }
.receipt-preview img { max-width: 100%; max-height: 100%; object-fit: contain; }
.receipt-preview iframe { width: 100%; height: 100%; border: 0; }
@media (max-width: 1100px) { .receipt-layout { grid-template-columns: minmax(0, 1fr); } .receipt-preview { position: static; height: 60vh; } }
.receipt-form h3 { font-size: 15px; }
.vat-lines input, .vat-lines select { width: 100%; min-width: 0; }
.vat-lines td { padding: 6px 6px; }
[data-conf="prüfen"] input, [data-conf="prüfen"] select { border-color: var(--orange-b); background: var(--orange-l); }
[data-conf="sicher"] input, [data-conf="sicher"] select { border-color: var(--green-b); }
[data-conf="ki"] input, [data-conf="vorschlag"] select, [data-conf="gelernt"] select { border-color: #CBB8F5; }
.conf-chip[data-conf="sicher"]::after { content: "sicher erkannt"; font-size: 11px; color: var(--green); background: var(--green-l); border-radius: 6px; padding: 1px 6px; font-weight: 600; }
.conf-chip[data-conf="prüfen"]::after { content: "bitte prüfen"; font-size: 11px; color: var(--orange); background: var(--orange-l); border-radius: 6px; padding: 1px 6px; font-weight: 600; }
.conf-chip[data-conf="ki"]::after { content: "KI"; font-size: 11px; color: var(--purple); background: var(--purple-l); border-radius: 6px; padding: 1px 6px; font-weight: 600; }
.tool-status { list-style: none; padding: 0; margin: 0; display: grid; gap: 5px; }
.tool-status li { display: flex; gap: 6px; align-items: center; }
.tool-status li svg { color: var(--green); }
.tool-status li.bad { color: var(--orange); }
.tool-status li.bad svg { color: var(--orange); }
.bank-table .bank-action { min-width: 340px; }
.bank-action .actions { gap: 6px; }
.bank-action select { width: auto; }
#receipts-table tr.loading td { opacity: .5; }
@media (max-width: 600px) { .vat-lines { min-width: 420px; } .receipt-layout .card { padding: 16px; } .bank-table .bank-action { min-width: 260px; } }
.items .w-type { width: 118px; }
.items .w-disc { width: 84px; }
.items tr[data-type="text"] [name="qty[]"], .items tr[data-type="text"] [name="unit[]"], .items tr[data-type="text"] [name="price[]"], .items tr[data-type="text"] [name="disc[]"], .items tr[data-type="text"] [name="vat[]"] { visibility: hidden; }
.items tr[data-type="text"] [name="desc[]"] { font-weight: 600; }
.items tr[data-type="optional"] td, .items tr[data-type="alternative"] td { background: var(--soft); }
.items tr[data-type="optional"] [data-line], .items tr[data-type="alternative"] [data-line] { color: var(--muted); }
.tpl-select { display: inline-block; width: auto; min-height: 0; padding: 2px 6px; font-size: 12px; margin-left: 8px; font-weight: 400; }
.tpl-link { font-size: 12px; font-weight: 400; margin-left: 8px; }

/* ---------- Kundenportal ---------- */
.portal-body { background: var(--bg); min-height: 100vh; }
.portal { max-width: 860px; margin: 0 auto; padding: 28px 16px 40px; display: flex; flex-direction: column; gap: 16px; }
.portal-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.portal-logo { max-height: 46px; max-width: 220px; }
.portal-firm { font-size: 20px; color: var(--strong); }
.portal-title { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.portal-title h1 { font-size: 24px; margin: 2px 0; }
.row-option td { background: var(--soft); }
.row-text td { background: transparent; }
.portal-accept { border-top: 1px solid var(--line); margin-top: 18px; padding-top: 16px; }
.portal-accept h2 { font-size: 18px; margin: 0 0 12px; }
.portal-pay { display: flex; flex-wrap: wrap; gap: 20px; align-items: flex-start; }
.portal-pay .qr svg { width: 180px; height: 180px; }
.portal-pay h2 { margin: 0 0 6px; }
.portal-files { justify-content: center; }

/* ---------- Protokoll & Betrieb ---------- */
.filter-bar { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; padding: 14px 16px; margin-bottom: 14px; }
.filter-bar .field { min-width: 150px; flex: 0 1 190px; }
.pager { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.table-pager { justify-content: flex-end; gap: 6px; margin: 10px 0 4px; }
.table-pager .btn-sm { min-width: 34px; justify-content: center; }
.table-pager .small { margin-left: 6px; }
.nowrap { white-space: nowrap; }
.change-table details summary { cursor: pointer; color: var(--blue-d); }
table.diff { border-collapse: collapse; margin-top: 6px; font-size: 12.5px; }
table.diff th { text-align: left; font-weight: 600; padding: 3px 10px 3px 0; color: var(--text2); vertical-align: top; white-space: nowrap; }
table.diff td { padding: 3px 8px; vertical-align: top; word-break: break-word; max-width: 320px; }
table.diff td.old { background: var(--red-l); color: var(--red); text-decoration: line-through; border-radius: 4px 0 0 4px; }
table.diff td.new { background: var(--green-l); color: var(--green); border-radius: 0 4px 4px 0; }
.ops-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; margin-bottom: 16px; }
.ops-grid .kpi .value { font-size: 18px; }
.backup-list { list-style: none; margin: 0; padding: 0; }
.backup-list li { display: flex; justify-content: space-between; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line-soft); font-size: 14px; flex-wrap: wrap; }

/* ---------- CRM-Ausbau ---------- */
.board { grid-template-columns: repeat(var(--cols, 6), minmax(250px, 1fr)); min-width: calc(var(--cols, 6) * 264px); }
.tabs.tabs-plain { padding: 0; margin-bottom: 12px; }
.pipeline-filter { border: 0; padding: 0 0 12px; }
.pipeline-filter select { width: auto; min-width: 180px; }
.forecast { display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; align-items: end; }
.fc-col { display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; min-width: 0; }
.fc-bars { position: relative; width: 100%; max-width: 70px; height: 110px; display: flex; align-items: flex-end; justify-content: center; }
.fc-bars i { position: absolute; bottom: 0; width: 100%; border-radius: 6px 6px 2px 2px; }
.fc-v { background: var(--blue-l); }
.fc-w { background: #2F74E0; width: 56% !important; }
.fc-col b { font-size: 13px; }
@media (max-width: 640px) { .forecast { grid-template-columns: repeat(3, 1fr); row-gap: 18px; } }
.file-list { list-style: none; margin: 0 0 12px; padding: 0; }
.file-list li { display: flex; align-items: center; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--line-soft); flex-wrap: wrap; }
.file-list li a { display: inline-flex; gap: 6px; align-items: center; font-weight: 500; min-width: 0; overflow-wrap: anywhere; flex: 1 1 180px; }
.file-list li form { margin-left: auto; }
.file-drop { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 12px; border: 1.5px dashed var(--line2); border-radius: 10px; }
.file-drop.drag { border-color: var(--blue); background: var(--blue-l); }
.file-drop label.btn { cursor: pointer; }
.saved-filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 10px 16px; border-bottom: 1px solid var(--line); }
.saved-filters:empty { display: none; }
.chip-saved { gap: 4px; padding-right: 4px; }
.chip-saved a { color: inherit; text-decoration: none; display: inline-flex; gap: 5px; align-items: center; }
.chip-x { border: 0; background: none; font-size: 16px; line-height: 1; color: var(--muted); cursor: pointer; padding: 2px 6px; border-radius: 10px; }
.chip-x:hover { background: var(--red-l); color: var(--red); }
.save-filter { display: inline-flex; gap: 8px; align-items: center; margin-left: auto; flex-wrap: wrap; }
.save-filter input[name=name] { width: 170px; min-height: 34px; }
.list-filters { display: flex; flex-wrap: wrap; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--line); align-items: flex-end; background: var(--soft); }
.list-filters .field { flex: 0 1 170px; min-width: 140px; }
.list-filters .field label { font-size: 12px; }
.table th a.sort { color: inherit; text-decoration: none; white-space: nowrap; }
.table th a.sort:hover { color: var(--blue-d); }
.table th a.sort.on::after { content: ' ▲'; font-size: 10px; }
.table th a.sort.on.desc::after { content: ' ▼'; }
.dup-box { border: 1px solid var(--orange-b); background: var(--orange-l); border-radius: 10px; padding: 12px 14px; margin-bottom: 14px; }
.dup-box ul { margin: 6px 0 10px; padding-left: 18px; }
.dup-group { padding: 14px 16px; border-bottom: 1px solid var(--line); }
.dup-group:last-child { border-bottom: 0; }
.dup-rows { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 10px; margin: 10px 0; }
.dup-card { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; font-size: 13.5px; }
.dup-card label { display: flex; gap: 8px; align-items: flex-start; font-weight: 600; cursor: pointer; }
.readonly-bar { background: var(--orange-l); color: var(--orange-t); border-bottom: 1px solid var(--orange-b); padding: 9px 20px; font-size: 13.5px; text-align: center; }
/* Kalender Woche/Tag */
.cal-views { display: inline-flex; border: 1px solid var(--line2); border-radius: 9px; overflow: hidden; }
.cal-views a { padding: 6px 12px; font-size: 13px; text-decoration: none; color: var(--text2); background: var(--card); }
.cal-views a + a { border-left: 1px solid var(--line2); }
.cal-views a.active { background: var(--blue-l); color: var(--blue-d); font-weight: 600; }
.week { display: grid; grid-template-columns: 56px repeat(7, minmax(84px, 1fr)); min-width: 660px; }
.week.day { grid-template-columns: 56px 1fr; min-width: 0; }
.week-h.allday-label { font-size: 10.5px; font-weight: 500; color: var(--muted); padding: 8px 2px; }
.week-h { padding: 8px 6px; font-size: 12.5px; font-weight: 600; text-align: center; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--card); z-index: 2; }
.week-h.today { color: var(--blue-d); }
.week-h a { color: inherit; text-decoration: none; }
.week-allday { grid-column: 1 / -1; display: grid; grid-template-columns: inherit; border-bottom: 1px solid var(--line); }
.week-col { position: relative; border-left: 1px solid var(--line-soft); height: calc(var(--hours) * 48px); }
.week-col.today { background: var(--soft); }
.week-times { position: relative; height: calc(var(--hours) * 48px); }
.week-times span { position: absolute; right: 6px; font-size: 11px; color: var(--muted); transform: translateY(-6px); }
.week-times span:first-child { transform: none; top: 2px !important; }
.week-line { position: absolute; left: 0; right: 0; border-top: 1px solid var(--line-soft); }
.week-ev { position: absolute; left: 3px; right: 3px; background: var(--blue-l); border-left: 3px solid var(--blue); border-radius: 6px; padding: 3px 6px; font-size: 12px; overflow: hidden; line-height: 1.3; text-decoration: none; color: var(--text); }
.week-ev.task { background: var(--orange-l); border-left-color: #E08A1E; }
.week-ev small { display: block; color: var(--muted); }
.week-allday-cell { padding: 4px; min-height: 28px; display: flex; flex-direction: column; gap: 3px; border-left: 1px solid var(--line-soft); }
.week-allday-cell .cal-e { font-size: 11.5px; }
.now-line { position: absolute; left: 0; right: 0; border-top: 2px solid #E5484D; z-index: 1; }
.field-highlight input { border-color: #E08A1E; box-shadow: 0 0 0 3px var(--orange-l); }

/* ---------- Schnellsuche Strg+K ---------- */
.search { position: relative; }
.kbd-hint { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); border: 0; background: none; padding: 0; display: flex; gap: 3px; cursor: pointer; }
kbd { display: inline-block; min-width: 20px; padding: 1px 5px; border: 1px solid var(--line2); border-bottom-width: 2px; border-radius: 5px; background: var(--card); font: 600 11px/1.5 inherit; color: var(--text2); text-align: center; }
@media (max-width: 760px) { .kbd-hint { display: none; } }
.palette { position: fixed; inset: 0; z-index: 90; background: rgba(17, 24, 39, .38); display: flex; align-items: flex-start; justify-content: center; padding: 10vh 16px 16px; }
.palette[hidden] { display: none !important; }
.palette-box { width: 100%; max-width: 620px; background: var(--card); border-radius: 14px; box-shadow: 0 24px 60px rgba(17, 24, 39, .3); overflow: hidden; display: flex; flex-direction: column; max-height: 70vh; }
.palette-input { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--line); color: var(--muted); }
.palette-input input { border: 0; outline: 0; box-shadow: none; padding: 4px 0; font-size: 16px; flex: 1; min-height: 0; background: none; }
.palette-list { list-style: none; margin: 0; padding: 6px; overflow-y: auto; }
.palette-group { font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); padding: 10px 10px 4px; }
.palette-item a { display: flex; justify-content: space-between; gap: 12px; padding: 9px 10px; border-radius: 8px; text-decoration: none; color: var(--text); align-items: baseline; }
.palette-item a span { color: var(--muted); font-size: 12.5px; text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 55%; }
.palette-item.sel a { background: var(--blue-l); }
.palette-item.sel a b { color: var(--blue-d); }
.palette-empty { padding: 18px; color: var(--muted); text-align: center; }
.palette-foot { display: flex; gap: 16px; padding: 9px 16px; border-top: 1px solid var(--line); background: var(--soft); flex-wrap: wrap; }
body.palette-open { overflow: hidden; }
@media (min-width: 761px) { .search input[type=search] { padding-right: 76px; } }

/* ---------- Steuer-Ampel & Liquidität ---------- */
.ampel { list-style: none; margin: 0; padding: 0; }
.ampel li a { display: grid; grid-template-columns: 14px 1fr auto; gap: 10px; align-items: center; padding: 9px 10px; border-radius: 8px; text-decoration: none; color: var(--text); }
.ampel li.sel a, .ampel li a:hover { background: var(--blue-l); }
.dot { width: 11px; height: 11px; border-radius: 50%; display: inline-block; }
.dot-green { background: #1E9E5A; } .dot-red { background: #E5484D; } .dot-orange { background: #F08A24; } .dot-yellow { background: #F2C94C; } .dot-blue { background: #A9C8F5; }
.uva-table td.mono { font-variant-numeric: tabular-nums; color: var(--text2); }
.uva-total td { font-weight: 700; border-top: 2px solid var(--line); }
.liq-wrap { width: 100%; overflow-x: auto; }
.liq-chart { width: 100%; min-width: 560px; height: auto; display: block; }
.liq-form { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.liq-form .field { flex: 1 1 180px; }
.progress { height: 12px; background: var(--line-soft); border-radius: 6px; overflow: hidden; }
.progress i { display: block; height: 100%; background: var(--blue); border-radius: 6px; transition: width .3s; }
.mail-pre { white-space: pre-wrap; font-family: inherit; background: var(--soft); border: 1px solid var(--line); border-radius: 8px; padding: 12px; margin: 0; overflow-wrap: anywhere; }
.recipient-list { list-style: none; padding: 0; margin: 6px 0; }
.recipient-list li { padding: 3px 0; border-bottom: 1px solid var(--line-soft); overflow-wrap: anywhere; }
.code-block { background: #0F172A; color: #E2E8F0; border-radius: 10px; padding: 14px 16px; font: 12.5px/1.55 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; overflow-x: auto; white-space: pre; margin: 8px 0; }
.alert-link { text-decoration: none; margin-bottom: 12px; align-items: center; } .alert-link span { flex: 1; } .alert-link:hover { filter: brightness(.98); }
.dot-gray { background: #D5DBE3; }

/* ---------- Reiter in den Einstellungen ---------- */
.settings-tabs { margin: 0 0 18px; padding: 0; background: transparent; scrollbar-width: none; }
.settings-tabs::-webkit-scrollbar { display: none; }
.settings-tabs a { display: inline-flex; align-items: center; gap: 7px; }
.settings-tabs a svg { opacity: .75; }
.settings-tabs a.active svg { opacity: 1; }
.tab-pane > .card:first-child, .tab-pane > form:first-child { margin-top: 0; }
.tab-pane[hidden] { display: none !important; }
.settings-links { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.settings-links .card-link { display: grid; grid-template-columns: 40px 1fr; grid-template-rows: auto auto; column-gap: 12px; row-gap: 2px; align-items: center; padding: 16px 18px; text-decoration: none; color: var(--text); }
.settings-links .card-link .feed-ic { grid-row: 1 / 3; }
.settings-links .card-link:hover { border-color: var(--blue-b); }

/* ---------- Ladeanzeige in Knöpfen ---------- */
.btn.is-loading { position: relative; pointer-events: none; opacity: .85; }
.btn.is-loading > svg { visibility: hidden; width: 16px; }
.btn.is-loading::before { content: ""; width: 15px; height: 15px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: kv-spin .7s linear infinite; flex: none; }
.btn.is-loading > svg:first-child { display: none; }
.icon-btn.is-loading > svg { visibility: hidden; }
.icon-btn.is-loading { position: relative; }
.icon-btn.is-loading::after { content: ""; position: absolute; inset: 0; margin: auto; width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--blue); border-right-color: transparent; animation: kv-spin .7s linear infinite; }
@keyframes kv-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .btn.is-loading::before, .icon-btn.is-loading::after { animation-duration: 2s; } }
.profile > .grow { flex: 1 1 280px; } .profile > .actions { flex-wrap: wrap; }

/* ---------- Live-Demo (nur im Demo-Paket aktiv) ---------- */
.demo-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 16px; padding: 8px 18px; background: #1D5FD1; color: #fff; font-size: 13.5px; }
.demo-bar svg { vertical-align: -3px; }
.demo-bar-actions { display: flex; gap: 14px; align-items: center; }
.demo-bar a { color: #fff; font-weight: 600; }
.demo-bar .demo-buy { background: var(--card); color: #1D5FD1; border-radius: 8px; padding: 4px 12px; text-decoration: none; }
.demo-lobby h2 { font-size: 16px; margin: 6px 0 0; }
.demo-branches { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.demo-countries { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.demo-branches .radio-card b svg { vertical-align: -3px; color: var(--blue); }
@media (max-width: 600px) { .demo-countries { grid-template-columns: 1fr; } }

/* ---------- UID-Prüfung ---------- */
.badge-link { text-decoration: none; }
.uid-override { border: 1px dashed var(--red-b); border-radius: 10px; padding: 10px 12px; background: var(--red-l); }
.print-doc { background: var(--card); }
.uid-proof { max-width: 720px; margin: 0 auto; padding: 40px 24px; }
.uid-proof h1 { font-size: 24px; margin: 4px 0 6px; }
.uid-proof .table th { width: 42%; text-align: left; color: var(--muted); font-weight: 600; }
@media print { .no-print { display: none !important; } .uid-proof { padding: 0; } }

/* ---------- Kleinunternehmer-Wächter ---------- */
.ku-watch .ku-amount { font-size: 15px; }
.ku-watch .ku-amount b { font-size: 22px; color: var(--strong); }
.ku-bar { position: relative; height: 12px; background: var(--line-soft); border-radius: 6px; margin: 10px 0 4px; overflow: visible; }
.ku-bar i { display: block; height: 100%; border-radius: 6px; background: var(--green); transition: width .4s; }
.ku-orange .ku-bar i { background: #E08A1E; }
.ku-red .ku-bar i { background: var(--red); }
.ku-mark { position: absolute; top: -4px; bottom: -4px; width: 2px; background: var(--strong); opacity: .55; border-radius: 1px; }
.ku-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 6px 14px; margin: 10px 0 0; }
.ku-facts dt { color: var(--muted); }
.ku-facts dd { margin: 0; font-weight: 600; color: var(--strong); }
.ku-red { border-color: var(--red-b); }
.ku-orange { border-color: var(--orange-b); }

/* ---------- Unterschrift ---------- */
.sig-pad { position: relative; border: 1.5px dashed #AFC3DE; border-radius: 12px; background: var(--soft); touch-action: none; max-width: 600px; }
.sig-pad canvas { display: block; width: 100%; height: auto; aspect-ratio: 600 / 180; cursor: crosshair; touch-action: none; }
.sig-hint { position: absolute; left: 18px; bottom: 14px; color: #9AA9BF; font-size: 13px; pointer-events: none; border-top: 1px solid #C9D6E8; padding-top: 4px; width: 55%; }
.sig-pad.has-sig .sig-hint { opacity: 0; }
.sig-clear { position: absolute; top: 8px; right: 8px; }
.sig-img { display: block; max-width: 100%; height: auto; }
.portal-accepted { border-top: 1px solid var(--line); margin-top: 18px; padding-top: 14px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.portal-accepted > div { display: flex; flex-direction: column; gap: 2px; }
.portal-accepted b { color: var(--green); display: inline-flex; gap: 6px; align-items: center; }
.accepted-box { background: var(--green-l); border: 1px solid var(--green-b); border-radius: 10px; padding: 10px 12px; margin-top: 8px; }
.accepted-box .sig-img { margin-top: 6px; background: var(--card); border-radius: 8px; }

/* ---------- Online-Terminbuchung ---------- */
.booking-body.is-embed { background: transparent; }
.booking-body.is-embed .booking { padding-top: 4px; }
.booking-card h1 { font-size: 22px; margin: 0 0 6px; }
.booking-steps { list-style: none; display: flex; gap: 6px; padding: 0; margin: 0 0 18px; counter-reset: st; flex-wrap: wrap; }
.booking-steps li { counter-increment: st; font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 6px; padding: 4px 10px 4px 4px; border-radius: 16px; background: var(--line-soft); }
.booking-steps li::before { content: counter(st); width: 22px; height: 22px; border-radius: 50%; background: #fff; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 12px; }
.booking-steps li.on { background: var(--blue-l); color: var(--blue-d); font-weight: 600; }
.booking-steps li.on::before { background: var(--blue); color: #fff; }
.booking-steps li.done { color: var(--green); }
.booking-steps li.done::before { content: '✓'; background: var(--green-l); }
.booking-types { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; margin-top: 14px; }
.booking-type { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; border: 1px solid var(--line); border-radius: 12px; padding: 16px; text-decoration: none; color: var(--text); background: var(--card); transition: border-color .15s, box-shadow .15s; }
.booking-type:hover { border-color: var(--blue); box-shadow: var(--shadow); color: var(--text); }
.booking-type b { font-size: 16px; color: var(--strong); }
.booking-type .badge { display: inline-flex; gap: 4px; align-items: center; }
.booking-chosen { display: flex; justify-content: space-between; gap: 10px; align-items: center; background: var(--bg); border-radius: 10px; padding: 10px 14px; margin-bottom: 16px; }
.booking-days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; margin-top: 8px; }
.booking-day { display: flex; flex-direction: column; align-items: center; gap: 0; padding: 10px 4px; border: 1px solid var(--blue-b); border-radius: 12px; background: var(--card); text-decoration: none; color: var(--text); font-size: 12px; }
.booking-day b { font-size: 20px; color: var(--strong); line-height: 1.2; }
.booking-day i { font-style: normal; font-size: 11px; color: var(--green); margin-top: 3px; }
a.booking-day:hover { border-color: var(--blue); background: var(--blue-l); color: var(--text); }
.booking-day.is-off { border-color: var(--line-soft); background: var(--bg); color: #A0AABA; }
.booking-day.is-off b { color: #A0AABA; }
.booking-day.is-off i { color: #A0AABA; }
.booking-slots { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 8px; margin-top: 8px; }
.booking-slot { display: block; text-align: center; padding: 11px 0; border: 1px solid var(--blue-b); border-radius: 10px; font-weight: 600; text-decoration: none; color: var(--blue-d); background: var(--card); }
.booking-slot:hover { background: var(--blue); border-color: var(--blue); color: #fff; }
.booking-when { display: flex; gap: 8px; align-items: center; background: var(--blue-l); color: var(--blue-dd); border-radius: 10px; padding: 10px 14px; margin: 4px 0 14px; }
.booking-form .hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.booking-done { text-align: center; margin-bottom: 14px; }
.booking-check { width: 60px; height: 60px; border-radius: 50%; background: var(--green-l); color: var(--green); display: inline-flex; align-items: center; justify-content: center; margin-bottom: 8px; }
.booking-summary { display: grid; gap: 0; border: 1px solid var(--line); border-radius: 12px; margin: 0 0 16px; overflow: hidden; }
.booking-summary > div { display: grid; grid-template-columns: 110px 1fr; gap: 10px; padding: 10px 14px; border-top: 1px solid var(--line-soft); }
.booking-summary > div:first-child { border-top: 0; }
.booking-summary dt { color: var(--muted); font-size: 13px; }
.booking-summary dd { margin: 0; font-weight: 600; }
@media (max-width: 560px) { .booking-days { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.copy-row { display: flex; gap: 8px; align-items: flex-start; }
.copy-row input, .copy-row textarea { flex: 1; min-width: 0; }
.embed-code { margin-top: 10px; }
.embed-code summary { cursor: pointer; font-weight: 600; font-size: 14px; color: var(--blue-d); margin-bottom: 8px; }
.booking-qr .qr svg { width: 150px; height: 150px; }
.hours-grid { display: grid; grid-template-columns: 150px minmax(0, 420px); gap: 8px 14px; align-items: center; }
@media (max-width: 560px) { .hours-grid { grid-template-columns: 1fr; } }
.grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.grid-4 .span-4 { grid-column: span 4; }
@media (max-width: 900px) { .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .grid-4 .span-4 { grid-column: span 2; } }
@media (max-width: 560px) { .grid-4 { grid-template-columns: 1fr; } .grid-4 .span-2, .grid-4 .span-4 { grid-column: auto; } }
.toggle-big { background: var(--blue-l); border: 1px solid var(--blue-b); border-radius: 10px; padding: 12px 14px; }

/* ---------- Zwei-Faktor: Gerät merken ---------- */
.remember-device { align-items: flex-start; font-size: 14px; line-height: 1.4; }
.remember-device input { margin-top: 2px; }
.trusted-list { background: var(--bg); border-radius: 10px; padding: 10px 14px; margin: 10px 0; }
.trusted-list ul { list-style: none; padding: 0; margin: 6px 0 8px; display: grid; gap: 4px; }
.trusted-list li svg { color: var(--green); vertical-align: -2px; }
.portal-online h2 { margin: 0 0 4px; }
.portal-online .actions { margin-top: 12px; }

/* Steuerberater & Kanzlei */
.check-list { list-style: none; padding: 0; margin: 0 0 12px; display: grid; gap: 8px; }
.check-list li { display: flex; gap: 8px; align-items: flex-start; }
.check-list li svg { flex: none; margin-top: 3px; color: var(--green, #16a34a); }
.card-flush .card-head.pad, .card-head.pad { padding: 16px 20px 0; }
.kz-table td.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.kz-table tr.kz-total td { font-weight: 700; border-top: 2px solid var(--line); }
.kz { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; color: var(--text2); width: 56px; }
.mandant-kpis { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.mandant-kpis .card { padding: 14px 16px; }
.mandant-kpis b { display: block; font-size: 24px; letter-spacing: -.02em; }
.mandant-kpis span { color: var(--text2); font-size: 13px; }
@media (max-width: 900px) { .mandant-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 6px; vertical-align: 1px; background: #9aa3b2; }
.dot-green { background: #16a34a; } .dot-yellow { background: #eab308; } .dot-orange { background: #f97316; } .dot-red { background: #dc2626; } .dot-blue { background: #2563eb; } .dot-gray { background: #9aa3b2; }
.upload-hero { text-align: center; padding: 28px 18px; }
.upload-hero .btn-lg { width: 100%; max-width: 360px; justify-content: center; margin: 6px auto; display: flex; }
.miss-item { display: flex; gap: 12px; align-items: center; justify-content: space-between; padding: 12px 0; border-top: 1px solid var(--line); }
.miss-item:first-child { border-top: 0; }
.konto-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px 16px; }
.konto-grid .field input { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.sure-chip { font-size: 11px; font-weight: 600; color: var(--green); background: var(--green-l); border-radius: 99px; padding: 1px 7px; margin-left: 4px; }
.notice-green { background: var(--green-l); border-color: var(--green-b); color: var(--green-t); }
.notice-green svg { color: var(--green); }
.inline-form { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.inline-form input { flex: 1; min-width: 180px; }
.mb { margin-bottom: 14px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 14px; }
[data-dir][hidden] { display: none !important; }
.notice-row { display: flex; flex-wrap: wrap; gap: 14px 20px; align-items: center; justify-content: space-between; background: var(--blue-l); border-color: var(--line2); }
.notice-row .actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.notice-row select { width: auto; }
.text-orange { color: var(--orange); }

/* Eigenes Aussehen */
.swatches { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; }
.swatch { position: relative; cursor: pointer; }
.swatch input { position: absolute; opacity: 0; }
.swatch span:first-of-type { display: block; aspect-ratio: 1; border-radius: 10px; border: 2px solid #fff; box-shadow: 0 0 0 1px var(--line); }
.swatch input:checked + span { box-shadow: 0 0 0 2px var(--strong); }
.swatch input:focus-visible + span { outline: 2px solid var(--strong); outline-offset: 2px; }
.brand-logo { display: block; max-width: 190px; width: auto; object-fit: contain; border-radius: 6px; }
.auth-brand .brand-logo { max-width: 240px; }
.brand-initial { display: inline-grid; place-items: center; flex: none; border-radius: 10px; background: var(--blue); color: #fff; font-weight: 800; font-size: 17px; }

/* Positionen: zweizeilig – oben Art und Beschreibung über die ganze Breite, darunter die Zahlen */
.items thead { display: none; }
.items, .items tbody { display: block; width: 100%; }
.items tr.item { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); grid-template-areas: "type type type desc desc desc desc desc desc desc desc del" "qty qty unit unit price price disc disc vat vat sum sum"; gap: 8px 10px; padding: 14px 20px; border-bottom: 1px solid var(--line); }
.items[data-small="1"] tr.item { grid-template-areas: "type type type desc desc desc desc desc desc desc desc del" "qty qty unit unit price price price disc disc sum sum sum"; }
.items .c-del { justify-self: end; }
.items tr.item td { display: block; padding: 0; border: 0; min-width: 0; }
.items tr.item td[data-l]::before { content: attr(data-l); display: block; font-size: 12px; font-weight: 600; color: var(--muted); margin-bottom: 4px; }
.items .c-type { grid-area: type; } .items .c-desc { grid-area: desc; } .items .c-del { grid-area: del; align-self: end; padding-bottom: 4px !important; }
.items .c-qty { grid-area: qty; } .items .c-unit { grid-area: unit; } .items .c-price { grid-area: price; } .items .c-disc { grid-area: disc; } .items .c-vat { grid-area: vat; }
.items .c-sum { grid-area: sum; text-align: right; font-weight: 600; align-self: end; padding-bottom: 9px !important; }
.items tr.item input, .items tr.item select { width: 100%; }
.items tr[data-type="text"] .c-qty, .items tr[data-type="text"] .c-unit, .items tr[data-type="text"] .c-price, .items tr[data-type="text"] .c-disc, .items tr[data-type="text"] .c-vat, .items tr[data-type="text"] .c-sum { display: none; }
.items tr.item:has(td.muted) { display: block; }
@media (max-width: 640px) {
  .items tr.item { grid-template-columns: repeat(2, minmax(0, 1fr)) 36px; grid-template-areas: "type type del" "desc desc desc" "qty unit unit" "price disc disc" "vat sum sum"; padding: 14px 16px; }
  .items[data-small="1"] tr.item { grid-template-areas: "type type del" "desc desc desc" "qty unit unit" "price disc disc" "sum sum sum"; }
}

/* Datei-Feld zum Hineinziehen */
.filedrop { position: relative; display: flex; align-items: center; gap: 14px; min-height: 76px; padding: 14px 18px; border: 2px dashed var(--line2); border-radius: 12px; background: var(--soft); transition: border-color .15s, background .15s; min-width: 0; }
.actions > .filedrop { flex: 1 1 280px; }
.filedrop:hover, .filedrop.is-over { border-color: var(--blue); background: var(--blue-l, var(--blue-l)); }
.filedrop.has-file { border-style: solid; border-color: var(--green-b); background: var(--green-l); }
.filedrop input[type="file"] { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.filedrop-ic { flex: none; width: 42px; height: 42px; border-radius: 50%; background: var(--card); border: 1px solid var(--line, #E3E8EF); color: var(--blue); display: grid; place-items: center; }
.filedrop-ic svg { width: 20px; height: 20px; }
.filedrop.has-file .filedrop-ic { color: var(--green); }
.filedrop-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.filedrop-text b { font-size: 14.5px; overflow-wrap: anywhere; }
.filedrop-text small { font-size: 12.5px; color: var(--muted, #5B6474); }
.filedrop input[type="file"]:focus-visible { outline: none; }
.filedrop:focus-within { box-shadow: 0 0 0 3px rgba(37, 99, 235, .2); }
.actions > .filedrop { margin-right: 4px; }

/* Kontenplan: eigene Konten */
.konto-eigen { margin-top: 16px; padding-top: 14px; border-top: 1px dashed var(--line, #E3E8EF); display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.konto-eigen-h { font-size: 14px; margin: 0; color: var(--muted, #5B6474); }
.konto-row { display: grid; grid-template-columns: 130px minmax(0, 1fr) 36px; gap: 8px; width: 100%; max-width: 620px; align-items: center; }

.quote-chip { display: inline-block; padding: 2px 8px; border-radius: 999px; font-weight: 600; font-size: 12.5px; }
.quote-chip.q-hi { background: var(--green-l); color: var(--green); } .quote-chip.q-mid { background: var(--orange-l); color: var(--orange-t); } .quote-chip.q-lo { background: var(--red-l); color: var(--red); }
.split-form { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.split-form input { width: 140px; min-height: 34px; padding: 5px 9px; }

/* Kanzlei-Buchung: Betragszeilen zweizeilig (oben Beträge, darunter Konto und Kostenstelle für Splitbuchungen) */
.vat-split thead { display: none; }
.vat-split, .vat-split tbody, .vat-split tfoot { display: block; width: 100%; }
.vat-split tbody tr { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr) 34px; grid-template-areas: "rate net vat gross del" "lk lk lc lc ."; gap: 6px 8px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.vat-split tbody td { display: block; padding: 0 !important; border: 0; min-width: 0; }
.vat-split tbody td[data-l]::before { content: attr(data-l); display: block; font-size: 11.5px; font-weight: 600; color: var(--text2); margin-bottom: 3px; }
.vat-split .c-rate { grid-area: rate; } .vat-split .c-net { grid-area: net; } .vat-split .c-vat { grid-area: vat; } .vat-split .c-gross { grid-area: gross; align-self: end; padding-bottom: 9px !important; }
.vat-split .c-lk { grid-area: lk; } .vat-split .c-lc { grid-area: lc; } .vat-split .c-del { grid-area: del; align-self: end; padding-bottom: 4px !important; }
.vat-split input, .vat-split select { width: 100%; }
.vat-split tfoot tr { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr) 34px; gap: 8px; padding-top: 10px; align-items: center; }
.vat-split tfoot td { display: block; padding: 0; border: 0; }

/* Testversion */
.trial-bar { display: flex; align-items: center; justify-content: center; gap: 6px 16px; flex-wrap: wrap; text-align: center; background: linear-gradient(90deg, #1D4ED8, #2563EB); color: #fff; padding: 9px 20px; font-size: 13.5px; }
.trial-bar svg { vertical-align: -2px; }
.trial-buy { background: #fff; color: #1D4ED8 !important; font-weight: 700; padding: 4px 14px; border-radius: 999px; text-decoration: none; white-space: nowrap; }
.trial-buy:hover { background: var(--blue-l); }
.nav-extra { margin-left: auto; font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; padding: 2px 6px; border-radius: 6px; background: var(--orange-l); color: var(--orange-t); }
.trial-extra { background: var(--orange-l); border-color: var(--orange-b); }

.trial-reset { color: #DCE8FB !important; font-size: 13px; text-decoration: underline; text-underline-offset: 2px; }
.trial-reset:hover { color: #fff !important; }

.support-bar { display: flex; align-items: center; justify-content: center; gap: 6px 14px; flex-wrap: wrap; background: #7C2D12; color: #fff; padding: 8px 16px; font-size: 14px; text-align: center; }
.support-bar form { display: inline; margin: 0; }
.support-bar button { background: none; border: 0; padding: 0; color: #fff; font: inherit; font-weight: 700; text-decoration: underline; cursor: pointer; }

/* ---------- Notariat ---------- */
.notar-kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.notar-kpis a.card { color: inherit; text-decoration: none; }
.actions-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.notar-typen { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px; }
.kind-card { display: flex; gap: 10px; align-items: center; border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; cursor: pointer; background: var(--card); }
.kind-card:hover { border-color: #9DB5D8; }
.kind-card input { position: absolute; opacity: 0; pointer-events: none; }
.kind-card b { font-size: 14px; }
.kind-ic { flex: none; width: 36px; height: 36px; border-radius: 9px; background: var(--line-soft); color: var(--text2); display: flex; align-items: center; justify-content: center; }
.kind-card:has(input:checked) { border: 2px solid var(--blue); padding: 9px 11px; background: var(--blue-l); }
.kind-card:has(input:checked) .kind-ic { background: var(--blue); color: #fff; }
.kind-card:has(input:focus-visible) { box-shadow: 0 0 0 3px var(--blue-l); }
.akt-grid { display: grid; grid-template-columns: 330px minmax(0, 1fr); gap: 16px; align-items: start; margin-top: 8px; }
.akt-side .card + .card, .akt-main > .card + .card, .akt-main > div + .card { margin-top: 16px; }
.akt-main > .card:first-child { margin-top: 0; }
@media (max-width: 1000px) { .akt-grid { grid-template-columns: 1fr; } }
.np-steps { list-style: none; margin: 8px 0; padding: 0; display: grid; gap: 2px; }
.np-steps li { display: flex; align-items: flex-start; justify-content: space-between; gap: 6px; padding: 6px 4px; border-radius: 8px; }
.np-steps li:hover { background: var(--line-soft); }
.np-step { display: flex; gap: 10px; align-items: flex-start; flex: 1; font-size: 14px; }
.np-check { flex: none; width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--line2); background: #fff; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; padding: 0; color: #fff; margin-top: 1px; }
.np-steps li.done .np-check { background: var(--green); border-color: var(--green); }
.np-steps li.done > form > span, .np-public li.done > span { color: var(--text2); }
.np-steps li.now .np-check { border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-l); }
.np-public li { justify-content: flex-start; gap: 10px; font-size: 15px; }
.np-public li:hover { background: none; }
.np-del { opacity: 0; }
.np-steps li:hover .np-del { opacity: 1; }
.np-del .icon-btn, .nd-file .icon-btn { width: 24px; height: 24px; border-radius: 6px; border: 0; background: transparent; }
.np-add { display: flex; gap: 6px; align-items: center; margin: 4px 0 8px; }
.np-add input[name=label] { flex: 1; min-width: 0; }
.np-bar { height: 10px; background: var(--line-soft); border-radius: 6px; overflow: hidden; }
.np-bar span { display: block; height: 100%; background: var(--green); border-radius: 6px; }
td .np-bar { height: 8px; margin-bottom: 4px; }
.nd-list { list-style: none; margin: 12px 0 0; padding: 0; border-top: 1px solid var(--line); }
.nd-row { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; padding: 9px 0; border-bottom: 1px solid var(--line); }
.nd-main { display: flex; flex-wrap: wrap; gap: 6px 8px; align-items: center; min-width: 0; }
.nd-label { font-size: 14px; font-weight: 500; }
.nd-entfaellt .nd-label { color: var(--muted); text-decoration: line-through; }
.nd-file { display: inline-flex; align-items: center; gap: 2px; font-size: 13px; background: var(--line-soft); border-radius: 6px; padding: 1px 4px 1px 8px; }
div.nd-file { display: flex; background: none; padding: 4px 0; }
.nd-actions { display: flex; gap: 6px; align-items: flex-start; flex: none; }
.nd-more { position: relative; }
.nd-more summary { list-style: none; }
.nd-more summary::-webkit-details-marker { display: none; }
.nd-menu { position: absolute; right: 0; top: 36px; z-index: 20; width: 300px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 12px 30px rgba(15, 23, 42, .14); padding: 12px; display: grid; gap: 10px; }
.nd-menu form { display: flex; gap: 6px; flex-wrap: wrap; }
.nd-menu input[name=note] { flex: 1; min-width: 0; }
.nd-menu input[type=file] { font-size: 12px; max-width: 100%; }
.bet-head { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.bet-head h2 { margin: 2px 0 2px; }
.bet-role { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--blue-d); }
.bet-badges { display: flex; gap: 6px; flex-wrap: wrap; align-items: flex-start; }
.badge-link { text-decoration: none; }
.bet-link { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 12px; }
.bet-link input { flex: 1; min-width: 200px; font-size: 13px; color: var(--text2); background: var(--line-soft); }
.gwg-form h2 { font-size: 17px; }
@media (max-width: 700px) { .notar-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } .nd-row { flex-direction: column; } .nd-menu { right: auto; left: 0; } }
.notar-toolbar input[type=search] { flex: 1; min-width: 220px; width: auto; }
.notar-toolbar select { width: auto; }
.flash.flash-bad { background: var(--red-l); color: var(--red); border-color: var(--red-b); }

/* Als App installieren */
.nav-link.install-app { width: 100%; background: none; border: 0; font: inherit; text-align: left; cursor: pointer; color: inherit; }
.nav-link.install-app[hidden] { display: none; }
.app-card h2 { display: flex; align-items: center; gap: 8px; }
.app-done { color: var(--green, #15803d); display: flex; align-items: center; gap: 6px; margin: 0; }
.app-howto summary { cursor: pointer; }
.app-howto ul { margin: 10px 0; padding-left: 18px; display: grid; gap: 6px; }

.menu-danger, .menu-danger svg { color: var(--red, #dc2626) !important; }

/* ---------- Design-Umschalter ---------- */
.menu-theme { display: flex; flex-direction: column; gap: 6px; padding: 8px 10px; border-top: 1px solid var(--line-soft); border-bottom: 1px solid var(--line-soft); margin: 4px 0; }
.menu-theme > span { font-size: 12px; color: var(--muted); font-weight: 600; }
.theme-switch { display: inline-flex; border: 1px solid var(--line2); border-radius: 9px; overflow: hidden; background: var(--soft); }
.theme-switch button { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 5px; border: 0; background: none; color: var(--text2); font: inherit; font-size: 12.5px; padding: 6px 9px; cursor: pointer; min-height: 32px; white-space: nowrap; }
.theme-switch button + button { border-left: 1px solid var(--line2); }
.theme-switch button[aria-pressed="true"] { background: var(--card); color: var(--blue-d); font-weight: 600; box-shadow: inset 0 0 0 1px var(--blue-b); }
.dropdown-menu .theme-switch button { width: auto; }
.theme-fab { position: fixed; top: 14px; right: 14px; z-index: 50; width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line2); background: var(--card); color: var(--text2); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; box-shadow: var(--shadow); }
.theme-fab:hover { color: var(--blue-d); border-color: var(--blue-b); }
.theme-fab .th-light { display: none; }
:root[data-theme="dark"] .theme-fab .th-dark { display: none; }
:root[data-theme="dark"] .theme-fab .th-light { display: inline-flex; }
@media (prefers-color-scheme: dark) {
  :root[data-theme="auto"] .theme-fab .th-dark { display: none; }
  :root[data-theme="auto"] .theme-fab .th-light { display: inline-flex; }
}
@media print { .theme-fab { display: none; } }

/* Feinheiten im dunklen Design */
:root[data-theme="dark"] .btn-primary:hover { background: var(--blue); border-color: var(--blue); filter: brightness(1.12); }
:root[data-theme="dark"] .print-doc, :root[data-theme="dark"] .receipt-preview:not(.rv), :root[data-theme="dark"] .qr, :root[data-theme="dark"] .sig-pad, :root[data-theme="dark"] .accepted-box .sig-img, :root[data-theme="dark"] .logo-preview img { background: #fff; color: #1F2937; }
:root[data-theme="dark"] img.portal-logo { background: #fff; border-radius: 8px; padding: 4px; }
@media (prefers-color-scheme: dark) {
  :root[data-theme="auto"] .btn-primary:hover { background: var(--blue); border-color: var(--blue); filter: brightness(1.12); }
  :root[data-theme="auto"] .print-doc, :root[data-theme="auto"] .receipt-preview:not(.rv), :root[data-theme="auto"] .qr, :root[data-theme="auto"] .sig-pad, :root[data-theme="auto"] .accepted-box .sig-img, :root[data-theme="auto"] .logo-preview img { background: #fff; color: #1F2937; }
  :root[data-theme="auto"] img.portal-logo { background: #fff; border-radius: 8px; padding: 4px; }
}

/* ---------- Bestätigungsfenster ---------- */
.kv-confirm-back { position: fixed; inset: 0; z-index: 1000; background: rgba(15, 23, 42, .45); display: flex; align-items: center; justify-content: center; padding: 16px; animation: kvc-fade .12s ease-out; }
.kv-confirm { width: 100%; max-width: 460px; background: var(--card); color: var(--text); border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 24px 60px rgba(15, 23, 42, .35); padding: 22px 22px 18px; display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; animation: kvc-pop .14s ease-out; }
.kv-confirm-ic { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; background: var(--blue-l); color: var(--blue-d); grid-row: span 1; }
.kv-confirm-ic.is-danger { background: var(--red-l); color: var(--red); }
.kv-confirm-text h2 { font-size: 16.5px; font-weight: 650; margin: 2px 0 6px; line-height: 1.35; }
.kv-confirm-text p { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.5; }
.kv-confirm-actions { grid-column: 1 / -1; display: flex; justify-content: flex-end; gap: 10px; margin-top: 16px; flex-wrap: wrap; }
.btn-danger-solid { background: var(--red); border-color: var(--red); color: var(--card); }
.btn-danger-solid:hover { filter: brightness(1.08); color: #fff; border-color: var(--red); }
body.kv-modal-open { overflow: hidden; }
@keyframes kvc-fade { from { opacity: 0; } }
@keyframes kvc-pop { from { opacity: 0; transform: translateY(6px) scale(.98); } }
@media (max-width: 520px) { .kv-confirm-actions .btn { flex: 1; } }
:root[data-theme="dark"] .btn-danger-solid { background: #C2372C; border-color: #C2372C; }
@media (prefers-color-scheme: dark) { :root[data-theme="auto"] .btn-danger-solid { background: #C2372C; border-color: #C2372C; } }

/* ---------- Beleg-Vorschau mit Drehen und Markieren ---------- */
.receipt-preview.rv { display: flex; flex-direction: column; align-items: stretch; justify-content: flex-start; overflow: hidden; }
.rv-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 8px 10px; border-bottom: 1px solid var(--line); background: var(--card); }
.rv-group { display: inline-flex; align-items: center; gap: 4px; }
.rv-group .icon-btn { width: 32px; height: 32px; font-size: 17px; font-weight: 600; }
.rv-next svg { transform: rotate(180deg); }
.rv-pageinfo { font-size: 13px; color: var(--muted); min-width: 44px; text-align: center; }
.rv-orig { margin-left: auto; }
.rv-hint { margin: 0; display: flex; gap: 8px; align-items: flex-start; padding: 8px 12px; font-size: 13px; color: var(--text2); background: var(--soft); border-bottom: 1px solid var(--line-soft); }
.rv-hint svg { flex: none; margin-top: 2px; color: var(--blue-d); }
.rv-hint.is-armed { background: var(--blue-l); color: var(--blue-dd); font-weight: 600; }
.rv-hint.is-busy { background: var(--blue-l); }
.rv-hint.is-ok { background: var(--green-l); color: var(--green-t); }
.rv-hint.is-error { background: var(--orange-l); color: var(--orange-t); }
.rv-scroll { flex: 1; overflow: auto; background: var(--col); padding: 12px; }
.rv-page { position: relative; width: 100%; margin: 0 auto; cursor: crosshair; user-select: none; -webkit-user-select: none; touch-action: pan-x pan-y pinch-zoom; }
.rv.rv-armed .rv-page { touch-action: none; }
.rv-page img { display: block; width: 100%; height: auto; max-width: none; max-height: none; background: #fff; box-shadow: 0 1px 3px rgba(15, 23, 42, .18); border-radius: 2px; pointer-events: none; }
.rv-sel { position: absolute; border: 2px solid var(--blue); background: rgba(37, 99, 235, .14); border-radius: 3px; pointer-events: none; }
.rv-sel.is-busy { animation: rv-pulse .8s ease-in-out infinite alternate; }
@keyframes rv-pulse { to { background: rgba(37, 99, 235, .32); } }
.field.rv-target input, .field.rv-target textarea, input.rv-target { border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-l); }
.field.rv-filled input, .field.rv-filled textarea, input.rv-filled { animation: rv-flash 1.2s ease-out; }
@keyframes rv-flash { from { background: var(--green-l); border-color: var(--green); } }
@media (max-width: 1100px) { .receipt-preview.rv { height: 70vh; } }

/* Belege im Hintergrund lesen */
.bg-read { display: block; }
.bg-read-row { display: flex; align-items: center; gap: 10px; }
.bg-read-bar { height: 4px; border-radius: 2px; background: var(--line); margin-top: 8px; overflow: hidden; }
.bg-read-bar i { display: block; height: 100%; width: 0; background: var(--blue); transition: width .3s; }
.bg-read.is-done { background: var(--green-l); border-color: var(--green-b); color: var(--green-t); }
.bg-read.is-done .spinner, .bg-read.is-done .bg-read-bar { display: none; }
.spinner { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--blue-b); border-top-color: var(--blue); animation: spin .8s linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }
#receipts-table tr.loading td[data-f="method"]::after { content: " wird gelesen …"; color: var(--muted); font-size: 12px; }
@media (max-width: 700px) { .rv-orig { display: none; } .rv-bar { padding: 6px 8px; } }

/* ---------- Sperre während Hochladen/Lesen ---------- */
.kv-busy { position: fixed; inset: 0; z-index: 1100; background: rgba(15, 23, 42, .5); display: flex; align-items: center; justify-content: center; padding: 16px; animation: kvc-fade .15s ease-out; cursor: progress; }
.kv-busy-box { width: 100%; max-width: 380px; background: var(--card); color: var(--text); border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 24px 60px rgba(15, 23, 42, .35); padding: 24px 22px; display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; }
.kv-busy-box b { font-size: 16px; color: var(--strong); }
.kv-busy-spin { width: 34px; height: 34px; border-radius: 50%; border: 3px solid var(--blue-b); border-top-color: var(--blue); animation: spin .8s linear infinite; margin-bottom: 4px; }
.kv-busy-bar { width: 100%; height: 6px; border-radius: 3px; background: var(--line); overflow: hidden; margin-top: 4px; }
.kv-busy-bar i { display: block; height: 100%; width: 0; background: var(--blue); transition: width .3s; }
.kv-busy-hint { margin-top: 2px; }
.bulk-bar { align-items: center; gap: 10px; border-bottom: 1px solid var(--line-soft); }
.bulk-bar input[type=date] { width: auto; padding: 5px 8px; }
.bulk-bar .check-line { margin: 0; }
/* schlichte Vorschau (eigene Rechnung/Angebot) */
.receipt-preview.rv-simple { height: auto; position: static; max-height: none; }
.rv-simple .rv-scroll { max-height: 85vh; }
.rv-simple .rv-page { cursor: default; max-width: 820px; }
.rv-title { font-size: 14px; }
@media (max-width: 700px) { .rv-simple .rv-orig { display: inline-flex; } .rv-simple .rv-scroll { padding: 6px; } }
.bank-all { margin-left: auto; }
/* Ausgabenliste */
.exp-table { min-width: 860px; }
.exp-table .exp-sup { max-width: 220px; }
.exp-table .exp-desc { max-width: 300px; }
.exp-table .exp-desc span { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.exp-table .exp-desc { white-space: normal; }
.exp-table .exp-desc a { display: inline-block; margin-top: 2px; }
.exp-form { max-width: 720px; }
.exp-search { width: 240px; padding: 6px 10px; font-size: 14px; }
tr.row-hit td { background: var(--orange-l); }
@media (max-width: 700px) { .exp-search { width: 100%; } }
.bank-why { margin-top: 6px; color: var(--text2); }
.bank-why summary { cursor: pointer; color: var(--orange-t); }
.bank-why ul { margin: 4px 0 0; padding-left: 1.1em; }
.sort-link { color: inherit; text-decoration: none; white-space: nowrap; }
.sort-link:hover, .sort-link.is-active { color: var(--blue-d); }
.rcpt-tools { display: flex; justify-content: flex-end; margin: -4px 0 10px; }
/* Suchfeld mit Trefferliste statt langer Auswahlliste (select[data-search]) */
.combo { position: relative; }
.combo-native { position: absolute !important; opacity: 0; pointer-events: none; width: 1px !important; height: 1px; bottom: 0; left: 0; }
.combo-input { width: 100%; padding-right: 34px; }
.combo-clear { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); border: 0; background: none; color: var(--muted); font-size: 20px; line-height: 1; cursor: pointer; padding: 4px 6px; }
.combo-clear:hover { color: var(--text); }
.combo-list { position: absolute; z-index: 60; left: 0; right: 0; top: calc(100% + 4px); max-height: 300px; overflow-y: auto; margin: 0; padding: 4px; list-style: none;
  background: var(--card); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 12px 30px rgba(15, 23, 42, .16); }
.combo-list li { padding: 8px 10px; border-radius: 6px; cursor: pointer; font-size: 14px; }
.combo-list li.is-active { background: var(--blue-l); }
.combo-list li.is-sel { font-weight: 600; }
.combo-list li.combo-none { color: var(--muted); cursor: default; font-size: 13px; }

/* Anmeldeseiten: zweigeteilt mit Markenfläche (Farbe folgt dem Branding) */
.auth-split-body { background: var(--bg); }
.auth-split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); min-height: 100vh; }
.auth-side { position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: space-between; gap: 32px; padding: 40px 48px; color: #fff;
  background: radial-gradient(circle at 85% 12%, rgba(255,255,255,.18), transparent 38%), radial-gradient(circle at 10% 95%, rgba(255,255,255,.12), transparent 42%), linear-gradient(150deg, var(--blue), color-mix(in srgb, var(--blue) 55%, #020617)); }
.auth-side::after { content: ""; position: absolute; right: -120px; bottom: -120px; width: 420px; height: 420px; border-radius: 50%; border: 60px solid rgba(255,255,255,.06); pointer-events: none; }
.auth-side-brand { align-self: flex-start; display: flex; align-items: center; gap: 10px; background: #fff; color: #0f172a; border-radius: 12px; padding: 8px 14px; font-weight: 800; font-size: 17px; letter-spacing: -.01em; box-shadow: 0 6px 20px rgba(0,0,0,.12); }
.auth-side-brand .tld { color: var(--blue); }
.auth-side-brand .brand-logo { max-width: 200px; }
.auth-side-brand.bare { background: none; box-shadow: none; padding: 0; border-radius: 0; }
.auth-side-brand.bare .brand-logo { max-width: 240px; border-radius: 0; }
.brand-logo-d { display: none; }
:root[data-theme="dark"] .brand-logo-l { display: none; }
:root[data-theme="dark"] .brand-logo-d { display: block; }
@media (prefers-color-scheme: dark) { :root[data-theme="auto"] .brand-logo-l { display: none; } :root[data-theme="auto"] .brand-logo-d { display: block; } }
.auth-side-main { position: relative; z-index: 1; max-width: 460px; }
.auth-side-kicker { margin: 0 0 6px; font-size: 15px; opacity: .85; }
.auth-side-title { margin: 0 0 14px; font-size: clamp(28px, 3.2vw, 42px); line-height: 1.12; font-weight: 800; letter-spacing: -.02em; overflow-wrap: anywhere; }
.auth-side-text { margin: 0 0 26px; font-size: 16px; line-height: 1.55; opacity: .92; }
.auth-side-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.auth-side-list li { display: flex; align-items: center; gap: 12px; font-size: 15px; }
.auth-side-list svg { flex: none; width: 34px; height: 34px; padding: 8px; border-radius: 10px; background: rgba(255,255,255,.16); }
.auth-side-foot { position: relative; z-index: 1; margin: 0; font-size: 13px; opacity: .7; }
.auth-split .auth { width: 100%; max-width: 440px; margin: auto; padding: 48px 24px; justify-content: center; }
.auth-split .auth-brand { display: none; }
.auth-split .auth-card { padding: 32px; border-radius: 16px; }
.auth-split .auth-card h1 { font-size: 28px; letter-spacing: -.02em; }
.auth-split .auth-card .btn-block { padding-top: 12px; padding-bottom: 12px; font-size: 15px; }
@media (max-width: 860px) {
  .auth-split { grid-template-columns: 1fr; min-height: 0; }
  .auth-side { padding: 22px 20px 26px; gap: 14px; }
  .auth-side::after, .auth-side-list, .auth-side-text, .auth-side-foot { display: none; }
  .auth-side-title { font-size: 24px; margin: 0; }
  .auth-side-kicker { font-size: 13px; margin-bottom: 2px; }
  .auth-split .auth { padding: 24px 16px 32px; }
}
@media (max-width: 760px) { .vm-grid { grid-template-columns: 1fr !important; } }

/* Mandanten: Firmen-Umschalter in der Seitenleiste */
.firm-switch { margin: 4px 0 10px; padding: 8px; border: 1px solid var(--line); border-radius: 12px; background: var(--soft); }
.firm-switch > label { display: block; padding: 0 6px 4px; }
.firm-switch-list { display: grid; gap: 2px; }
.firm-switch-list a { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 8px; color: var(--text); text-decoration: none; font-size: 14px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.firm-switch-list a:hover { background: var(--card); }
.firm-switch-list a.active { background: var(--card); font-weight: 600; color: var(--blue); box-shadow: 0 1px 2px rgba(0,0,0,.06); }

/* Digi – digitaler Mitarbeiter */
.digi-btn { gap: 6px; }
.digi-btn svg { color: var(--blue); }
.digi-label { display: block; font-weight: 700; font-size: 1.05rem; margin-bottom: 8px; }
.digi-input { display: flex; gap: 10px; align-items: stretch; }
.digi-input textarea { flex: 1; font-size: 1.05rem; min-height: 64px; }
.digi-mic { flex-direction: column; gap: 4px; min-width: 92px; justify-content: center; }
.digi-mic.rec { background: var(--red); border-color: var(--red); color: var(--card); animation: digiPulse 1.2s infinite; }
@keyframes digiPulse { 50% { box-shadow: 0 0 0 8px var(--red-l); } }
.digi-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 12px; }
.digi-examples { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.digi-ex { text-align: left; border: 1px solid var(--line); background: var(--soft); border-radius: 10px; padding: 10px 12px; cursor: pointer; color: inherit; font: inherit; display: flex; flex-direction: column; gap: 4px; }
.digi-ex:hover { border-color: var(--blue); }
.digi-ex span { font-size: .9rem; color: var(--muted); }
.digi-items input { width: 100%; }
@media (max-width: 640px) { .digi-input { flex-direction: column; } .digi-mic { flex-direction: row; } .digi-btn span { display: none; } }
.digi-answer { background: var(--blue-l); border: 1px solid var(--blue-b); border-radius: 12px; padding: 14px 16px; margin: 12px 0; }
.digi-answer-main { font-size: 1.15rem; font-weight: 700; margin: 0 0 8px; }
.digi-answer ul { margin: 0 0 10px; padding-left: 18px; line-height: 1.7; }

/* Bankabgleich: PayPal-Konto */
.chip-sep { width: 1px; height: 22px; background: var(--line2); margin: 0 4px; }
.pp-tag { display: inline-block; font-size: 11px; font-weight: 700; line-height: 1; padding: 3px 6px; border-radius: 5px; background: var(--blue-l); color: var(--blue-d); vertical-align: 1px; }
.paypal-head { display: flex; gap: 16px; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; }
.paypal-head > div:first-child { flex: 1 1 420px; }
.pp-setup { margin-top: 12px; border-top: 1px solid var(--line2); padding-top: 10px; }
.pp-setup summary { cursor: pointer; font-weight: 600; color: var(--blue-d); font-size: 14px; }
.pp-setup ol { margin: 10px 0 8px; padding-left: 1.3em; display: grid; gap: 6px; font-size: 14px; color: var(--text2); }
.pp-setup p { margin: 0; }
.pp-fetch { display: inline-flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.pp-fetch input[type=date] { width: auto; min-height: 32px; padding: 4px 8px; }
.bank-upload label.btn { cursor: pointer; gap: 6px; }
.bank-upload label.loading { opacity: .6; pointer-events: none; }
.bank-table tr.drop-over td { background: var(--blue-l); }
.bank-table tr.drop-over td:first-child { box-shadow: inset 3px 0 0 var(--blue); }

/* Vertragsvorlagen: Editor */
.rte { border: 1px solid var(--line); border-radius: 10px; background: var(--card, #fff); }
.rte-bar { display: flex; flex-wrap: wrap; gap: 4px; padding: 6px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: inherit; border-radius: 10px 10px 0 0; z-index: 2; }
.rte-bar button { min-width: 32px; height: 30px; border: 1px solid var(--line); background: transparent; border-radius: 6px; cursor: pointer; font: inherit; font-size: 13px; color: inherit; padding: 0 8px; }
.rte-bar button:hover { background: var(--soft, rgba(0,0,0,.05)); }
.rte-bar select { height: 30px; font-size: 13px; max-width: 220px; }
.rte-body { min-height: 420px; max-height: 70vh; overflow: auto; padding: 22px 28px; font-family: Arial, "Liberation Sans", sans-serif; font-size: 14px; line-height: 1.45; outline: none; }
.rte-body p { margin: 0 0 6px; }
.rte-body table { width: 100%; border-collapse: collapse; margin: 6px 0; }
.rte-body td, .rte-body th { border: 1px dashed var(--line); padding: 4px 6px; vertical-align: top; }
.vm-ph { columns: 2 260px; font-size: 12.5px; margin: 8px 0 0; padding-left: 0; list-style: none; }
.vm-ph li { break-inside: avoid; margin-bottom: 3px; }
.vm-ph code { font-size: 12px; }

/* Dashboard: Firma wechseln */
.dash-firms { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 16px; }
.dash-firm { display: inline-flex; align-items: center; gap: 7px; min-height: 38px; padding: 0 14px; border: 1px solid var(--line2); border-radius: 999px; background: var(--card); color: var(--text); text-decoration: none; font-weight: 600; font-size: 14px; }
.dash-firm:hover { border-color: var(--blue); }
.dash-firm.active { background: var(--blue); border-color: var(--blue); color: #fff; }

/* Mietvertrag ausfüllen */
.mv-grid { display: grid; grid-template-columns: minmax(320px, 440px) minmax(0, 1fr); gap: 18px; align-items: start; }
.mv-form .field { margin-bottom: 10px; }
.mv-row { display: flex; gap: 10px; }
.mv-row > .field { flex: 1; min-width: 0; }
.mv-h { font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin: 18px 0 8px; padding-top: 12px; border-top: 1px solid var(--line); }
.mv-sum { margin: 0 0 4px; font-weight: 600; }
.mv-preview-wrap { position: sticky; top: 12px; }
.mv-preview-head { margin: 0 0 8px; }
.mv-paper { background: var(--card); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); padding: 36px 44px; max-height: calc(100vh - 80px); overflow: auto;
  font-family: Arial, "Liberation Sans", sans-serif; font-size: 13.5px; line-height: 1.5; color: var(--text); }
.mv-paper p { margin: 0 0 7px; }
.mv-paper table { width: 100%; border-collapse: collapse; }
.mv-paper td, .mv-paper th { vertical-align: top; padding: 4px 6px; }
.mv-paper .ph { background: var(--blue-l); border-radius: 3px; padding: 0 2px; }
.mv-paper .ph.ph-empty, .ph-legend { background: var(--orange-l); color: var(--orange, inherit); border-radius: 3px; padding: 0 3px; font-style: italic; }
.mv-paper .ph-sig img { max-height: 70px; display: block; }
@media (max-width: 1000px) { .mv-grid { grid-template-columns: 1fr; } .mv-preview-wrap { position: static; } .mv-paper { padding: 20px; max-height: none; } }

.vm-brief-view { display: block; width: 100%; height: 75vh; min-height: 480px; border: 1px solid var(--line); border-radius: 10px; background: var(--soft); }
.vm-versand { border-color: var(--blue); }

.vm-brief-pages { display: grid; gap: 14px; justify-items: center; background: var(--soft); border: 1px solid var(--line); border-radius: 10px; padding: 16px; }
.vm-brief-pages img { width: 100%; max-width: 760px; height: auto; background: #fff; box-shadow: var(--shadow); border-radius: 4px; }

/* Einnahmen & Ausgaben: EA-Rechnung je Quartal */
.ea-more { position: relative; display: inline-block; }
.ea-more > summary { list-style: none; cursor: pointer; }
.ea-more > summary::-webkit-details-marker { display: none; }
.ea-menu { position: absolute; right: 0; top: calc(100% + 6px); z-index: 30; background: var(--card); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); padding: 6px; min-width: 190px; display: flex; flex-direction: column; }
.ea-menu a { padding: 8px 10px; border-radius: 8px; color: var(--text); text-decoration: none; font-size: 14px; white-space: nowrap; }
.ea-menu a:hover { background: var(--soft); }

/* Logo kundenverwaltung.eu (kv_logo()) */
.kv-logo { display: block; flex: none; color: var(--strong); }
.kv-logo .kvl-a { fill: #2563EB; }
:root[data-theme="dark"] .kv-logo .kvl-a { fill: #7FB0FF; }
@media (prefers-color-scheme: dark) { :root[data-theme="auto"] .kv-logo .kvl-a { fill: #7FB0FF; } }
.auth-side-brand .kv-logo { color: #0f172a; }
.auth-side-brand .kv-logo .kvl-a { fill: #2563EB; }
.brand-stack { flex-direction: column; align-items: flex-start; gap: 4px; }
.brand-stack small { font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); padding-left: 2px; }

/* Hinweis „Rechnungen in Ordner speichern – Zugriff erlauben“ (app.js) */
.ar-chip { position: fixed; right: 18px; bottom: 18px; z-index: 60; border: 1px solid var(--line2); background: var(--card); color: var(--text); border-radius: 999px; padding: 10px 16px; font: inherit; font-size: 13.5px; font-weight: 600; box-shadow: var(--shadow); cursor: pointer; }
.ar-chip:hover { border-color: var(--blue); color: var(--blue); }

.ar-box { border: 1px solid var(--line); border-radius: var(--r); padding: 16px; background: var(--soft); }
.ar-box h3 { margin: 0 0 2px; font-size: 15px; }
.ar-box .small.muted { margin: 0 0 8px; }
