/*
 * Obsidian – Designsystem der Anwendung (Phase 10c, docs/DESIGN.md)
 *
 * Aufbau: 1. Schriften (lokal, SIL OFL)  2. Gestaltungswerte (Tokens) hell/dunkel  3. Bootstrap-Theming
 *         4. Grundlagen  5. Anwendungsrahmen (Seitenleiste, Kopfleiste)  6. Bausteine  7. Seiten  8. Barrierefreiheit
 * Hell/Dunkel über data-bs-theme auf <html> (static/js/theme.js setzt „System“ um). Keine Inline-Styles (CSP).
 * Kontraste nach WCAG 2.2 AA geprüft (Text ≥ 4,5:1, Bedienelemente ≥ 3:1) – Werte in docs/DESIGN.md.
 */

/* 1. Schriften ------------------------------------------------------------------------------------- */
@font-face {
  font-family: "Instrument Sans";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("../fonts/instrument-sans/instrument-sans-latin-wght-normal.fa41c43a3d8e.woff2") format("woff2-variations");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Instrument Sans";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("../fonts/instrument-sans/instrument-sans-latin-ext-wght-normal.1ff13d113ba4.woff2") format("woff2-variations");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Fraunces";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("../fonts/fraunces/fraunces-latin-wght-normal.eb2486760f75.woff2") format("woff2-variations");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Fraunces";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("../fonts/fraunces/fraunces-latin-ext-wght-normal.9cab501e1829.woff2") format("woff2-variations");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/ibm-plex-mono/ibm-plex-mono-latin-400-normal.79936b18df9f.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/ibm-plex-mono/ibm-plex-mono-latin-ext-400-normal.8450d5944de2.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("../fonts/ibm-plex-mono/ibm-plex-mono-latin-500-normal.b1c8a895f5fd.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("../fonts/ibm-plex-mono/ibm-plex-mono-latin-ext-500-normal.fa8d8838b94a.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* 2. Gestaltungswerte ------------------------------------------------------------------------------- */
:root {
  --ob-font-ui: "Instrument Sans", "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --ob-font-display: "Fraunces", Cambria, "Iowan Old Style", Georgia, serif;
  --ob-font-mono: "IBM Plex Mono", "Cascadia Mono", Consolas, ui-monospace, monospace;

  --ob-fs-xs: 0.6875rem;   /* 11 */
  --ob-fs-sm: 0.78125rem;  /* 12,5 */
  --ob-fs-base: 0.875rem;  /* 14 */
  --ob-fs-md: 1rem;
  --ob-fs-lg: 1.0625rem;
  --ob-fs-xl: 1.5rem;
  --ob-fs-2xl: 2.125rem;

  --ob-s1: 0.25rem; --ob-s2: 0.5rem; --ob-s3: 0.75rem; --ob-s4: 1rem; --ob-s5: 1.25rem;
  --ob-s6: 1.5rem; --ob-s8: 2rem; --ob-s10: 2.5rem; --ob-s12: 3rem;

  --ob-r-sm: 6px; --ob-r-md: 8px; --ob-r-lg: 12px; --ob-r-xl: 16px; --ob-r-pill: 999px;

  --ob-dur-1: 120ms; --ob-dur-2: 200ms; --ob-dur-3: 320ms;
  --ob-ease: cubic-bezier(0.2, 0.7, 0.2, 1);

  --ob-sidebar-width: 16.5rem;
  --ob-topbar-height: 60px;
  --ob-tabbar-height: 4.5rem;
  --ob-content-max: 82rem;
}

/* Hell – warmes Elfenbein mit Nachtblau und Bronze. Grundlage für jedes Theme; gedruckt wird immer hell. */
[data-bs-theme] {
  color-scheme: light;
  --ob-bg: #F6F2E9; --ob-sidebar: #EFE9DC; --ob-surface: #FFFDF8; --ob-surface-2: #F9F5EC; --ob-surface-3: #F1ECE1;
  --ob-field: #FFFFFF; --ob-chrome: #E6DFD0; --ob-nav-hover: #E8E1D2; --ob-nav-active: #FFFDF8;
  --ob-line: #E7E0D1; --ob-line-2: #D8CFBC; --ob-line-strong: #8C8371;
  --ob-text: #121A2C; --ob-text-2: #4B5263; --ob-text-3: #5A606E;
  --ob-accent: #805C1B; --ob-accent-deco: #C2A469; --ob-accent-soft: #F4ECDA;
  --ob-primary-bg: #14203A; --ob-primary-hover: #1F2E50; --ob-primary-fg: #FBF7EE;
  --ob-danger: #A3302C; --ob-danger-bg: #A3302C; --ob-danger-hover: #8C2724; --ob-danger-fg: #FFFFFF; --ob-danger-soft: #FBEAE7; --ob-danger-line: #E6BDB8;
  --ob-warn: #87470A; --ob-warn-soft: #FBF1DE; --ob-warn-line: #EAD2A6;
  --ob-info: #1C4DA3; --ob-info-soft: #EAF0FB; --ob-info-line: #C5D4F0;
  --ob-success: #16623D; --ob-success-soft: #E6F3EA; --ob-success-line: #BCDEC8;
  --ob-focus: #805C1B; --ob-focus-halo: rgba(128, 92, 27, 0.18);
  --ob-shadow-1: 0 1px 0 rgba(18, 26, 44, 0.03), 0 1px 2px rgba(18, 26, 44, 0.05);
  --ob-shadow-2: 0 18px 40px -18px rgba(18, 26, 44, 0.28), 0 2px 6px rgba(18, 26, 44, 0.07);
  --ob-btn-sheen: inset 0 1px 0 rgba(255, 255, 255, 0.12), 0 1px 2px rgba(18, 26, 44, 0.25);
  --ob-glow: radial-gradient(900px 380px at 14% -10%, rgba(194, 164, 105, 0.16), transparent 62%);
  --ob-scrim: rgba(18, 26, 44, 0.40);

  --st-draft-fg: #474D5C;   --st-draft-bg: #ECE7DC;   --st-draft-line: #DAD3C4;
  --st-open-fg: #1C4DA3;    --st-open-bg: #E6EDFA;    --st-open-line: #C8D6F1;
  --st-partial-fg: #0D5E64; --st-partial-bg: #DDEFEE; --st-partial-line: #B7DCDA;
  --st-paid-fg: #16623D;    --st-paid-bg: #DFF0E4;    --st-paid-line: #BCDEC8;
  --st-overdue-fg: #A1262A; --st-overdue-bg: #FBE3E0; --st-overdue-line: #F0C3BE;
  --st-void-fg: #5A5F6C;    --st-void-bg: #EEEAE2;    --st-void-line: #DBD6CB;
  --st-dun-fg: #87470A;     --st-dun-bg: #FBEBD3;     --st-dun-line: #EDD2A6;
  --st-accent-fg: #6E4F17;  --st-accent-bg: #F4ECDA;  --st-accent-line: #E2D2AF;
}

/* Dunkel – Leitmodus (nur am Bildschirm) */
@media screen {
  [data-bs-theme="dark"] {
    color-scheme: dark;
    --ob-bg: #0A0E15; --ob-sidebar: #0D121B; --ob-surface: #121825; --ob-surface-2: #171E2D; --ob-surface-3: #1D2536;
    --ob-field: #0E131D; --ob-chrome: #06090E; --ob-nav-hover: #141A27; --ob-nav-active: #171E2D;
    --ob-line: #1F2737; --ob-line-2: #2A3345; --ob-line-strong: #646F85;
    --ob-text: #EDE9E0; --ob-text-2: #A9AEBB; --ob-text-3: #8D93A3;
    --ob-accent: #D6BC82; --ob-accent-deco: #9C8455; --ob-accent-soft: rgba(214, 188, 130, 0.10);
    --ob-primary-bg: #D2B77C; --ob-primary-hover: #DFC690; --ob-primary-fg: #15120B;
    --ob-danger: #F29A96; --ob-danger-bg: #E5736E; --ob-danger-hover: #EC8783; --ob-danger-fg: #1A0B0B; --ob-danger-soft: #2A1416; --ob-danger-line: #5A2A2C;
    --ob-warn: #F5BC77; --ob-warn-soft: #231B10; --ob-warn-line: #4A3818;
    --ob-info: #9EC2FF; --ob-info-soft: #111C30; --ob-info-line: #24375A;
    --ob-success: #8ADBB1; --ob-success-soft: #0F291E; --ob-success-line: #1C4434;
    --ob-focus: #F0D9A4; --ob-focus-halo: rgba(240, 217, 164, 0.22);
    --ob-shadow-1: inset 0 1px 0 rgba(255, 255, 255, 0.035), 0 1px 2px rgba(0, 0, 0, 0.45);
    --ob-shadow-2: inset 0 1px 0 rgba(255, 255, 255, 0.05), 0 18px 44px -18px rgba(0, 0, 0, 0.8), 0 2px 6px rgba(0, 0, 0, 0.4);
    --ob-btn-sheen: inset 0 1px 0 rgba(255, 255, 255, 0.28), 0 1px 2px rgba(0, 0, 0, 0.4);
    --ob-glow: radial-gradient(900px 380px at 14% -10%, rgba(214, 188, 130, 0.075), transparent 62%);
    --ob-scrim: rgba(4, 6, 10, 0.64);

    --st-draft-fg: #BAC0CC;   --st-draft-bg: #1C2331;   --st-draft-line: #2C3446;
    --st-open-fg: #9EC2FF;    --st-open-bg: #14223B;    --st-open-line: #233A62;
    --st-partial-fg: #7FD6DA; --st-partial-bg: #0F282C; --st-partial-line: #1C4448;
    --st-paid-fg: #8ADBB1;    --st-paid-bg: #0F291E;    --st-paid-line: #1C4434;
    --st-overdue-fg: #FFA3A0; --st-overdue-bg: #33171A; --st-overdue-line: #56282B;
    --st-void-fg: #9EA4B1;    --st-void-bg: #181E2A;    --st-void-line: #283041;
    --st-dun-fg: #F5BC77;     --st-dun-bg: #2F2210;     --st-dun-line: #4F3A18;
    --st-accent-fg: #D6BC82;  --st-accent-bg: #231E14;  --st-accent-line: #4A3E25;
  }
}

/* 3. Bootstrap-Theming (Variablen statt Einzel-Überschreibungen) ---------------------------------- */
[data-bs-theme="dark"], [data-bs-theme="light"] {
  --bs-body-font-family: var(--ob-font-ui);
  --bs-body-font-size: var(--ob-fs-base);
  --bs-body-line-height: 1.55;
  --bs-body-color: var(--ob-text);
  --bs-body-bg: var(--ob-bg);
  --bs-emphasis-color: var(--ob-text);
  --bs-heading-color: var(--ob-text);
  --bs-secondary-color: var(--ob-text-2);
  --bs-tertiary-color: var(--ob-text-3);
  --bs-secondary-bg: var(--ob-surface-2);
  --bs-tertiary-bg: var(--ob-surface-3);
  --bs-border-color: var(--ob-line-2);
  --bs-border-color-translucent: var(--ob-line);
  --bs-border-radius: var(--ob-r-md);
  --bs-border-radius-sm: var(--ob-r-sm);
  --bs-border-radius-lg: var(--ob-r-lg);
  --bs-border-radius-xl: var(--ob-r-xl);
  --bs-link-color: var(--ob-accent);
  --bs-link-hover-color: var(--ob-accent);
  --bs-code-color: var(--ob-accent);
  --bs-focus-ring-color: var(--ob-focus-halo);
  --bs-form-invalid-color: var(--ob-danger);
  --bs-form-invalid-border-color: var(--ob-danger);
  --bs-form-valid-color: var(--ob-success);
  --bs-form-valid-border-color: var(--ob-success);
  --bs-highlight-bg: var(--ob-accent-soft);
  --bs-highlight-color: var(--ob-text);

  --bs-primary-text-emphasis: var(--ob-accent);
  --bs-primary-bg-subtle: var(--ob-accent-soft);
  --bs-primary-border-subtle: var(--ob-accent-deco);
  --bs-secondary-text-emphasis: var(--ob-text-2);
  --bs-secondary-bg-subtle: var(--ob-surface-2);
  --bs-secondary-border-subtle: var(--ob-line-2);
  --bs-success-text-emphasis: var(--ob-success);
  --bs-success-bg-subtle: var(--ob-success-soft);
  --bs-success-border-subtle: var(--ob-success-line);
  --bs-info-text-emphasis: var(--ob-info);
  --bs-info-bg-subtle: var(--ob-info-soft);
  --bs-info-border-subtle: var(--ob-info-line);
  --bs-warning-text-emphasis: var(--ob-warn);
  --bs-warning-bg-subtle: var(--ob-warn-soft);
  --bs-warning-border-subtle: var(--ob-warn-line);
  --bs-danger-text-emphasis: var(--ob-danger);
  --bs-danger-bg-subtle: var(--ob-danger-soft);
  --bs-danger-border-subtle: var(--ob-danger-line);
  --bs-light-text-emphasis: var(--ob-text-2);
  --bs-light-bg-subtle: var(--ob-surface-2);
  --bs-light-border-subtle: var(--ob-line);
  --bs-dark-text-emphasis: var(--ob-text);
  --bs-dark-bg-subtle: var(--ob-surface-3);
  --bs-dark-border-subtle: var(--ob-line-2);
}
[data-bs-theme] {
  --bs-body-color-rgb: 18, 26, 44;
  --bs-body-bg-rgb: 246, 242, 233;
  --bs-secondary-color-rgb: 75, 82, 99;
  --bs-link-color-rgb: 128, 92, 27;
  --bs-link-hover-color-rgb: 104, 74, 20;
  --bs-primary-rgb: 128, 92, 27;
  --bs-success-rgb: 22, 98, 61;
  --bs-danger-rgb: 163, 48, 44;
  --bs-warning-rgb: 135, 71, 10;
  --bs-info-rgb: 28, 77, 163;
  --bs-secondary-rgb: 75, 82, 99;
}
@media screen {
  [data-bs-theme="dark"] {
    --bs-body-color-rgb: 237, 233, 224;
    --bs-body-bg-rgb: 10, 14, 21;
    --bs-secondary-color-rgb: 169, 174, 187;
    --bs-link-color-rgb: 214, 188, 130;
    --bs-link-hover-color-rgb: 223, 198, 144;
    --bs-primary-rgb: 214, 188, 130;
    --bs-success-rgb: 138, 219, 177;
    --bs-danger-rgb: 242, 154, 150;
    --bs-warning-rgb: 245, 188, 119;
    --bs-info-rgb: 158, 194, 255;
    --bs-secondary-rgb: 169, 174, 187;
  }
}

/* 4. Grundlagen ------------------------------------------------------------------------------------- */
body {
  background-color: var(--ob-bg);
  background-image: var(--ob-glow);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "ss01" 0;
}
h1, .h1, h2, .h2, .h3 {
  font-family: var(--ob-font-display);
  font-weight: 400;
  letter-spacing: -0.015em;
}
h1, .h1 { font-size: clamp(1.6rem, 1.2rem + 1.2vw, 2.125rem); line-height: 1.12; }
.h3, h1.h3 { font-size: clamp(1.45rem, 1.15rem + 0.9vw, 1.875rem); line-height: 1.15; }
h2, .h2 { font-size: 1.5rem; }
h3, .h4, h4 { font-family: var(--ob-font-ui); font-weight: 600; letter-spacing: -0.005em; }
.h5, h5, .h6, h6 { font-family: var(--ob-font-ui); font-weight: 600; letter-spacing: 0; }
.h5, h5 { font-size: 1rem; }
a { text-underline-offset: 3px; text-decoration-thickness: 1px; }
.table a, .kf-row-title, .kf-panel-link, .card-header a, .list-group-item-action, .kf-brand, .dropdown-item { text-decoration: none; }
.table a:hover, .kf-row-title:hover, .kf-panel-link:hover, .card-header a:hover { text-decoration: underline; }
.table a { font-weight: 600; }
.kf-mono, .table a.kf-mono { font-weight: 500; }
a:not(.btn):not(.nav-link):not(.dropdown-item):not(.page-link):not(.list-group-item):hover { text-decoration-thickness: 2px; }
code, kbd, pre, samp, .font-monospace { font-family: var(--ob-font-mono); }
.text-body-secondary { color: var(--ob-text-2) !important; }
.text-muted { color: var(--ob-text-3) !important; }
.small, small { font-size: var(--ob-fs-sm); }
hr { border-color: var(--ob-line-2); opacity: 1; }
.tnum, .table, .kf-amount { font-variant-numeric: tabular-nums; }
.kf-mono { font-family: var(--ob-font-mono); font-size: 0.92em; letter-spacing: -0.01em; }
.kf-eyebrow {
  font-size: var(--ob-fs-xs);
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ob-text-3);
}
::selection { background: var(--ob-accent-soft); color: var(--ob-text); }
/* Fokus und Sprungziele nicht unter der Kopfleiste bzw. der Schnellleiste (WCAG 2.4.11) */
html { scroll-padding-top: calc(var(--ob-topbar-height) + var(--ob-s3)); }
@media (max-width: 991.98px) {
  html { scroll-padding-bottom: calc(var(--ob-tabbar-height) + env(safe-area-inset-bottom) + var(--ob-s3)); }
}

/* 5. Anwendungsrahmen ------------------------------------------------------------------------------- */
.kf-shell { min-height: 100vh; }
@media (min-width: 1200px) {
  .kf-shell {
    display: grid; grid-template-columns: var(--ob-sidebar-width) minmax(0, 1fr);
    /* Fläche der Seitenleiste über die ganze Seitenhöhe (die Leiste selbst bleibt beim Scrollen stehen) */
    background: linear-gradient(to right, var(--ob-sidebar) calc(var(--ob-sidebar-width) - 1px), var(--ob-line) calc(var(--ob-sidebar-width) - 1px), var(--ob-line) var(--ob-sidebar-width), transparent var(--ob-sidebar-width));
  }
  .kf-sidebar { background: transparent; border-right: 0; }
}
.kf-sidebar {
  background: var(--ob-sidebar);
  border-right: 1px solid var(--ob-line);
}
@media (min-width: 1200px) {
  .kf-sidebar { position: sticky; top: 0; height: 100vh; }
}
.kf-sidebar .offcanvas-xl { --bs-offcanvas-bg: var(--ob-sidebar); --bs-offcanvas-width: 18rem; height: 100%; }
.kf-sidebar-inner { display: flex; flex-direction: column; height: 100%; width: 100%; overflow-y: auto; padding: var(--ob-s5) var(--ob-s4); gap: var(--ob-s4); }
.kf-brand { display: flex; align-items: center; gap: var(--ob-s3); color: var(--ob-text); text-decoration: none; padding: var(--ob-s1) var(--ob-s2); }
.kf-brand:hover { color: var(--ob-text); }
.kf-brand-mark { width: 30px; height: 30px; color: var(--ob-accent); flex: none; }
.kf-brand-logo { height: 32px; width: auto; flex: none; }
.kf-brand-logo-dark { display: none; }
@media screen {
  [data-bs-theme="dark"] .kf-brand-logo-light { display: none; }
  [data-bs-theme="dark"] .kf-brand-logo-dark { display: inline; }
}
.kf-brand-name { font-family: var(--ob-font-display); font-size: 1.25rem; line-height: 1; letter-spacing: -0.01em; }
.kf-brand-sub { display: block; font-family: var(--ob-font-ui); font-size: 0.625rem; letter-spacing: 0.32em; text-transform: uppercase; color: var(--ob-text-3); margin-top: 4px; }

.kf-company {
  display: flex; align-items: center; gap: var(--ob-s3); width: 100%;
  padding: var(--ob-s2) var(--ob-s3); border-radius: var(--ob-r-lg);
  background: var(--ob-surface); border: 1px solid var(--ob-line-2); color: var(--ob-text); text-align: left;
  box-shadow: var(--ob-shadow-1);
}
.kf-company:hover { border-color: var(--ob-line-strong); }
.kf-company-flag {
  display: grid; place-items: center; width: 30px; height: 30px; flex: none;
  border-radius: var(--ob-r-md); border: 1px solid var(--ob-accent-deco); color: var(--ob-accent);
  font-family: var(--ob-font-mono); font-size: 0.6875rem; font-weight: 500;
}
.kf-company-name { display: block; font-weight: 600; font-size: var(--ob-fs-sm); line-height: 1.25; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kf-company-meta { display: block; font-size: var(--ob-fs-xs); color: var(--ob-text-3); }
.kf-company-text { min-width: 0; flex: 1; }

.kf-nav { display: flex; flex-direction: column; gap: 2px; margin: 0; padding: 0; list-style: none; }
.kf-nav-group { margin-top: var(--ob-s3); }
.kf-nav-title { padding: var(--ob-s2) var(--ob-s3) var(--ob-s1); font-size: 0.65625rem; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ob-text-3); }
.kf-nav-link {
  position: relative; display: flex; align-items: center; gap: var(--ob-s3);
  min-height: 36px; padding: var(--ob-s2) var(--ob-s3); border-radius: var(--ob-r-md);
  color: var(--ob-text-2); text-decoration: none; font-weight: 500;
  transition: background-color var(--ob-dur-1) var(--ob-ease), color var(--ob-dur-1) var(--ob-ease);
}
.kf-nav-link:hover { background: var(--ob-nav-hover); color: var(--ob-text); }
.kf-nav-link.active { background: var(--ob-nav-active); color: var(--ob-text); font-weight: 600; box-shadow: var(--ob-shadow-1); }
.kf-nav-link.active::before {
  content: ""; position: absolute; left: calc(-1 * var(--ob-s4)); top: 8px; bottom: 8px; width: 3px;
  border-radius: 0 3px 3px 0; background: var(--ob-accent);
}
.kf-nav-link .kf-icon { color: var(--ob-text-3); }
.kf-nav-link.active .kf-icon, .kf-nav-link:hover .kf-icon { color: var(--ob-accent); }
.kf-nav-more { border-top: 1px solid var(--ob-line); padding-top: var(--ob-s3); margin-top: var(--ob-s3); }
.kf-nav-more > summary { list-style: none; cursor: pointer; }
.kf-nav-more > summary::-webkit-details-marker { display: none; }
.kf-nav-more > summary .kf-chevron { margin-left: auto; transition: transform var(--ob-dur-2) var(--ob-ease); }
.kf-nav-more[open] > summary .kf-chevron { transform: rotate(180deg); }
.kf-nav-sub .kf-nav-link { min-height: 32px; padding-left: calc(var(--ob-s3) + 28px); font-size: var(--ob-fs-sm); }
.kf-nav-sub .kf-nav-title { padding-left: calc(var(--ob-s3) + 28px); }
.kf-sidebar-foot { margin-top: auto; padding-top: var(--ob-s3); border-top: 1px solid var(--ob-line); }
.kf-user {
  display: flex; align-items: center; gap: var(--ob-s3); width: 100%; padding: var(--ob-s2);
  border: 0; border-radius: var(--ob-r-md); background: transparent; color: var(--ob-text); text-align: left;
}
.kf-user:hover { background: var(--ob-nav-hover); }
.kf-avatar {
  display: grid; place-items: center; width: 32px; height: 32px; flex: none; border-radius: 50%;
  background: var(--ob-accent-soft); color: var(--ob-accent); font-weight: 600; font-size: var(--ob-fs-sm);
  border: 1px solid var(--ob-accent-deco);
}
.kf-user-name { display: block; font-weight: 600; font-size: var(--ob-fs-sm); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kf-user-mail { display: block; font-size: var(--ob-fs-xs); color: var(--ob-text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.kf-main { min-width: 0; display: flex; flex-direction: column; min-height: 100vh; }
.kf-topbar {
  position: sticky; top: 0; z-index: 1020;
  display: flex; align-items: center; gap: var(--ob-s3);
  min-height: var(--ob-topbar-height); padding: var(--ob-s2) var(--ob-s8);
  background: color-mix(in srgb, var(--ob-bg) 86%, transparent);
  border-bottom: 1px solid var(--ob-line);
  backdrop-filter: saturate(140%) blur(10px);
}
@media (max-width: 991.98px) { .kf-topbar { padding: var(--ob-s2) var(--ob-s4); } }
.kf-crumbs { display: flex; align-items: center; gap: var(--ob-s2); min-width: 0; color: var(--ob-text-2); font-size: var(--ob-fs-sm); }
.kf-crumbs strong { color: var(--ob-text); font-weight: 600; }
.kf-crumbs .kf-crumb-company,
.kf-crumbs strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kf-topbar-actions { margin-left: auto; display: flex; align-items: center; gap: var(--ob-s2); flex-shrink: 0; }
.kf-env {
  display: inline-flex; align-items: center; height: 24px; padding: 0 var(--ob-s3); border-radius: var(--ob-r-pill);
  border: 1px solid var(--ob-accent-deco); color: var(--ob-accent); white-space: nowrap;
  font-size: 0.65625rem; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase;
}
/* Smartphone: Firma steht im Menü, die Kopfleiste zeigt nur den Bereich */
@media (max-width: 575.98px) {
  .kf-crumbs .kf-crumb-company, .kf-crumbs .kf-crumb-sep { display: none; }
  .kf-topbar-actions .kf-env { padding: 0 var(--ob-s2); letter-spacing: 0.06em; }
}
.kf-icon-btn {
  display: inline-grid; place-items: center; width: 36px; height: 36px; padding: 0;
  border-radius: var(--ob-r-md); border: 1px solid var(--ob-line-2); background: var(--ob-surface);
  color: var(--ob-text-2);
}
.kf-icon-btn:hover { color: var(--ob-text); border-color: var(--ob-line-strong); }
.kf-theme { display: inline-flex; padding: 2px; gap: 2px; border-radius: var(--ob-r-md); border: 1px solid var(--ob-line-2); background: var(--ob-surface); }
.kf-theme button {
  display: inline-grid; place-items: center; width: 30px; height: 28px; padding: 0; border: 0;
  border-radius: var(--ob-r-sm); background: transparent; color: var(--ob-text-3);
}
.kf-theme button:hover { color: var(--ob-text); }
.kf-theme button[aria-pressed="true"] { background: var(--ob-accent-soft); color: var(--ob-accent); box-shadow: inset 0 0 0 1px var(--ob-accent); }
.kf-content { width: 100%; max-width: var(--ob-content-max); margin: 0 auto; padding: var(--ob-s8) var(--ob-s8) var(--ob-s12); flex: 1; }
@media (max-width: 991.98px) { .kf-content { padding: var(--ob-s5) var(--ob-s4) var(--ob-s10); } }
.kf-footer { padding: var(--ob-s4) var(--ob-s8); border-top: 1px solid var(--ob-line); color: var(--ob-text-3); font-size: var(--ob-fs-sm); }

/* Smartphone: Tab-Leiste unten */
.kf-tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 1030;
  display: grid; grid-auto-flow: column; grid-auto-columns: 1fr;
  padding: var(--ob-s1) var(--ob-s2) calc(var(--ob-s1) + env(safe-area-inset-bottom));
  background: color-mix(in srgb, var(--ob-sidebar) 92%, transparent);
  border-top: 1px solid var(--ob-line-2);
  backdrop-filter: saturate(140%) blur(10px);
}
.kf-tabbar a, .kf-tabbar button {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  min-height: 52px; padding: var(--ob-s1); border: 0; background: transparent; border-radius: var(--ob-r-md);
  color: var(--ob-text-2); font-size: 0.6875rem; font-weight: 600; text-decoration: none;
}
.kf-tabbar .kf-icon { width: 20px; height: 20px; }
.kf-tabbar a, .kf-tabbar button { position: relative; }
.kf-tabbar a.active { color: var(--ob-accent); font-weight: 700; }
.kf-tabbar a.active:not(.kf-tabbar-new)::before {
  content: ""; position: absolute; top: 0; left: 28%; right: 28%; height: 3px;
  border-radius: 0 0 3px 3px; background: var(--ob-accent);
}
.kf-tabbar .kf-tabbar-new .kf-icon {
  width: 36px; height: 36px; padding: 8px; border-radius: 50%;
  background: var(--ob-primary-bg); color: var(--ob-primary-fg); box-shadow: var(--ob-btn-sheen);
}
@media (max-width: 991.98px) {
  .kf-shell:has(+ .kf-tabbar) .kf-main { padding-bottom: var(--ob-tabbar-height); }
}

/* Anmeldung und Konto ohne Sitzung */
.kf-auth { min-height: 100vh; display: grid; }
@media (min-width: 992px) { .kf-auth { grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); } }
.kf-auth-brand {
  position: relative; overflow: hidden; display: none; flex-direction: column; justify-content: space-between;
  padding: var(--ob-s12); color: var(--ob-text);
  background: var(--ob-bg) radial-gradient(900px 520px at 18% 0%, rgba(214, 188, 130, 0.16), transparent 60%);
  border-right: 1px solid var(--ob-line);
}
@media (min-width: 992px) { .kf-auth-brand { display: flex; } }
.kf-auth-brand .kf-brand, .kf-auth-brand .kf-brand:hover { color: var(--ob-text); }
.kf-auth-brand .kf-brand-mark { color: var(--ob-accent); }
.kf-auth-brand .kf-brand-sub { color: var(--ob-text-3); }
.kf-auth-claim { font-family: var(--ob-font-display); font-weight: 300; font-size: clamp(2.25rem, 1.5rem + 2vw, 3.5rem); line-height: 1.04; letter-spacing: -0.03em; max-width: 14ch; }
.kf-auth-claim em { font-style: normal; color: var(--ob-accent); }
.kf-auth-points { list-style: none; margin: var(--ob-s8) 0 0; padding: 0; display: grid; gap: var(--ob-s3); color: var(--ob-text-2); max-width: 40ch; }
.kf-auth-points li { display: flex; gap: var(--ob-s3); align-items: flex-start; }
.kf-auth-points .kf-icon { color: var(--ob-accent); margin-top: 3px; }
.kf-auth-foot { color: var(--ob-text-3); font-size: var(--ob-fs-sm); }
.kf-auth-lines { position: absolute; inset: auto -10% -30% auto; width: 70%; opacity: 0.18; color: var(--ob-accent); pointer-events: none; }
.kf-auth-panel { display: flex; flex-direction: column; justify-content: center; align-items: center; padding: var(--ob-s10) var(--ob-s4); }
.kf-auth-card { width: 100%; max-width: 26rem; }
.kf-auth-mobile-brand { margin-bottom: var(--ob-s8); }
@media (min-width: 992px) { .kf-auth-mobile-brand { display: none; } }
.kf-auth-panel .row { --bs-gutter-x: 0; }
.kf-auth-panel .row > [class*="col"] { width: 100%; max-width: 26rem; flex: 0 0 auto; }
.kf-auth-tools { position: absolute; top: var(--ob-s4); right: var(--ob-s4); }
.kf-auth-panel { position: relative; }
.kf-divider { display: flex; align-items: center; gap: var(--ob-s3); color: var(--ob-text-3); font-size: var(--ob-fs-sm); margin: var(--ob-s5) 0; }
.kf-divider::before, .kf-divider::after { content: ""; flex: 1; height: 1px; background: var(--ob-line-2); }

/* 6. Bausteine -------------------------------------------------------------------------------------- */
.kf-icon { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; vertical-align: -0.15em; }
.kf-icon-lg { width: 20px; height: 20px; }

/* Schaltflächen */
.btn {
  --bs-btn-font-weight: 600;
  --bs-btn-font-size: 0.84375rem;
  --bs-btn-padding-x: 0.875rem;
  --bs-btn-padding-y: 0.5rem;
  --bs-btn-border-radius: var(--ob-r-md);
  --bs-btn-focus-box-shadow: 0 0 0 0.2rem var(--ob-focus-halo);
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  letter-spacing: 0.005em;
  transition: background-color var(--ob-dur-1) var(--ob-ease), border-color var(--ob-dur-1) var(--ob-ease), color var(--ob-dur-1) var(--ob-ease), box-shadow var(--ob-dur-1) var(--ob-ease);
}
.btn.w-100 { display: flex; }
.btn-sm { --bs-btn-padding-x: 0.625rem; --bs-btn-padding-y: 0.3125rem; --bs-btn-font-size: 0.78125rem; --bs-btn-border-radius: var(--ob-r-sm); gap: 0.375rem; }
.btn-lg { --bs-btn-padding-y: 0.75rem; --bs-btn-padding-x: 1.25rem; --bs-btn-font-size: 0.90625rem; }
.btn-primary {
  --bs-btn-color: var(--ob-primary-fg); --bs-btn-bg: var(--ob-primary-bg); --bs-btn-border-color: var(--ob-primary-bg);
  --bs-btn-hover-color: var(--ob-primary-fg); --bs-btn-hover-bg: var(--ob-primary-hover); --bs-btn-hover-border-color: var(--ob-primary-hover);
  --bs-btn-active-color: var(--ob-primary-fg); --bs-btn-active-bg: var(--ob-primary-hover); --bs-btn-active-border-color: var(--ob-primary-hover);
  --bs-btn-disabled-color: var(--ob-primary-fg); --bs-btn-disabled-bg: var(--ob-primary-bg); --bs-btn-disabled-border-color: var(--ob-primary-bg);
  box-shadow: var(--ob-btn-sheen);
}
.btn-secondary, .btn-outline-secondary, .btn-light, .btn-outline-dark, .btn-outline-light {
  --bs-btn-color: var(--ob-text); --bs-btn-bg: var(--ob-surface); --bs-btn-border-color: var(--ob-line-2);
  --bs-btn-hover-color: var(--ob-text); --bs-btn-hover-bg: var(--ob-surface-2); --bs-btn-hover-border-color: var(--ob-line-strong);
  --bs-btn-active-color: var(--ob-text); --bs-btn-active-bg: var(--ob-surface-3); --bs-btn-active-border-color: var(--ob-line-strong);
  --bs-btn-disabled-color: var(--ob-text-3); --bs-btn-disabled-bg: var(--ob-surface); --bs-btn-disabled-border-color: var(--ob-line);
  box-shadow: var(--ob-shadow-1);
}
.btn-outline-primary {
  --bs-btn-color: var(--ob-accent); --bs-btn-bg: transparent; --bs-btn-border-color: var(--ob-accent-deco);
  --bs-btn-hover-color: var(--ob-text); --bs-btn-hover-bg: var(--ob-accent-soft); --bs-btn-hover-border-color: var(--ob-accent);
  --bs-btn-active-color: var(--ob-text); --bs-btn-active-bg: var(--ob-accent-soft); --bs-btn-active-border-color: var(--ob-accent);
  --bs-btn-disabled-color: var(--ob-text-3); --bs-btn-disabled-border-color: var(--ob-line-2);
}
.btn-danger {
  --bs-btn-color: var(--ob-danger-fg); --bs-btn-bg: var(--ob-danger-bg); --bs-btn-border-color: var(--ob-danger-bg);
  --bs-btn-hover-color: var(--ob-danger-fg); --bs-btn-hover-bg: var(--ob-danger-hover); --bs-btn-hover-border-color: var(--ob-danger-hover);
  --bs-btn-active-color: var(--ob-danger-fg); --bs-btn-active-bg: var(--ob-danger-hover); --bs-btn-active-border-color: var(--ob-danger-hover);
}
.btn-outline-danger {
  --bs-btn-color: var(--ob-danger); --bs-btn-bg: transparent; --bs-btn-border-color: var(--ob-danger-line);
  --bs-btn-hover-color: var(--ob-danger); --bs-btn-hover-bg: var(--ob-danger-soft); --bs-btn-hover-border-color: var(--ob-danger);
  --bs-btn-active-color: var(--ob-danger); --bs-btn-active-bg: var(--ob-danger-soft); --bs-btn-active-border-color: var(--ob-danger);
}
.btn-warning, .btn-outline-warning {
  --bs-btn-color: var(--ob-warn); --bs-btn-bg: var(--ob-warn-soft); --bs-btn-border-color: var(--ob-warn-line);
  --bs-btn-hover-color: var(--ob-warn); --bs-btn-hover-bg: var(--ob-warn-soft); --bs-btn-hover-border-color: var(--ob-warn);
  --bs-btn-active-color: var(--ob-warn); --bs-btn-active-bg: var(--ob-warn-soft); --bs-btn-active-border-color: var(--ob-warn);
}
.btn-success, .btn-outline-success {
  --bs-btn-color: var(--ob-success); --bs-btn-bg: var(--ob-success-soft); --bs-btn-border-color: var(--ob-success-line);
  --bs-btn-hover-color: var(--ob-success); --bs-btn-hover-bg: var(--ob-success-soft); --bs-btn-hover-border-color: var(--ob-success);
  --bs-btn-active-color: var(--ob-success); --bs-btn-active-bg: var(--ob-success-soft); --bs-btn-active-border-color: var(--ob-success);
}
.btn-info, .btn-outline-info {
  --bs-btn-color: var(--ob-info); --bs-btn-bg: var(--ob-info-soft); --bs-btn-border-color: var(--ob-info-line);
  --bs-btn-hover-color: var(--ob-info); --bs-btn-hover-bg: var(--ob-info-soft); --bs-btn-hover-border-color: var(--ob-info);
}
.btn-link {
  --bs-btn-color: var(--ob-accent); --bs-btn-hover-color: var(--ob-accent); --bs-btn-active-color: var(--ob-accent);
  --bs-btn-disabled-color: var(--ob-text-3); text-decoration: none;
}
.btn-link:hover { text-decoration: underline; }

/* Status-Badges: getönte Fläche, Rand und Text (Information nie nur über Farbe) */
.badge {
  --bs-badge-font-size: 0.75rem;
  --bs-badge-font-weight: 600;
  --bs-badge-padding-x: 0.5rem;
  --bs-badge-padding-y: 0.3rem;
  --bs-badge-border-radius: var(--ob-r-sm);
  --kf-b-fg: var(--st-draft-fg); --kf-b-bg: var(--st-draft-bg); --kf-b-line: var(--st-draft-line);
  display: inline-flex; align-items: center; gap: 0.3rem; line-height: 1; letter-spacing: 0.01em;
  color: var(--kf-b-fg) !important; background-color: var(--kf-b-bg) !important; border: 1px solid var(--kf-b-line) !important;
  vertical-align: 0.05em;
}
.badge.text-bg-light, .kf-st-draft { --kf-b-fg: var(--st-draft-fg); --kf-b-bg: var(--st-draft-bg); --kf-b-line: var(--st-draft-line); }
.badge.text-bg-info, .kf-st-open { --kf-b-fg: var(--st-open-fg); --kf-b-bg: var(--st-open-bg); --kf-b-line: var(--st-open-line); }
.kf-st-partial { --kf-b-fg: var(--st-partial-fg); --kf-b-bg: var(--st-partial-bg); --kf-b-line: var(--st-partial-line); }
.badge.text-bg-success, .kf-st-paid { --kf-b-fg: var(--st-paid-fg); --kf-b-bg: var(--st-paid-bg); --kf-b-line: var(--st-paid-line); }
.badge.text-bg-danger, .kf-st-overdue { --kf-b-fg: var(--st-overdue-fg); --kf-b-bg: var(--st-overdue-bg); --kf-b-line: var(--st-overdue-line); }
.badge.text-bg-secondary, .badge.text-bg-dark, .kf-st-void { --kf-b-fg: var(--st-void-fg); --kf-b-bg: var(--st-void-bg); --kf-b-line: var(--st-void-line); }
.badge.text-bg-warning, .kf-st-dun { --kf-b-fg: var(--st-dun-fg); --kf-b-bg: var(--st-dun-bg); --kf-b-line: var(--st-dun-line); }
.badge.text-bg-primary, .kf-st-accent { --kf-b-fg: var(--st-accent-fg); --kf-b-bg: var(--st-accent-bg); --kf-b-line: var(--st-accent-line); }
.badge::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex: none; opacity: 0.9;
}
.badge.rounded-pill { --bs-badge-border-radius: var(--ob-r-pill); }

/* Karten */
.card {
  --bs-card-bg: var(--ob-surface);
  --bs-card-border-color: var(--ob-line);
  --bs-card-border-radius: var(--ob-r-lg);
  --bs-card-inner-border-radius: calc(var(--ob-r-lg) - 1px);
  --bs-card-cap-bg: transparent;
  --bs-card-cap-padding-y: 0.875rem;
  --bs-card-cap-padding-x: 1.25rem;
  --bs-card-spacer-x: 1.25rem;
  --bs-card-spacer-y: 1.125rem;
  --bs-card-color: var(--ob-text);
  box-shadow: var(--ob-shadow-1);
}
.card-header { border-bottom-color: var(--ob-line); font-weight: 600; display: flex; align-items: center; gap: var(--ob-s2); flex-wrap: wrap; }
.card-header > a, .card-header .ms-auto { font-weight: 600; font-size: var(--ob-fs-sm); }
.card-footer { border-top-color: var(--ob-line); }
.card.border-danger { border-color: var(--ob-danger-line) !important; }
.card.border-warning { border-color: var(--ob-warn-line) !important; }
.card.border-success { border-color: var(--ob-success-line) !important; }

/* Listen */
.list-group {
  --bs-list-group-bg: var(--ob-surface);
  --bs-list-group-color: var(--ob-text);
  --bs-list-group-border-color: var(--ob-line);
  --bs-list-group-action-hover-bg: var(--ob-surface-2);
  --bs-list-group-action-hover-color: var(--ob-text);
  --bs-list-group-action-active-bg: var(--ob-surface-3);
  --bs-list-group-active-bg: var(--ob-accent-soft);
  --bs-list-group-active-color: var(--ob-text);
  --bs-list-group-active-border-color: var(--ob-accent-deco);
  --bs-list-group-border-radius: var(--ob-r-lg);
}

/* Tabellen: in einer Fläche, Kopf in Versalien, Zahlen rechtsbündig mit tabellarischen Ziffern */
.table {
  --bs-table-color: var(--ob-text);
  --bs-table-bg: transparent;
  --bs-table-border-color: var(--ob-line);
  --bs-table-striped-bg: var(--ob-surface-2);
  --bs-table-striped-color: var(--ob-text);
  --bs-table-hover-bg: var(--ob-surface-2);
  --bs-table-hover-color: var(--ob-text);
  --bs-table-active-bg: var(--ob-accent-soft);
  margin-bottom: 0;
}
.table > :not(caption) > * > * { padding: 0.75rem 1rem; }
.table-sm > :not(caption) > * > * { padding: 0.5rem 0.875rem; }
@media (max-width: 1399.98px) { .table:not(.table-sm) > :not(caption) > * > * { padding: 0.75rem 0.625rem; } }
.table > thead > tr > th, .table > thead > tr > td {
  font-size: var(--ob-fs-xs); font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--ob-text-3); white-space: nowrap; background: var(--ob-surface-2);
}
.table > tbody > tr:last-child > * { border-bottom-width: 0; }
.table > tfoot > tr > * { font-weight: 600; background: var(--ob-surface-2); border-top: 1px solid var(--ob-line-2); }
.table-responsive, .kf-table-card {
  background: var(--ob-surface); border: 1px solid var(--ob-line); border-radius: var(--ob-r-lg);
  box-shadow: var(--ob-shadow-1); margin-bottom: var(--ob-s4);
}
.table-responsive > .table > thead > tr:first-child > *:first-child { border-top-left-radius: calc(var(--ob-r-lg) - 1px); }
.table-responsive > .table > thead > tr:first-child > *:last-child { border-top-right-radius: calc(var(--ob-r-lg) - 1px); }
.card .table-responsive, .modal .table-responsive, .table-responsive .table-responsive {
  border: 0; border-radius: 0; box-shadow: none; margin-bottom: 0; background: transparent;
}
.card > .table, .card > .card-body > .table { margin-bottom: 0; }
.table td.text-end, .table th.text-end { white-space: nowrap; }
.table .kf-col-text { min-width: 9rem; }
.table-light { --bs-table-bg: var(--ob-surface-2); --bs-table-color: var(--ob-text); --bs-table-border-color: var(--ob-line); }

