/* ==========================================================
   FeWo-Belegungskalender – Kundenbereich (neues Design)
   Vorlage: design/mockups/kundenbereich.css
   Phase 2: nur der Rahmen (Kopfleiste, Seitenleiste, Inhaltsfläche).
   Die Seiteninhalte nutzen vorerst weiter style.css und werden
   seitenweise umgestellt. Wird NACH style.css geladen.
   ========================================================== */

:root {
  --kb-sidebar-w: 248px;
  --kb-topbar-h: 60px;
  --kb-bg: #F4F8F8;
}

body.indexbody, body.kb {
  margin: 0;
  background: var(--kb-bg);
  -webkit-font-smoothing: antialiased;
}

/* ---------- Grundgerüst: Kopfleiste oben, Seitenleiste links, Inhalt rechts ---------- */
.sitecontent {
  position: static;
  width: auto;
  margin: 0;
  display: grid;
  grid-template-columns: var(--kb-sidebar-w) minmax(0, 1fr);
  grid-template-rows: auto 1fr;
  min-height: 100vh;
}
.sitecontent > .kb-topbar { grid-column: 1 / -1; grid-row: 1; }
.sitecontent > .left { grid-column: 1; grid-row: 2; }
.sitecontent > .content { grid-column: 2; grid-row: 2; }
.kb-ohne-seitenleiste .sitecontent > .content,
.sitecontent:not(:has(> .left)) > .content { grid-column: 1 / -1; }

