:root {
  /* Farbwelt BBservice / Linda Bellmann (bb-bellmann.de) */
  --bg: #f5f4fa;
  --panel: #ffffff;
  --ink: #2a2e30;
  --muted: #6b6b6b;
  --line: #e7e4f1;
  --brand: #6e6aa1;
  --brand-dk: #585488;
  --accent: #8883bf;
  --ring: rgba(136,131,191,.22);
  --ok-bg: #e6f4ea; --ok-ink: #1e7d3a;
  --err-bg: #fdecec; --err-ink: #b3261e;
  --chip: #efedf8;
  --radius: 12px;
  --shadow: 0 1px 3px rgba(42,46,48,.06), 0 4px 16px rgba(110,106,161,.07);
}
* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 15px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

header.topbar {
  background: linear-gradient(95deg, #6e6aa1 0%, #585488 100%);
  color: #fff; padding: 13px 26px;
  display: flex; align-items: center; gap: 16px;
  box-shadow: 0 2px 12px rgba(110,106,161,.18);
}
header.topbar a.brand { display: flex; align-items: center; }
header.topbar img.logo { height: 40px; width: auto; display: block; }
header.topbar .sub { color: #ece9f7; font-size: 13px; letter-spacing: .2px;
  border-left: 1px solid rgba(255,255,255,.35); padding-left: 16px; }
header.topbar nav { margin-left: auto; display: flex; gap: 20px; }
header.topbar nav a { color: #ece9f7; font-size: 14px; font-weight: 500; }
header.topbar nav a:hover { color: #fff; text-decoration: none; }

/* Mandanten-Subnavigation (auf allen Mandanten-Seiten) */
.subnav { background: var(--panel); border-bottom: 1px solid var(--line); box-shadow: var(--shadow); }
.subnav-inner { max-width: 1560px; margin: 0 auto; padding: 0 24px; display: flex; align-items: center; gap: 2px; flex-wrap: wrap; }
.subnav a { padding: 12px 13px; font-size: 14px; color: var(--muted); border-bottom: 2px solid transparent; white-space: nowrap; }
.subnav a:hover { color: var(--ink); text-decoration: none; }
.subnav a.active { color: var(--brand); border-bottom-color: var(--brand); font-weight: 600; }
.subnav a.subnav-back { margin-left: auto; color: var(--brand); }

main { max-width: 1560px; margin: 28px auto; padding: 0 24px; }

/* ── Linke Seitenleiste (innerhalb eines Mandanten) ───────────────────── */
:root { --sb-w: 266px; }
body.with-sidebar main { margin: 28px auto 28px var(--sb-w); max-width: 1440px; padding: 0 34px; }

.sidebar {
  position: fixed; top: 0; left: 0; bottom: 0; width: var(--sb-w); z-index: 50;
  background: var(--panel); border-right: 1px solid var(--line);
  display: flex; flex-direction: column; overflow-y: auto;
  box-shadow: 2px 0 18px rgba(110,106,161,.05);
}
.sb-brand { background: linear-gradient(95deg, #6e6aa1 0%, #585488 100%);
  padding: 14px 18px; display: flex; align-items: center; }
.sb-brand img.logo { height: 34px; width: auto; display: block; }
/* Marken-Stapel: Linda oben (weiß auf violett), Partner (Büroservice Stolze, farbig) darunter auf weißem Feld */
.brand-stack { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.partner-logo { background: #fff; border-radius: 7px; padding: 4px 9px; display: inline-flex; }
.partner-logo img { height: 24px; width: auto; display: block; }
/* In der Seitenleiste: Partner-Logo füllt die volle Breite (gleicher Abstand links wie rechts) */
.sb-brand .brand-stack { width: 100%; }
.sb-brand .partner-logo { width: 100%; box-sizing: border-box; justify-content: center; padding: 9px 12px; }
.sb-brand .partner-logo img { width: 100%; height: auto; }
/* Einzelnes Bearbeiter-Logo (Ramona, farbig) als alleinige Marke → weißes Feld in voller Breite */
.sb-brand .solo-logo { width: 100%; box-sizing: border-box; background: #fff; border-radius: 7px;
  padding: 9px 12px; display: flex; justify-content: center; }
.sb-brand .solo-logo img { max-width: 100%; max-height: 44px; width: auto; height: auto; display: block; }
.sb-mandant { padding: 13px 18px 11px; border-bottom: 1px solid var(--line); }
.sb-mandant-name { font-weight: 700; font-size: 16px; color: var(--ink); line-height: 1.25; }
.sb-mandant-sub { font-size: 12px; color: var(--muted); margin-top: 3px; }

.sb-nav { flex: 1; padding: 9px 10px; display: flex; flex-direction: column; gap: 1px; }
.sb-item { display: block; padding: 8px 12px; border-radius: 8px;
  color: var(--ink); font-size: 14.5px; font-weight: 500; }
.sb-item:hover { background: var(--chip); text-decoration: none; }
.sb-item.active { background: var(--brand); color: #fff; }

.sb-row { display: flex; align-items: center; gap: 2px; border-radius: 8px; padding-right: 6px; }
.sb-row .sb-item { flex: 1; }
.sb-row:hover { background: var(--chip); }
.sb-row.active { background: var(--brand); }
.sb-row.active .sb-item, .sb-row.active:hover { background: transparent; color: #fff; }
.sb-row.active:hover { background: var(--brand); }

.sb-badge { background: var(--brand); color: #fff; font-size: 11px; font-weight: 700;
  min-width: 19px; height: 19px; padding: 0 5px; border-radius: 10px;
  display: inline-flex; align-items: center; justify-content: center; }
.sb-row.active .sb-badge { background: #fff; color: var(--brand); }

.sb-caret { border: 0; background: transparent; cursor: pointer; color: var(--muted);
  font-size: 11px; padding: 5px 6px; border-radius: 6px; line-height: 1; transition: transform .15s; }
.sb-caret:hover { background: rgba(0,0,0,.06); color: var(--ink); }
.sb-row.active .sb-caret { color: #fff; }
.sb-group:not(.open) .sb-caret { transform: rotate(-90deg); }

.sb-sub { display: none; flex-direction: column; gap: 1px;
  margin: 2px 0 5px 15px; padding-left: 10px; border-left: 2px solid var(--line); }
.sb-group.open .sb-sub { display: flex; }
.sb-sub a { display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 6px 10px; border-radius: 7px; color: var(--muted); font-size: 13.5px; }
.sb-sub a:hover { background: var(--chip); color: var(--ink); text-decoration: none; }
.sb-sub a.active { color: var(--brand); font-weight: 600; background: var(--chip); }
.sb-c { font-size: 11px; color: var(--muted); background: #f1eff8; border-radius: 8px; padding: 1px 6px; }

/* Bank-Untermenü: Konto-Überschrift „Bezeichnung -IBAN4" + eingerückte Links */
.sb-konto { font-size: 12px; font-weight: 700; color: var(--ink); padding: 7px 10px 2px; }
.sb-konto + .sb-konto { margin-top: 2px; }
.sb-konto-link { display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 5px 10px 5px 22px; border-radius: 7px; color: var(--muted); font-size: 13px; }
.sb-konto-link:hover { background: var(--chip); color: var(--ink); text-decoration: none; }
.sb-konto-link.active { color: var(--brand); font-weight: 600; background: var(--chip); }

/* Beleg-Bearbeiten: Formular links, Dokument rechts */
.beleg-edit { display: flex; gap: 20px; align-items: flex-start; }
.beleg-edit-form { flex: 0 0 480px; max-width: 480px; }
.beleg-edit--wide .beleg-edit-form { flex-basis: 600px; max-width: 640px; }   /* Splitbuchung (Tabelle) */
.beleg-edit-doc { flex: 1; position: sticky; top: 16px; }
.beleg-edit-doc iframe { width: 100%; height: min(82vh, 1000px); border: 1px solid var(--line);
  border-radius: var(--radius); background: #f4f4f6; }
@media (max-width: 1000px) {
  .beleg-edit { flex-direction: column; }
  .beleg-edit-form, .beleg-edit--wide .beleg-edit-form { flex: 1 1 auto; max-width: none; width: 100%; }
  .beleg-edit-doc { position: static; width: 100%; }
  .beleg-edit-doc iframe { height: 70vh; }
}

.sb-footer { border-top: 1px solid var(--line); padding: 12px 16px;
  display: flex; flex-direction: column; gap: 9px; }
.sb-footer a { font-size: 13.5px; color: var(--brand); font-weight: 500; }

@media (max-width: 860px) {
  .sidebar { position: static; width: auto; flex-direction: column; box-shadow: none; }
  body.with-sidebar main { margin: 20px auto; max-width: none; padding: 0 16px; }
}

/* ── Konto-Typeahead (Buchen) ─────────────────────────────────────────── */
.ks-dd { position: absolute; z-index: 3000; background: var(--panel); border: 1px solid var(--line);
  border-radius: 8px; box-shadow: 0 8px 24px rgba(42,46,48,.18); max-height: 280px; overflow-y: auto;
  font-size: 13px; padding: 4px; }
.ks-item { display: flex; gap: 10px; align-items: baseline; padding: 6px 9px; border-radius: 6px; cursor: pointer; }
.ks-item:hover, .ks-item.ks-on { background: var(--chip); }
.ks-nr { font-weight: 700; color: var(--brand); min-width: 52px; font-variant-numeric: tabular-nums; }
.ks-name { color: var(--ink); }
.ks-empty { padding: 7px 9px; color: var(--muted); }
.ks-ki { padding: 7px 9px; margin-top: 2px; border-top: 1px solid var(--line); color: var(--brand);
  cursor: pointer; font-weight: 600; }
.ks-ki:hover { background: #ede9fe; }
td .aktionen { display: flex; gap: 6px; justify-content: flex-end; align-items: center; flex-wrap: wrap; }

.page-head { display: flex; align-items: center; margin-bottom: 20px; gap: 16px; }
.page-head h1 { font-size: 22px; margin: 0; }
.page-head .spacer { flex: 1; }

.btn {
  display: inline-flex; align-items: center; gap: 6px; cursor: pointer;
  border: 1px solid var(--line); background: var(--panel); color: var(--ink);
  padding: 8px 14px; border-radius: 8px; font-size: 14px; font-weight: 500;
}
.btn:hover { background: #f7f9fc; text-decoration: none; }
.btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-dk); }
.btn-sm { padding: 5px 10px; font-size: 13px; }
.btn-danger:hover { background: var(--err-bg); border-color: #f3c0bc; color: var(--err-ink); }

.panel { background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow); }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 12px 16px; border-bottom: 1px solid var(--line); }
td { word-break: break-word; overflow-wrap: break-word; min-width: 0; }
th { font-size: 12px; text-transform: uppercase; letter-spacing: .4px; color: var(--muted); }
/* Sticky-Kopf: Spaltenkoepfe der Listentabellen bleiben beim Scrollen unter der Filterzeile sichtbar */
body.with-sidebar main table thead th { position: sticky; top: var(--stick-h, 50px); z-index: 12;
  background: var(--panel); box-shadow: inset 0 -1px 0 var(--line); }
.viewhead { position: sticky; top: 0; z-index: 40; background: var(--bg);
  box-shadow: 0 10px 16px -12px rgba(42,46,48,.25); }
tr:last-child td { border-bottom: none; }
tr.inaktiv td { color: var(--muted); background: #fafbfc; }
td .name { font-weight: 600; }
td .name a { color: var(--ink); }

.chip { display: inline-block; padding: 2px 9px; border-radius: 99px;
  background: var(--chip); font-size: 12px; color: var(--muted); font-weight: 500; }
.chip.ok { background: var(--ok-bg); color: var(--ok-ink); }
.chip.off { background: #f0f1f3; color: #8a929c; }

.flash { padding: 11px 16px; border-radius: 8px; margin-bottom: 16px; font-size: 14px; }
.flash.ok { background: var(--ok-bg); color: var(--ok-ink); }
.flash.error { background: var(--err-bg); color: var(--err-ink); }

.empty { text-align: center; padding: 48px 24px; color: var(--muted); }

.card { padding: 24px; }
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px 24px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field.full { grid-column: 1 / -1; }
.field label { font-size: 13px; font-weight: 600; color: #3a4451; }
.field .hint { font-size: 12px; color: var(--muted); }
/* Alle Texteingaben, nicht nur [type=text]: Bis 21.09.2026 stand hier allein
   `input[type=text]` -- Passwort-, Datums-, Zahl-, Such- und E-Mail-Felder fielen
   durch und erschienen im rohen Browser-Stil (21 px statt 43 px hoch, Arial,
   grauer Inset-Rahmen). Aufgefallen an der neuen Anmeldemaske, betroffen waren
   38 Felder. Ausgenommen bleiben Kasten-, Auswahl- und Dateifelder: die haben
   ihre eigene Darstellung. */
.field input[type=text], .field input[type=password], .field input[type=date],
.field input[type=month], .field input[type=number], .field input[type=email],
.field input[type=search], .field input[type=tel], .field input[type=url],
.field input:not([type]),
.field select, .field textarea {
  padding: 9px 11px; border: 1px solid var(--line); border-radius: 8px;
  font: inherit; background: #fff; color: var(--ink);
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--ring);
}
.field.check { flex-direction: row; align-items: center; gap: 9px; }
.field.check label { font-weight: 500; }
fieldset { border: none; padding: 0; margin: 0 0 6px; }
fieldset legend { font-size: 12px; text-transform: uppercase; letter-spacing: .4px;
  color: var(--muted); font-weight: 600; padding-bottom: 4px; }
.form-actions { display: flex; gap: 12px; margin-top: 24px; padding-top: 20px;
  border-top: 1px solid var(--line); }
.section-title { grid-column: 1/-1; font-size: 14px; text-transform: uppercase;
  letter-spacing: .6px; color: var(--brand); font-weight: 700;
  margin-top: 28px; padding: 7px 0 9px 12px; border-left: 4px solid var(--accent);
  border-bottom: 2px solid var(--accent); background: linear-gradient(90deg, var(--chip), transparent 60%); }
.section-title:first-child { margin-top: 4px; }
.inline-form { display: inline; }

/* Export-Optionen: jede Zeile mit Abstand + Trennlinie */
.export-block { display: flex; justify-content: space-between; align-items: center; gap: 24px;
  padding: 18px 0; border-bottom: 1px solid var(--line); }
.export-block:first-child { padding-top: 0; }

/* Upload-Dropzone */
.dropzone { display: block; border: 2px dashed var(--line); border-radius: var(--radius);
  background: #fafbfc; padding: 32px 24px; text-align: center; cursor: pointer; transition: .15s; }
.dropzone:hover { border-color: var(--brand); background: #f5f8fc; }
.dropzone.over { border-color: var(--brand); background: #eef4fb; }
.dropzone .link { color: var(--brand); text-decoration: underline; }
.dropzone .hint { margin-top: 8px; font-size: 12px; color: var(--muted); }
.filelist { margin-top: 14px; display: flex; flex-direction: column; gap: 4px; }
.fileitem { font-size: 13px; color: var(--ink); background: var(--chip);
  border-radius: 6px; padding: 4px 10px; display: inline-block; }

/* Aufklappbares Bearbeiten (Bank-Direktbuchung) */
details.editbox { display: inline-block; }
details.editbox > summary { list-style: none; cursor: pointer; }
details.editbox > summary::-webkit-details-marker { display: none; }
details.editbox[open] > summary { background: #f7f9fc; }


/* Kontosuche: eigene Konten des Mandanten vs. Vorschlaege aus dem Kontenrahmen */
.ks-item.ks-eigen .ks-nr { font-weight: 700; }
.ks-neu {
  margin-left: auto; font-size: 10.5px; color: #9a6b12;
  background: #fff6e5; border: 1px solid #f0d9a8; border-radius: 4px; padding: 0 5px;
}