/* Formulare */
.form-control, .form-select {
  --kf-field-border: var(--ob-line-strong);
  background-color: var(--ob-field); color: var(--ob-text);
  border-color: var(--kf-field-border); border-radius: var(--ob-r-md);
  min-height: 2.5rem; padding: 0.5rem 0.75rem; font-size: var(--ob-fs-base);
  transition: border-color var(--ob-dur-1) var(--ob-ease), box-shadow var(--ob-dur-1) var(--ob-ease);
}
.form-control-sm, .form-select-sm { min-height: 2rem; padding: 0.3125rem 0.625rem; font-size: var(--ob-fs-sm); }
textarea.form-control { min-height: 5rem; }
.form-control::placeholder { color: var(--ob-text-3); opacity: 1; }
.form-control:focus, .form-select:focus {
  background-color: var(--ob-field); color: var(--ob-text);
  border-color: var(--ob-focus); box-shadow: 0 0 0 3px var(--ob-focus-halo);
}
.form-control:disabled, .form-select:disabled, .form-control[readonly] { background-color: var(--ob-surface-2); color: var(--ob-text-2); }
.form-control.is-invalid, .form-select.is-invalid { border-color: var(--ob-danger); }
.form-label, .col-form-label { font-weight: 600; font-size: var(--ob-fs-sm); color: var(--ob-text); margin-bottom: 0.375rem; }
.form-text { color: var(--ob-text-3); font-size: var(--ob-fs-sm); }
.invalid-feedback { color: var(--ob-danger); font-size: var(--ob-fs-sm); }
.form-check-input { background-color: var(--ob-field); border-color: var(--ob-line-strong); }
.form-check-input:checked { background-color: var(--ob-primary-bg); border-color: var(--ob-primary-bg); }
@media screen {
  [data-bs-theme="dark"] .form-check-input:checked[type="checkbox"] {
    --bs-form-check-bg-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3e%3cpath fill='none' stroke='%2315120B' stroke-linecap='round' stroke-linejoin='round' stroke-width='3' d='m6 10 3 3 6-6'/%3e%3c/svg%3e");
  }
  [data-bs-theme="dark"] .form-check-input:checked[type="radio"] {
    --bs-form-check-bg-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='2' fill='%2315120B'/%3e%3c/svg%3e");
  }
}
.form-check-input:focus { border-color: var(--ob-focus); box-shadow: 0 0 0 3px var(--ob-focus-halo); }
.kf-select-wide { min-width: 18rem; max-width: 100%; }
.input-group-text { background: var(--ob-surface-2); border-color: var(--ob-line-strong); color: var(--ob-text-2); }
fieldset legend, .kf-fieldset-title { font-family: var(--ob-font-ui); font-weight: 600; font-size: var(--ob-fs-md); }