/* ---------- Kopfleiste ---------- */
.kb-topbar {
  position: sticky; top: 0; z-index: 30;
  height: var(--kb-topbar-h);
  display: flex; align-items: center; gap: 18px;
  padding: 0 24px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--text);
}
.kb-brand {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--font-head); font-size: 19px; font-weight: 600;
  color: var(--ink); text-decoration: none; white-space: nowrap;
}
.kb-brand .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--teal); flex-shrink: 0; }
.kb-brand small {
  font-family: var(--font-body); font-size: 12px; font-weight: 500;
  color: var(--text-soft); letter-spacing: .04em; text-transform: uppercase;
  margin-left: 4px;
}
.kb-spacer { flex: 1; }
.kb-aktks {
  color: var(--text-soft); font-size: 13px;
  max-width: 34ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.kb-aktks b { color: var(--ink); font-weight: 600; }
a.kb-toplink, a.kb-toplink:link, a.kb-toplink:visited {
  color: var(--text-soft); text-decoration: none; white-space: nowrap;
}
a.kb-toplink:hover { color: var(--teal-deep); }
a.kb-toplink.neu { color: #7A5A12; font-weight: 600; }
a.kb-toplink.neu::after {
  content: ""; display: inline-block; width: 7px; height: 7px; margin-left: 6px;
  border-radius: 50%; background: var(--sand); vertical-align: 2px;
  animation: kbPuls 1.4s ease-in-out infinite;
}
@keyframes kbPuls { 50% { opacity: .25; } }
.kb-menu-toggle {
  display: none;
  border: 1px solid var(--border); background: var(--surface); color: var(--ink);
  border-radius: var(--radius-sm); padding: 7px 12px;
  font: 500 14px var(--font-body); cursor: pointer;
}

/* Session-Timer (session-timer.js setzt die Klassen sessionTimer / sessionTimerWarn) */
.kb-topbar .sessionTimer {
  position: static;
  font-size: 12.5px;
  color: var(--text-soft);
  background: var(--kb-bg);
  border: 1px solid var(--border);
  border-radius: 99px;
  padding: 2px 10px;
  font-variant-numeric: tabular-nums;
}
.kb-topbar .sessionTimer:empty { display: none; }
.kb-topbar .sessionTimerWarn { color: var(--warn); background: var(--warn-soft); border-color: #EBD3A1; font-weight: 600; }

/* ---------- Seitenleiste ---------- */
.sitecontent > .left, nav.left {
  position: sticky;
  top: var(--kb-topbar-h);
  left: auto;
  float: none;
  width: auto;
  height: calc(100vh - var(--kb-topbar-h));
  overflow-y: auto;
  padding: 20px 14px 32px;
  background: var(--surface);
  border-right: 1px solid var(--border);
  font-family: var(--font-body);
  box-sizing: border-box;
}
.left .nav-group + .nav-group { margin-top: 20px; }
.left .nav-title {
  padding: 0 12px 6px;
  font-size: 11.5px; font-weight: 600; letter-spacing: .08em;
  text-transform: uppercase; color: var(--text-soft);
}
.left a.nav-link, .left a.nav-link:link, .left a.nav-link:visited {
  display: block;
  padding: 7px 12px; border-radius: var(--radius-sm);
  color: var(--text); text-decoration: none; font-size: 14.5px; line-height: 1.35;
}
.left a.nav-link:hover { background: var(--kb-bg); color: var(--teal-deep); }
.left a.nav-link.active { background: var(--teal-soft); color: var(--teal-deep); font-weight: 600; }
.left a.nav-link .nav-zaehler {
  float: right; min-width: 20px; padding: 0 6px; margin-left: 8px; box-sizing: border-box;
  border-radius: 10px; background: var(--teal); color: #fff;
  font-size: 12px; font-weight: 600; line-height: 20px; text-align: center;
}

.kb-info {
  margin: 26px 4px 0; padding: 14px 8px 0;
  border-top: 1px solid var(--border);
  font-size: 12px; line-height: 1.5; color: var(--text-soft);
  overflow-wrap: anywhere;
}
.kb-info b { color: var(--ink); font-weight: 600; }
.kb-info-titel {
  font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase;
  margin: 10px 0 2px;
}
.kb-info-titel:first-child { margin-top: 0; }
.kb-foot { display: flex; flex-wrap: wrap; gap: 4px 14px; margin: 16px 12px 0; font-size: 12.5px; }
.kb-foot a, .kb-foot a:link, .kb-foot a:visited { color: var(--text-soft); text-decoration: none; }
.kb-foot a:hover { color: var(--teal-deep); }

/* ---------- Inhaltsfläche ---------- */
.sitecontent > .content {
  position: static;
  width: auto;
  max-width: 1180px;
  min-width: 0;
  box-sizing: border-box;
  padding: 28px 36px 64px;
  margin: 0;
  overflow-x: auto;
}

/* Toast-Erfolgsmeldung im neuen Look */
#adminToast {
  top: calc(var(--kb-topbar-h) + 14px);
  background: var(--ok);
  font-family: var(--font-body);
  font-size: 14px;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow), 0 6px 20px rgba(15, 36, 48, .15);
}

/* ---------- Schmale Bildschirme: Seitenleiste wird zum Menü ---------- */
@media (max-width: 960px) {
  .sitecontent { grid-template-columns: minmax(0, 1fr); }
  .sitecontent > .content { grid-column: 1; padding: 20px 14px 56px; }
  .kb-menu-toggle { display: inline-block; }
  .kb-topbar { padding: 0 12px; gap: 10px; }
  .kb-aktks, .kb-nur-breit, .kb-brand small { display: none; }
  .kb-brand { font-size: 17px; }

  .sitecontent > .left, nav.left {
    position: fixed; left: 0; top: var(--kb-topbar-h); bottom: 0; padding-top: 16px;
    width: 280px; height: auto; z-index: 1000;
    transform: translateX(-105%);
    transition: transform .2s ease-out;
    box-shadow: var(--shadow), 4px 0 18px rgba(15, 36, 48, .12);
  }
  body.mobileMenuOpen .left { transform: none; }
  body.mobileMenuOpen .mobileMenuBackdrop {
    display: block;
    position: fixed; inset: var(--kb-topbar-h) 0 0 0;
    background: rgba(15, 36, 48, .35);
    z-index: 999;
  }
}
@media (max-width: 420px) {
  .kb-brand { font-size: 15.5px; gap: 8px; }
  .kb-topbar .sessionTimer { display: none; }
}

/* ==========================================================
   Phase 3: Bausteine für umgestellte Seiten.
   Greifen nur innerhalb von <div class="content kb-neu">,
   damit noch nicht umgestellte Seiten unverändert bleiben.
   ========================================================== */
.kb-neu {
  font-family: var(--font-body);
  font-size: 14.5px;
  line-height: 1.5;
  color: var(--text);
}
.kb-neu table { font-size: inherit; }
.kb-neu h1, .kb-neu h2, .kb-neu h3 {
  font-family: var(--font-head); color: var(--ink); font-weight: 500; line-height: 1.2; margin: 0;
}
.kb-neu a { color: var(--teal-deep); }

/* Seitenkopf */
.kb-neu .page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.kb-neu .page-head h1 { font-size: 30px; }
.kb-neu .page-head p { margin: 6px 0 0; color: var(--text-soft); max-width: 62ch; }
.kb-neu .page-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

/* Buttons */
.kb-neu .btn, .kb-neu a.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 16px; border-radius: var(--radius-sm);
  font: 500 14px var(--font-body); text-decoration: none; cursor: pointer;
  border: 1px solid transparent; white-space: nowrap; min-height: 0;
}
.kb-neu .btn-primary { background: var(--teal); color: #fff; }
.kb-neu .btn-primary:hover { background: var(--teal-deep); color: #fff; }
.kb-neu .btn-secondary { background: var(--surface); color: var(--ink); border-color: var(--border-strong); }
.kb-neu .btn-secondary:hover { border-color: var(--teal); color: var(--teal-deep); }
.kb-neu .btn-small { padding: 4px 11px; font-size: 13px; }

/* Karten */
.kb-neu .card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 22px 24px;
}
.kb-neu .card + .card { margin-top: 20px; }
.kb-neu .card h2 { font-size: 20px; margin-bottom: 4px; }
.kb-neu .card .hint { margin: 0 0 16px; color: var(--text-soft); font-size: 14px; }
.kb-neu .leer-hinweis { padding: 18px 20px; }

/* Auswahl der Kalenderseite (kalenderseitenlistSnippet) */
.kb-neu .kslistformular { background: none; padding: 0; margin: 0; text-align: left; font-size: inherit; }
.kb-neu .kslistformular .helplink { display: none; }
.kb-neu .kslistformular .inkslistFormularRegion { margin: 0; padding: 0; display: flex; gap: 8px; align-items: center; }
.kb-neu .kslistformular select { min-width: 220px; }
.kb-neu select, .kb-neu input[type=text], .kb-neu input[type=submit], .kb-neu input[type=button] {
  font: inherit; font-size: 14px; border-radius: var(--radius-sm);
}
.kb-neu select { padding: 6px 10px; border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); }
.kb-neu input[type=submit], .kb-neu input[type=button] {
  padding: 6px 14px; border: 1px solid var(--border-strong); background: var(--surface); color: var(--ink); cursor: pointer;
}
.kb-neu input[type=submit]:hover, .kb-neu input[type=button]:hover { border-color: var(--teal); color: var(--teal-deep); }

