/* =====================================================================
   KBS UI – gemeinsames Design-System (Admin, Portale, öffentliche Seite)
   Stil wie das Login (includes/auth_layout.php): Inter, dunkles Marken-
   Panel #161616, Akzentfarbe aus system_settings, Karten 18px Radius,
   weicher Schatten, Inputs 2px #e9ecef / 10px Radius / Fokus-Ring.
   Wird NACH dem Inline-CSS der Header geladen und überschreibt gezielt.
   ===================================================================== */

:root {
    --kbs-accent: #1971c2;            /* wird per PHP in den Headern überschrieben */
    --kbs-accent-rgb: 25, 113, 194;
    --kbs-dark: #161616;
    --kbs-dark-2: #1f1f1f;
    --kbs-surface: #ffffff;
    --kbs-bg: #f3f4f6;
    --kbs-text: #1e293b;
    --kbs-muted: #6b7280;
    --kbs-border: #e9ecef;
    --kbs-border-strong: #d1d5db;
    --kbs-radius: 18px;
    --kbs-radius-sm: 10px;
    --kbs-radius-xs: 6px;
    --kbs-shadow: 0 10px 30px rgba(0, 0, 0, .08);
    --kbs-shadow-sm: 0 2px 8px rgba(0, 0, 0, .06);
    --kbs-shadow-lg: 0 20px 60px rgba(0, 0, 0, .18);
    --kbs-success: #15803d; --kbs-success-bg: #f0fdf4; --kbs-success-border: #bbf7d0;
    --kbs-danger: #b91c1c;  --kbs-danger-bg: #fef2f2;  --kbs-danger-border: #fecaca;
    --kbs-warning: #b45309; --kbs-warning-bg: #fffbeb; --kbs-warning-border: #fde68a;
    --kbs-info: #0369a1;    --kbs-info-bg: #f0f9ff;    --kbs-info-border: #bae6fd;
    /* ---- Schriftgrößen: eine Stufe ändern wirkt überall; --kbs-fs-scale skaliert ALLES ---- */
    --kbs-fs-scale: 1;                                   /* 1.05 = alles 5 % größer */
    --kbs-fs-xs:   calc(11.5px * var(--kbs-fs-scale));   /* Fußnoten, Kennzeichen */
    --kbs-fs-sm:   calc(13px   * var(--kbs-fs-scale));   /* Nebentext, Beschriftungen */
    --kbs-fs-base: calc(14px   * var(--kbs-fs-scale));   /* Fließtext, Tabellen, Felder */
    --kbs-fs-md:   calc(15px   * var(--kbs-fs-scale));   /* Hervorgehobener Text */
    --kbs-fs-lg:   calc(17px   * var(--kbs-fs-scale));   /* Abschnittsüberschriften */
    --kbs-fs-xl:   calc(21px   * var(--kbs-fs-scale));   /* Seitentitel mobil */
    --kbs-fs-2xl:  calc(26px   * var(--kbs-fs-scale));   /* Seitentitel, große Zahlen */
    /* ---- Flächenfarben für Knöpfe und Kennzeichen (die --kbs-*-Basisfarben sind Textfarben) ---- */
    --kbs-success-solid: #16a34a;
    --kbs-danger-solid:  #dc2626;
    --kbs-warning-solid: #f59e0b;
    --kbs-info-solid:    #0ea5e9;
    --kbs-font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    --kbs-sidebar-width: 272px;
    --kbs-sidebar-width-collapsed: 74px;
    --kbs-topbar-height: 56px;
    /* Kompatibilität mit altem Admin-CSS */
    --primary-color: var(--kbs-accent);
    --sidebar-width: var(--kbs-sidebar-width);
    --topbar-height: var(--kbs-topbar-height);
    color-scheme: light;
}

/* ---------- Basis ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    font-family: var(--kbs-font);
    font-size: var(--kbs-fs-base);
    line-height: 1.55;
    color: var(--kbs-text);
    background: var(--kbs-bg);
    -webkit-font-smoothing: antialiased;
}
a { color: var(--kbs-accent); }
a:hover { filter: brightness(.9); }
h1, h2, h3, h4 { color: var(--kbs-text); letter-spacing: -.01em; line-height: 1.25; }
img { max-width: 100%; }
:focus-visible { outline: 3px solid rgba(var(--kbs-accent-rgb), .45); outline-offset: 2px; border-radius: 4px; }
button, input, select, textarea { font-family: inherit; }
.kbs-icon, .kbs-icon svg, svg.kbs-icon { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- App-Layout (Admin + Portale) ---------- */
.admin-layout, .portal-layout { display: flex; min-height: 100vh; }

.sidebar {
    width: var(--kbs-sidebar-width);
    background: var(--kbs-dark);
    color: #fff;
    position: fixed;
    top: 0; left: 0; bottom: 0;
    height: 100vh;
    overflow-y: auto;
    overflow-x: hidden;
    z-index: 1000;
    padding: 0;
    border-right: none;
    box-shadow: none;
    transition: transform .25s ease, width .2s ease;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,.2) transparent;
    display: flex;
    flex-direction: column;
}
/* ---------- Eingeklappte Seitenleiste (mehr Platz zum Arbeiten) ---------- */
.kbs-sidebar-collapse-btn {
    position: fixed; top: 50%; left: var(--kbs-sidebar-width); z-index: 1001;
    transform: translate(-50%, -50%);
    width: 32px; height: 32px; padding: 0; border-radius: 50%;
    background: var(--kbs-accent); border: 3px solid var(--kbs-bg); color: #fff;
    display: inline-flex; align-items: center; justify-content: center; cursor: pointer;
    font-size: var(--kbs-fs-md); font-weight: 700; line-height: 1;
    box-shadow: 0 3px 10px rgba(0,0,0,.3);
    transition: background .15s, color .15s, left .2s ease, transform .15s;
}
.kbs-sidebar-collapse-btn:hover { background: var(--kbs-dark-2); border-color: var(--kbs-bg); color: #fff; transform: translate(-50%, -50%) scale(1.12); }
.kbs-sidebar-collapse-btn:focus-visible { outline: 2px solid var(--kbs-accent); outline-offset: 2px; opacity: 1; }
body.kbs-sidebar-collapsed .kbs-sidebar-collapse-btn { left: var(--kbs-sidebar-width-collapsed); }
/* Platz für den Schalter, damit er Logo und Name nicht überlappt */

body.kbs-sidebar-collapsed .sidebar { width: var(--kbs-sidebar-width-collapsed); overflow: visible; }
body.kbs-sidebar-collapsed .main-content { margin-left: var(--kbs-sidebar-width-collapsed); }
body.kbs-sidebar-collapsed .sidebar .sidebar-logo-text,
body.kbs-sidebar-collapsed .sidebar .sidebar-user-meta,
body.kbs-sidebar-collapsed .sidebar .nav-section-title,
body.kbs-sidebar-collapsed .sidebar .nav-text,
body.kbs-sidebar-collapsed .sidebar .dropdown-arrow,
body.kbs-sidebar-collapsed .sidebar .sidebar-footer,
body.kbs-sidebar-collapsed .sidebar .nav-submenu { display: none; }
body.kbs-sidebar-collapsed .sidebar .sidebar-header { padding: 14px 8px 12px; }
body.kbs-sidebar-collapsed .sidebar .sidebar-logo,
body.kbs-sidebar-collapsed .sidebar .sidebar-user { justify-content: center; gap: 0; }
body.kbs-sidebar-collapsed .sidebar .sidebar-logo img { max-width: 46px; }
body.kbs-sidebar-collapsed .sidebar .nav-link,
body.kbs-sidebar-collapsed .sidebar .nav-dropdown-toggle { justify-content: center; padding: 11px 8px; }
body.kbs-sidebar-collapsed .sidebar .nav-dropdown-toggle > span:first-child { flex: 0 0 auto; gap: 0; }
body.kbs-sidebar-collapsed .sidebar .nav-badge {
    position: absolute; top: 5px; right: 9px; margin: 0; min-width: 17px; height: 17px; font-size: calc(10px * var(--kbs-fs-scale)); padding: 0 4px;
}
body.kbs-sidebar-collapsed .sidebar .nav-link { position: relative; }
/* Eingeklappt: Beschriftung als Sprechblase beim Überfahren */
body.kbs-sidebar-collapsed .sidebar .nav-link[data-title]:hover::after,
body.kbs-sidebar-collapsed .sidebar .nav-dropdown-toggle[data-title]:hover::after {
    content: attr(data-title);
    position: absolute; left: calc(100% + 8px); top: 50%; transform: translateY(-50%);
    background: var(--kbs-dark-2); color: #fff; padding: 6px 11px; border-radius: 8px;
    font-size: var(--kbs-fs-sm); font-weight: 500; white-space: nowrap; z-index: 1200;
    box-shadow: var(--kbs-shadow-lg); border: 1px solid rgba(255,255,255,.1); pointer-events: none;
}
/* Untermenüs eingeklappt: als Flyout neben dem Symbol */
body.kbs-sidebar-collapsed .sidebar .nav-dropdown.open .nav-submenu {
    display: block; position: absolute; left: calc(100% + 6px); top: 0; min-width: 210px;
    max-height: none; opacity: 1; background: var(--kbs-dark-2); border: 1px solid rgba(255,255,255,.1);
    border-radius: 12px; padding: 6px; box-shadow: var(--kbs-shadow-lg); z-index: 1200;
}
body.kbs-sidebar-collapsed .sidebar .nav-dropdown { position: relative; }
body.kbs-sidebar-collapsed .sidebar .nav-dropdown.open .nav-submenu .nav-link { justify-content: flex-start; padding: 8px 12px 8px 22px; }
body.kbs-sidebar-collapsed .sidebar .nav-dropdown.open .nav-submenu .nav-text { display: inline; }
.sidebar::-webkit-scrollbar { width: 6px; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,.2); border-radius: 3px; }