/* Meldungen */
.alert {
  --bs-alert-border-radius: var(--ob-r-lg);
  --bs-alert-padding-x: 1rem;
  --bs-alert-padding-y: 0.875rem;
  --bs-alert-color: var(--ob-text) !important;
  border-left-width: 3px;
}
.alert-info { --bs-alert-bg: var(--ob-info-soft); --bs-alert-border-color: var(--ob-info-line); border-left-color: var(--ob-info); }
.alert-success { --bs-alert-bg: var(--ob-success-soft); --bs-alert-border-color: var(--ob-success-line); border-left-color: var(--ob-success); }
.alert-warning { --bs-alert-bg: var(--ob-warn-soft); --bs-alert-border-color: var(--ob-warn-line); border-left-color: var(--ob-warn); }
.alert-danger { --bs-alert-bg: var(--ob-danger-soft); --bs-alert-border-color: var(--ob-danger-line); border-left-color: var(--ob-danger); }
.alert-secondary, .alert-light, .alert-dark { --bs-alert-bg: var(--ob-surface-2); --bs-alert-border-color: var(--ob-line-2); border-left-color: var(--ob-line-strong); }
.alert-primary { --bs-alert-bg: var(--ob-accent-soft); --bs-alert-border-color: var(--ob-accent-deco); border-left-color: var(--ob-accent); }
.alert .alert-link, .alert a { color: var(--ob-text); font-weight: 600; text-decoration: underline; }
.alert strong { font-weight: 600; }