/* Werkzeugleiste über Tabellen */
.kb-neu .toolbar { display: flex; gap: 10px 16px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; }
.kb-neu .toolbar .spacer { flex: 1; }
.kb-neu .toolbar .linkbtn {
  background: none; border: 0; padding: 4px 0; font: inherit; font-size: 14px; color: var(--teal-deep);
  cursor: pointer; text-decoration: underline; text-underline-offset: 2px; min-height: 0;
}
.kb-neu .toolbar .info { color: var(--text-soft); font-size: 14px; }
.kb-neu .col-chips { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 12px; font-size: 13px; color: var(--text-soft); }
.kb-neu .chip {
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--text);
  border-radius: 99px; padding: 3px 13px; font: 500 13px var(--font-body); cursor: pointer; min-height: 0;
}
.kb-neu .chip[aria-pressed=true] { background: var(--teal-soft); border-color: var(--teal); color: var(--teal-deep); }

/* Tabellen */
.kb-neu .table-wrap { overflow: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
.kb-neu table.data { width: 100%; border-collapse: separate; border-spacing: 0; }
.kb-neu table.data.dense { width: max-content; min-width: 100%; font-size: 14px; }
.kb-neu table.data th {
  text-align: left; padding: 9px 10px; white-space: nowrap; vertical-align: bottom;
  font-size: 11.5px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase;
  color: var(--text-soft); background: var(--kb-bg); border-bottom: 1px solid var(--border);
}
.kb-neu table.data th.num { text-align: left; }
.kb-neu table.data th a { color: inherit; text-decoration: none; }
.kb-neu table.data th a:hover { color: var(--teal-deep); text-decoration: underline; }
.kb-neu table.data th a.sortiert { color: var(--teal-deep); }
.kb-neu table.data td { padding: 4px 6px; border-bottom: 1px solid var(--border); vertical-align: middle; white-space: nowrap; }
.kb-neu table.data tbody tr:hover td { background: #FAFCFC; }
.kb-neu table.data tfoot td { border-bottom: 0; background: var(--kb-bg); padding: 8px 6px; }
.kb-neu table.hide-pay [data-grp=pay], .kb-neu table.hide-betr [data-grp=betr], .kb-neu table.hide-misc [data-grp=misc] { display: none; }

/* Fixierte Spalten (Aktionen, Nr.) beim seitlichen Scrollen */
.kb-neu .sticky-1, .kb-neu .sticky-2 { position: sticky; z-index: 2; background: var(--surface); }
.kb-neu .sticky-1 { left: 0; }
.kb-neu .sticky-2 { left: var(--kb-sticky1-w, 120px); box-shadow: 1px 0 0 var(--border), 4px 0 8px -4px rgba(15, 36, 48, .14); }
.kb-neu th.sticky-1, .kb-neu th.sticky-2, .kb-neu tfoot .sticky-1, .kb-neu tfoot .sticky-2 { background: var(--kb-bg); z-index: 3; }

/* Aktionssymbole */
.kb-neu .row-actions { display: flex; align-items: center; gap: 2px; }
.kb-neu .row-actions input[type=checkbox] { margin: 0 6px 0 2px; }
.kb-neu .icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; border-radius: var(--radius-sm); text-decoration: none;
}
.kb-neu .icon-btn:hover { background: var(--kb-bg); }
.kb-neu .icon-btn img { display: block; }
.kb-neu .icon-platz { display: inline-block; width: 28px; height: 28px; }

/* Anzeigefelder in Tabellenzellen (readonly-Inputs der Altversion, Werte unverändert) */
.kb-neu table.data input[type=text] {
  font-size: 14px; font-family: var(--font-body); color: var(--text);
  padding: 4px 7px; border: 1px solid transparent; border-radius: 4px; background: transparent;
  font-variant-numeric: tabular-nums;
}
.kb-neu table.data input[type=text]:focus { outline: none; border-color: var(--teal); box-shadow: 0 0 0 2px var(--teal-soft); }
.kb-neu table.data input.dateInputField { width: 11ch; text-align: left; }
.kb-neu table.data input.price { width: 9ch; text-align: right; }
.kb-neu table.data input.nr { width: 7ch; }
.kb-neu table.data input.naechte { width: 5ch; text-align: right; }
.kb-neu table.data input.gast { width: 30ch; cursor: pointer; }
.kb-neu table.data input.gast.breit { width: 52ch; }
.kb-neu table.data input.sprache { width: 4ch; text-align: center; }
.kb-neu table.data input.werbung { width: 22ch; text-align: left; }
.kb-neu table.data input.autoerzeugt { color: #2D5FB8; }
.kb-neu table.data input.noteditable { color: var(--text-soft); }
.kb-neu table.data input.intersection { background: var(--warn-soft); border-color: #EBD3A1; }
.kb-neu table.data input.bzt_resbel {
  width: 11ch; text-align: center; border-radius: 99px; border: 0;
  font-weight: 600; font-size: 12.5px; padding: 3px 8px;
}
.kb-neu table.data input.bz_zusatzinfo { background: #FDF6E9; }
.kb-neu table.data input.nichtgezahlt { background: var(--danger-soft); color: var(--danger); }
.kb-neu table.data input.angezahlt { background: var(--warn-soft); color: #7A5A12; }
.kb-neu table.data input.allesgezahlt { background: var(--ok-soft); color: var(--ok); }
.kb-neu table.data input.kein_eintrag { background: transparent; }
.kb-neu table.data input.sum { background: transparent; font-weight: 600; color: var(--ink); }

/* Hinweis zu Klicken & Ziehen über der Kalendervorschau */
.kb-neu .kal-vorschau { margin-top: 26px; }
.kb-neu .kal-vorschau .kal-inhalt { overflow-x: auto; text-align: center; }

@media (max-width: 960px) {
  .kb-neu .page-head h1 { font-size: 25px; }
  .kb-neu .card { padding: 18px 16px; }
  .kb-neu .kslistformular select { min-width: 0; max-width: 60vw; }
}
.kb-neu .sr-only, .sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }

/* ---------- Formulare (Phase 3.2: Neue Buchung u. a.) ---------- */
.kb-neu fieldset.group { border: 0; padding: 0; margin: 0; min-width: 0; }
.kb-neu .group-title {
  display: flex; align-items: center; gap: 10px;
  margin: 24px 0 14px; padding-top: 20px; border-top: 1px solid var(--border);
  font-family: var(--font-head); font-size: 17px; color: var(--ink);
}
.kb-neu .card > fieldset.group:first-child > .group-title,
.kb-neu .card > .group-title:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
.kb-neu .form-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 14px 18px; }
.kb-neu .col-12 { grid-column: span 12; } .kb-neu .col-8 { grid-column: span 8; } .kb-neu .col-6 { grid-column: span 6; }
.kb-neu .col-4 { grid-column: span 4; } .kb-neu .col-3 { grid-column: span 3; } .kb-neu .col-2 { grid-column: span 2; }
.kb-neu .field > label, .kb-neu .field > .label, .kb-neu span.label {
  display: block; margin-bottom: 5px; font-size: 13px; font-weight: 600; color: var(--ink-soft);
}
.kb-neu .field .opt { font-weight: 400; color: var(--text-soft); }
.kb-neu .hint-inline { color: var(--text-soft); font-size: 14px; margin: 0; }
.kb-neu .field input[type=text], .kb-neu .field input[type=date], .kb-neu .field input[type=time],
.kb-neu .field input[type=email], .kb-neu .field input[type=tel], .kb-neu .field input[type=number],
.kb-neu .field select, .kb-neu .field textarea, .kb-neu #guesttable input[type=text], .kb-neu #guesttable input[type=email],
.kb-neu #guesttable input[type=tel], .kb-neu #guesttable select, .kb-neu #guesttable textarea {
  width: 100%; max-width: 100%;
  padding: 8px 11px; font: inherit; font-size: 14.5px; color: var(--text);
  background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  box-sizing: border-box;
}
.kb-neu .field textarea, .kb-neu #guesttable textarea { min-height: 84px; resize: vertical; }
.kb-neu .field input:focus, .kb-neu .field select:focus, .kb-neu .field textarea:focus,
.kb-neu #guesttable input:focus, .kb-neu #guesttable select:focus, .kb-neu #guesttable textarea:focus {
  outline: none; border-color: var(--teal); box-shadow: 0 0 0 3px var(--teal-soft);
}
.kb-neu .field input.price { text-align: right; font-variant-numeric: tabular-nums; }
.kb-neu .field input:disabled, .kb-neu .field select:disabled, .kb-neu .field textarea:disabled,
.kb-neu .field textarea[readonly], .kb-neu #guesttable :disabled, .kb-neu .field input.dayOutputField {
  background: var(--kb-bg); color: var(--text-soft);
}
.kb-neu .noteditable { color: var(--text-soft); }
/* Gast = Kontoinhaber selbst (Eigenbedarf): bisher rosa hinterlegt, jetzt dezenter Ton */
.kb-neu input.admin, .kb-neu select.admin, .kb-neu textarea.admin { background: #FBEDEA; }

/* Gastauswahl und Gastformular (Markup aus editGuestSnippet.jsp / ajax.GetPersonTable unverändert) */
.kb-neu .kb-gastwahl select, .kb-neu .kb-gastwahl input { width: 100%; }
.kb-neu .kb-gastwahl select[size] { min-height: 110px; }
.kb-neu .kb-gastwahl label[for=personlisteadmin] { display: block; margin: 8px 0 4px; font-size: 13px; color: var(--text-soft); }
.kb-neu .kb-gastwahl br { display: none; }
.kb-neu .kb-oder { display: flex; align-items: center; gap: 12px; margin: 18px 0 12px; color: var(--text-soft); font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; }
.kb-neu .kb-oder::before, .kb-neu .kb-oder::after { content: ""; flex: 1; border-top: 1px solid var(--border); }
.kb-neu #guesttable { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 18px; font-size: inherit; }
.kb-neu #guesttable .gfRow { display: flex; gap: 10px; align-items: center; margin: 0; min-width: 0; }
.kb-neu #guesttable .gfRow:first-child, .kb-neu #guesttable .gfRow:has(textarea) { grid-column: 1 / -1; }
.kb-neu #guesttable .gfRow:has(select) select { width: auto; min-width: 140px; flex: none; }
.kb-neu #guesttable .gfRow input[name=sprache] { width: 6ch; flex: none; }
.kb-neu #guesttable .gfRow > input, .kb-neu #guesttable .gfRow > textarea { flex: 1; }

/* Status als Kacheln (Radio-Buttons unverändert) */
.kb-neu .status-choice { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-top: 4px; }
.kb-neu .status-choice label {
  display: flex; align-items: center; gap: 10px; margin: 0;
  padding: 10px 14px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  font-weight: 500; color: var(--text); cursor: pointer; background: var(--surface);
}
.kb-neu .status-choice label:has(input:checked) { border-color: var(--teal); background: var(--teal-soft); }
.kb-neu .status-choice label:has(input:disabled) { cursor: default; opacity: .75; }
.kb-neu .status-choice input, .kb-neu .status-extra input, .kb-neu .kb-radios input { accent-color: var(--teal); margin: 0; }
.kb-neu .swatch { display: inline-block; width: 14px; height: 14px; border-radius: 4px; flex-shrink: 0; box-shadow: inset 0 0 0 1px rgba(0,0,0,.08); }
.kb-neu .status-extra { margin-top: 10px; display: flex; gap: 8px 20px; flex-wrap: wrap; align-items: center; font-size: 14px; }
.kb-neu .status-extra label, .kb-neu .kb-radios label { display: inline-flex; gap: 8px; align-items: center; margin: 0; }
.kb-neu .kb-radios { display: flex; flex-wrap: wrap; gap: 6px 18px; align-items: center; }
.kb-neu .kb-check { display: inline-flex; align-items: center; gap: 10px; font-weight: 500; cursor: pointer; }
.kb-neu .kb-hinweis-bearbeiten { color: var(--warn) !important; font-weight: 600; }

.kb-neu .form-actions {
  display: flex; gap: 10px; flex-wrap: wrap; align-items: center;
  margin-top: 24px; padding-top: 18px; border-top: 1px solid var(--border);
}
.kb-neu button.buttonsave {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--teal); color: #fff; border: 0; border-radius: var(--radius-sm);
  padding: 10px 22px; font: 500 15px var(--font-body); cursor: pointer; box-shadow: none; min-height: 0;
}
.kb-neu button.buttonsave:hover { background: var(--teal-deep); color: #fff; }
.kb-neu .card + .card { margin-top: 20px; }
.kb-neu form + .card, .kb-neu .card + form, .kb-neu form .card + .card { margin-top: 20px; }

@media (max-width: 760px) {
  .kb-neu .col-8, .kb-neu .col-6, .kb-neu .col-4, .kb-neu .col-3, .kb-neu .col-2 { grid-column: span 12; }
  .kb-neu .col-3.keep, .kb-neu .col-4.keep, .kb-neu .col-6.keep { grid-column: span 6; }
  .kb-neu #guesttable { grid-template-columns: minmax(0, 1fr); }
  .kb-neu #guesttable .gfRow:first-child, .kb-neu #guesttable .gfRow:has(select) { flex-wrap: wrap; }
}
.kb-neu input[hidden], .kb-neu textarea[hidden] { display: none !important; }

/* ---------- Gäste (Phase 3.3) ---------- */
.kb-neu .btn-danger, .kb-neu input[type=submit].btn-danger { background: var(--surface); color: var(--danger); border: 1px solid #E5BDB9; padding: 8px 16px; }
.kb-neu .btn-danger:hover:not(:disabled) { background: var(--danger-soft); color: var(--danger); }
.kb-neu .btn-danger:disabled, .kb-neu input[type=submit]:disabled { opacity: .5; cursor: not-allowed; }
.kb-neu .card > h2 + form, .kb-neu .card > h2 + .hint { margin-top: 10px; }
.kb-neu .kb-gastformular { margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--border); }
/* Zeilen des Gastformulars (auch per AJAX nachgeladen): Auswahlfelder, Hinweise und Knopf über volle Breite */
.kb-neu #guesttable .gfRow:has(select), .kb-neu #guesttable .gfRow:has(input[type=submit]),
.kb-neu #guesttable .gfRow:has(input[readonly]) { grid-column: 1 / -1; }
.kb-neu #guesttable .gfRow:not(:has(input, select, textarea)) { color: var(--text-soft); font-size: 13.5px; }
.kb-neu #guesttable .gfRow input[readonly] { width: 10ch; flex: none; background: var(--kb-bg); color: var(--text-soft); }
.kb-neu #guesttable input[type=submit], .kb-neu input.greenButton {
  background: var(--teal); color: #fff; border: 0; border-radius: var(--radius-sm);
  padding: 10px 22px; font: 500 15px var(--font-body); cursor: pointer; width: auto; flex: none;
}
.kb-neu #guesttable input[type=submit]:hover { background: var(--teal-deep); }
.kb-neu #guestbztable td a img { display: inline-block; vertical-align: middle; }
.kb-neu #guestbztable th { background: var(--kb-bg); }
.kb-neu .kb-gastwahl > table, .kb-neu .kb-gastwahl > table td { width: 100%; padding: 0; border-spacing: 0; }

