/* Kassenblick – Design „Kassenbuch“ in Navy/Gold */

@font-face { font-family: "Source Serif 4"; font-weight: 600; font-display: swap; src: url("../fonts/source-serif-4-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Source Serif 4"; font-weight: 700; font-display: swap; src: url("../fonts/source-serif-4-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-weight: 400; font-display: swap; src: url("../fonts/ibm-plex-sans-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-weight: 500; font-display: swap; src: url("../fonts/ibm-plex-sans-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-weight: 600; font-display: swap; src: url("../fonts/ibm-plex-sans-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-weight: 500; font-display: swap; src: url("../fonts/ibm-plex-mono-latin-500-normal.woff2") format("woff2"); }

:root {
  --kb-navy: #1B3A6B;
  --kb-navy-d: #14284A;
  --kb-navy-l: #24497F;
  --kb-gold: #F5B333;
  --kb-gold-d: #E0A020;
  --kb-bg: #F4F6FA;
  --kb-line: #DCE2EC;
  --kb-line-2: #B9C4D6;
  --kb-muted: #4A5872;
  --kb-ink: #18233A;
  --kb-side-text: #E6ECF5;
  --kb-side-muted: #B8C4D9;
  --kb-in: #1F6B45;
  --kb-out: #A3361F;
  --kb-open: #8A5300;
  --kb-tile: #FFF6E0;
  --kb-row-alt: #F7F9FC;
  --kb-serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  --kb-sans: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --kb-mono: "IBM Plex Mono", ui-monospace, Menlo, Consolas, monospace;

  --bs-body-font-family: var(--kb-sans);
  --bs-body-color: var(--kb-ink);
  --bs-body-bg: var(--kb-bg);
  --bs-border-color: var(--kb-line);
  --bs-link-color: var(--kb-navy);
  --bs-link-color-rgb: 27, 58, 107;
  --bs-link-hover-color: var(--kb-navy-d);
  --bs-focus-ring-color: rgba(245, 179, 51, .45);
}

body { font-family: var(--kb-sans); color: var(--kb-ink); background: var(--kb-bg); font-size: 16px; }
a { color: var(--kb-navy); }
a:hover { color: var(--kb-navy-d); }
.form-control:focus, .form-select:focus, .form-check-input:focus { border-color: var(--kb-gold); box-shadow: 0 0 0 .2rem rgba(245, 179, 51, .35); }
.form-check-input:checked { background-color: var(--kb-navy); border-color: var(--kb-navy); }
.form-label { font-weight: 500; font-size: 15px; }

.kb-muted { color: var(--kb-muted) !important; }
.kb-in { color: var(--kb-in) !important; }
.kb-out { color: var(--kb-out) !important; }
.kb-open { color: var(--kb-open) !important; }
.kb-num, .kb-mono { font-family: var(--kb-mono); font-variant-numeric: tabular-nums; }
.kb-kicker { font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--kb-muted); }
.kb-h1 { font-family: var(--kb-serif); font-weight: 700; font-size: 40px; margin: 4px 0 0; line-height: 1.15; }
.kb-h2 { font-family: var(--kb-serif); font-weight: 700; font-size: 26px; margin: 0; }
.kb-h3 { font-family: var(--kb-serif); font-weight: 600; font-size: 20px; margin: 0 0 12px; }

/* Buttons */
.btn { border-radius: 6px; font-weight: 500; }
.kb-btn-gold { background: var(--kb-gold); color: var(--kb-navy); border: 0; font-weight: 600; }
.kb-btn-gold:hover, .kb-btn-gold:focus { background: var(--kb-gold-d); color: var(--kb-navy-d); }
.kb-btn-navy { background: var(--kb-navy); color: #fff; border: 0; }
.kb-btn-navy:hover, .kb-btn-navy:focus { background: var(--kb-navy-d); color: #fff; }
.kb-btn-line { background: #fff; color: var(--kb-ink); border: 1px solid var(--kb-line-2); }
.kb-btn-line:hover { background: var(--kb-row-alt); color: var(--kb-ink); border-color: var(--kb-muted); }
.kb-btn-danger { background: #fff; color: var(--kb-out); border: 1px solid #E3B5AA; }
.kb-btn-danger:hover { background: #FBEDEA; color: #7E2715; }

/* Grundlayout */
.kb-shell { display: flex; min-height: 100vh; }
.kb-side {
  background: var(--kb-navy); color: var(--kb-side-text);
  width: 260px; flex: 0 0 260px; padding: 22px 16px; display: flex; flex-direction: column; gap: 12px;
}
/* Desktop: kein eigener Scrollbalken. Passt die Leiste nicht in die Fensterhöhe,
   scrollt sie mit der Seite mit und bleibt dann unten stehen (top wird per JS gesetzt). */
@media (min-width: 992px) {
  .kb-side.offcanvas-lg {
    position: sticky; top: 0; align-self: flex-start; height: auto; min-height: 100vh; overflow: visible;
    background-color: var(--kb-navy) !important; padding: 22px 16px;
  }
}
@media (max-width: 991.98px) {
  .kb-side.offcanvas-lg { --bs-offcanvas-width: 290px; --bs-offcanvas-bg: var(--kb-navy); color: var(--kb-side-text); padding: 22px 16px; }
}
.kb-brand { font-family: var(--kb-serif); font-size: 28px; font-weight: 700; color: #fff; line-height: 1.1; text-decoration: none; display: block; }
.kb-brand:hover { color: #fff; }
.kb-brand-sub { font-size: 14px; color: var(--kb-side-muted); margin-top: 2px; }
.kb-side a, .kb-side button.kb-side-link { color: var(--kb-side-text); text-decoration: none; }
.kb-side-link {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: left;
  font: inherit; font-size: 15px; padding: 7px 10px; border: 0; border-radius: 6px; background: transparent;
}
.kb-side-link:hover, .kb-side-link:focus-visible { background: rgba(255, 255, 255, .1); color: #fff; }
.kb-side-link.active { background: var(--kb-gold); color: var(--kb-navy) !important; font-weight: 600; }
.kb-side-sep { margin-top: auto; border-top: 1px solid rgba(255, 255, 255, .2); padding-top: 10px; display: flex; flex-direction: column; gap: 1px; }
.kb-side-label { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--kb-side-muted); padding: 10px 10px 4px; }
.kb-side-toggle .kb-chev { margin-left: auto; transition: transform .15s; font-size: 12px; }
.kb-side-toggle[aria-expanded="true"] .kb-chev { transform: rotate(180deg); }
.kb-side-sub .kb-side-link { padding-left: 36px; font-size: 14px; }
.kb-side-foot { display: flex; align-items: center; gap: 4px; border-top: 1px solid rgba(255, 255, 255, .12); margin-top: 6px; padding-top: 6px; }
.kb-side-foot .kb-side-link { flex: 1 1 auto; min-width: 0; }
.kb-side-foot .kb-side-link span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kb-side-foot form .kb-side-link { width: 40px; justify-content: center; padding: 7px 0; }
.kb-yearnav { display: flex; align-items: center; gap: 8px; }
.kb-yearnav a, .kb-yearnav span.disabled {
  width: 34px; height: 34px; border-radius: 8px; border: 1px solid rgba(255, 255, 255, .35);
  display: flex; align-items: center; justify-content: center; color: #fff;
}
.kb-yearnav a:hover { background: rgba(255, 255, 255, .1); }
.kb-yearnav .kb-year { font-family: var(--kb-serif); font-size: 22px; font-weight: 600; color: #fff; flex-grow: 1; text-align: center; }
.kb-months { display: flex; flex-direction: column; gap: 1px; }
.kb-month {
  display: flex; justify-content: space-between; align-items: center; font-size: 15px;
  padding: 4px 10px; border-radius: 6px; color: var(--kb-side-text) !important; text-decoration: none;
}
.kb-month:hover { background: rgba(255, 255, 255, .1); }
.kb-month .kb-mono { font-size: 13px; color: var(--kb-side-muted); }
.kb-month.empty { color: #8C9CBA !important; }
.kb-month.active { background: var(--kb-gold); color: var(--kb-navy) !important; font-weight: 600; }
.kb-month.active .kb-mono { color: var(--kb-navy); }
.kb-bookpick .dropdown-toggle {
  width: 100%; text-align: left; background: rgba(255, 255, 255, .08); color: #fff; border: 1px solid rgba(255, 255, 255, .25);
  padding: 9px 12px; font-size: 15px; border-radius: 6px; display: flex; justify-content: space-between; align-items: center; gap: 8px;
}
.kb-bookpick .dropdown-menu { width: 100%; }
.kb-bookpick .dropdown-item { color: var(--kb-navy) !important; font-weight: 500; padding: 8px 14px; white-space: normal; }
.kb-bookpick .dropdown-item:hover, .kb-bookpick .dropdown-item:focus { background: #E9EEF6; color: var(--kb-navy) !important; }
.kb-bookpick .dropdown-item.active, .kb-bookpick .dropdown-item:active { background: var(--kb-navy); color: #fff !important; }
.kb-bookpick .dropdown-item .kb-muted { color: #5E6B82 !important; }
.kb-bookpick .dropdown-item.active .kb-muted { color: #C9D4E6 !important; }

.kb-main { flex: 1 1 auto; min-width: 0; padding: 32px 40px 48px; max-width: 1760px; }
.kb-topbar { display: none; }
@media (max-width: 991.98px) {
  .kb-shell { display: block; }
  .kb-main { padding: 18px 14px 110px; }
  .kb-topbar {
    display: flex; align-items: center; gap: 10px; background: var(--kb-navy); color: #fff;
    padding: 10px 12px; position: sticky; top: 0; z-index: 1020;
  }
  .kb-topbar .kb-brand { font-size: 21px; flex-grow: 1; }
  .kb-topbar button { width: 44px; height: 44px; border-radius: 8px; border: 1px solid rgba(255, 255, 255, .35); background: transparent; color: #fff; font-size: 22px; }
  .kb-h1 { font-size: 30px; }
}

.kb-card { background: #fff; border: 1px solid var(--kb-line); border-radius: 8px; }
.kb-pagehead { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; border-bottom: 1px solid var(--kb-line); padding-bottom: 18px; margin-bottom: 22px; }
.kb-pagehead > .kb-grow { flex-grow: 1; }

/* Kennzahlen */
.kb-tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border: 1px solid var(--kb-line); background: #fff; margin-bottom: 22px; border-radius: 8px; overflow: hidden; }
.kb-tile { padding: 16px 18px; border-right: 1px solid var(--kb-line); }
.kb-tile:last-child { border-right: 0; background: var(--kb-tile); }
.kb-tile .kb-label { font-size: 13px; color: var(--kb-muted); }
.kb-tile .kb-value { font-family: var(--kb-mono); font-size: 22px; margin-top: 6px; font-weight: 500; }
.kb-tile .kb-sub { font-size: 12px; color: var(--kb-muted); margin-top: 3px; }
@media (max-width: 767.98px) {
  .kb-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kb-tile:nth-child(2) { border-right: 0; }
  .kb-tile:nth-child(-n+2) { border-bottom: 1px solid var(--kb-line); }
}

/* Tabelle */
.kb-tablewrap { position: relative; background: #fff; border: 1px solid var(--kb-line); border-radius: 8px; overflow-x: auto; overflow-y: hidden; }
/* Nur waagerecht scrollen (Handy) – nie ein senkrechter Scrollbalken in Tabellen */
.kb-scrollx { position: relative; overflow-x: auto; overflow-y: hidden; }
.kb-table { width: 100%; border-collapse: collapse; font-size: 16px; }
.kb-table th, .kb-table td { padding: 12px 14px; border-bottom: 1px solid var(--kb-line); text-align: left; white-space: nowrap; vertical-align: middle; }
.kb-table th { font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--kb-muted); font-weight: 600; border-bottom: 2px solid var(--kb-gold); background: #fff; }
.kb-table td.kb-r, .kb-table th.kb-r { text-align: right; }
.kb-table td.kb-m { font-family: var(--kb-mono); font-size: 15px; }
.kb-table td.kb-title { white-space: normal; min-width: 200px; }
.kb-table tr.kb-carry td { background: var(--kb-row-alt); color: var(--kb-muted); }
.kb-table tbody tr.kb-row:hover td { background: #FBFCFE; }
.kb-table tr.kb-row.kb-editable { cursor: pointer; }
.kb-table tfoot td { font-weight: 600; background: var(--kb-row-alt); border-bottom: 0; }
.kb-badge-fix { font-size: 12px; color: var(--kb-muted); border: 1px solid var(--kb-line-2); border-radius: 4px; padding: 1px 6px; margin-left: 8px; white-space: nowrap; }
.kb-note { display: block; font-size: 13px; color: var(--kb-muted); }
.kb-badge-res { font-size: 12px; color: #6B4A00; background: var(--kb-tile); border: 1px solid #EBCB82; border-radius: 4px; padding: 1px 6px; margin-left: 8px; white-space: nowrap; }
.kb-tile .kb-free { color: var(--kb-ink); font-weight: 600; font-size: 13px; }
.kb-table-sm { font-size: 15px; }
.kb-table-sm th, .kb-table-sm td { padding: 10px 12px; }
.kb-reserves .kb-tablewrap { border-left: 0; border-right: 0; border-bottom: 0; }

.kb-status {
  font: inherit; font-size: 14px; display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid transparent; background: transparent; padding: 4px 8px; border-radius: 6px; white-space: nowrap;
}
button.kb-status:hover { border-color: var(--kb-line-2); background: #fff; }
.kb-status.is-cleared { color: var(--kb-in); }
.kb-status.is-open { color: var(--kb-open); }
.kb-status[disabled] { opacity: 1; }

/* Handy-Liste */
.kb-mobile { display: none; }
@media (max-width: 991.98px) {
  .kb-desktop { display: none !important; }
  .kb-mobile { display: block; }
}
.kb-mhead { background: var(--kb-navy); color: #fff; margin: -18px -14px 0; padding: 14px 16px 16px; }
.kb-mhead .kb-mnav { display: flex; align-items: center; gap: 8px; }
.kb-mhead .kb-mnav a { width: 44px; height: 44px; border-radius: 8px; border: 1px solid rgba(255, 255, 255, .35); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 20px; text-decoration: none; }
.kb-mhead .kb-mtitle { flex-grow: 1; text-align: center; }
.kb-mhead .kb-mkicker { font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--kb-side-muted); }
.kb-mhead .kb-mmonth { font-family: var(--kb-serif); font-size: 28px; font-weight: 700; }
.kb-mstats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); background: rgba(255, 255, 255, .1); border-radius: 8px; margin-top: 14px; }
.kb-mstats > div { padding: 10px 6px; text-align: center; }
.kb-mstats > div + div { border-left: 1px solid rgba(255, 255, 255, .2); }
.kb-mstats .l { font-size: 12px; color: var(--kb-side-muted); }
.kb-mstats .v { font-family: var(--kb-mono); font-size: 15px; }
.kb-mlist { background: #fff; margin: 0 -14px; }
.kb-mlist-head, .kb-mrow { display: grid; grid-template-columns: 48px minmax(0, 1fr) auto; gap: 8px; padding: 11px 16px; align-items: center; }
.kb-mlist-head { border-bottom: 2px solid var(--kb-gold); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--kb-muted); }
.kb-mrow { border-bottom: 1px solid var(--kb-line); }
.kb-mrow .d { font-family: var(--kb-mono); font-size: 14px; color: var(--kb-muted); }
.kb-mrow .t { font-size: 16px; font-weight: 500; word-break: break-word; }
.kb-mrow .kb-status { padding: 2px 0; font-size: 13px; }
.kb-mrow .a { font-family: var(--kb-mono); font-size: 15px; text-align: right; }
.kb-mrow .b { font-family: var(--kb-mono); font-size: 12px; color: #5E6B82; text-align: right; }
.kb-mrow-main { background: none; border: 0; padding: 0; text-align: left; font: inherit; color: inherit; width: 100%; }
.kb-mbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 1030; background: var(--kb-bg); border-top: 1px solid var(--kb-line);
  padding: 10px calc(14px + var(--sar)) var(--kb-bottom-pad) calc(14px + var(--sal)); display: flex; gap: 10px;
}
.kb-mbar .btn { padding: 12px 14px; font-size: 16px; }

/* Fixkosten-Vorschau */
.kb-upcoming { margin-top: 22px; }
.kb-upcoming li { display: flex; justify-content: space-between; padding: 6px 0; border-bottom: 1px dashed var(--kb-line); }
.kb-upcoming li:last-child { border-bottom: 0; }

/* Modals */
.modal-content { border-radius: 10px; border: 0; }
.modal-header { border-bottom: 2px solid var(--kb-gold); }
.modal-title { font-family: var(--kb-serif); font-weight: 700; }
.kb-seg { display: grid; grid-template-columns: 1fr 1fr; gap: 0; border: 1px solid var(--kb-line-2); border-radius: 6px; overflow: hidden; }
.kb-seg input { position: absolute; opacity: 0; pointer-events: none; }
.kb-seg label { padding: 11px 10px; text-align: center; cursor: pointer; font-weight: 500; margin: 0; background: #fff; }
.kb-seg label + input + label, .kb-seg input + label + input + label { border-left: 1px solid var(--kb-line-2); }
.kb-seg input:checked + label.out { background: #FBEDEA; color: var(--kb-out); }
.kb-seg input:checked + label.in { background: #E7F3EC; color: var(--kb-in); }
.kb-seg input:focus-visible + label { outline: 3px solid rgba(245, 179, 51, .6); outline-offset: -3px; }
.kb-amount { font-family: var(--kb-mono); font-size: 22px; }

/* Listen/Verwaltung */
.kb-list { width: 100%; border-collapse: collapse; }
.kb-list th, .kb-list td { padding: 11px 14px; border-bottom: 1px solid var(--kb-line); vertical-align: middle; }
.kb-list th { font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--kb-muted); font-weight: 600; border-bottom: 2px solid var(--kb-gold); }
.kb-list tr:last-child td { border-bottom: 0; }
.kb-pill { display: inline-block; font-size: 12px; border-radius: 999px; padding: 2px 10px; border: 1px solid var(--kb-line-2); color: var(--kb-muted); white-space: nowrap; }
.kb-pill.gold { background: var(--kb-tile); border-color: #EBCB82; color: #6B4A00; }
.kb-pill.navy { background: #E6ECF5; border-color: #B8C4D9; color: var(--kb-navy); }
.kb-pill.off { background: #F1F1F1; }
.kb-access { display: flex; flex-wrap: wrap; gap: 0; border: 1px solid var(--kb-line-2); border-radius: 6px; overflow: hidden; width: max-content; max-width: 100%; }
.kb-access input { position: absolute; opacity: 0; pointer-events: none; }
.kb-access label { padding: 8px 12px; cursor: pointer; margin: 0; font-size: 14px; background: #fff; border-left: 1px solid var(--kb-line-2); }
.kb-access label:first-of-type { border-left: 0; }
.kb-access input:checked + label { background: var(--kb-navy); color: #fff; }
.kb-access input:focus-visible + label { outline: 3px solid rgba(245, 179, 51, .6); outline-offset: -3px; }
.kb-codes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; font-family: var(--kb-mono); font-size: 17px; }
.kb-codes span { background: var(--kb-row-alt); border: 1px solid var(--kb-line); border-radius: 6px; padding: 8px 10px; text-align: center; }
.kb-qr { width: 220px; height: 220px; background: #fff; border: 1px solid var(--kb-line); border-radius: 8px; padding: 10px; }
.kb-qr img, .kb-qr svg { width: 100%; height: 100%; }

/* Gast-Seiten (Login, Installer) */
.kb-guest { background: var(--kb-bg); }
.kb-guest-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px 14px; }
.kb-guest-box { width: 100%; max-width: 420px; }
.kb-guest-brand { font-family: var(--kb-serif); font-weight: 700; font-size: 32px; color: var(--kb-navy); display: flex; align-items: center; gap: 12px; justify-content: center; margin-bottom: 20px; }
.kb-logo-mark { width: 46px; height: 46px; border-radius: 10px; background: var(--kb-navy); color: var(--kb-gold); display: inline-flex; align-items: center; justify-content: center; font-size: 22px; }
.kb-install { max-width: 860px; margin: 0 auto; padding: 32px 14px; }
.kb-install .kb-guest-brand { justify-content: flex-start; }

.alert { border-radius: 8px; }
.alert-success { background: #E7F3EC; border-color: #BFDCCB; color: #154D31; }
.alert-danger { background: #FBEDEA; border-color: #EDC4BA; color: #7E2715; }
.alert-warning { background: var(--kb-tile); border-color: #EBCB82; color: #5C3F00; }

/* Druck */
@media print {
  .kb-side, .kb-topbar, .kb-mbar, .kb-noprint, .kb-mobile, .alert { display: none !important; }
  .kb-desktop { display: block !important; }
  .kb-shell { display: block; }
  .kb-main { padding: 0; max-width: none; }
  body { background: #fff; font-size: 12pt; }
  .kb-tablewrap, .kb-tiles { border-color: #999; }
  .kb-table th, .kb-table td { padding: 6px 8px; }
  .kb-status { padding: 0; }
  a { text-decoration: none; color: inherit; }
}

/* Statistik */
.kb-segnav { display: flex; border: 1px solid var(--kb-line-2); border-radius: 6px; overflow: hidden; background: #fff; }
.kb-segnav a { padding: 9px 14px; font-size: 14px; color: var(--kb-ink); text-decoration: none; }
.kb-segnav a + a { border-left: 1px solid var(--kb-line-2); }
.kb-segnav a.active { background: var(--kb-navy); color: #fff; }
.kb-stepper { display: flex; gap: 6px; }
.kb-legend { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--kb-muted); }
.kb-legend .sw { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.kb-legend .sw.line { height: 3px; width: 16px; background: var(--kb-gold); border-radius: 2px; }
.kb-chart svg { width: 100%; height: 240px; display: block; }
.kb-chart-x { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); text-align: center; font-size: 12px; color: var(--kb-muted); padding-top: 6px; }
.kb-chart-x .future { color: #8C9CBA; }
.kb-hbar { height: 10px; background: #EEF1F6; border-radius: 5px; overflow: hidden; margin-top: 4px; }
.kb-hbar span { display: block; height: 100%; background: var(--kb-navy); border-radius: 5px; }
.kb-split { display: flex; height: 26px; border-radius: 6px; overflow: hidden; background: #EEF1F6; }
.kb-dl li { display: flex; justify-content: space-between; padding: 5px 0; border-bottom: 1px dashed var(--kb-line); }
.kb-dl li:last-child { border-bottom: 0; }
.kb-list-tight th, .kb-list-tight td { padding: 8px 10px; font-size: 14px; }
.kb-hl { background: var(--kb-tile); }
details summary { cursor: pointer; color: var(--kb-navy); font-weight: 500; }
.kb-info { background: var(--kb-tile); border: 1px solid #EBCB82; border-radius: 6px; padding: 10px 12px; font-size: 14px; line-height: 1.45; }
.kb-info:empty { display: none; }
@media (max-width: 767.98px) { .kb-chart svg { height: 180px; } .kb-segnav a { padding: 9px 10px; } }
@media print { .kb-chart svg { height: 200px; } details { display: block; } details > * { display: block; } }

/* Import */
.kb-steps { display: flex; flex-wrap: wrap; gap: 8px 24px; list-style: none; padding: 0; margin: 0 0 22px; }
.kb-steps li { display: flex; align-items: center; gap: 8px; color: var(--kb-muted); font-size: 15px; }
.kb-step-no { width: 28px; height: 28px; border-radius: 50%; border: 1px solid var(--kb-line-2); display: inline-flex; align-items: center; justify-content: center; font-weight: 600; font-size: 14px; background: #fff; }
.kb-steps li.is-active { color: var(--kb-ink); font-weight: 600; }
.kb-steps li.is-active .kb-step-no { background: var(--kb-gold); border-color: var(--kb-gold); color: var(--kb-navy); }
.kb-steps li.is-done .kb-step-no { background: var(--kb-navy); border-color: var(--kb-navy); color: #fff; }
.kb-sheetlist { max-height: 260px; overflow-y: auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 4px 12px; }
.kb-rawwrap { overflow: auto; max-height: 520px; border-top: 1px solid var(--kb-line); }
.kb-raw { border-collapse: collapse; font-size: 13px; width: max-content; min-width: 100%; }
.kb-raw th, .kb-raw td { border: 1px solid var(--kb-line); padding: 5px 8px; white-space: nowrap; max-width: 260px; overflow: hidden; text-overflow: ellipsis; vertical-align: top; }
.kb-raw thead th { background: var(--kb-row-alt); position: sticky; top: 0; font-weight: 600; color: var(--kb-muted); text-align: left; }
.kb-raw .kb-raw-n { background: var(--kb-row-alt); color: var(--kb-muted); font-weight: 500; text-align: right; }
.kb-raw .kb-raw-head td { background: var(--kb-tile); font-weight: 600; }
.kb-raw-tag { display: block; font-size: 11px; font-weight: 600; color: #fff; background: var(--kb-navy); border-radius: 4px; padding: 1px 6px; margin-top: 3px; width: max-content; }
.kb-imp td { vertical-align: top; }
.kb-imp tr.is-error td { background: #FDF3F1; }
.kb-imp tr.is-dup td { background: #FFF8E8; }
.kb-imp tr.is-warn td { background: #FFFBF0; }
.kb-imp tr.is-carry td { background: var(--kb-row-alt); color: var(--kb-muted); }
.kb-imp .kb-checks { font-size: 13px; margin-top: 4px; }
.kb-imp .kb-checks:empty { display: none; }
.kb-imp { font-size: 14px; }
.kb-imp th, .kb-imp td { padding: 9px 10px; }
.kb-imp td.kb-m { font-size: 14px; }
.kb-imp td.kb-title { min-width: 220px; white-space: normal; }
.kb-imp td.kb-line { white-space: normal; min-width: 70px; }
.kb-imp td.kb-line .kb-note { font-size: 12px; line-height: 1.2; }
.kb-imp .form-check-input { width: 1.3em; height: 1.3em; }
.kb-imp.only-issues tr[data-issue="0"] { display: none; }
.kb-impbar { position: sticky; bottom: 0; z-index: 5; display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: flex-end; background: var(--kb-bg); border-top: 1px solid var(--kb-line); padding: 14px 0; margin-top: 16px; }
.kb-impbar > span { margin-right: auto; }
@media (max-width: 991.98px) { .kb-impbar { bottom: 0; padding-bottom: calc(6px + var(--kb-bottom-pad)); } }

/* Übertrag bestätigen */
.kb-carrybox .btn { white-space: nowrap; }
.kb-tile .btn-link.kb-sub { color: var(--kb-muted); text-decoration: underline; }
.kb-carryoff { background: #EEF1F6; border: 1px solid var(--kb-line-2); color: var(--kb-ink); padding: 10px 14px; }
.kb-tile .btn-link.kb-sub, .kb-tile form .btn-link { color: var(--kb-muted); text-decoration: underline; font-size: 12px; }
.kb-month .kb-cstate { font-size: 11px; margin-left: 4px; color: var(--kb-gold); }
.kb-month.active .kb-cstate { color: var(--kb-navy); }

/* ===== Sparkonten & Umbuchungen (1.7.0) ===== */
:root { --kb-xfer: #2A5DA8; }
.kb-xfer { color: var(--kb-xfer) !important; }
.kb-badge-xfer { font-size: 12px; color: var(--kb-xfer); background: #EAF1FB; border: 1px solid #C4D6EF; border-radius: 4px; padding: 1px 6px; margin-left: 8px; white-space: nowrap; }
td > .kb-badge-xfer:first-child { margin-left: 0; }
.kb-xferrow td { background: #F6F9FE; }
.kb-xfersum td { font-weight: 500; color: var(--kb-xfer); }
.kb-tiles-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
@media (max-width: 1199.98px) and (min-width: 768px) { .kb-tiles-5 .kb-tile .kb-value { font-size: 19px; } }
.kb-tiles:has(.kb-tile-hl) .kb-tile:last-child { background: #fff; }
.kb-tile.kb-tile-hl { background: var(--kb-tile); }
.kb-savgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 18px; }
.kb-savcard { padding: 18px 20px; display: flex; flex-direction: column; gap: 10px; }
.kb-savicon { width: 40px; height: 40px; border-radius: 10px; color: #fff; display: flex; align-items: center; justify-content: center; font-size: 19px; flex: 0 0 40px; }
.kb-savbal { font-size: 26px; font-weight: 500; }
.kb-legend span { display: inline-flex; align-items: center; gap: 5px; margin-right: 10px; }
.kb-legend span i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; }
.kb-legend { flex-wrap: wrap; }
svg.kb-chart { width: 100%; height: auto; display: block; }
@media (min-width: 768px) { svg.kb-chart { min-width: 640px; } }
/* Navy-Streifen hinter der Seitenleiste, falls die Seite länger ist als die Leiste */
@media (min-width: 992px) { .kb-shell { background: linear-gradient(to right, var(--kb-navy) 260px, transparent 260px); } }
.kb-segnav > span { border-left: 1px solid var(--kb-line-2); border-right: 1px solid var(--kb-line-2); }
.kb-mpill { display: inline-block; font-size: 12px; border-radius: 999px; padding: 1px 9px; border: 1px solid; white-space: nowrap; }
.kb-pill-in { color: var(--kb-in); border-color: #A9D3BC; background: #EEF8F2; }
.kb-pill-out { color: var(--kb-out); border-color: #E3B5AA; background: #FBEDEA; }
.kb-pill-int { color: #6B4A00; border-color: #EBCB82; background: var(--kb-tile); }
.kb-xfer-after { background: #F6F9FE; border: 1px solid #C4D6EF; border-radius: 6px; padding: 10px 12px; font-size: 14px; display: flex; flex-direction: column; gap: 4px; }
.kb-xfer-after:empty { display: none; }

/* ===== Tabellen filtern & sortieren (1.7.1) ===== */
.kb-tbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 8px; }
.kb-tbar-search { position: relative; flex: 0 1 340px; min-width: 200px; }
.kb-tbar-search i { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--kb-muted); font-size: 13px; pointer-events: none; }
.kb-tbar-search input { padding-left: 30px; background: #fff; }
.kb-sortbtn { all: unset; cursor: pointer; display: inline-flex; align-items: center; gap: 4px; font: inherit; color: inherit; letter-spacing: inherit; text-transform: inherit; white-space: nowrap; }
.kb-sortbtn:focus-visible { outline: 2px solid var(--kb-gold); outline-offset: 2px; border-radius: 3px; }
.kb-sortbtn i { font-size: 11px; opacity: .45; }
th[aria-sort="ascending"] .kb-sortbtn i, th[aria-sort="descending"] .kb-sortbtn i { opacity: 1; color: var(--kb-navy); }
.kb-r .kb-sortbtn, th.text-end .kb-sortbtn { justify-content: flex-end; }
@media print { .kb-tbar { display: none !important; } }

/* ===== Mehrfachauswahl im Kassenbuch (1.7.2) ===== */
.kb-selcell { width: 38px; padding-right: 0 !important; }
.kb-selcell .form-check-input { width: 1.15em; height: 1.15em; margin: 0; cursor: pointer; }
tr.kb-selected td { background: #FFF3D6 !important; }
.kb-bulkbar { position: sticky; top: 0; z-index: 30; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; background: var(--kb-navy); color: #fff;
  border-radius: 8px; padding: 10px 14px; margin-bottom: 10px; box-shadow: 0 4px 14px rgba(20, 40, 74, .18); }
.kb-bulkbar.d-none { display: none !important; }
.kb-bulkcount { margin-right: 6px; }
.kb-bulkbar .kb-out { color: #FFD3C8 !important; }
@media print { form.kb-bulkbar, .kb-selcell { display: none !important; } }


/* ===== 1.7.4 – Handy als installierte App: „Himmel“ und „Erde“ (sichere Bildschirmränder) =====
   iOS gibt der App vom Home-Bildschirm den ganzen Bildschirm (Uhrzeit, Dynamic Island, Home-Balken).
   Die Werte kommen aus env(); über die Variablen lassen sie sich im Test simulieren. */
:root {
  --sat: env(safe-area-inset-top, 0px);
  --sab: env(safe-area-inset-bottom, 0px);
  --sal: env(safe-area-inset-left, 0px);
  --sar: env(safe-area-inset-right, 0px);
  /* Unten: etwas Luft über dem Home-Balken, aber nicht den vollen Abstand obendrauf */
  --kb-bottom-pad: max(10px, calc(var(--sab) - 10px));
}
@media (max-width: 991.98px) {
  /* Himmel: Kopfzeile beginnt unter Uhrzeit/Insel und deckt den Bereich beim Scrollen navy ab */
  .kb-topbar { padding: calc(8px + var(--sat)) calc(12px + var(--sar)) 8px calc(12px + var(--sal)); }
  .kb-main { padding-left: calc(14px + var(--sal)); padding-right: calc(14px + var(--sar)); padding-bottom: calc(86px + var(--kb-bottom-pad)); }
  .kb-mhead { margin-left: calc(-14px - var(--sal)); margin-right: calc(-14px - var(--sar)); }
  .kb-mlist { margin-left: calc(-14px - var(--sal)); margin-right: calc(-14px - var(--sar)); }
  /* Navigation (aufklappbares Menü) – nur hier scrollbar, mit Platz für Uhrzeit und Home-Balken */
  .kb-side.offcanvas-lg {
    padding: calc(18px + var(--sat)) 16px calc(16px + var(--sab)) calc(16px + var(--sal));
    overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch;
  }
  .kb-side.offcanvas-lg > * { flex-shrink: 0; }
}
/* Vollbild-Fenster auf dem Handy (Buchung, Umbuchen …) */
@media (max-width: 575.98px) {
  /* navy Streifen hinter der (weißen) Uhrzeit, Fenster beginnt darunter */
  .modal-fullscreen-sm-down .modal-content { border-top: var(--sat) solid var(--kb-navy) !important; }
  .modal-fullscreen-sm-down .modal-footer { padding-bottom: calc(.75rem + var(--sab)); }
  .modal-fullscreen-sm-down .modal-content { padding-left: var(--sal); padding-right: var(--sar); }
}
/* Anmeldung / Installation */
.kb-guest-wrap { padding-top: calc(24px + var(--sat)); padding-bottom: calc(24px + var(--sab)); }


/* ===== 1.7.5 – Handy: Navigationsleiste unten (wie Arztrechnungen), kein seitliches Verschieben ===== */
.kb-bottom { display: none; }
.kb-topbar-book { display: none; }
@media (max-width: 991.98px) {
  /* Seite lässt sich nicht mehr nach links/rechts ziehen */
  html, body { overflow-x: clip; }
  @supports not (overflow-x: clip) { html, body { overflow-x: hidden; } }
  .kb-topbar { min-height: calc(52px + var(--sat)); }
  .kb-topbar .kb-brand { flex-grow: 0; }
  .kb-topbar-book { display: block; margin-left: auto; font-size: 13px; color: var(--kb-side-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 55%; }
  .kb-bottom {
    display: grid; grid-template-columns: repeat(5, 1fr); align-items: end;
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 1030;
    background: rgba(255, 255, 255, .96); -webkit-backdrop-filter: saturate(180%) blur(12px); backdrop-filter: saturate(180%) blur(12px);
    border-top: 1px solid var(--kb-line);
    padding: 6px calc(4px + var(--sar)) var(--kb-bottom-pad) calc(4px + var(--sal));
  }
  .kb-bottom.kb-bottom-4 { grid-template-columns: repeat(4, 1fr); }
  .kb-bottom > a, .kb-bottom > .dropup > button {
    display: flex; flex-direction: column; align-items: center; gap: 2px; width: 100%;
    color: #5E6B82; text-decoration: none; font-size: 11px; background: none; border: 0; padding: 2px 0; font-family: var(--kb-sans);
  }
  .kb-bottom i { font-size: 21px; line-height: 1.1; }
  .kb-bottom .is-active { color: var(--kb-navy); font-weight: 600; }
  .kb-bottom .is-active i { color: var(--kb-navy); }
  .kb-bottom .dropup { display: flex; }
  .kb-bottom-add { display: flex; justify-content: center; background: none; border: 0; padding: 0; }
  .kb-bottom-add span {
    display: grid; place-items: center; width: 52px; height: 52px; border-radius: 50%;
    background: var(--kb-gold); color: var(--kb-navy); margin-top: -22px; box-shadow: 0 4px 14px rgba(27, 58, 107, .3);
  }
  .kb-bottom-add span i { font-size: 24px; }
  .kb-moremenu {
    min-width: 250px; max-height: calc(100vh - 120px - var(--sat) - var(--kb-bottom-pad)); overflow-y: auto; overscroll-behavior: contain;
    border: 1px solid var(--kb-line); border-radius: 10px; box-shadow: 0 10px 30px rgba(16, 24, 40, .15); padding: 6px;
  }
  .kb-moremenu .dropdown-item { border-radius: 6px; padding: 9px 10px; display: flex; align-items: center; gap: 10px; font-size: 15px; }
  .kb-moremenu .dropdown-item > i { color: #8A94A3; width: 1.1rem; }
  .kb-moremenu .dropdown-item.active, .kb-moremenu .dropdown-item:active { background: var(--kb-navy); color: #fff; }
  .kb-moremenu .dropdown-item.active > i { color: var(--kb-gold); }
  .kb-moremenu .dropdown-header { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: #8A94A3; }
  .kb-main { padding-bottom: calc(84px + var(--kb-bottom-pad)); }
  .kb-impbar { bottom: calc(62px + var(--kb-bottom-pad)); }
}
@media print { .kb-bottom { display: none !important; } }


/* ===== 1.7.6 – Handy: App-Optik oben/unten in den Größenverhältnissen wie MiniMe ===== */
@media (max-width: 991.98px) {
  /* Oben: 64 px hohe Kopfzeile unter Uhrzeit/Insel, App-Symbol + Name links, runder Knopf rechts */
  .kb-topbar {
    min-height: calc(64px + var(--sat)); padding: var(--sat) calc(16px + var(--sar)) 0 calc(16px + var(--sal));
    gap: 12px; box-shadow: 0 1px 0 rgba(255, 255, 255, .08), 0 2px 10px rgba(16, 32, 64, .12);
  }
  .kb-topbar-home { display: flex; align-items: center; gap: 12px; min-width: 0; flex: 1 1 auto; color: #fff; text-decoration: none; }
  .kb-applogo { width: 34px; height: 34px; border-radius: 9px; flex: 0 0 34px; box-shadow: 0 0 0 1px rgba(255, 255, 255, .18); }
  .kb-topbar-title { display: flex; flex-direction: column; min-width: 0; line-height: 1.1; }
  .kb-topbar .kb-brand { font-size: 22px; flex-grow: 0; }
  .kb-topbar-book { display: block; margin: 2px 0 0; max-width: none; font-size: 12.5px; color: var(--kb-side-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .kb-topbar-btn {
    width: 44px; height: 44px; flex: 0 0 44px; border-radius: 12px; border: 1px solid rgba(255, 255, 255, .28);
    display: grid; place-items: center; text-decoration: none;
  }
  .kb-avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--kb-gold); color: var(--kb-navy); font-weight: 700; font-size: 14px; display: grid; place-items: center; }

  /* Unten: höhere Leiste, größere Symbole, Beschriftung bis knapp über den Home-Balken */
  .kb-bottom {
    padding: 12px calc(6px + var(--sar)) max(10px, calc(var(--sab) - 20px)) calc(6px + var(--sal));
    background: rgba(255, 255, 255, .97); border-top: 1px solid #E3E7EE; box-shadow: 0 -4px 18px rgba(16, 32, 64, .06);
  }
  .kb-bottom > a, .kb-bottom > .dropup > button { gap: 4px; font-size: 12.5px; color: #6B7689; padding: 0; }
  .kb-bottom > a i, .kb-bottom > .dropup > button i {
    font-size: 23px; line-height: 1; height: 30px; display: grid; place-items: center; min-width: 54px; border-radius: 999px; transition: background .15s;
  }
  /* Aktiver Punkt: Symbol in heller „Pille“ wie bei MiniMe */
  .kb-bottom .is-active { color: var(--kb-navy); font-weight: 600; }
  .kb-bottom .is-active i { background: #DCE3EE; color: var(--kb-navy); }
  /* Großer runder Plus-Knopf mit weißem Ring, ragt über die Leiste */
  .kb-bottom-add { align-self: start; }
  .kb-bottom-add span {
    width: 62px; height: 62px; margin-top: -38px; border-radius: 50%;
    background: linear-gradient(160deg, #24497F 0%, var(--kb-navy) 100%); color: #fff;
    box-shadow: 0 0 0 6px #fff, 0 8px 20px rgba(27, 58, 107, .35);
  }
  .kb-bottom-add span i { font-size: 28px; }
  .kb-main { padding-bottom: calc(96px + var(--sab)); }
  .kb-impbar { bottom: calc(70px + max(10px, calc(var(--sab) - 20px))); }
}

/* 1.7.7 – drei Kacheln (Sparkonten) */
.kb-tiles-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 767.98px) { .kb-tiles-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .kb-tiles-3 .kb-tile:first-child { grid-column: span 2; } }
@media (max-width: 767.98px) { .kb-tiles-3 .kb-tile:nth-child(2) { border-right: 1px solid var(--kb-line); border-bottom: 0; } .kb-tiles-3 .kb-tile:first-child { border-right: 0; } }

/* ===== 1.7.7 – Seite „Bezeichnungen“ ===== */
.kb-titlebar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; }
.kb-titlebar .kb-tbar-search { flex: 1 1 280px; max-width: 420px; }
.kb-titles { display: flex; flex-direction: column; gap: 8px; max-width: 1100px; }
.kb-titleitem { background: #fff; border: 1px solid var(--kb-line); border-radius: 8px; }
.kb-titleitem > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 12px; padding: 12px 16px; }
.kb-titleitem > summary::-webkit-details-marker { display: none; }
.kb-titleitem > summary:focus-visible { outline: 2px solid var(--kb-navy); outline-offset: -2px; border-radius: 8px; }
.kb-titlename { flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; }
.kb-titlemeta { display: flex; align-items: center; gap: 12px; flex: 0 0 auto; }
.kb-titlecount { background: var(--kb-tile); border-radius: 999px; padding: 1px 9px; font-size: 13px; font-weight: 600; color: var(--kb-navy); }
.kb-titlechev { transition: transform .15s; color: var(--kb-muted); }
.kb-titleitem[open] > summary { border-bottom: 1px solid var(--kb-line); }
.kb-titleitem[open] .kb-titlechev { transform: rotate(180deg); }
.kb-titlebody { padding: 4px 0 6px; }
.kb-titlefix { display: flex; flex-direction: column; gap: 4px; padding: 8px 16px; }
.kb-titlefix a { font-size: 14px; }
.kb-titleitem .kb-list td, .kb-titleitem .kb-list th { padding-left: 16px; }
@media (max-width: 575.98px) { .kb-titlemeta .kb-mono { display: none; } }
/* Zielbuchung beim Sprung aus „Bezeichnungen“ / Fixposten-Anker */
@keyframes kbFlash { 0%, 60% { background: #E2E8F2; } 100% { background: transparent; } }
.kb-flash, .kb-flash td { animation: kbFlash 2.4s ease-out; }
tr:target td { animation: kbFlash 2.4s ease-out; }