/* Menüs, Dialoge, Seitenwechsel */
.dropdown-menu {
  --bs-dropdown-bg: var(--ob-surface-2);
  --bs-dropdown-border-color: var(--ob-line-2);
  --bs-dropdown-border-radius: var(--ob-r-lg);
  --bs-dropdown-link-color: var(--ob-text);
  --bs-dropdown-link-hover-color: var(--ob-text);
  --bs-dropdown-link-hover-bg: var(--ob-surface-3);
  --bs-dropdown-link-active-color: var(--ob-text);
  --bs-dropdown-link-active-bg: var(--ob-accent-soft);
  --bs-dropdown-divider-bg: var(--ob-line-2);
  --bs-dropdown-header-color: var(--ob-text-3);
  --bs-dropdown-font-size: var(--ob-fs-base);
  --bs-dropdown-item-padding-y: 0.45rem;
  --bs-dropdown-padding-x: 0.375rem;
  --bs-dropdown-item-border-radius: var(--ob-r-sm);
  box-shadow: var(--ob-shadow-2);
}
.dropdown-item { border-radius: var(--ob-r-sm); display: flex; align-items: center; gap: var(--ob-s2); }
.dropdown-item.active { font-weight: 600; box-shadow: inset 3px 0 0 var(--ob-accent); }
.dropdown-item .kf-icon { color: var(--ob-text-3); }
.dropdown-item-text { color: var(--ob-text-3); font-size: var(--ob-fs-sm); }
.modal {
  --bs-modal-bg: var(--ob-surface);
  --bs-modal-border-color: var(--ob-line-2);
  --bs-modal-border-radius: var(--ob-r-xl);
  --bs-modal-header-border-color: var(--ob-line);
  --bs-modal-footer-border-color: var(--ob-line);
  --bs-modal-box-shadow: var(--ob-shadow-2);
}
.modal-backdrop { --bs-backdrop-bg: var(--ob-scrim); --bs-backdrop-opacity: 1; }
.offcanvas-backdrop { background-color: var(--ob-scrim); }
.offcanvas-backdrop.show { opacity: 1; }
.pagination {
  --bs-pagination-bg: var(--ob-surface);
  --bs-pagination-color: var(--ob-text);
  --bs-pagination-border-color: var(--ob-line-2);
  --bs-pagination-hover-bg: var(--ob-surface-2);
  --bs-pagination-hover-color: var(--ob-text);
  --bs-pagination-hover-border-color: var(--ob-line-strong);
  --bs-pagination-active-bg: var(--ob-primary-bg);
  --bs-pagination-active-border-color: var(--ob-primary-bg);
  --bs-pagination-active-color: var(--ob-primary-fg);
  --bs-pagination-disabled-bg: var(--ob-surface);
  --bs-pagination-disabled-color: var(--ob-text-2);
  --bs-pagination-disabled-border-color: var(--ob-line);
  --bs-pagination-focus-box-shadow: 0 0 0 3px var(--ob-focus-halo);
  --bs-pagination-border-radius: var(--ob-r-md);
}
.nav-tabs { --bs-nav-tabs-border-color: var(--ob-line-2); --bs-nav-tabs-link-active-bg: var(--ob-surface); --bs-nav-tabs-link-active-color: var(--ob-text); --bs-nav-tabs-link-active-border-color: var(--ob-line-2) var(--ob-line-2) var(--ob-surface); --bs-nav-tabs-link-hover-border-color: var(--ob-line) var(--ob-line) var(--ob-line-2); }
.nav { --bs-nav-link-color: var(--ob-text-2); --bs-nav-link-hover-color: var(--ob-text); }
.nav-pills { --bs-nav-pills-link-active-bg: var(--ob-accent-soft); --bs-nav-pills-link-active-color: var(--ob-text); }
.progress { --bs-progress-bg: var(--ob-surface-3); --bs-progress-bar-bg: var(--ob-accent); }
.border, .border-top, .border-bottom, .border-start, .border-end { border-color: var(--ob-line-2) !important; }
.bg-body-tertiary, .bg-light { background-color: var(--ob-surface-2) !important; }
.bg-body { background-color: var(--ob-surface) !important; }
.bg-white { background-color: #FFFFFF !important; }
.text-danger { color: var(--ob-danger) !important; }
.text-success { color: var(--ob-success) !important; }
.text-warning { color: var(--ob-warn) !important; }
.text-info { color: var(--ob-info) !important; }
.text-primary { color: var(--ob-accent) !important; }
details > summary { cursor: pointer; }
dl dt { font-weight: 600; }
.btn-close { --bs-btn-close-focus-shadow: 0 0 0 3px var(--ob-focus-halo); }
@media screen { [data-bs-theme="dark"] .btn-close { filter: invert(1) grayscale(100%) brightness(200%); } }

/* Seitenkopf und Kennzahlen */
.kf-page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: var(--ob-s4); margin-bottom: var(--ob-s6); }
.kf-page-head h1 { margin: 0; }
.kf-page-head .kf-eyebrow { display: block; margin-bottom: var(--ob-s2); }
.kf-page-sub { color: var(--ob-text-2); margin: var(--ob-s2) 0 0; }
.kf-kpis { display: grid; gap: var(--ob-s4); grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); margin-bottom: var(--ob-s6); }
.kf-kpi {
  position: relative; padding: var(--ob-s5); border-radius: var(--ob-r-lg);
  background: var(--ob-surface); border: 1px solid var(--ob-line); box-shadow: var(--ob-shadow-1);
}
.kf-kpi-label { display: flex; align-items: center; gap: var(--ob-s2); color: var(--ob-text-2); font-weight: 500; font-size: var(--ob-fs-sm); }
.kf-kpi-label .kf-icon { color: var(--ob-accent); }
.kf-kpi-value { display: flex; align-items: baseline; gap: var(--ob-s2); flex-wrap: wrap; margin-top: var(--ob-s3); font-family: var(--ob-font-display); font-weight: 400; font-size: 2rem; line-height: 1.05; letter-spacing: -0.02em; font-variant-numeric: lining-nums tabular-nums; }
.kf-kpi-value small { font-family: var(--ob-font-ui); font-size: var(--ob-fs-sm); font-weight: 600; letter-spacing: 0.06em; color: var(--ob-text-3); }
.kf-kpi-value + .kf-kpi-value { margin-top: var(--ob-s1); font-size: 1.375rem; }
.kf-kpi-meta { margin-top: var(--ob-s3); color: var(--ob-text-2); font-size: var(--ob-fs-sm); }
.kf-kpi.is-alert { border-color: var(--ob-danger-line); }
.kf-kpi.is-alert .kf-kpi-label .kf-icon, .kf-kpi.is-alert .kf-kpi-value { color: var(--ob-danger); }
.kf-kpi.is-good .kf-kpi-value { color: var(--ob-success); }