/* ---------- Hilfe (Popup helpPart.jsp und Gesamthilfe help.jsp) ---------- */
.kb-hilfe-popup { padding: 20px 22px 32px; max-width: 760px; }
body.indexbody:has(.kb-hilfe-popup) { background: var(--surface); }
.kb-hilfe .helptext { font-family: var(--font-body); font-size: 14.5px; line-height: 1.6; color: var(--text); padding: 0 0 8px; }
.kb-hilfe .helptext + .helptext, .kb-hilfe .hilfe-texte .helptext { border-top: 1px solid var(--border); padding-top: 22px; margin-top: 22px; }
.kb-hilfe .hilfe-texte .helptext:first-child { border-top: 0; padding-top: 0; margin-top: 0; }
.kb-hilfe .helpheadline {
  font-family: var(--font-head); font-weight: 500; font-size: 22px; line-height: 1.25;
  color: var(--ink); background: none; padding: 0; margin: 0 0 10px;
}
.kb-hilfe .help-section-title {
  font-family: var(--font-body); font-weight: 600; font-size: 15px; color: var(--ink);
  border-bottom: 0; margin: 18px 0 4px; padding: 0;
}
.kb-hilfe p { margin: 0 0 10px; }
.kb-hilfe ul, .kb-hilfe ol { padding-left: 22px; margin: 6px 0 12px; }
.kb-hilfe li { margin-bottom: 4px; }
.kb-hilfe .help-hint {
  background: var(--teal-soft); border: 1px solid #BCD9E2; border-left: 3px solid var(--teal);
  color: var(--teal-deep); border-radius: var(--radius-sm);
  padding: 10px 14px; margin: 14px 0 6px; font-size: 14px; line-height: 1.5;
}
.kb-hilfe .help-dl { margin: 8px 0 12px; }
.kb-hilfe .help-dl dt { width: 28px; padding: 6px 0; }
.kb-hilfe .help-dl dd { margin-left: 34px; padding: 6px 0; border-bottom: 1px solid var(--border); }
.kb-hilfe img { vertical-align: middle; }
.kb-hilfe code, .kb-hilfe pre, .kb-hilfe #htmltag { font-size: 13px; border-radius: 4px; }
.kb-hilfe .nachobenlink { font-size: 12.5px; text-align: right; margin-top: 8px; }
.kb-hilfe-popup .nachobenlink { display: none; }
.kb-hilfe .nachobenlink a { color: var(--text-soft); }
/* Inhaltsverzeichnis der Gesamthilfe */
.kb-hilfe .hilfe-toc { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 18px 28px; margin-top: 12px; }
.kb-hilfe .hilfe-toc .nav-title { font-size: 11.5px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--text-soft); margin-bottom: 6px; }
.kb-hilfe .hilfe-toc ul { list-style: none; padding: 0; margin: 0; }
.kb-hilfe .hilfe-toc li { margin: 0 0 4px; font-size: 14.5px; }
.kb-hilfe .hilfe-toc a { text-decoration: none; }
.kb-hilfe .hilfe-toc a:hover { text-decoration: underline; }
.kb-hilfe .hilfe-texte { margin-top: 20px; }