.sidebar-header {
    position: relative;
    padding: 22px 18px 16px;
    background: var(--kbs-dark);
    border-bottom: 1px solid rgba(255,255,255,.08);
    position: static;
    margin: 0;
}
.sidebar-logo { display: flex; align-items: center; gap: 12px; text-decoration: none; color: #fff; min-width: 0; }
.sidebar-logo:hover { filter: none; }
.sidebar-logo img { max-height: 44px; max-width: 170px; object-fit: contain; display: block; }
.sidebar-logo-text { font-size: var(--kbs-fs-lg); font-weight: 800; color: #fff; letter-spacing: -.2px; line-height: 1.2; overflow-wrap: anywhere; min-width: 0; }
.sidebar-brand-initials { display: none; width: 40px; height: 40px; border-radius: 12px; background: var(--kbs-accent); color: #fff; font-weight: 800; font-size: var(--kbs-fs-base); letter-spacing: .03em; align-items: center; justify-content: center; flex-shrink: 0; }
body.kbs-sidebar-collapsed .sidebar .sidebar-brand-initials { display: inline-flex; }
.sidebar-logo-sub { display: block; font-size: var(--kbs-fs-xs); font-weight: 500; color: #9a9a9a; margin-top: 2px; letter-spacing: .2px; }
.brand-mark { width: 40px; height: 40px; border-radius: 12px; background: var(--kbs-accent); display: inline-flex; align-items: center; justify-content: center; box-shadow: 0 8px 20px rgba(var(--kbs-accent-rgb), .35); flex-shrink: 0; }
.brand-mark svg { width: 22px; height: 22px; stroke: #fff; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.akzent-balken { width: 56px; height: 4px; border-radius: 2px; background: var(--kbs-accent); margin: 14px 0 0; }

.sidebar-user {
    margin-top: 14px;
    padding: 10px 12px;
    background: rgba(255,255,255,.06);
    border-radius: var(--kbs-radius-sm);
    font-size: var(--kbs-fs-sm);
    display: flex;
    align-items: center;
    gap: 10px;
    color: #fff;
}
.sidebar-user-avatar { width: 34px; height: 34px; border-radius: 50%; background: rgba(var(--kbs-accent-rgb), .25); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: var(--kbs-fs-sm); flex-shrink: 0; }
.sidebar-user-avatar svg { width: 18px; height: 18px; stroke: #fff; }
.sidebar-user-meta { min-width: 0; flex: 1; }
.sidebar-user-email { font-weight: 600; color: #fff; margin-bottom: 1px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-user-role { color: #9a9a9a; text-transform: uppercase; font-size: calc(10.5px * var(--kbs-fs-scale)); letter-spacing: .5px; }
.sidebar-user .user-info { color: #cfcfcf; }
.sidebar-header .user-info { font-size: var(--kbs-fs-sm); color: #cfcfcf; margin-top: 4px; }
.sidebar-header h1 { font-size: var(--kbs-fs-md); font-weight: 800; margin: 0; color: #fff; }

/* Navigation */
.sidebar nav { flex: 1; }
.nav-menu { list-style: none; margin: 0; padding: 14px 12px 20px; }
.nav-section-title { padding: 16px 14px 6px; font-size: var(--kbs-fs-xs); font-weight: 700; text-transform: uppercase; letter-spacing: .8px; color: #8a8a8a; }
.nav-item { margin-bottom: 2px; }
.nav-menu li { margin-bottom: 2px; }
.nav-link,
.nav-menu li > a,
.nav-dropdown-toggle {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 10px 13px;
    color: #cfcfcf;
    text-decoration: none;
    border-radius: var(--kbs-radius-sm);
    font-size: var(--kbs-fs-base);
    font-weight: 500;
    line-height: 1.3;
    position: relative;
    transition: background .15s ease, color .15s ease;
    cursor: pointer;
    user-select: none;
    transform: none;
    box-shadow: none;
}
.nav-link svg, .nav-dropdown-toggle svg, .nav-menu li > a svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; opacity: .85; }
.nav-link:hover, .nav-menu li > a:hover, .nav-dropdown-toggle:hover { background: rgba(255,255,255,.07); color: #fff; filter: none; transform: none; }
.nav-link.active, .nav-menu li > a.active {
    background: rgba(var(--kbs-accent-rgb), .18);
    color: #fff;
    font-weight: 600;
    box-shadow: none;
}
.nav-link.active svg, .nav-menu li > a.active svg { stroke: var(--kbs-accent); opacity: 1; }
.nav-link.active::before, .nav-menu li > a.active::before {
    content: '';
    position: absolute;
    left: 0; top: 50%;
    transform: translateY(-50%);
    width: 3px; height: 60%;
    background: var(--kbs-accent);
    border-radius: 0 3px 3px 0;
}
.nav-link .nav-text, .nav-dropdown-toggle .nav-text { flex: 1; min-width: 0; }
.nav-badge {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 20px; height: 20px; padding: 0 6px;
    background: var(--kbs-accent); color: #fff;
    border-radius: 10px; font-size: var(--kbs-fs-xs); font-weight: 700; line-height: 1; margin-left: 6px;
}
.nav-link:hover .nav-badge { background: var(--kbs-accent); }
.nav-dropdown { margin-bottom: 2px; }
.nav-dropdown-toggle { justify-content: flex-start; }
.nav-dropdown-toggle > span:first-child { flex: 1; display: inline-flex; align-items: center; gap: 11px; }
.nav-dropdown.open .nav-dropdown-toggle { color: #fff; background: rgba(255,255,255,.05); font-weight: 600; }
.dropdown-arrow { font-size: calc(9px * var(--kbs-fs-scale)); color: #8a8a8a; transition: transform .2s ease; margin-left: auto; }
.nav-dropdown.open .dropdown-arrow { transform: rotate(90deg); color: var(--kbs-accent); }
.nav-submenu { list-style: none; margin: 0; padding: 0 0 0 14px; max-height: 0; overflow: hidden; opacity: 0; transition: max-height .25s ease, opacity .2s ease; }
.nav-dropdown.open .nav-submenu { max-height: 900px; opacity: 1; padding-top: 2px; padding-bottom: 4px; }
.nav-submenu .nav-link { padding: 8px 12px 8px 30px; font-size: var(--kbs-fs-base); font-weight: 400; color: #b5b5b5; }
.nav-submenu .nav-link::after { content: ''; position: absolute; left: 15px; top: 50%; width: 5px; height: 5px; border-radius: 50%; background: currentColor; opacity: .45; transform: translateY(-50%); }
.nav-submenu .nav-link.active { background: rgba(var(--kbs-accent-rgb), .18); color: #fff; }
.nav-submenu .nav-link.active::after { background: var(--kbs-accent); opacity: 1; }
.nav-submenu .nav-link.active::before { height: 50%; }
.nav-logout { margin-top: 18px; padding-top: 12px; border-top: 1px solid rgba(255,255,255,.08); }
.nav-logout .nav-link { color: #cfcfcf; }
.nav-logout .nav-link:hover { background: rgba(239, 68, 68, .14); color: #fff; }
.sidebar-footer { padding: 12px 18px 16px; font-size: var(--kbs-fs-xs); color: #7a7a7a; border-top: 1px solid rgba(255,255,255,.06); }

/* Mobile Topbar + Hamburger */
.kbs-topbar {
    display: none;
    position: fixed; top: 0; left: 0; right: 0;
    height: var(--kbs-topbar-height);
    background: var(--kbs-dark);
    color: #fff;
    z-index: 1001;
    align-items: center;
    gap: 12px;
    padding: 0 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,.25);
}
.kbs-topbar-title { font-weight: 700; font-size: var(--kbs-fs-md); flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kbs-topbar img { max-height: 34px; max-width: 120px; object-fit: contain; }
.kbs-topbar .brand-mark { width: 34px; height: 34px; border-radius: 10px; box-shadow: none; }
.kbs-topbar .brand-mark svg { width: 18px; height: 18px; }
.mobile-toggle {
    display: none;
    position: static;
    background: transparent;
    border: 1px solid rgba(255,255,255,.18);
    border-radius: 8px;
    width: 40px; height: 40px;
    padding: 0;
    cursor: pointer;
    box-shadow: none;
    color: #fff;
    align-items: center; justify-content: center; flex-direction: column; gap: 5px;
}
.mobile-toggle span { display: block; width: 20px; height: 2px; background: #fff; margin: 0; border-radius: 1px; transition: transform .2s, opacity .2s; }
.kbs-sidebar-open .mobile-toggle span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.kbs-sidebar-open .mobile-toggle span:nth-child(2) { opacity: 0; }
.kbs-sidebar-open .mobile-toggle span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
.kbs-backdrop { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 999; }
.kbs-sidebar-open .kbs-backdrop { display: block; }

.main-content {
    flex: 1;
    min-width: 0;
    margin-left: var(--kbs-sidebar-width);
    transition: margin-left .2s ease;
    padding: 32px 32px 24px;
    min-height: 100vh;
    transition: none;
}
.main-content > .container, .portal-layout .container { max-width: none; padding: 0; margin: 0; }
.container { max-width: 1400px; margin: 0 auto; padding: 0 2rem; }

/* Seitenkopf */
.page-header { margin-bottom: 26px; }
.page-header h1, .page-header h2 { font-size: var(--kbs-fs-2xl); font-weight: 800; margin: 0 0 6px; letter-spacing: -.02em; }
.page-header p { color: var(--kbs-muted); font-size: var(--kbs-fs-md); margin: 0; }
.page-header .breadcrumb, .breadcrumb { color: var(--kbs-muted); font-size: var(--kbs-fs-sm); margin: 0 0 18px; }
.topbar {
    background: var(--kbs-surface);
    border-radius: var(--kbs-radius);
    padding: 18px 24px;
    margin-bottom: 26px;
    box-shadow: var(--kbs-shadow-sm);
    display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap;
}
.page-title-section h1 { font-size: calc(22px * var(--kbs-fs-scale)); font-weight: 800; margin: 0 0 4px; }

/* ---------- Karten ---------- */
.card {
    background: var(--kbs-surface);
    border-radius: var(--kbs-radius);
    padding: 24px;
    box-shadow: var(--kbs-shadow);
    margin-bottom: 24px;
    border: none;
}
.card-header {
    font-size: var(--kbs-fs-lg);
    font-weight: 700;
    margin: -24px -24px 20px;
    padding: 16px 24px;
    border-bottom: 1px solid var(--kbs-border);
    border-radius: var(--kbs-radius) var(--kbs-radius) 0 0;
    background: transparent;
    color: var(--kbs-text);
    display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
}
.card-header h2, .card-header h3 { font-size: inherit; font-weight: inherit; margin: 0; }
.card-header .btn { margin: -4px 0; }
.card-body { padding: 0; }
.card-title { font-size: var(--kbs-fs-lg); font-weight: 700; margin: 0 0 12px; }
.card-footer { margin: 20px -24px -24px; padding: 14px 24px; border-top: 1px solid var(--kbs-border); background: #fafafa; border-radius: 0 0 var(--kbs-radius) var(--kbs-radius); }
.card h2:first-child { font-size: var(--kbs-fs-lg); font-weight: 700; margin: 0 0 16px; }
.card .card { box-shadow: var(--kbs-shadow-sm); border: 1px solid var(--kbs-border); }
.shadow-sm { box-shadow: var(--kbs-shadow-sm) !important; }

/* Statistik-Karten */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 18px; margin-bottom: 28px; }
.stat-card, .stats-card {
    background: var(--kbs-surface);
    padding: 22px 22px 20px;
    border-radius: var(--kbs-radius);
    box-shadow: var(--kbs-shadow);
    border: none;
    position: relative;
    overflow: hidden;
    transition: transform .2s ease, box-shadow .2s ease;
}
.stat-card::after, .stats-card::after {
    content: ''; position: absolute; left: 22px; right: auto; bottom: 14px; width: 36px; height: 4px; border-radius: 2px;
    background: var(--kbs-accent); opacity: .9;
}
.stat-card:hover, .stats-card:hover { transform: translateY(-2px); box-shadow: 0 14px 34px rgba(0,0,0,.11); }
.stat-card .stat-value, .stats-card .stats-value { font-size: calc(32px * var(--kbs-fs-scale)); font-weight: 800; color: var(--kbs-accent); margin-bottom: 4px; letter-spacing: -.03em; line-height: 1.1; }
.stat-card .stat-label, .stats-card .stats-label { color: var(--kbs-muted); font-size: var(--kbs-fs-sm); font-weight: 500; padding-bottom: 12px; }
.stat-card[style*="border-left"] { border-left-width: 0 !important; }

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
    min-height: 40px;
    padding: 0 18px;
    background: var(--kbs-accent);
    color: #fff;
    text-decoration: none;
    border-radius: var(--kbs-radius-sm);
    border: 2px solid transparent;
    cursor: pointer;
    font-size: var(--kbs-fs-base);
    font-weight: 600;
    line-height: 1.3;
    transition: all .2s ease;
    box-shadow: none;
    white-space: nowrap;
    vertical-align: middle;
}
.btn svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.btn:hover { filter: brightness(.9); box-shadow: 0 8px 20px rgba(var(--kbs-accent-rgb), .35); color: #fff; transform: none; }
.btn:active { transform: translateY(1px); }
.btn:disabled, .btn.disabled { opacity: .55; cursor: not-allowed; box-shadow: none; filter: none; }
.btn-primary, .btn-details, .btn-info { background: var(--kbs-accent); color: #fff; }
.btn-primary:hover, .btn-details:hover, .btn-info:hover { background: var(--kbs-accent); }
.btn-secondary { background: #fff; color: var(--kbs-text); border-color: var(--kbs-border); }
.btn-secondary:hover { background: #fff; color: var(--kbs-text); border-color: var(--kbs-border-strong); box-shadow: 0 8px 20px rgba(0,0,0,.08); }
.btn-outline { background: transparent; color: var(--kbs-accent); border-color: var(--kbs-accent); }
.btn-outline:hover { background: rgba(var(--kbs-accent-rgb), .08); color: var(--kbs-accent); box-shadow: none; }
.btn-success { background: var(--kbs-success-solid); }
.btn-success:hover { background: var(--kbs-success-solid); box-shadow: 0 8px 20px rgba(22, 163, 74, .35); }
.btn-danger { background: var(--kbs-danger-solid); }
.btn-danger:hover { background: var(--kbs-danger-solid); box-shadow: 0 8px 20px rgba(220, 38, 38, .35); }
.btn-warning { background: var(--kbs-warning-solid); color: #1e293b; }
.btn-warning:hover { background: var(--kbs-warning-solid); color: #1e293b; box-shadow: 0 8px 20px rgba(245, 158, 11, .35); }
.btn-light { background: #f3f4f6; color: var(--kbs-text); }
.btn-light:hover { background: #f3f4f6; color: var(--kbs-text); box-shadow: 0 8px 20px rgba(0,0,0,.08); }
.btn-link { background: transparent; color: var(--kbs-accent); padding-left: 4px; padding-right: 4px; }
.btn-link:hover { box-shadow: none; text-decoration: underline; }
.btn-small, .btn-sm { min-height: 34px; padding: 0 12px; font-size: var(--kbs-fs-sm); border-radius: 8px; }
.btn-lg { min-height: 46px; padding: 0 24px; font-size: var(--kbs-fs-md); }
.btn .bi { font-size: 1.15em; line-height: 1; }
.btn-icon { width: 40px; padding: 0; }
.btn-icon.btn-sm, .btn-icon.btn-small { width: 34px; }
.btn-icon.btn-lg { width: 46px; }
.btn-outline-primary { background: #fff; color: var(--kbs-accent); border-color: var(--kbs-accent); }
.btn-outline-primary:hover { background: rgba(var(--kbs-accent-rgb), .08); color: var(--kbs-accent); box-shadow: none; filter: none; }
.btn-outline-secondary { background: #fff; color: #4b5563; border-color: var(--kbs-border-strong); }
.btn-outline-secondary:hover { background: #f9fafb; color: var(--kbs-text); border-color: #9ca3af; box-shadow: none; filter: none; }
.btn-outline-danger { background: #fff; color: var(--kbs-danger-solid); border-color: var(--kbs-danger-solid); }
.btn-outline-danger:hover { background: #fef2f2; color: var(--kbs-danger); box-shadow: none; filter: none; }
.btn-outline-success { background: #fff; color: var(--kbs-success-solid); border-color: var(--kbs-success-solid); }
.btn-outline-success:hover { background: #f0fdf4; color: var(--kbs-success); box-shadow: none; filter: none; }
.btn-outline-warning { background: #fff; color: var(--kbs-warning); border-color: var(--kbs-warning-solid); }
.btn-outline-warning:hover { background: #fffbeb; color: #92400e; box-shadow: none; filter: none; }
.btn-outline-info { background: #fff; color: var(--kbs-info); border-color: var(--kbs-info-solid); }
.btn-outline-info:hover { background: #f0f9ff; color: #075985; box-shadow: none; filter: none; }
td .btn, .table-responsive .btn, .action-buttons .btn { min-height: 32px; padding: 0 10px; font-size: var(--kbs-fs-sm); border-radius: 8px; }
td .btn-icon { width: 32px; }
.action-buttons { display: inline-flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.page-actions, .toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 20px; }
.page-actions .spacer, .toolbar .spacer { flex: 1; }
.btn-block { display: flex; width: 100%; }
.btn-group { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.btn-close { background: transparent; border: none; font-size: calc(18px * var(--kbs-fs-scale)); line-height: 1; cursor: pointer; color: inherit; opacity: .6; padding: 2px 6px; }
.btn-close:hover { opacity: 1; }
.btn-close:empty::before { content: '×'; }

/* ---------- Formulare ---------- */
.form-group { margin-bottom: 18px; }
.form-group label, .form-label, label.form-check-label { display: block; margin-bottom: 6px; font-weight: 600; font-size: var(--kbs-fs-base); color: var(--kbs-text); }
.form-check { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.form-check label, .form-check .form-check-label { margin: 0; font-weight: 500; }
.form-check-input { width: 17px; height: 17px; accent-color: var(--kbs-accent); margin: 0; }
input[type="checkbox"], input[type="radio"] { accent-color: var(--kbs-accent); width: auto; height: auto; }
.form-group input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]),
.form-group select, .form-group textarea, .form-control, .form-select,
input[type="text"], input[type="email"], input[type="password"], input[type="number"], input[type="date"],
input[type="time"], input[type="datetime-local"], input[type="tel"], input[type="url"], input[type="search"], select, textarea {
    width: 100%;
    height: auto;
    padding: 10px 13px;
    border: 2px solid var(--kbs-border);
    border-radius: var(--kbs-radius-sm);
    font-size: var(--kbs-fs-base);
    color: var(--kbs-text);
    background: #fff;
    transition: border-color .2s, box-shadow .2s;
    line-height: 1.4;
}
.form-group input[type="file"] { font-size: var(--kbs-fs-sm); }
input[type="color"] { height: 42px; padding: 4px; border: 2px solid var(--kbs-border); border-radius: var(--kbs-radius-sm); background: #fff; width: 64px; }
select, .form-select {
    -webkit-appearance: none; -moz-appearance: none; appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 12px center; padding-right: 38px;
}
select[multiple] { background-image: none; padding-right: 13px; }
textarea { min-height: 100px; resize: vertical; }
input:focus, select:focus, textarea:focus, .form-control:focus, .form-select:focus {
    outline: none;
    border-color: var(--kbs-accent);
    box-shadow: 0 0 0 3px rgba(var(--kbs-accent-rgb), .12);
}
input:disabled, select:disabled, textarea:disabled, input[readonly] { background: #f9fafb; color: var(--kbs-muted); }
input::placeholder, textarea::placeholder { color: #9ca3af; }
.form-hint, .form-text, small.help { display: block; font-size: var(--kbs-fs-sm); color: var(--kbs-muted); margin-top: 5px; }
.input-group { display: flex; border: 2px solid var(--kbs-border); border-radius: var(--kbs-radius-sm); overflow: hidden; background: #fff; transition: border-color .2s, box-shadow .2s; }
.input-group:focus-within { border-color: var(--kbs-accent); box-shadow: 0 0 0 3px rgba(var(--kbs-accent-rgb), .12); }
.input-group input, .input-group select { border: none !important; box-shadow: none !important; border-radius: 0; flex: 1; min-width: 0; }
.input-icon, .input-group-text { display: flex; align-items: center; justify-content: center; min-width: 44px; padding: 0 10px; background: #f8f9fa; border-right: 1px solid var(--kbs-border); color: var(--kbs-muted); font-size: var(--kbs-fs-sm); }
.form-row, .form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0 18px; }
.form-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 8px; padding-top: 18px; border-top: 1px solid var(--kbs-border); }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.filter-box, .filter-bar { background: var(--kbs-surface); border-radius: var(--kbs-radius); box-shadow: var(--kbs-shadow); padding: 20px 24px; margin-bottom: 24px; }
.filter-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; align-items: end; }
.filter-group { display: flex; flex-direction: column; gap: 6px; }
.filter-group label { font-size: var(--kbs-fs-sm); font-weight: 600; }
.filter-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.filter-row input[type="text"], .filter-row input[type="search"] { flex: 3 1 260px; width: auto; min-width: 0; }
.filter-row select { flex: 1 1 180px; width: auto; min-width: 160px; max-width: 320px; }
.filter-row .btn { flex: 0 0 auto; }
.filter-row label { white-space: nowrap; }
.kbs-filter { margin-bottom: 20px; }
.kbs-filter-search { position: relative; flex: 3 1 280px; min-width: 0; }
.kbs-filter-search .bi { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: #9ca3af; font-size: var(--kbs-fs-md); pointer-events: none; }
.kbs-filter-search input[type="text"], .kbs-filter-search input[type="search"] { width: 100%; padding-left: 38px; }
.kbs-filter .filter-row > .checkbox-label { display: inline-flex; align-items: center; gap: 8px; font-weight: 500; cursor: pointer; white-space: nowrap; }
.kbs-filter .filter-row > .checkbox-label input { width: 16px; height: 16px; }
.kbs-filter-hint { margin-top: 6px; font-size: var(--kbs-fs-sm); color: var(--kbs-muted); }
.filter-chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--kbs-border); }
.filter-chips-label { font-size: var(--kbs-fs-sm); font-weight: 700; color: var(--kbs-muted); text-transform: uppercase; letter-spacing: .04em; margin-right: 4px; }
.filter-chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 6px 4px 11px; border-radius: 999px; background: rgba(var(--kbs-accent-rgb), .1); color: var(--kbs-accent); font-size: var(--kbs-fs-sm); font-weight: 600; text-decoration: none; line-height: 1.3; transition: background .15s; }
.filter-chip .bi { font-size: var(--kbs-fs-sm); border-radius: 999px; padding: 2px; }
.filter-chip:hover { background: rgba(var(--kbs-accent-rgb), .2); color: var(--kbs-accent); }
.filter-chip:hover .bi { background: rgba(var(--kbs-accent-rgb), .25); }
.filter-chip-clear { background: #f3f4f6; color: #4b5563; }
.filter-chip-clear:hover { background: #e5e7eb; color: var(--kbs-text); }
h1 > .bi, h2 > .bi, h3 > .bi, h4 > .bi, .card-header > .bi, .card-header > span > .bi, strong > .bi, label > .bi { margin-right: 6px; color: var(--kbs-accent); vertical-align: -.08em; }
.alert > .bi { margin-right: 6px; vertical-align: -.08em; }
.action-menu-btn .bi { font-size: calc(18px * var(--kbs-fs-scale)); }
.action-menu-item .bi { width: 18px; margin-right: 8px; text-align: center; color: var(--kbs-muted); vertical-align: -.08em; }
.action-menu-item:hover .bi { color: inherit; }
.action-menu-item.danger .bi { color: inherit; }
/* ---------- Raster + Hilfsklassen (Bootstrap-kompatible Namen, lokal – kein CDN) ---------- */
.container, .container-fluid { width: 100%; margin: 0 auto; }
.container { max-width: 1320px; }
.row { display: flex; flex-wrap: wrap; margin-left: -12px; margin-right: -12px; }
.row > * { padding-left: 12px; padding-right: 12px; box-sizing: border-box; }
.row.g-0 { margin: 0; } .row.g-0 > * { padding: 0; }
.row.g-2 { margin-left: -4px; margin-right: -4px; } .row.g-2 > * { padding-left: 4px; padding-right: 4px; }
.col { flex: 1 0 0%; min-width: 0; }
.col-auto { flex: 0 0 auto; width: auto; }
.col-1 { flex: 0 0 auto; width: 8.3333%; } .col-2 { flex: 0 0 auto; width: 16.6667%; } .col-3 { flex: 0 0 auto; width: 25%; }
.col-4 { flex: 0 0 auto; width: 33.3333%; } .col-5 { flex: 0 0 auto; width: 41.6667%; } .col-6 { flex: 0 0 auto; width: 50%; }
.col-7 { flex: 0 0 auto; width: 58.3333%; } .col-8 { flex: 0 0 auto; width: 66.6667%; } .col-9 { flex: 0 0 auto; width: 75%; }
.col-10 { flex: 0 0 auto; width: 83.3333%; } .col-11 { flex: 0 0 auto; width: 91.6667%; } .col-12 { flex: 0 0 auto; width: 100%; }
[class*="col-sm-"], [class*="col-md-"], [class*="col-lg-"], [class*="col-xl-"] { flex: 0 0 auto; width: 100%; }
@media (min-width: 576px) {
    .col-sm-2 { width: 16.6667%; } .col-sm-3 { width: 25%; } .col-sm-4 { width: 33.3333%; } .col-sm-6 { width: 50%; }
    .col-sm-8 { width: 66.6667%; } .col-sm-9 { width: 75%; } .col-sm-12 { width: 100%; }
}
@media (min-width: 768px) {
    .col-md-1 { width: 8.3333%; } .col-md-2 { width: 16.6667%; } .col-md-3 { width: 25%; } .col-md-4 { width: 33.3333%; }
    .col-md-5 { width: 41.6667%; } .col-md-6 { width: 50%; } .col-md-7 { width: 58.3333%; } .col-md-8 { width: 66.6667%; }
    .col-md-9 { width: 75%; } .col-md-10 { width: 83.3333%; } .col-md-12 { width: 100%; }
}
@media (min-width: 992px) {
    .col-lg-2 { width: 16.6667%; } .col-lg-3 { width: 25%; } .col-lg-4 { width: 33.3333%; } .col-lg-6 { width: 50%; }
    .col-lg-8 { width: 66.6667%; } .col-lg-9 { width: 75%; } .col-lg-12 { width: 100%; }
}
.d-flex { display: flex !important; } .d-inline-flex { display: inline-flex !important; } .d-block { display: block !important; }
.d-inline-block { display: inline-block !important; } .d-none { display: none !important; }
@media (min-width: 768px) { .d-md-inline { display: inline !important; } .d-md-block { display: block !important; } .d-md-none { display: none !important; } }
.flex-column { flex-direction: column !important; } .flex-wrap { flex-wrap: wrap !important; }
.justify-content-between { justify-content: space-between !important; } .justify-content-center { justify-content: center !important; }
.justify-content-end { justify-content: flex-end !important; } .align-items-center { align-items: center !important; }
.align-items-start { align-items: flex-start !important; } .align-items-end { align-items: flex-end !important; }
.gap-1 { gap: .25rem !important; } .gap-2 { gap: .5rem !important; } .gap-3 { gap: 1rem !important; }
.text-center { text-align: center !important; } .text-end { text-align: right !important; } .text-start { text-align: left !important; }
.w-100 { width: 100% !important; } .h-100 { height: 100% !important; }
.px-4 { padding-left: 1.5rem !important; padding-right: 1.5rem !important; }
.py-3 { padding-top: 1rem !important; padding-bottom: 1rem !important; }
.p-3 { padding: 1rem !important; } .p-0 { padding: 0 !important; }
.m-0 { margin: 0 !important; } .mb-0 { margin-bottom: 0 !important; } .mb-4 { margin-bottom: 1.5rem !important; }
.mt-0 { margin-top: 0 !important; } .mt-4 { margin-top: 1.5rem !important; } .me-auto { margin-right: auto !important; } .ms-auto { margin-left: auto !important; }
.fw-bold { font-weight: 700 !important; } .fw-semibold { font-weight: 600 !important; } .small { font-size: .875em; }
.border-top { border-top: 1px solid var(--kbs-border) !important; } .pt-3 { padding-top: 1rem !important; }
/* Nur ausdrücklich mit .h-100 markierte Karten füllen die Spaltenhöhe – sonst entstehen
   in gemischten Reihen (z. B. Kursinfo neben Buchungsübersicht) große leere Flächen. */
.row > [class*="col"] > .card.h-100 { height: 100%; }

/* Kleine Abstands-/Größen-Utilities (Bootstrap-kompatible Namen, von Icons genutzt) */
.me-1 { margin-right: .25rem !important; } .me-2 { margin-right: .5rem !important; } .ms-1 { margin-left: .25rem !important; } .ms-2 { margin-left: .5rem !important; }
.mb-1 { margin-bottom: .25rem !important; } .mb-2 { margin-bottom: .5rem !important; } .mb-3 { margin-bottom: 1rem !important; } .mt-2 { margin-top: .5rem !important; } .mt-3 { margin-top: 1rem !important; }
.bi-2x { font-size: 2em; display: inline-block; }
.text-primary { color: var(--kbs-accent) !important; } .text-success { color: var(--kbs-success) !important; } .text-danger { color: var(--kbs-danger) !important; }
.text-warning { color: var(--kbs-warning) !important; } .text-info { color: var(--kbs-info) !important; } .text-secondary, .text-muted { color: var(--kbs-muted) !important; }
.field-readonly { padding: 10px 13px; border: 2px dashed var(--kbs-border); border-radius: var(--kbs-radius-sm); background: #f9fafb; color: var(--kbs-text); font-weight: 600; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .02em; }
.form-hint { display: block; margin-top: 4px; font-size: var(--kbs-fs-sm); color: var(--kbs-muted); }
.info-grid { display: grid; grid-template-columns: 200px 1fr; gap: 10px 20px; }
.info-grid .label, .info-label, .detail-label { font-weight: 600; color: var(--kbs-muted); font-size: var(--kbs-fs-sm); }
.info-grid .value, .info-value, .detail-value { color: var(--kbs-text); }
.info-row, .detail-row, .summary-row { display: flex; justify-content: space-between; gap: 16px; padding: 10px 0; border-bottom: 1px solid var(--kbs-border); }
.info-row:last-child, .detail-row:last-child, .summary-row:last-child { border-bottom: none; }

/* ---------- Tabellen ---------- */
.table-container, .table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: 12px;
    border: 1px solid var(--kbs-border);
    background: #fff;
}
.table-container table, .table-responsive table { min-width: 600px; border: none; }
table, .table, .data-table { width: 100%; border-collapse: separate; border-spacing: 0; background: #fff; font-size: var(--kbs-fs-base); }
.card > table, .card-body > table, .card > form > table { border: 1px solid var(--kbs-border); border-radius: 12px; overflow: hidden; }
table th, .table th {
    background: #f8f9fa;
    padding: 12px 16px;
    text-align: left;
    font-weight: 700;
    font-size: var(--kbs-fs-sm);
    letter-spacing: .2px;
    text-transform: uppercase;
    color: #4b5563;
    border-bottom: 2px solid var(--kbs-border);
    white-space: nowrap;
    position: sticky; top: 0; z-index: 1;
}
table td, .table td { padding: 12px 16px; border-bottom: 1px solid var(--kbs-border); vertical-align: middle; font-size: var(--kbs-fs-base); }
table tbody tr:nth-child(even) > td { background: #fafbfc; }
table tbody tr:hover > td { background: rgba(var(--kbs-accent-rgb), .05); }
table tbody tr:last-child > td { border-bottom: none; }
table tr:hover { background: transparent; }
.table-sm th, .table-sm td { padding: 8px 12px; }
td.actions, th.actions, .table-actions { white-space: nowrap; text-align: right; }
.empty-state, .no-data { text-align: center; padding: 40px 20px; color: var(--kbs-muted); }
.empty-state svg { width: 40px; height: 40px; stroke: var(--kbs-border-strong); margin-bottom: 10px; }

/* ---------- Alerts ---------- */
.alert {
    display: flex; align-items: flex-start; gap: .6rem; flex-wrap: wrap;
    padding: 12px 16px;
    border-radius: var(--kbs-radius-sm);
    margin-bottom: 20px;
    font-size: var(--kbs-fs-base);
    font-weight: 500;
    border: 1px solid var(--kbs-border);
    border-left-width: 1px;
    background: #f9fafb;
    color: var(--kbs-text);
    line-height: 1.5;
}
.alert::before { font-size: var(--kbs-fs-md); font-weight: 700; line-height: 1.3; flex-shrink: 0; }
/* Enthält der Hinweis ein eigenes Icon oder eine Überschrift, entfällt das Zeichen aus dem Stylesheet */
.alert:has(> .bi, > i.bi, > svg)::before,
.alert:has(> h1, > h2, > h3, > h4, > h5, > h6)::before { content: none !important; }
.alert-success::before { content: "✓"; }
.alert-error::before, .alert-danger::before { content: "✕"; }
.alert-warning::before { content: "!"; }
.alert-info::before { content: "i"; font-style: italic; font-family: Georgia, serif; }
/* Hinweise mit mehreren Inhalten (Überschrift, Absätze, Listen): alles untereinander.
   Ohne diese Regeln legt der Flex-Container die Kinder nebeneinander und der Text läuft ineinander. */
.alert > * { min-width: 0; }
.alert > h1, .alert > h2, .alert > h3, .alert > h4, .alert > h5, .alert > h6,
.alert > p, .alert > ul, .alert > ol, .alert > hr, .alert > table, .alert > .row { flex: 0 0 100%; margin-left: 0; }
.alert > hr { border: none; border-top: 1px solid currentColor; opacity: .25; width: 100%; margin: 10px 0; }
.alert > ul, .alert > ol { padding-left: 20px; margin: 6px 0; }
.alert-heading { font-size: var(--kbs-fs-md); font-weight: 700; margin: 0 0 4px; }
.alert > div, .alert > span { flex: 1 1 auto; min-width: 0; }
.alert p:last-child { margin-bottom: 0; }
.alert a { color: inherit; font-weight: 600; }
.alert-success { background: var(--kbs-success-bg); color: var(--kbs-success); border-color: var(--kbs-success-border); }
.alert-error, .alert-danger { background: var(--kbs-danger-bg); color: var(--kbs-danger); border-color: var(--kbs-danger-border); }
.alert-warning { background: var(--kbs-warning-bg); color: var(--kbs-warning); border-color: var(--kbs-warning-border); }
.alert-info, .alert-primary { background: var(--kbs-info-bg); color: var(--kbs-info); border-color: var(--kbs-info-border); }
.alert-dismissible { padding-right: 40px; position: relative; }
.alert-dismissible .btn-close { position: absolute; right: 8px; top: 8px; }
.alert.fade:not(.show) { display: none; }

/* ---------- Badges ---------- */
.badge, .category-badge, .format-badge, .cert-badge, .accordion-status-badge {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 3px 9px;
    border-radius: 999px;
    font-size: var(--kbs-fs-xs);
    font-weight: 700;
    letter-spacing: .2px;
    line-height: 1.4;
    background: #eef2f7; color: #374151;
    white-space: nowrap;
    vertical-align: middle;
}
.badge-success, .badge-confirmed, .badge-active, .accordion-status-badge.booked { background: #dcfce7; color: #166534; }
.badge-warning, .badge-pending, .badge-waitlist, .accordion-status-badge.waitlist { background: #fef3c7; color: #92400e; }
.badge-danger, .badge-cancelled, .badge-error { background: #fee2e2; color: #991b1b; }
.badge-info, .badge-primary { background: rgba(var(--kbs-accent-rgb), .12); color: var(--kbs-accent); }
.badge-secondary, .badge-default { background: #e5e7eb; color: #374151; }
.badge-dark { background: var(--kbs-dark); color: #fff; }
.badge-light { background: #f3f4f6; color: #4b5563; }
.nav-badge { border-radius: 10px; }

/* ---------- Accordion (Admin + Portale) ---------- */
.accordion-item, .accordion-section { border: 1px solid var(--kbs-border); border-radius: 12px; margin-bottom: 14px; overflow: hidden; background: #fff; box-shadow: none; }
.accordion-header { padding: 14px 18px; cursor: pointer; display: flex; justify-content: space-between; align-items: center; gap: 12px; background: #f8f9fa; border-bottom: 1px solid var(--kbs-border); transition: background .2s; user-select: none; }
.accordion-header:hover { background: #f1f3f5; }
.accordion-header.active { background: rgba(var(--kbs-accent-rgb), .08); color: var(--kbs-text); border-bottom-color: rgba(var(--kbs-accent-rgb), .3); }
.accordion-header .title, .accordion-title { font-weight: 700; font-size: var(--kbs-fs-md); display: flex; align-items: center; gap: 10px; }
.accordion-count { background: var(--kbs-accent); color: #fff; padding: 3px 10px; border-radius: 999px; font-size: var(--kbs-fs-sm); font-weight: 700; }
.accordion-icon { transition: transform .25s; color: var(--kbs-accent); font-size: var(--kbs-fs-sm); font-weight: 700; display: inline-block; }
.accordion-header.active .accordion-icon, .accordion-icon.open { transform: rotate(180deg); }
.accordion-toggle { cursor: pointer; display: inline-flex; align-items: center; gap: 8px; user-select: none; border-radius: 50%; transition: background .2s; }
.accordion-toggle:hover { background: rgba(var(--kbs-accent-rgb), .08); }
.accordion-grid { display: flex; flex: 1; gap: 15px; align-items: center; }
.accordion-col { min-width: 0; }
.accordion-content-inner { padding: 18px; background: #fafbfc; border-top: 1px solid var(--kbs-border); }
.accordion-content-title { font-size: var(--kbs-fs-md); font-weight: 700; margin-bottom: 12px; }
.accordion-content table { border: 1px solid var(--kbs-border); border-radius: 10px; overflow: hidden; box-shadow: none; }
.accordion-content table thead { background: #f1f3f5; }
.accordion-no-data { padding: 16px; text-align: center; color: var(--kbs-muted); font-style: italic; background: #fff; border-radius: 10px; }
.accordion-row { cursor: pointer; }

.accordion-content { display: none; max-height: none; overflow: visible; }
.accordion-content.active, .accordion-content.open { display: block; }
tr.accordion-content.active, tr.accordion-content.open { display: table-row; }

/* ---------- Aktions-Menü ---------- */
.action-menu { position: relative; display: inline-block; }
.action-menu-btn { background: #fff; border: 2px solid var(--kbs-border); border-radius: 8px; padding: 4px 10px; cursor: pointer; font-size: var(--kbs-fs-md); font-weight: 700; color: #4b5563; transition: all .15s; display: inline-flex; align-items: center; justify-content: center; min-width: 36px; height: 32px; }
.action-menu-btn:hover { border-color: var(--kbs-accent); color: var(--kbs-accent); background: #fff; }
.action-menu-content { display: none; position: absolute; right: 0; top: 100%; margin-top: 6px; background: #fff; min-width: 180px; box-shadow: var(--kbs-shadow-lg); border-radius: 12px; border: 1px solid var(--kbs-border); z-index: 1000; overflow: hidden; padding: 6px; }
.action-menu.active .action-menu-content { display: block; }
.action-menu-item { display: block; padding: 9px 12px; text-decoration: none; color: var(--kbs-text); font-size: var(--kbs-fs-base); border-radius: 8px; border-bottom: none; transition: background .15s; background: none; width: 100%; text-align: left; cursor: pointer; }
.action-menu-item:hover { background: rgba(var(--kbs-accent-rgb), .08); color: var(--kbs-accent); filter: none; }
.action-menu-item.danger { color: var(--kbs-danger-solid); }
.action-menu-item.danger:hover { background: #fef2f2; color: var(--kbs-danger); }

/* ---------- Tabs ---------- */
.tabs-nav, .nav-tabs { display: flex; gap: 4px; border-bottom: 2px solid var(--kbs-border); margin-bottom: 20px; overflow-x: auto; list-style: none; padding: 0; }
.tab-button, .nav-tabs .nav-link { background: transparent; border: none; padding: 10px 16px; font-weight: 600; font-size: var(--kbs-fs-base); color: var(--kbs-muted); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -2px; border-radius: 0; white-space: nowrap; }
.tab-button:hover, .nav-tabs .nav-link:hover { color: var(--kbs-accent); background: transparent; }
.tab-button.active, .nav-tabs .nav-link.active { color: var(--kbs-accent); border-bottom-color: var(--kbs-accent); background: transparent; }
.tab-content { display: none; }
.tab-content.active { display: block; }

/* ---------- Pagination ---------- */
.pagination { display: flex; gap: 6px; list-style: none; padding: 0; margin: 20px 0 0; flex-wrap: wrap; justify-content: center; }
.pagination a, .pagination span, .pagination .page-link { display: inline-flex; align-items: center; justify-content: center; min-width: 36px; height: 36px; padding: 0 10px; border-radius: 8px; border: 2px solid var(--kbs-border); background: #fff; color: var(--kbs-text); text-decoration: none; font-weight: 600; font-size: var(--kbs-fs-sm); }
.pagination a:hover { border-color: var(--kbs-accent); color: var(--kbs-accent); filter: none; }
.pagination .active a, .pagination .active span, .pagination .page-item.active .page-link, .pagination a.active, .pagination span.current { background: var(--kbs-accent); border-color: var(--kbs-accent); color: #fff; }
.pagination .disabled a, .pagination .disabled span, .pagination .page-item.disabled .page-link { opacity: .5; pointer-events: none; }

/* ---------- Modal (einfach) ---------- */
.modal-overlay, .kbs-modal-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 1050; display: none; align-items: center; justify-content: center; padding: 20px; }
.modal-overlay.active, .modal-overlay.show, .kbs-modal-backdrop.show { display: flex; }
.modal-content, .modal-box { background: #fff; border-radius: var(--kbs-radius); box-shadow: var(--kbs-shadow-lg); max-width: 560px; width: 100%; max-height: 90vh; overflow: auto; border: none; }
.modal-header { padding: 18px 24px; border-bottom: 1px solid var(--kbs-border); display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.modal-header h3, .modal-title { font-size: var(--kbs-fs-lg); font-weight: 700; margin: 0; }
.modal-body { padding: 20px 24px; }
.modal-footer { padding: 14px 24px; border-top: 1px solid var(--kbs-border); display: flex; justify-content: flex-end; gap: 10px; }

/* ---------- Utilities (Bootstrap-light) ---------- */
.text-muted { color: var(--kbs-muted) !important; }
.text-center { text-align: center; } .text-right, .text-end { text-align: right; }
.text-success { color: var(--kbs-success); } .text-danger { color: var(--kbs-danger); } .text-warning { color: var(--kbs-warning); } .text-accent { color: var(--kbs-accent); }
.fw-bold, .font-bold { font-weight: 700; } .small { font-size: var(--kbs-fs-sm); }
.d-flex { display: flex; } .d-block { display: block; } .d-none { display: none; } .d-inline-flex { display: inline-flex; }
.align-items-center { align-items: center; } .justify-content-between { justify-content: space-between; } .justify-content-end { justify-content: flex-end; }
.gap-1 { gap: 4px; } .gap-2 { gap: 8px; } .gap-3 { gap: 16px; } .flex-wrap { flex-wrap: wrap; }
.mb-0 { margin-bottom: 0 !important; } .mb-1 { margin-bottom: 4px; } .mb-2 { margin-bottom: 8px; } .mb-3 { margin-bottom: 16px; } .mb-4 { margin-bottom: 24px; }
.mt-1 { margin-top: 4px; } .mt-2 { margin-top: 8px; } .mt-3 { margin-top: 16px; } .mt-4 { margin-top: 24px; }
.me-1 { margin-right: 4px; } .me-2 { margin-right: 8px; } .ms-2 { margin-left: 8px; } .ms-4 { margin-left: 24px; }
.p-3 { padding: 16px; } .w-100 { width: 100%; }
/* Das Raster steht weiter oben im Abschnitt „Raster + Hilfsklassen". Die frühere zweite
   Definition an dieser Stelle überschrieb per `.row > [class*="col-"] { flex: 1 1 0 }` sämtliche
   Spaltenbreiten – dadurch war jede Spalte gleich breit. Entfernt. */
hr { border: none; border-top: 1px solid var(--kbs-border); margin: 20px 0; }
code, pre { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: var(--kbs-fs-sm); }
pre { background: #f8f9fa; border: 1px solid var(--kbs-border); border-radius: 10px; padding: 14px; overflow-x: auto; }

/* ---------- Versionszeile ---------- */
.app-version-footer { text-align: right; padding: 18px 0 4px; font-size: var(--kbs-fs-xs); color: #9ca3af; }
.app-version-footer a { color: #9ca3af; text-decoration: underline; }
.app-version-footer a:hover { color: var(--kbs-muted); filter: none; }
.kbs-app-footer { text-align: center; padding: 24px 0 6px; color: #9ca3af; font-size: var(--kbs-fs-sm); }
.kbs-app-footer p { margin: 2px 0; }

/* ---------- Öffentliche Seite ---------- */
.public-header { background: var(--kbs-dark); color: #fff; padding: 0; box-shadow: 0 2px 16px rgba(0,0,0,.25); position: relative; z-index: 20; }
.public-header-container { max-width: 1400px; margin: 0 auto; padding: 14px 2rem; display: flex; align-items: center; gap: 1.25rem; min-height: 72px; }
.public-header-logo { max-height: 48px; max-width: 170px; object-fit: contain; display: block; }
.public-header-container > .sidebar-logo { flex: 0 0 auto; min-width: auto; }
.public-header-title { flex: 1; min-width: 0; }
.public-header-title h1 { color: #fff; font-size: 1.25rem; font-weight: 800; margin: 0; line-height: 1.2; letter-spacing: -.01em; }
.public-header-title p { color: #9a9a9a; font-size: .85rem; font-weight: 500; margin: .15rem 0 0; }
.public-header-login {
    display: inline-flex; align-items: center; gap: .45rem;
    background: var(--kbs-accent); color: #fff;
    padding: .6rem 1.2rem; border-radius: var(--kbs-radius-sm);
    text-decoration: none; font-weight: 600; font-size: .9rem;
    border: none; white-space: nowrap; transition: all .2s ease;
}
.public-header-login svg { width: 16px; height: 16px; stroke: #fff; }
.public-header-login:hover { filter: brightness(.9); box-shadow: 0 8px 20px rgba(var(--kbs-accent-rgb), .35); transform: none; color: #fff; }
.public-header-nav { display: flex; gap: .25rem; margin-right: .5rem; }
.public-header-nav a { color: #cfcfcf; text-decoration: none; font-size: .9rem; font-weight: 500; padding: .5rem .8rem; border-radius: 8px; }
.public-header-nav a:hover, .public-header-nav a.active { color: #fff; background: rgba(255,255,255,.08); filter: none; }
.public-header-nav a { display: inline-flex; align-items: center; gap: 6px; }
.public-header-user { display: flex; align-items: center; gap: 8px; }
.public-header-user-chip { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: #fff; padding: 5px 12px 5px 5px; border-radius: 999px; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.1); transition: background .15s; }
.public-header-user-chip:hover { background: rgba(255,255,255,.14); color: #fff; filter: none; }
.public-header-avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--kbs-accent); color: #fff; font-weight: 800; font-size: var(--kbs-fs-sm); display: inline-flex; align-items: center; justify-content: center; letter-spacing: .02em; flex: 0 0 auto; }
.public-header-user-text { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.public-header-user-text strong { font-size: .9rem; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 220px; }
.public-header-user-text small { font-size: .72rem; color: #b5b5b5; font-weight: 500; }
.public-header-logout { display: inline-flex; align-items: center; gap: 6px; color: #fff; text-decoration: none; font-weight: 600; font-size: .9rem; padding: .6rem .9rem; border-radius: var(--kbs-radius-sm); border: 2px solid rgba(255,255,255,.25); transition: all .15s; }
.public-header-logout:hover { border-color: #fff; background: rgba(255,255,255,.08); color: #fff; filter: none; }
.public-footer .footer-section .bi { color: var(--kbs-accent); margin-right: 6px; }

.public-footer { background: var(--kbs-dark); color: #fff; padding: 3rem 0 1.5rem; margin-top: 4rem; }
.footer-container { max-width: 1400px; margin: 0 auto; padding: 0 2rem; }
.footer-content { display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: 3rem; margin-bottom: 2rem; }
.footer-section h3 { font-size: 1rem; font-weight: 700; margin: 0 0 .9rem; color: #fff; }
.footer-section h3::after { content: ''; display: block; width: 36px; height: 3px; border-radius: 2px; background: var(--kbs-accent); margin-top: .6rem; }
.footer-section p, .footer-section a { font-size: .9rem; line-height: 1.7; color: #cfcfcf; margin: .4rem 0; }
.footer-section a { text-decoration: none; transition: color .2s; }
.footer-section a:hover { color: #fff; filter: none; }
.footer-section strong { color: #fff; font-weight: 600; }
.footer-logo { max-height: 56px; max-width: 180px; object-fit: contain; margin-bottom: 1rem; display: block; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.1); padding-top: 1.25rem; text-align: center; font-size: .82rem; color: #9a9a9a; }
.footer-links { display: flex; justify-content: center; gap: 1.5rem; margin-bottom: .75rem; }
.footer-links a { color: #cfcfcf; text-decoration: none; font-size: .88rem; }
.footer-links a:hover { color: #fff; filter: none; }

/* Kurs-Karten / Wizard auf den öffentlichen Seiten */
.course-card { border-radius: var(--kbs-radius); box-shadow: var(--kbs-shadow); border: none; }
.course-card:hover { box-shadow: 0 14px 34px rgba(0,0,0,.12); }

/* Schritt-Leiste (includes/breadcrumb_stepper.php) */
.booking-stepper { display: flex; align-items: stretch; background: var(--kbs-surface); padding: 10px; border-radius: var(--kbs-radius); box-shadow: var(--kbs-shadow); margin-bottom: 2rem; overflow-x: auto; gap: 8px; }
.step-item { display: flex; align-items: center; gap: 12px; padding: 12px 18px; flex: 1; min-width: 150px; border-radius: 12px; background: #f3f4f6; color: var(--kbs-muted); position: relative; transition: all .2s ease; clip-path: none; transform: none; }
.step-item:first-child, .step-item:last-child { clip-path: none; padding: 12px 18px; }
.step-item.completed { background: rgba(var(--kbs-accent-rgb), .08); color: var(--kbs-text); }
.step-item.active { background: var(--kbs-accent); color: #fff; box-shadow: 0 8px 20px rgba(var(--kbs-accent-rgb), .35); transform: none; z-index: 1; }
.step-item.pending { background: #f3f4f6; color: var(--kbs-muted); }
.step-number { width: 32px; height: 32px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: .9rem; margin: 0; flex-shrink: 0; background: #e5e7eb; color: var(--kbs-muted); }
.step-item.completed .step-number { background: var(--kbs-accent); color: #fff; }
.step-item.active .step-number { background: #fff; color: var(--kbs-accent); }
.step-item.pending .step-number { background: #e5e7eb; color: var(--kbs-muted); }
.step-label { font-weight: 600; font-size: .92rem; white-space: nowrap; }
.step-item.active .step-label { color: #fff; }
.step-item.completed .step-label { color: var(--kbs-text); }

/* Cookie-Banner (includes/cookie_banner.php) */
.cookie-banner {
    position: fixed; left: 50%; bottom: 20px; right: auto; transform: translateX(-50%);
    width: min(960px, calc(100% - 32px));
    background: var(--kbs-surface); color: var(--kbs-text);
    padding: 1.1rem 1.4rem; border-radius: var(--kbs-radius);
    box-shadow: var(--kbs-shadow-lg); border: 1px solid var(--kbs-border);
    z-index: 9999; display: none; animation: kbsSlideUp .3s ease-out;
}
.cookie-banner.show { display: block; }
@keyframes kbsSlideUp { from { transform: translate(-50%, 30px); opacity: 0; } to { transform: translate(-50%, 0); opacity: 1; } }
.cookie-content { display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; margin: 0; max-width: none; }
.cookie-text { flex: 1; font-size: .88rem; line-height: 1.55; color: var(--kbs-text); }
.cookie-text strong { display: block; margin-bottom: .2rem; font-size: .95rem; }
.cookie-text a { color: var(--kbs-accent); text-decoration: underline; }
.cookie-buttons { display: flex; gap: .6rem; flex-shrink: 0; }
.cookie-btn { padding: .65rem 1.2rem; border: 2px solid transparent; border-radius: var(--kbs-radius-sm); font-weight: 600; font-size: .88rem; cursor: pointer; transition: all .2s; white-space: nowrap; }
.cookie-btn-accept { background: var(--kbs-accent); color: #fff; }
.cookie-btn-accept:hover { filter: brightness(.9); box-shadow: 0 8px 20px rgba(var(--kbs-accent-rgb), .35); transform: none; }
.cookie-btn-decline { background: #fff; color: var(--kbs-text); border-color: var(--kbs-border); }
.cookie-btn-decline:hover { border-color: var(--kbs-border-strong); background: #fff; }

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
    .grid-3, .grid-4 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 768px) {
    .kbs-topbar { display: flex; }
    .mobile-toggle { display: inline-flex; }
    .sidebar { transform: translateX(-100%); top: var(--kbs-topbar-height); height: calc(100vh - var(--kbs-topbar-height)); box-shadow: 4px 0 24px rgba(0,0,0,.35); }
    .sidebar.active, .kbs-sidebar-open .sidebar { transform: translateX(0); }
    .kbs-sidebar-open .kbs-backdrop { top: var(--kbs-topbar-height); }
    .main-content { margin-left: 0; padding: calc(var(--kbs-topbar-height) + 16px) 14px 20px; }
    body.kbs-sidebar-collapsed .main-content { margin-left: 0; }
    body.kbs-sidebar-collapsed .sidebar { width: var(--kbs-sidebar-width); }
    .kbs-sidebar-collapse-btn { display: none; }
    .container { padding: 0 1rem; }
    .page-header h1, .page-header h2 { font-size: var(--kbs-fs-xl); }
    .card { padding: 18px; border-radius: 14px; }
    .card-header { margin: -18px -18px 16px; padding: 14px 18px; border-radius: 14px 14px 0 0; }
    .card-footer { margin: 16px -18px -18px; padding: 12px 18px; }
    .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
    .stats-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
    .stat-card, .stats-card { padding: 16px; }
    .stat-card .stat-value, .stats-card .stats-value { font-size: var(--kbs-fs-2xl); }
    .info-grid { grid-template-columns: 1fr; gap: 6px; }
    .topbar { flex-direction: column; align-items: flex-start; }
    .action-menu-content { right: auto; left: 0; }
    .btn { padding: 9px 14px; }
    .public-header-container { flex-wrap: wrap; padding: 12px 1rem; gap: .75rem; }
    .public-header-logo { max-height: 40px; max-width: 120px; }
    .public-header-title h1 { font-size: 1.05rem; }
    .public-header-title p { display: none; }
    .public-header-login { padding: .5rem .9rem; font-size: .85rem; }
    .public-header-nav { order: 5; width: 100%; margin: 0; justify-content: center; }
    .public-header-user-text { display: none; }
    .public-header-user-chip { padding: 4px; }
    .public-header-logout span { display: none; }
    .footer-content { grid-template-columns: 1fr; gap: 2rem; }
    .footer-container { padding: 0 1rem; }
    .footer-links { flex-direction: column; gap: .5rem; }
    .booking-stepper { padding: 8px; gap: 6px; }
    .step-item, .step-item:first-child, .step-item:last-child { min-width: auto; padding: 8px 12px; flex: 0 0 auto; }
    .step-number { width: 28px; height: 28px; font-size: .8rem; }
    .step-label { display: none; }
    .step-item.active .step-label { display: block; font-size: .85rem; }
    .cookie-banner { bottom: 12px; padding: 1rem; }
    .cookie-content { flex-direction: column; align-items: stretch; gap: .9rem; }
    .cookie-buttons { width: 100%; flex-direction: column; }
    .cookie-btn { width: 100%; }

    /* Tabellen als Karten (data-label wird per kbs-ui.js gesetzt) */
    .table-container, .table-responsive { overflow-x: visible; border: none; background: transparent; }
    .table-container table, .table-responsive table { min-width: 0; }
    .kbs-app table:not(.kbs-keep-table), .kbs-app .table:not(.kbs-keep-table) { min-width: 0; background: transparent; border: none; }
    .kbs-app table:not(.kbs-keep-table) thead { display: none; }
    .kbs-app table:not(.kbs-keep-table) tr { display: block; margin-bottom: 12px; border: 1px solid var(--kbs-border); border-radius: 12px; background: #fff; box-shadow: var(--kbs-shadow-sm); overflow: hidden; }
    .kbs-app table:not(.kbs-keep-table) tbody tr:nth-child(even) > td, .kbs-app table:not(.kbs-keep-table) tbody tr:hover > td { background: #fff; }
    .kbs-app table:not(.kbs-keep-table) td { display: block; text-align: right; padding: 10px 12px 10px 45%; border-bottom: 1px solid #f1f3f5; position: relative; font-size: var(--kbs-fs-sm); min-height: 38px; }
    .kbs-app table:not(.kbs-keep-table) td:last-child { border-bottom: none; }
    .kbs-app table:not(.kbs-keep-table) td[data-label]::before { content: attr(data-label); position: absolute; left: 12px; top: 10px; width: 40%; font-weight: 600; color: var(--kbs-muted); text-align: left; font-size: var(--kbs-fs-sm); white-space: normal; }
    .kbs-app table:not(.kbs-keep-table) td:empty::before { content: none; }
    .kbs-app table:not(.kbs-keep-table) tr.accordion-content { display: none; }
    .kbs-app table:not(.kbs-keep-table) tr.accordion-content.open, .kbs-app table:not(.kbs-keep-table) tr.accordion-content.active { display: block; }
}
@media (max-width: 480px) {
    .stats-grid { grid-template-columns: 1fr; }
    .step-label { display: none !important; }
    .step-item, .step-item:first-child, .step-item:last-child { padding: 8px; }
}

/* ---------- Barrierefreiheit / Bewegung ---------- */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}

/* ---------- Druck (Teilnehmerlisten etc.) ---------- */
@media print {
    body { background: #fff; color: #000; font-size: var(--kbs-fs-sm); }
    .sidebar, .kbs-topbar, .kbs-backdrop, .mobile-toggle, .btn, .action-menu, .cookie-banner, .public-header-login,
    .app-version-footer, .kbs-app-footer, .page-header .breadcrumb, .filter-box, .filter-bar, .pagination, .nav-menu, .public-footer, .booking-stepper, .no-print { display: none !important; }
    .main-content { margin: 0 !important; padding: 0 !important; min-height: 0; }
    .card, .stat-card, .stats-card, .table-container, .table-responsive { box-shadow: none !important; border: 1px solid #ccc !important; border-radius: 4px !important; break-inside: avoid; }
    .card-header { background: #f3f4f6 !important; }
    table { border-collapse: collapse; }
    table th { position: static; background: #f3f4f6 !important; color: #000 !important; }
    table th, table td { border: 1px solid #ccc; padding: 6px 8px; }
    table tbody tr:nth-child(even) > td, table tbody tr:hover > td { background: #fff; }
    a { color: #000; text-decoration: none; }
    .badge { border: 1px solid #999; background: #fff !important; color: #000 !important; }
}

/* ---------- Hilfe-System (includes/help_helper.php) ----------
   Knopf in der Aktionszeile + seitlich einfahrende Leiste. Kein Bootstrap-JS:
   Öffnen/Schließen über window.kbsOpenHelp / kbsCloseHelp in kbs-ui.js.
   z-index liegt über der Seitenleiste (1000) und der Topbar. */
.kbs-help-btn { margin-left: auto; }
.page-actions .kbs-help-btn, .toolbar .kbs-help-btn { margin-left: auto; }
.kbs-help-btn i { color: var(--kbs-accent); }

.kbs-help-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, .38);
    z-index: 1190;
    opacity: 0;
    transition: opacity .2s ease;
}
.kbs-help-backdrop.open { opacity: 1; }
.kbs-help-backdrop[hidden] { display: none; }

.kbs-help-panel {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: min(430px, 100vw);
    max-width: 100vw;
    background: var(--kbs-surface);
    color: var(--kbs-text);
    border-left: 1px solid var(--kbs-border);
    box-shadow: var(--kbs-shadow-lg);
    z-index: 1200;
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform .25s ease;
}
.kbs-help-panel.open { transform: translateX(0); }
.kbs-help-panel[hidden] { display: none; }

.kbs-help-panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 18px 20px;
    border-bottom: 1px solid var(--kbs-border);
    background: linear-gradient(180deg, rgba(var(--kbs-accent-rgb), .06), transparent);
}
.kbs-help-panel-head h2 {
    margin: 0;
    font-size: var(--kbs-fs-lg);
    font-weight: 700;
    letter-spacing: -.01em;
    display: flex;
    align-items: center;
    gap: 8px;
}
.kbs-help-panel-head h2 i { color: var(--kbs-accent); }
.kbs-help-close {
    border: 1px solid var(--kbs-border);
    background: #fff;
    color: var(--kbs-muted);
    border-radius: var(--kbs-radius-sm);
    width: 34px;
    height: 34px;
    line-height: 1;
    cursor: pointer;
    flex-shrink: 0;
}
.kbs-help-close:hover { background: var(--kbs-bg); color: var(--kbs-text); }

.kbs-help-panel-body {
    padding: 18px 20px 26px;
    overflow-y: auto;
    flex: 1;
    -webkit-overflow-scrolling: touch;
}
.kbs-help-panel-body h3 {
    font-size: var(--kbs-fs-base);
    font-weight: 700;
    margin: 20px 0 6px;
    color: var(--kbs-text);
}
.kbs-help-panel-body h3:first-child { margin-top: 0; }
.kbs-help-panel-body p {
    margin: 0 0 4px;
    font-size: var(--kbs-fs-base);
    line-height: 1.6;
    color: var(--kbs-muted);
}
.kbs-help-panel-admin {
    margin-top: 26px;
    padding-top: 14px;
    border-top: 1px dashed var(--kbs-border-strong);
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    justify-content: space-between;
}
.kbs-help-panel-admin a { font-size: var(--kbs-fs-sm); text-decoration: none; }
.kbs-help-panel-admin a:hover { text-decoration: underline; }
.kbs-help-key {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: var(--kbs-fs-xs);
    color: var(--kbs-muted);
    background: var(--kbs-bg);
    border: 1px solid var(--kbs-border);
    border-radius: var(--kbs-radius-xs);
    padding: 2px 6px;
}

body.kbs-help-open { overflow: hidden; }

@media (max-width: 768px) {
    .kbs-help-panel { width: 100vw; }
    .kbs-help-btn, .page-actions .kbs-help-btn, .toolbar .kbs-help-btn { margin-left: 0; }
}
@media print {
    .kbs-help-btn, .kbs-help-panel, .kbs-help-backdrop { display: none !important; }
}


/* =====================================================================
   Öffentliche Kursseiten (public/courses.php, courses_table.php,
   course_details.php, course_booking.php + course_booking_form.php)
   ---------------------------------------------------------------------
   Nur die Muster, die es im Design-System sonst nicht gibt. Alle Farben
   kommen aus den --kbs-*-Variablen (Akzentfarbe = Kundeneinstellung),
   damit hier keine festen Farbwerte entstehen.
   ===================================================================== */

/* Inhaltsbereich zwischen öffentlichem Kopf und Fuß */
/* Nur senkrechte Abstände setzen – die seitliche Polsterung kommt von .container */
.kbs-public-main { padding-top: 28px; padding-bottom: 56px; }
.kbs-public-main > .page-header { margin-bottom: 22px; }
@media (max-width: 768px) { .kbs-public-main { padding-top: 18px; padding-bottom: 36px; } }
/* Erster Absatz direkt unter der Kartenüberschrift ohne zusätzlichen Leerraum */
.kbs-public-main .card > .card-header + p,
.kbs-public-main .card > .card-header + div > p:first-child { margin-top: 0; }

/* Format-Navigation (Alle / Seminare / Lehrgänge …) */
.kbs-pill-nav { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin: 0 0 22px; }
.kbs-pill {
    display: inline-flex; align-items: center; gap: 7px;
    padding: 8px 16px; border-radius: 999px;
    border: 2px solid var(--kbs-border);
    background: var(--kbs-surface); color: var(--kbs-text);
    font-size: var(--kbs-fs-base); font-weight: 600; text-decoration: none;
    transition: border-color .15s, color .15s, background .15s;
}
.kbs-pill:hover { border-color: var(--kbs-accent); color: var(--kbs-accent); filter: none; }
.kbs-pill.active { background: var(--kbs-accent); border-color: var(--kbs-accent); color: #fff; }
.kbs-pill-count { font-size: var(--kbs-fs-xs); font-weight: 700; opacity: .7; }

/* Raster für Kurskarten und die zweispaltige Kursdetail-Seite.
   Bewusst eigene Raster statt .row/.col-*: das Spaltenraster des Systems ist doppelt
   definiert (.row > [class*="col-"] { flex: 1 1 0 }) und setzt die col-*-Breiten außer
   Kraft – Karten würden dadurch nicht umbrechen. */
.kbs-course-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 22px; }
.kbs-course-grid > .card { height: 100%; margin-bottom: 0; }
.kbs-detail-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 24px; align-items: start; }
@media (max-width: 900px) { .kbs-detail-grid { grid-template-columns: 1fr; } }

/* Kurskarten (Kartenansicht der Kursliste) */
.course-card { display: flex; flex-direction: column; }
.course-card .info-row:last-of-type { border-bottom: none; }
.course-card > .card-footer { margin-top: auto; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.course-card .card-header { align-items: flex-start; }
.course-card-title { font-size: var(--kbs-fs-md); font-weight: 700; line-height: 1.3; margin: 0; }
.course-card-code { display: block; margin-top: 3px; font-size: var(--kbs-fs-sm); font-weight: 500; color: var(--kbs-muted); }
.course-card-badges { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.course-card-price { font-size: var(--kbs-fs-lg); font-weight: 800; color: var(--kbs-text); letter-spacing: -.02em; }
.course-card-price small { display: block; font-size: var(--kbs-fs-xs); font-weight: 500; color: var(--kbs-muted); }

/* Eckdaten mit Symbol (Kursdetails) */
.kbs-fact-list { display: grid; gap: 10px; }
.kbs-fact { display: flex; align-items: flex-start; gap: 12px; padding: 12px 14px; background: var(--kbs-bg); border-radius: var(--kbs-radius-sm); }
.kbs-fact > .bi { color: var(--kbs-accent); font-size: var(--kbs-fs-lg); line-height: 1.35; }
.kbs-fact-label { display: block; font-size: var(--kbs-fs-sm); font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--kbs-muted); }
.kbs-fact-value { color: var(--kbs-text); }

/* Preisblock in der Seitenleiste der Kursdetails */
.kbs-price-box {
    background: var(--kbs-accent); color: #fff;
    border-radius: var(--kbs-radius); padding: 22px 20px; text-align: center;
    box-shadow: 0 10px 30px rgba(var(--kbs-accent-rgb), .3);
    margin-bottom: 24px;
}
.kbs-price-label { font-size: var(--kbs-fs-sm); font-weight: 600; opacity: .85; }
.kbs-price-value { font-size: calc(30px * var(--kbs-fs-scale)); font-weight: 800; letter-spacing: -.03em; line-height: 1.2; }
.kbs-price-vat { font-size: var(--kbs-fs-sm); opacity: .8; }

/* Seitenleiste läuft auf großen Bildschirmen mit */
@media (min-width: 992px) {
    .kbs-sticky-side { position: sticky; top: 20px; }
}

/* Auswahl „Wie möchten Sie buchen?" im Wizard */
.booking-option {
    display: flex; align-items: flex-start; gap: 14px;
    border: 2px solid var(--kbs-border); border-radius: var(--kbs-radius-sm);
    padding: 16px 18px; margin-bottom: 12px; cursor: pointer;
    transition: border-color .15s, background .15s;
}
.booking-option:hover { border-color: var(--kbs-accent); background: rgba(var(--kbs-accent-rgb), .05); }
.booking-option input[type="radio"] { width: 18px; height: 18px; margin: 2px 0 0; flex: 0 0 auto; }
.booking-option-title { display: block; font-size: calc(15.5px * var(--kbs-fs-scale)); font-weight: 700; margin: 0 0 2px; }
.booking-option-text { display: block; font-size: var(--kbs-fs-base); color: var(--kbs-muted); margin: 0; }

/* Wiederholte Feldgruppen im Buchungsformular (Teilnehmerzeilen) */
.kbs-subform {
    position: relative;
    border: 1px solid var(--kbs-border); border-radius: var(--kbs-radius-sm);
    background: #fafbfc; padding: 16px 18px; margin-bottom: 16px;
}
.kbs-subform > h4 { font-size: calc(14.5px * var(--kbs-fs-scale)); font-weight: 700; margin: 0 0 14px; }
.kbs-subform-remove { position: absolute; top: 12px; right: 12px; }

/* Einwilligung als anklickbarer Hinweis (Stornierungsbedingungen) */
.alert.kbs-consent { cursor: pointer; align-items: flex-start; }
.alert.kbs-consent::before { content: none !important; }
.alert.kbs-consent input[type="checkbox"] { width: 18px; height: 18px; margin: 2px 0 0; flex: 0 0 auto; }

.kbs-captcha { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.kbs-captcha img { border: 2px solid var(--kbs-border); border-radius: var(--kbs-radius-sm); background: #fff; }
.kbs-captcha-input { max-width: 170px; }

/* Breite Tabellen der öffentlichen Seiten bleiben auch auf schmalen Bildschirmen
   waagerecht scrollbar – die Karten-Umwandlung des Systems greift dort nicht
   (kbs-ui.js/.kbs-app werden auf den öffentlichen Seiten nicht geladen). */
.table-responsive.kbs-scroll-table {
    overflow-x: auto; -webkit-overflow-scrolling: touch;
    border: 1px solid var(--kbs-border); background: var(--kbs-surface);
}
.table-responsive.kbs-scroll-table table { min-width: 1040px; }

/* Farbige Knöpfe behalten in Hinweisboxen ihre eigene Schriftfarbe (.alert a färbt sonst um) */
.alert .btn-primary, .alert .btn-success, .alert .btn-danger { color: #fff; }

/* ---------- Zusatzleistungen im Buchungsformular (includes/extras_form_helper.php) ---------- */
.kbs-extras { margin: 10px 0 4px; padding: 12px 14px; border: 1px dashed var(--kbs-border); border-radius: var(--kbs-radius-sm); background: #fff; }
.kbs-extras-title { font-size: var(--kbs-fs-sm); font-weight: 700; color: var(--kbs-muted); margin-bottom: 8px; }
.kbs-extras-title .bi { margin-right: 4px; }
.kbs-extras-item { display: flex; align-items: flex-start; gap: 10px; padding: 7px 0; margin: 0; font-weight: 400; cursor: pointer; border-top: 1px solid var(--kbs-border); }
.kbs-extras-item:first-of-type { border-top: none; }
.kbs-extras-item input[type="checkbox"] { width: 17px; height: 17px; margin: 2px 0 0; flex: 0 0 auto; accent-color: var(--kbs-accent); }
.kbs-extras-item.is-required { cursor: default; }
.kbs-extras-body { display: flex; flex-wrap: wrap; gap: 2px 12px; align-items: baseline; flex: 1; min-width: 0; }
.kbs-extras-name { font-weight: 600; }
.kbs-extras-price { white-space: nowrap; font-weight: 600; margin-left: auto; }
.kbs-extras-price small { font-weight: 400; color: var(--kbs-muted); }
.kbs-extras-desc { flex: 0 0 100%; font-size: var(--kbs-fs-sm); color: var(--kbs-muted); }
.kbs-extras-req { flex: 0 0 100%; font-size: var(--kbs-fs-sm); color: var(--kbs-info); }
table .kbs-extras-row td { padding-top: 0; }
table .kbs-extras-row .kbs-extras { margin-top: 0; }
.kbs-totals { margin-top: 20px; padding: 14px 18px; border: 1px solid var(--kbs-border); border-radius: var(--kbs-radius-sm); background: #fafbfc; }
.kbs-totals-title { font-weight: 700; margin-bottom: 6px; }
.kbs-totals .summary-row { padding: 7px 0; }
.kbs-totals .summary-row.kbs-totals-gross { border-top: 2px solid var(--kbs-border); margin-top: 4px; padding-top: 10px; font-size: var(--kbs-fs-md); }
.kbs-billing-card .card-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.kbs-billing-card .info-value { text-align: right; }

/* Nachträgliche Leistungsänderung an einer Buchung: ruhige Matrix + Summenliste */
.kbs-extras-matrix th { white-space: normal; line-height: 1.3; vertical-align: bottom; }
.kbs-extras-matrix td { vertical-align: middle; }
.kbs-extras-matrix input[type="checkbox"] { width: 18px; height: 18px; }
.kbs-summary { display: grid; grid-template-columns: 1fr auto; gap: 6px 24px; max-width: 420px; margin: 18px 0 18px auto; padding-top: 12px; border-top: 1px solid var(--kbs-border); }
.kbs-summary dt { color: var(--kbs-muted); margin: 0; }
.kbs-summary dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }
.kbs-summary .kbs-summary-total { font-weight: 700; color: var(--kbs-text); font-size: var(--kbs-fs-md); padding-top: 6px; border-top: 1px solid var(--kbs-border); }

/* =============================================================================
   Dashboard-Bausteine („Design-Sprache", siehe docs/design-sprache.md)
   -----------------------------------------------------------------------------
   Ruhige Fachsoftware-Optik: Hierarchie über Typografie und Abstand, nicht über
   Schatten und Rahmen. Eine Kennzahlenleiste statt vieler Kacheln, Listen mit
   Hairlines, Auslastung als schmaler Balken, genau EIN Akzent pro Ansicht.
   Alle Bausteine nutzen --kbs-*-Variablen und gelten in Admin und Portalen.
   ============================================================================= */
:root {
    --kbs-hairline: var(--kbs-border);
    --kbs-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}

/* Flaches Panel: Fläche mit Hairline, ohne Schatten (Gegenstück zur .card) */
.kbs-panel {
    background: var(--kbs-surface);
    border: 1px solid var(--kbs-hairline);
    border-radius: var(--kbs-radius-sm);
    margin-bottom: 28px;
}

/* Abschnitt: Überschrift-Zeile mit rechts bündiger Kennzahl/Aktion, darunter Inhalt */
.kbs-section { margin-bottom: 36px; }
.kbs-section-head {
    display: flex; align-items: baseline; justify-content: space-between; gap: 12px 20px; flex-wrap: wrap;
    padding-bottom: 10px; margin-bottom: 4px;
    border-bottom: 1px solid var(--kbs-text);
}
.kbs-section-head h2, .kbs-section-head h3 { font-size: var(--kbs-fs-md); font-weight: 700; margin: 0; letter-spacing: -.01em; }
.kbs-section-head .kbs-section-count { font-weight: 500; color: var(--kbs-muted); margin-left: 6px; }
.kbs-section-meta { font-size: var(--kbs-fs-sm); color: var(--kbs-muted); font-variant-numeric: tabular-nums; }
.kbs-section-meta strong { color: var(--kbs-text); font-weight: 600; }
.kbs-section-meta a { color: var(--kbs-accent); text-decoration: none; font-weight: 600; }
.kbs-section-meta a:hover { text-decoration: underline; }
.kbs-section-foot { padding-top: 12px; font-size: var(--kbs-fs-sm); }
.kbs-section-empty { padding: 22px 0; color: var(--kbs-muted); font-size: var(--kbs-fs-base); }
.kbs-panel > .kbs-section-head { padding: 16px 20px 12px; margin: 0; border-bottom-color: var(--kbs-hairline); }
.kbs-panel > .kbs-section-empty { padding: 22px 20px; }

/* Kennzahlenleiste: EIN Panel, Werte durch Hairlines getrennt */
.kbs-kpi-strip {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    background: var(--kbs-surface);
    border: 1px solid var(--kbs-hairline);
    border-radius: var(--kbs-radius-sm);
    margin-bottom: 32px;
    overflow: hidden;
}
.kbs-kpi {
    display: block; min-width: 0;
    padding: 18px 22px 16px;
    border-left: 1px solid var(--kbs-hairline);
    color: inherit; text-decoration: none;
}
.kbs-kpi:first-child { border-left: none; }
a.kbs-kpi:hover { background: #fafafa; text-decoration: none; color: inherit; }
a.kbs-kpi:focus-visible { outline-offset: -3px; border-radius: 0; }
.kbs-kpi-value {
    font-size: calc(30px * var(--kbs-fs-scale)); font-weight: 700; line-height: 1.1; letter-spacing: -.02em;
    color: var(--kbs-text); font-variant-numeric: tabular-nums;
    display: flex; align-items: baseline; gap: 8px;
}
.kbs-kpi-value small { font-size: var(--kbs-fs-base); font-weight: 500; color: var(--kbs-muted); letter-spacing: 0; }
.kbs-kpi-label {
    margin-top: 6px; font-size: var(--kbs-fs-xs); font-weight: 600; letter-spacing: .08em; text-transform: uppercase;
    color: var(--kbs-muted); line-height: 1.35;
}
.kbs-kpi-note { margin-top: 6px; font-size: var(--kbs-fs-sm); color: var(--kbs-muted); }
.kbs-kpi-note a { color: var(--kbs-accent); text-decoration: none; font-weight: 600; }
.kbs-kpi-note a:hover { text-decoration: underline; }
/* Der eine Akzent: Wert, der Aufmerksamkeit braucht */
.kbs-kpi.is-attention .kbs-kpi-value { color: var(--kbs-accent); }
.kbs-kpi.is-attention .kbs-kpi-value::before {
    content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--kbs-accent); flex: 0 0 auto;
    align-self: center; margin-right: 2px;
}

/* Liste mit Hairlines: Datum | Inhalt | Kennzahl/Status | Aktion */
.kbs-list { list-style: none; margin: 0; padding: 0; }
.kbs-list-row {
    display: grid;
    grid-template-columns: 112px minmax(0, 1fr) auto;
    gap: 6px 20px; align-items: center;
    padding: 13px 0;
    border-bottom: 1px solid var(--kbs-hairline);
}
.kbs-list-row:last-child { border-bottom: none; }
.kbs-list-row.has-action { grid-template-columns: 112px minmax(0, 1fr) auto auto; }
.kbs-panel > .kbs-list .kbs-list-row { padding-left: 20px; padding-right: 20px; }
.kbs-list-date {
    font-family: var(--kbs-mono); font-size: var(--kbs-fs-sm); color: var(--kbs-text); font-variant-numeric: tabular-nums;
    line-height: 1.35; white-space: nowrap;
}
.kbs-list-date small { display: block; font-family: var(--kbs-font); font-size: var(--kbs-fs-sm); color: var(--kbs-muted); }
.kbs-list-main { min-width: 0; }
.kbs-list-title { font-weight: 600; font-size: var(--kbs-fs-base); color: var(--kbs-text); line-height: 1.35; }
.kbs-list-title a { color: inherit; text-decoration: none; }
.kbs-list-title a:hover { color: var(--kbs-accent); }
.kbs-list-code { font-family: var(--kbs-mono); font-size: var(--kbs-fs-sm); color: var(--kbs-muted); font-weight: 500; margin-right: 8px; }
.kbs-list-sub { font-size: var(--kbs-fs-sm); color: var(--kbs-muted); margin-top: 2px; }
.kbs-list-aside { display: flex; align-items: center; gap: 14px; justify-content: flex-end; white-space: nowrap; }
.kbs-list-action .btn-sm { min-height: 34px; }

/* Auslastung: dünner Balken mit Zahl daneben */
.kbs-progress { display: inline-flex; align-items: center; gap: 10px; min-width: 0; }
.kbs-progress-bar { width: 88px; height: 4px; border-radius: 2px; background: var(--kbs-border); overflow: hidden; flex: 0 0 auto; }
.kbs-progress-bar > span { display: block; height: 100%; background: var(--kbs-muted); border-radius: 2px; }
.kbs-progress.is-full .kbs-progress-bar > span { background: var(--kbs-text); }
.kbs-progress-text { font-size: var(--kbs-fs-sm); color: var(--kbs-text); font-variant-numeric: tabular-nums; white-space: nowrap; }
.kbs-progress-text small { color: var(--kbs-muted); font-size: inherit; }
.kbs-progress.is-unknown .kbs-progress-text { color: var(--kbs-muted); }

/* Kennzahlen als Textliste (Beschriftung links, Wert rechts) */
.kbs-figures { display: grid; grid-template-columns: minmax(0, 1fr) auto; min-width: 0; gap: 0 16px; margin: 0; }
.kbs-figures dt { font-size: var(--kbs-fs-sm); color: var(--kbs-muted); white-space: nowrap; padding: 9px 0; border-bottom: 1px solid var(--kbs-hairline); margin: 0; }
.kbs-figures dd { font-size: var(--kbs-fs-base); font-weight: 600; color: var(--kbs-text); text-align: right; padding: 9px 0; border-bottom: 1px solid var(--kbs-hairline); margin: 0; font-variant-numeric: tabular-nums; white-space: nowrap; }
.kbs-figures dt:last-of-type, .kbs-figures dd:last-of-type { border-bottom: none; }
.kbs-figures dd small { display: block; font-weight: 400; color: var(--kbs-muted); font-size: var(--kbs-fs-sm); margin-top: 1px; }
.kbs-figures dd.is-attention { color: var(--kbs-accent); }
.kbs-figures .is-up { color: var(--kbs-success); }
.kbs-figures .is-down { color: var(--kbs-danger); }
/* Abschlusszeile einer Beträge-Liste (Gesamtsumme) */
.kbs-figures .is-total { padding-top: 12px; border-top: 1px solid var(--kbs-border-strong); border-bottom: none; font-size: var(--kbs-fs-md); color: var(--kbs-text); font-weight: 700; }
.kbs-figures dt.is-total { font-weight: 600; }
/* Beträge-Liste in einer Karte rechtsbündig einstellen, wenn sie eine Detailliste abschließt */
.kbs-detail + .kbs-figures { max-width: 420px; margin-left: auto; margin-top: 18px; padding-top: 6px; }

/* Umsatzdiagramm (inline SVG): Kopfzeile mit Summe, schlanke Balken, Textliste daneben */
.kbs-revenue-body { display: grid; grid-template-columns: minmax(0, 1fr) minmax(240px, 280px); gap: 12px 32px; padding: 14px 20px 18px; align-items: start; }
.kbs-revenue-chart { min-width: 0; }
.kbs-revenue-chart .kbs-chart { display: block; width: 100%; height: auto; max-height: 300px; overflow: visible; }
.kbs-revenue-empty { padding: 22px 20px; color: var(--kbs-muted); font-size: var(--kbs-fs-base); }
.kbs-chart-note { margin: 6px 0 0; font-size: var(--kbs-fs-sm); color: var(--kbs-muted); }
.kbs-chart-grid { stroke: var(--kbs-hairline); stroke-width: 1; }
.kbs-chart-axis-line { stroke: var(--kbs-border-strong); stroke-width: 1; }
.kbs-chart-axis, .kbs-chart-label { fill: var(--kbs-muted); font-size: calc(10.5px * var(--kbs-fs-scale)); font-family: var(--kbs-font); }
.kbs-chart-year { fill: var(--kbs-text); font-weight: 600; }
.kbs-chart-hit { fill: transparent; }
.kbs-chart-rect { fill: #9aa0a8; transition: fill .15s ease; }
.kbs-chart-bar.is-current .kbs-chart-rect { fill: var(--kbs-accent); }
.kbs-chart-bar:hover .kbs-chart-rect { fill: var(--kbs-text); }

/* Aufklappbare Gruppen (z. B. Buchungen je Kurstermin) */
.kbs-disclosure { border-bottom: 1px solid var(--kbs-hairline); }
.kbs-disclosure:last-child { border-bottom: none; }
.kbs-disclosure > summary {
    list-style: none; cursor: pointer; min-height: 48px;
    display: grid; grid-template-columns: 14px 112px minmax(0, 1fr) auto; gap: 6px 16px; align-items: center;
    padding: 12px 20px;
}
.kbs-disclosure > summary::-webkit-details-marker { display: none; }
.kbs-disclosure > summary:hover { background: #fafafa; }
.kbs-disclosure > summary .kbs-disclosure-marker {
    width: 0; height: 0; border-style: solid; border-width: 5px 0 5px 7px; border-color: transparent transparent transparent var(--kbs-muted);
    transition: transform .15s ease; justify-self: center;
}
.kbs-disclosure[open] > summary .kbs-disclosure-marker { transform: rotate(90deg); }
.kbs-disclosure-body { padding: 0 20px 16px 50px; }
.kbs-disclosure-body .table-responsive { border-radius: var(--kbs-radius-xs); }
.kbs-disclosure-body table { font-size: var(--kbs-fs-base); }
.kbs-disclosure-body table th { position: static; }
.kbs-disclosure-body tr.is-cancelled > td { color: var(--kbs-muted); }
.kbs-amount { font-variant-numeric: tabular-nums; white-space: nowrap; font-weight: 600; }

/* Neutrale Merkmal-Chips (z. B. Spezialisierungen) */
.kbs-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
.kbs-chips li, .kbs-chip { display: inline-flex; align-items: center; min-height: 32px; padding: 0 12px; border: 1px solid var(--kbs-border-strong); border-radius: 999px; font-size: var(--kbs-fs-sm); font-weight: 500; color: var(--kbs-text); background: var(--kbs-surface); }

/* Mobil: Leiste 2-spaltig bzw. 1-spaltig, Listen stapeln, Tap-Ziele ≥ 44 px */
@media (max-width: 900px) {
    .kbs-revenue-body { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 768px) {
    .kbs-kpi-strip { grid-template-columns: repeat(2, 1fr); margin-bottom: 24px; }
    .kbs-kpi { padding: 14px 16px 12px; border-left: none; border-top: 1px solid var(--kbs-hairline); }
    .kbs-kpi:nth-child(-n+2) { border-top: none; }
    .kbs-kpi:nth-child(2n) { border-left: 1px solid var(--kbs-hairline); }
    .kbs-kpi:last-child:nth-child(odd) { grid-column: 1 / -1; }
    .kbs-kpi-value { font-size: var(--kbs-fs-2xl); }
    .kbs-section { margin-bottom: 28px; }
    .kbs-list-row, .kbs-list-row.has-action { grid-template-columns: minmax(0, 1fr) auto; padding: 12px 0; }
    .kbs-panel > .kbs-list .kbs-list-row { padding-left: 16px; padding-right: 16px; }
    .kbs-list-date { grid-column: 1 / -1; font-size: var(--kbs-fs-sm); }
    .kbs-list-date small { display: inline; margin-left: 8px; }
    .kbs-list-aside { grid-column: 1 / 2; justify-content: flex-start; flex-wrap: wrap; gap: 8px 14px; }
    .kbs-list-action { grid-column: 2 / 3; grid-row: 2 / 4; align-self: center; }
    .kbs-list-action .btn-sm { min-height: 44px; min-width: 44px; }
    .kbs-progress-bar { width: 72px; }
    .kbs-revenue-body { padding: 12px 16px 16px; gap: 16px; }
    .kbs-panel > .kbs-section-head { padding: 14px 16px 10px; }
    .kbs-disclosure > summary { grid-template-columns: 14px minmax(0, 1fr); gap: 4px 12px; padding: 12px 16px; }
    .kbs-disclosure > summary .kbs-disclosure-marker { grid-column: 1; grid-row: 1; }
    .kbs-disclosure > summary .kbs-list-main { grid-column: 2; grid-row: 1; }
    .kbs-disclosure > summary .kbs-disclosure-date { grid-column: 2; grid-row: 2; font-size: var(--kbs-fs-sm); }
    .kbs-disclosure > summary .kbs-list-aside { grid-column: 2; grid-row: 3; justify-content: flex-start; }
    .kbs-disclosure-body { padding: 0 16px 14px 16px; }
    .kbs-disclosure-body .table-responsive { border: none; }
    .kbs-kpi-strip a.kbs-kpi { min-height: 44px; }
}
@media (max-width: 480px) {
    /* Kennzahlen als kompakte Zeilen: Beschriftung links, Zahl rechts */
    .kbs-kpi-strip { grid-template-columns: 1fr; }
    .kbs-kpi { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 2px 12px; padding: 11px 16px; min-height: 48px; }
    .kbs-kpi:nth-child(2) { border-top: 1px solid var(--kbs-hairline); }
    .kbs-kpi:nth-child(2n) { border-left: none; }
    .kbs-kpi-label { order: 1; flex: 1 1 auto; margin: 0; }
    .kbs-kpi-value { order: 2; font-size: calc(22px * var(--kbs-fs-scale)); }
    .kbs-kpi-value small { font-size: var(--kbs-fs-sm); }
    .kbs-kpi-note { order: 3; flex: 0 0 100%; margin: 0; font-size: var(--kbs-fs-sm); }
    .kbs-section-head { flex-direction: column; gap: 4px; }
    .kbs-list-row, .kbs-list-row.has-action { grid-template-columns: 1fr; }
    .kbs-list-action { grid-column: 1; grid-row: auto; text-align: right; }
}
@media print {
    .kbs-kpi-strip, .kbs-panel { border-color: #999; break-inside: avoid; }
    .kbs-chart-rect { fill: #666 !important; }
}

/* =============================================================================
   Verwaltungsseiten: Detail-, Formular- und Listenbausteine (docs/design-sprache.md)
   -----------------------------------------------------------------------------
   Ergänzt die Dashboard-Bausteine für die Seiten der Verwaltung: Definitions-
   listen statt Karten in Karten, Formularabschnitte mit Überschrift-Zeile,
   Aktionsleisten, Zahlen rechtsbündig. Nur --kbs-*-Variablen, keine Inline-Stile.
   ============================================================================= */

/* Definitionsliste: Beschriftung links (schmal, grau), Wert rechts davon */
.kbs-detail { display: grid; grid-template-columns: minmax(140px, 200px) minmax(0, 1fr); gap: 0 24px; margin: 0; }
.kbs-detail dt, .kbs-detail dd { padding: 9px 0; border-bottom: 1px solid var(--kbs-hairline); margin: 0; min-width: 0; }
.kbs-detail dt { font-size: var(--kbs-fs-sm); color: var(--kbs-muted); font-weight: 500; line-height: 1.5; }
.kbs-detail dd { font-size: var(--kbs-fs-base); color: var(--kbs-text); line-height: 1.5; overflow-wrap: anywhere; }
.kbs-detail dd.kbs-num, .kbs-detail dd .kbs-num { text-align: left; }
.kbs-detail dd strong { font-weight: 600; }
.kbs-detail dd small, .kbs-detail dd .kbs-detail-sub { display: block; font-size: var(--kbs-fs-sm); color: var(--kbs-muted); margin-top: 1px; }
.kbs-detail dt:last-of-type, .kbs-detail dd:last-of-type { border-bottom: none; }
.kbs-detail dd .badge + .badge { margin-left: 6px; }
.kbs-detail dd.is-code, .kbs-code { font-family: var(--kbs-mono); font-size: var(--kbs-fs-base); letter-spacing: .01em; }
.kbs-detail dd pre, .kbs-detail dd .kbs-prewrap { white-space: pre-wrap; margin: 0; }
/* Zwei Definitionslisten nebeneinander (ab 900 px) */
.kbs-detail-cols { display: grid; grid-template-columns: 1fr; gap: 0 48px; }
@media (min-width: 900px) { .kbs-detail-cols { grid-template-columns: 1fr 1fr; } }

/* Abschnittskopf in Karten (Detailseiten und Formulare): h3 links, Aktion rechts */
.card .kbs-section-head { border-bottom-color: var(--kbs-hairline); margin-bottom: 14px; }
.card .kbs-section-head:first-child { margin-top: 0; }
.card > .kbs-section-head + .kbs-detail, .card > .kbs-section-head + .kbs-detail-cols { margin-top: -4px; }

/* Formularabschnitt: Überschrift-Zeile, darüber Hairline ab dem zweiten Abschnitt */
.kbs-form-section { margin-top: 28px; padding-top: 22px; border-top: 1px solid var(--kbs-hairline); }
.kbs-form-section:first-child, .kbs-form-section.is-first, form > .kbs-form-section:first-of-type { margin-top: 0; padding-top: 0; border-top: none; }
.kbs-form-section > h3, .kbs-form-section > .kbs-section-head h3 { font-size: var(--kbs-fs-md); font-weight: 700; margin: 0 0 16px; letter-spacing: -.01em; }
.kbs-form-section > .kbs-section-head { margin-bottom: 16px; }
.kbs-form-section > .kbs-section-head h3 { margin: 0; }
.kbs-form-section-hint { font-size: var(--kbs-fs-sm); color: var(--kbs-muted); margin: -8px 0 16px; line-height: 1.5; }
.kbs-form-section .row > [class*="col-"] > .form-group:last-child { margin-bottom: 18px; }
.kbs-form-section .form-group:last-child { margin-bottom: 0; }
.kbs-form-section .row .form-group:last-child { margin-bottom: 18px; }

/* Aktionen am Formularende: Primär links, Abbrechen sekundär; oberhalb Hairline */
.page-actions.is-form { margin: 28px 0 0; padding-top: 20px; border-top: 1px solid var(--kbs-hairline); }
.page-actions.is-end { margin: 0; }

/* Ankreuzoption mit Titel und Beschreibung (Tap-Ziel ≥ 44 px) */
.kbs-check { display: flex; align-items: flex-start; gap: 12px; padding: 10px 0; margin: 0; min-height: 44px; cursor: pointer; font-weight: 400; }
.kbs-check input[type="checkbox"], .kbs-check input[type="radio"] { width: 18px; height: 18px; margin: 2px 0 0; flex: 0 0 auto; }
.kbs-check-body { min-width: 0; flex: 1 1 auto; }
.kbs-check-title { font-weight: 600; font-size: var(--kbs-fs-base); color: var(--kbs-text); line-height: 1.4; }
.kbs-check-desc { font-size: var(--kbs-fs-sm); color: var(--kbs-muted); margin-top: 2px; line-height: 1.5; }
.kbs-check-list { margin: 0; padding: 0; }
.kbs-check-list > .kbs-check { border-bottom: 1px solid var(--kbs-hairline); }
.kbs-check-list > .kbs-check:last-child { border-bottom: none; }
/* Auswahlraster (z. B. Spezialisierungen): Optionen mit Hairline, gewählte dunkel umrandet */
.kbs-option-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; }
.kbs-option-grid > .kbs-check { border: 1px solid var(--kbs-hairline); border-radius: var(--kbs-radius-xs); padding: 12px 14px; background: var(--kbs-surface); }
.kbs-option-grid > .kbs-check:hover { border-color: var(--kbs-border-strong); }
.kbs-option-grid > .kbs-check.is-selected, .kbs-option-grid > .kbs-check:has(input:checked) { border-color: var(--kbs-text); }

/* Aktionsleiste: Text links, Knöpfe rechts (z. B. Exporte, PDF-Listen) */
.kbs-actionbar { display: flex; align-items: center; justify-content: space-between; gap: 12px 24px; flex-wrap: wrap; padding: 14px 20px; border: 1px solid var(--kbs-hairline); border-radius: var(--kbs-radius-sm); background: var(--kbs-surface); margin-bottom: 16px; }
.kbs-actionbar-text { min-width: 0; flex: 1 1 280px; }
.kbs-actionbar-text strong { display: block; font-size: var(--kbs-fs-base); font-weight: 600; }
.kbs-actionbar-text small { display: block; font-size: var(--kbs-fs-sm); color: var(--kbs-muted); margin-top: 2px; line-height: 1.45; }
.kbs-actionbar-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
.kbs-actionbar + .kbs-actionbar { margin-top: -6px; }
.kbs-actionbar-group { margin-bottom: 24px; }
.kbs-actionbar-group .kbs-actionbar { margin-bottom: 10px; }

/* Einzeilige Erfassung (z. B. Kostenposition): Felder nebeneinander, Knopf rechts */
.kbs-inline-form { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) auto; gap: 12px 16px; align-items: end; }
.kbs-inline-form .form-group { margin: 0; }
.kbs-inline-form .btn { min-height: 42px; }
/* Formular, das nur einen Knopf enthält (Aktionsleisten) – soll nicht umbrechen */
.kbs-form-flat { display: contents; }
@supports not (display: contents) { .kbs-form-flat { display: inline-block; } }

/* Zahlen rechtsbündig und gleich breit (Tabellen, Summen) */
.kbs-num, table th.kbs-num, table td.kbs-num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
table tfoot td { font-weight: 600; background: #fafbfc; border-top: 2px solid var(--kbs-border); }
table tr.is-muted > td { color: var(--kbs-muted); }
table tr.is-muted > td .badge { opacity: .85; }
table td .kbs-cell-sub { display: block; font-size: var(--kbs-fs-sm); color: var(--kbs-muted); margin-top: 2px; white-space: normal; }
table td .kbs-cell-title { font-weight: 600; }
.table-responsive > table { min-width: 0; }
.table-responsive.is-wide > table { min-width: 720px; }
.card > .table-responsive, .card > form > .table-responsive { margin: 0 0 4px; }
.card > .table-responsive:last-child { margin-bottom: 0; }

/* Hinweiszeile unter Inhalten (kein Kasten) */
.kbs-note { font-size: var(--kbs-fs-sm); color: var(--kbs-muted); margin: 12px 0 0; line-height: 1.55; }
.kbs-note strong { color: var(--kbs-text); font-weight: 600; }
.kbs-note-list { font-size: var(--kbs-fs-sm); color: var(--kbs-muted); margin: 8px 0 0; padding-left: 18px; line-height: 1.6; }
.kbs-note-list strong { color: var(--kbs-text); font-weight: 600; }

/* Merkmal-Chips mit Zustand: erfüllt (dunkel) / fehlt (gestrichelt) */
.kbs-chips .is-on { border-color: var(--kbs-text); color: var(--kbs-text); }
.kbs-chips .is-off { border-style: dashed; color: var(--kbs-muted); }
.kbs-chips .kbs-chip-mark { font-size: var(--kbs-fs-sm); margin-right: 6px; }
.kbs-chips-label { font-size: var(--kbs-fs-sm); color: var(--kbs-muted); margin: 0 0 8px; }

/* Gefahrenzone: Karte mit rotem Kopf (statt roter Inline-Header) */
.card > .card-header.alert-danger, .card > .card-header.alert-warning, .card > .card-header.alert-info {
    margin: -24px -24px 20px; padding: 14px 24px; border-radius: var(--kbs-radius) var(--kbs-radius) 0 0;
    border-width: 0 0 1px; font-size: var(--kbs-fs-md); font-weight: 700; flex-wrap: wrap;
}
.card > .card-header.alert-danger::before, .card > .card-header.alert-warning::before, .card > .card-header.alert-info::before { content: none; }
.card > .card-header.alert-danger h3, .card > .card-header.alert-warning h3, .card > .card-header.alert-info h3 { color: inherit; }

/* Kennzahlenleiste innerhalb einer Karte: etwas kompakter */
.card > .kbs-kpi-strip { margin: 0 0 20px; }
.card > .kbs-kpi-strip .kbs-kpi { padding: 14px 18px 12px; }
.card > .kbs-kpi-strip .kbs-kpi-value { font-size: calc(24px * var(--kbs-fs-scale)); }

/* Seitenkopf mit Status-Badges und Untertitel */
.page-header .page-header-sub { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 8px; font-size: var(--kbs-fs-sm); color: var(--kbs-muted); }
.page-header .page-header-sub .kbs-code { font-size: var(--kbs-fs-sm); color: var(--kbs-text); }

/* Schlüssel-Wert-Zeilen mit Aktion rechts (z. B. Einstellungsübersicht) */
.kbs-keyvalue { display: grid; grid-template-columns: minmax(140px, 220px) minmax(0, 1fr) auto; gap: 0 20px; align-items: center; }
.kbs-keyvalue > * { padding: 10px 0; border-bottom: 1px solid var(--kbs-hairline); min-width: 0; }
.kbs-keyvalue > .kbs-keyvalue-key { font-size: var(--kbs-fs-sm); color: var(--kbs-muted); font-weight: 500; }
.kbs-keyvalue > .kbs-keyvalue-val { font-size: var(--kbs-fs-base); overflow-wrap: anywhere; }
.kbs-keyvalue > .kbs-keyvalue-act { text-align: right; white-space: nowrap; }
.kbs-keyvalue > :nth-last-child(-n+3) { border-bottom: none; }

@media (max-width: 768px) {
    .kbs-detail { grid-template-columns: 1fr; gap: 0; }
    .kbs-detail dt { padding: 10px 0 0; border-bottom: none; font-size: var(--kbs-fs-sm); text-transform: uppercase; letter-spacing: .06em; font-weight: 600; }
    .kbs-detail dd { padding: 2px 0 10px; }
    .kbs-detail dt:last-of-type { border-bottom: none; }
    .kbs-actionbar { flex-direction: column; align-items: stretch; padding: 14px 16px; }
    /* In der Spalten-Anordnung ist die Hauptachse senkrecht – die Breitenvorgabe würde sonst als Höhe wirken */
    .kbs-actionbar-text { flex: 0 0 auto; }
    .kbs-actionbar-actions { justify-content: flex-start; }
    .kbs-actionbar-actions .btn { flex: 1 1 auto; min-height: 44px; }
    .kbs-inline-form { grid-template-columns: 1fr; }
    .kbs-inline-form .btn { width: 100%; min-height: 44px; }
    .page-actions .btn, .kbs-check-list .btn { min-height: 44px; }
    .page-actions.is-form .btn { flex: 1 1 auto; }
    .kbs-option-grid { grid-template-columns: 1fr; }
    .kbs-keyvalue { grid-template-columns: 1fr auto; }
    .kbs-keyvalue > .kbs-keyvalue-key { grid-column: 1 / -1; padding-bottom: 0; border-bottom: none; }
    .kbs-keyvalue > :nth-last-child(-n+3) { border-bottom: 1px solid var(--kbs-hairline); }
    .kbs-keyvalue > :nth-last-child(-n+2) { border-bottom: none; }
    .card > .card-header.alert-danger, .card > .card-header.alert-warning, .card > .card-header.alert-info { margin: -18px -18px 16px; padding: 12px 18px; border-radius: 14px 14px 0 0; }
    .card > .kbs-kpi-strip .kbs-kpi { padding: 12px 14px 10px; }
    .kbs-form-section { margin-top: 22px; padding-top: 18px; }
}

/* Verlaufsliste (Buchungshistorie u. ä.) */
.kbs-timeline { list-style: none; margin: 0; padding: 0; }
.kbs-timeline-item { display: flex; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--kbs-hairline); }
.kbs-timeline-item:last-child { border-bottom: none; padding-bottom: 0; }
.kbs-timeline-mark { flex: 0 0 28px; width: 28px; text-align: center; color: var(--kbs-muted); font-size: var(--kbs-fs-md); line-height: 1.5; }
.kbs-timeline-body { flex: 1; min-width: 0; }
.kbs-timeline-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.kbs-timeline-head strong { font-size: var(--kbs-fs-base); font-weight: 600; }
.kbs-timeline-time { font-size: var(--kbs-fs-sm); color: var(--kbs-muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.kbs-timeline-text { font-size: var(--kbs-fs-base); color: var(--kbs-text); margin-top: 2px; }
.kbs-timeline-meta { font-size: var(--kbs-fs-sm); color: var(--kbs-muted); margin-top: 3px; }
.kbs-timeline-change { margin-top: 6px; font-size: var(--kbs-fs-sm); color: var(--kbs-muted); }
.kbs-change-old { text-decoration: line-through; }
.kbs-change-new { color: var(--kbs-text); font-weight: 600; }
.kbs-sublist { margin: 0; padding-left: 18px; font-size: var(--kbs-fs-sm); }
.action-buttons.is-stacked { flex-direction: column; align-items: stretch; }

/* Ergänzungen Detailseiten (Kurstermin-Ansicht u. a.) */
.kbs-stack { display: grid; gap: 20px; }
.kbs-subhead { font-size: var(--kbs-fs-base); font-weight: 700; color: var(--kbs-text); margin: 22px 0 10px; }
.kbs-panel-note { padding: 12px 0; margin-top: 14px; border-top: 1px solid var(--kbs-hairline); font-size: var(--kbs-fs-sm); color: var(--kbs-muted); }
.kbs-inline-fields { display: grid; grid-template-columns: 2fr 1fr auto; gap: 12px; align-items: end; }
@media (max-width: 768px) { .kbs-inline-fields { grid-template-columns: 1fr; } }
.form-group.is-flush { margin-bottom: 0; }
tr.kbs-row-total td { font-weight: 700; border-top: 1px solid var(--kbs-border-strong); background: transparent; }
tr.kbs-row-waitlist td { color: var(--kbs-text); }
tr.kbs-row-waitlist td:first-child { box-shadow: inset 3px 0 0 var(--kbs-warning); }
tr.kbs-row-cancelled td { color: var(--kbs-muted); }
tr.kbs-row-cancelled td:first-child { box-shadow: inset 3px 0 0 var(--kbs-border-strong); }
.text-end { text-align: right !important; }
.kbs-num { font-variant-numeric: tabular-nums; }

/* =============================================================================
   Belebte Statistiken (docs/design-sprache.md, Abschnitt „Bewegung")
   -----------------------------------------------------------------------------
   Sparsam eingesetzt: Zahlen und Balken wachsen beim Öffnen einmal auf, danach
   ist die Ansicht ruhig. Farbe nur in der Statistik – der Rest bleibt neutral.
   Respektiert die Systemeinstellung „Bewegung reduzieren".
   ============================================================================= */

/* Balken im Umsatzdiagramm: wachsen von unten */
@keyframes kbs-grow-y { from { transform: scaleY(0); } to { transform: scaleY(1); } }
.kbs-chart-rect { transform-origin: bottom; animation: kbs-grow-y .6s cubic-bezier(.2,.7,.3,1) both; }
.kbs-chart-rect:nth-child(2)  { animation-delay: .03s; } .kbs-chart-rect:nth-child(3)  { animation-delay: .06s; }
.kbs-chart-rect:nth-child(4)  { animation-delay: .09s; } .kbs-chart-rect:nth-child(5)  { animation-delay: .12s; }
.kbs-chart-rect:nth-child(6)  { animation-delay: .15s; } .kbs-chart-rect:nth-child(7)  { animation-delay: .18s; }
.kbs-chart-rect:nth-child(8)  { animation-delay: .21s; } .kbs-chart-rect:nth-child(9)  { animation-delay: .24s; }
.kbs-chart-rect:nth-child(10) { animation-delay: .27s; } .kbs-chart-rect:nth-child(11) { animation-delay: .30s; }
.kbs-chart-rect:nth-child(12) { animation-delay: .33s; }
.kbs-chart-rect:hover { filter: brightness(.92); }

/* Auslastungsbalken: füllt sich einmal auf */
@keyframes kbs-grow-x { from { transform: scaleX(0); } to { transform: scaleX(1); } }
.kbs-progress-bar { transform-origin: left; animation: kbs-grow-x .5s cubic-bezier(.2,.7,.3,1) both; }

/* Ringdiagramm für Belegung/Anteile – SVG, keine Bibliothek */
.kbs-ring { display: inline-flex; align-items: center; gap: 14px; }
.kbs-ring svg { flex: 0 0 auto; transform: rotate(-90deg); }
.kbs-ring-track { fill: none; stroke: var(--kbs-hairline); }
.kbs-ring-value { fill: none; stroke: var(--kbs-accent); stroke-linecap: round;
    animation: kbs-ring-fill .9s cubic-bezier(.2,.7,.3,1) both; }
@keyframes kbs-ring-fill { from { stroke-dashoffset: var(--kbs-ring-circumference); } }
.kbs-ring-caption { min-width: 0; }
.kbs-ring-caption strong { display: block; font-size: var(--kbs-fs-lg); font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.15; }
.kbs-ring-caption span { display: block; font-size: var(--kbs-fs-sm); color: var(--kbs-muted); margin-top: 2px; }
.kbs-ring.is-full .kbs-ring-value { stroke: var(--kbs-warning-solid); }
.kbs-ring.is-over .kbs-ring-value { stroke: var(--kbs-danger-solid); }

/* Kennzahlen zählen beim Öffnen hoch (JS setzt data-count-to) */
.kbs-kpi-value.is-counting { font-variant-numeric: tabular-nums; }

@media (prefers-reduced-motion: reduce) {
    .kbs-chart-rect, .kbs-progress-bar, .kbs-ring-value { animation: none !important; }
}