/* Listenpanels im Dashboard */
.kf-panel { background: var(--ob-surface); border: 1px solid var(--ob-line); border-radius: var(--ob-r-lg); box-shadow: var(--ob-shadow-1); height: 100%; display: flex; flex-direction: column; }
.kf-panel-head { display: flex; flex-wrap: wrap; align-items: center; gap: var(--ob-s1) var(--ob-s3); padding: var(--ob-s4) var(--ob-s5); border-bottom: 1px solid var(--ob-line); }
.kf-panel-head h2 { font-size: 1.125rem; margin: 0; }
.kf-panel-head .kf-panel-meta { color: var(--ob-text-3); font-size: var(--ob-fs-sm); }
.kf-panel-head .kf-panel-link { margin-left: auto; font-weight: 600; font-size: var(--ob-fs-sm); }
.kf-panel-body { padding: 0; flex: 1; }
.kf-rows { list-style: none; margin: 0; padding: 0; }
.kf-row { display: flex; align-items: center; gap: var(--ob-s3); padding: var(--ob-s3) var(--ob-s5); border-bottom: 1px solid var(--ob-line); }
.kf-row:last-child { border-bottom: 0; }
.kf-row-main { min-width: 0; flex: 1; }
.kf-row-title { display: block; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ob-text); }
.kf-row-sub { display: block; font-size: var(--ob-fs-sm); color: var(--ob-text-3); }
.kf-row-amount { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; white-space: nowrap; }
.kf-row-amount small { display: block; font-weight: 500; color: var(--ob-text-3); }
.kf-empty { padding: var(--ob-s8) var(--ob-s5); text-align: center; color: var(--ob-text-2); }
.kf-empty .kf-empty-icon { display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--ob-accent-deco); color: var(--ob-accent); margin-bottom: var(--ob-s3); }
.kf-empty-title { display: block; font-family: var(--ob-font-display); font-size: 1.125rem; color: var(--ob-text); margin-bottom: var(--ob-s1); }