/* ---------- Abfragen (Phase 3.4) ---------- */
.kb-neu .kb-schnellwahl { display: flex; flex-wrap: wrap; gap: 6px 16px; align-items: center; font-size: 14px; }
.kb-neu .kb-schnellwahl .noticelow { font-size: inherit; }
.kb-neu .kb-schalter { display: flex; flex-direction: column; gap: 8px; }
.kb-neu .kb-schalter .kb-check { font-weight: 400; flex-wrap: wrap; }
.kb-neu .kb-abfrageknoepfe { display: flex; flex-wrap: wrap; gap: 8px; }
.kb-neu .kb-abfrageknoepfe input[type=submit] {
  border-radius: 99px; padding: 6px 15px; font-size: 14px; font-weight: 500;
  background: var(--surface); color: var(--ink); border: 1px solid var(--border-strong); min-height: 0;
}
.kb-neu .kb-abfrageknoepfe input[type=submit]:hover { border-color: var(--teal); color: var(--teal-deep); }
.kb-neu .kb-abfrageknoepfe input[type=submit].greenButton { background: var(--teal); border-color: var(--teal); color: #fff; }
.kb-neu .kb-ergebnis { margin-top: 20px; }
.kb-neu table.kb-abfrage-tabelle td { vertical-align: top; }
.kb-neu table.kb-abfrage-tabelle td > input[type=text], .kb-neu table.kb-abfrage-tabelle td > a > input[type=text] { display: block; margin: 1px 0; }
.kb-neu table.kb-abfrage-tabelle textarea { font: 13.5px/1.5 var(--font-body); color: var(--text); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 6px 8px; max-width: 100%; }
.kb-neu table.kb-abfrage-tabelle input[type=text] { font-size: 13.5px; }
.kb-neu table.kb-abfrage-tabelle input[type=text][size="14"] { width: 17.5ch; }
.kb-neu table.kb-abfrage-tabelle input[type=text][size="10"] { width: 11.5ch; }

/* ---------- Status-Etiketten (Buchungsanfragen u. a.) ---------- */
.kb-neu .pill { display: inline-block; padding: 2px 11px; border-radius: 99px; font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.kb-neu .pill.reserviert { background: var(--cal-reserviert); color: var(--ink-soft); }
.kb-neu .pill.belegt { background: var(--teal); color: #fff; }
.kb-neu .pill.neutral { background: var(--kb-bg); color: var(--ink-soft); box-shadow: inset 0 0 0 1px var(--border); }
.kb-neu .pill.storno { background: var(--danger-soft); color: var(--danger); }
.kb-neu .pill.ok { background: var(--ok-soft); color: var(--ok); }
.kb-neu table.data input.dateTimeShortInputField { width: 16ch; }

/* ---------- Einstellungsseiten mit Feldgruppen (Kalender u. a., Phase 3.6) ---------- */
.kb-neu .kb-fieldsets fieldset.inFormularRegion {
  float: none !important; display: block; clear: both;
  border: 0; border-top: 1px solid var(--border); border-radius: 0;
  margin: 0; padding: 16px 0 18px; font-size: 14.5px; background: none;
}
.kb-neu .kb-fieldsets > fieldset.inFormularRegion:first-of-type { border-top: 0; padding-top: 0; }
.kb-neu .kb-fieldsets fieldset.inFormularRegion > legend {
  float: left; width: 100%; padding: 0; margin: 0 0 10px;
  font-family: var(--font-body); font-size: 14px; font-weight: 400; color: var(--text-soft);
}
.kb-neu .kb-fieldsets fieldset.inFormularRegion > legend > b:first-child {
  display: block; font-family: var(--font-head); font-size: 17px; font-weight: 500; color: var(--ink); margin-bottom: 2px;
}
.kb-neu .kb-fieldsets fieldset.inFormularRegion > legend + * { clear: left; }
.kb-neu .kb-fieldsets fieldset table { border-collapse: separate; border-spacing: 8px 6px; margin-left: -8px; }
.kb-neu .kb-fieldsets fieldset table td { vertical-align: middle; font-size: 14px; }
.kb-neu .kb-fieldsets input.colorPicker { width: 44px; height: 32px; padding: 2px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--surface); }
.kb-neu .kb-fieldsets input[type=radio] { accent-color: var(--teal); }
.kb-neu .kb-fieldsets button[type=button] { padding: 6px 14px; font: inherit; font-size: 14px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--surface); color: var(--ink); cursor: pointer; }
.kb-neu .kb-fieldsets button[type=button]:hover { border-color: var(--teal); color: var(--teal-deep); }
.kb-neu input[type=submit].greenButton { background: var(--teal); color: #fff; border: 0; border-radius: var(--radius-sm); padding: 10px 22px; font: 500 15px var(--font-body); cursor: pointer; }
.kb-neu input[type=submit].greenButton:hover { background: var(--teal-deep); }
.kb-neu .kal-vorschau .kal-inhalt { border-radius: var(--radius-sm); padding: 8px; }

/* ---------- Generisch umgestellte Seiten (kb-allg) ---------- */
.kb-neu.kb-allg > br, .kb-neu.kb-allg > form > br:first-child { display: none; }
.kb-neu.kb-allg > .kslistformular { display: flex; justify-content: flex-start; margin: -8px 0 18px; }
.kb-neu .card { position: relative; }
.kb-neu .card + .card, .kb-neu .card + form.card, .kb-neu form.card + .card { margin-top: 20px; }
.kb-neu .card .helplink { position: absolute; top: 18px; right: 20px; margin: 0; padding: 0; border: 0; font-size: 13px; z-index: 1; }
.kb-neu .card .helplink + .helplink { display: none; }
.kb-neu .helplinktext {
  display: inline-block; padding: 3px 11px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--ink); font-weight: 500;
}
.kb-neu .helplinktext:hover { border-color: var(--teal); color: var(--teal-deep); }
.kb-neu .helplinktext a { color: inherit; text-decoration: none; }
.kb-neu .kb-fieldsets fieldset.inFormularRegion > legend { font-size: 14px; font-weight: 600; color: var(--ink); padding-right: 90px; }
.kb-neu .kb-fieldsets input[type=text], .kb-neu .kb-fieldsets input[type=password], .kb-neu .kb-fieldsets input[type=email],
.kb-neu .kb-fieldsets input[type=tel], .kb-neu .kb-fieldsets input[type=number], .kb-neu .kb-fieldsets input[type=date],
.kb-neu .kb-fieldsets input[type=url], .kb-neu .kb-fieldsets input:not([type]), .kb-neu .kb-fieldsets textarea {
  font: inherit; font-size: 14px; padding: 6px 10px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--text); max-width: 100%;
}
.kb-neu .kb-fieldsets input[readonly] { background: var(--kb-bg); color: var(--text-soft); }
.kb-neu .kb-fieldsets input:focus, .kb-neu .kb-fieldsets textarea:focus, .kb-neu .kb-fieldsets select:focus { outline: none; border-color: var(--teal); box-shadow: 0 0 0 3px var(--teal-soft); }
.kb-neu .kb-fieldsets input[type=submit]:not(.greenButton):not(.btn-danger) { font-weight: 500; }
.kb-neu .kb-fieldsets .notice, .kb-neu .kb-fieldsets .noticelow, .kb-neu .kb-fieldsets .noticeLow { color: var(--text-soft); font-size: 13.5px; }
.kb-neu .kb-fieldsets .markError, .kb-neu .markError { color: var(--danger); }
.kb-neu .kb-fieldsets table { max-width: 100%; }
.kb-neu form.card { overflow-x: auto; }
.kb-neu .kb-hilfe-rechts { display: flex; justify-content: flex-end; margin: -8px 0 8px; }
.kb-neu .kb-hilfe-rechts .helplink { position: static; border: 0; margin: 0; }
.kb-neu .codePre, .kb-neu pre { border-radius: var(--radius-sm); padding: 12px 14px; overflow-x: auto; }
.kb-neu .codePre, .kb-neu #htmltag { background: var(--bg-mist) !important; border: 1px solid var(--border); color: var(--ink-soft); }