/* Dashboard-Abschnitte */
.kf-section-title { font-size: 1.25rem; margin: var(--ob-s8) 0 var(--ob-s4); }
.kf-dl { display: grid; grid-template-columns: minmax(0, 11rem) minmax(0, 1fr); gap: var(--ob-s2) var(--ob-s4); margin: 0; }
.kf-dl dt { color: var(--ob-text-2); font-weight: 500; }
.kf-dl dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
@media (max-width: 359.98px) {
  .kf-dl { grid-template-columns: minmax(0, 1fr); row-gap: 0; }
  .kf-dl dd { margin-bottom: var(--ob-s3); }
}

/* 7. Seiten ----------------------------------------------------------------------------------------- */
.kf-company-cards .list-group-item { padding: var(--ob-s4) var(--ob-s5); }

/* 8. Barrierefreiheit ------------------------------------------------------------------------------- */
:focus-visible { outline: 2px solid var(--ob-focus); outline-offset: 2px; }
.btn:focus-visible, .form-control:focus-visible, .form-select:focus-visible, .page-link:focus-visible, .nav-link:focus-visible, .dropdown-item:focus-visible, .kf-nav-link:focus-visible, .form-check-input:focus-visible {
  outline: 2px solid var(--ob-focus); outline-offset: 2px; box-shadow: none;
}
.kf-skip {
  position: absolute; left: var(--ob-s4); top: -100px; z-index: 2000;
  padding: var(--ob-s2) var(--ob-s4); border-radius: var(--ob-r-md);
  background: var(--ob-primary-bg); color: var(--ob-primary-fg); font-weight: 600;
}
.kf-skip:focus { top: var(--ob-s3); color: var(--ob-primary-fg); }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}
@media print {
  .kf-sidebar, .kf-topbar, .kf-footer, .kf-tabbar, .kf-skip { display: none !important; }
  .kf-shell { display: block; }
  body { background: #FFFFFF; }
}

/* Phase 32: Zähler an der Benachrichtigungs-Glocke */
.kf-badge-count { position: absolute; top: -4px; right: -6px; font-size: .65rem; padding: .2em .45em; }