/* ---------- Texte (prePostTextSnippet) ---------- */
.kb-neu .kb-texte textarea { width: 100%; font-family: ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace; font-size: 13.5px; line-height: 1.5; }
.kb-neu .kb-texte textarea[name=titleName] { font-family: var(--font-body); font-size: 15px; min-height: 0; height: auto; }
.kb-neu .kb-texte textarea[name=preText], .kb-neu .kb-texte textarea[name=postText] { min-height: 220px; }
.kb-neu .kb-texte-hinweise { margin-top: 22px; font-size: 14px; line-height: 1.55; }
.kb-neu .kb-texte-hinweise p { margin: 0 0 8px; }
.kb-neu .kb-texte-hinweise .kb-hinweis-titel { font-weight: 600; margin-bottom: 8px; }
.kb-neu .kb-texte-hinweise #htmltag { padding: 1px 6px; border-radius: 4px; background: var(--surface) !important; }
.kb-neu .alert-info { background: var(--teal-soft); border: 1px solid #BCD9E2; color: var(--teal-deep); border-radius: var(--radius-sm); padding: 14px 18px; }

/* ---------- Breite Ansicht (Vorhandene Buchungen): alle Spalten auf einen Blick ---------- */
body.kb-breit .sitecontent { grid-template-columns: minmax(0, 1fr); }
body.kb-breit .sitecontent > .left { display: none; }
body.kb-breit .sitecontent > .content { grid-column: 1 / -1; max-width: none; padding: 20px 16px 48px; }
body.kb-breit .kb-menu-toggle { display: inline-block; }
body.kb-breit.mobileMenuOpen .sitecontent > .left {
  display: block; position: fixed; left: 0; top: var(--kb-topbar-h); bottom: 0; width: 280px; height: auto; z-index: 1000;
  box-shadow: var(--shadow), 4px 0 18px rgba(15, 36, 48, .12);
}
body.kb-breit.mobileMenuOpen .mobileMenuBackdrop { display: block; position: fixed; inset: var(--kb-topbar-h) 0 0 0; background: rgba(15, 36, 48, .35); z-index: 999; }
body.kb-breit .kb-neu table.data.dense { font-size: 13px; }
body.kb-breit .kb-neu table.data.dense th { padding: 7px 5px; font-size: 10.5px; letter-spacing: .03em; }
body.kb-breit .kb-neu table.data.dense td { padding: 2px 3px; }
body.kb-breit .kb-neu table.data input[type=text] { font-size: 13px; padding: 3px 4px; }
body.kb-breit .kb-neu table.data input.dateInputField { width: 10ch; }
body.kb-breit .kb-neu table.data input.price { width: 8ch; }
body.kb-breit .kb-neu table.data input.gast { width: 24ch; }
body.kb-breit .kb-neu table.data input.werbung { width: 16ch; }
body.kb-breit .kb-neu .icon-btn, body.kb-breit .kb-neu .icon-platz { width: 24px; height: 24px; }
body.kb-breit .kb-neu table.data.dense th { white-space: normal; line-height: 1.25; vertical-align: bottom; max-width: 11ch; }
body.kb-breit .kb-neu table.data.dense th.sticky-1, body.kb-breit .kb-neu table.data.dense th.sticky-2 { max-width: none; }
body.kb-breit .kb-neu table.data input[type=text] { font-size: 12.5px; }
body.kb-breit .kb-neu table.data input.price { width: 7.5ch; }
body.kb-breit .kb-neu table.data input.dateInputField { width: 9.5ch; }
body.kb-breit .kb-neu table.data input.gast { width: 20ch; }
body.kb-breit .kb-neu table.data input.werbung { width: 12ch; }
body.kb-breit .kb-neu table.data input.bzt_resbel { width: 9ch; font-size: 11.5px; }
body.kb-breit .kb-neu table.data input.nr { width: 6ch; }
body.kb-breit .kb-neu table.data input.naechte { width: 4ch; }
body.kb-breit .kb-neu table.data.dense th { max-width: 9ch; hyphens: manual; }
body.kb-breit .kb-neu table.data input[type=text] { font-size: 12px; padding: 3px 3px; }
body.kb-breit .kb-neu table.data input.price { width: 7ch; }
body.kb-breit .kb-neu table.data input.gast { width: 18ch; }
body.kb-breit .kb-neu table.data input.werbung { width: 11ch; }
body.kb-breit .kb-neu table.data.dense td { padding: 2px 2px; }
/* Vorhandene Buchungen: schmale Spalten (Spr., An/Ab), Aktionsspalte nach Inhalt, mehr Platz für Werbung */
.kb-neu table.data th abbr { text-decoration: none; cursor: help; }
.kb-neu table.data th.schmal { text-align: center; }
.kb-neu .sticky-1 { width: 1%; }
.kb-neu table.data input.nr { width: 6ch; }
.kb-neu table.data input.werbung { width: 32ch; }
body.kb-breit .kb-neu table.data input.werbung { width: 20ch; }
body.kb-breit .kb-neu table.data.dense th { max-width: 11ch; letter-spacing: 0; padding-right: 8px; }

/* Seitenleiste: Gruppenüberschriften deutlicher von den Menüpunkten absetzen */
.left .nav-title { color: var(--teal-deep); font-weight: 700; font-size: 12px; }
.left .nav-group + .nav-group { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--border); }

/* ---------- Kalenderseiten-Auswahl (Kopfleiste / Handy-Menü) ---------- */
.kb-kswahl { display: flex; align-items: center; gap: 8px; margin: 0; }
.kb-kswahl label { font-size: 13px; color: var(--text-soft); white-space: nowrap; }
.kb-kswahl select {
  font: inherit; font-size: 14px; color: var(--ink); max-width: 280px;
  padding: 6px 10px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--surface); cursor: pointer;
}
.kb-kswahl select:focus { outline: none; border-color: var(--teal); box-shadow: 0 0 0 3px var(--teal-soft); }
.kb-nur-schmal-menue { display: none; }
@media (max-width: 960px) {
  .kb-topbar .kb-kswahl-kopf { display: none; }
  .kb-nur-schmal-menue { display: block; padding: 0 4px 16px; margin-bottom: 14px; border-bottom: 1px solid var(--border); }
  .kb-nur-schmal-menue .kb-kswahl { flex-direction: column; align-items: stretch; gap: 4px; }
  .kb-nur-schmal-menue .kb-kswahl select { max-width: none; width: 100%; }
  .kb-nur-schmal-menue .kb-aktks { display: block; max-width: none; white-space: normal; }
}
