/* Ausgebucht (Kurstool) Backend – global styles. Theme: Ausgebucht-CD (Sora, Blau). */

@font-face {
  font-family: 'Sora-fallback';
  src: local('Sora');
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  /* Ausgebucht-CD (Blau/Petrol; Variablennamen historisch beibehalten) */
  --tinte: #062459;
  --tinte-soft: #24395f;
  --tinte-muted: #55607a;
  /* Primär-Akzent = Petrol/Türkis (kein Terracotta mehr im Backend) */
  --terracotta: #396fc2;
  --terracotta-dunkel: #2f5aa8;
  --terracotta-warm: #85b3ea;
  --terracotta-soft: #eaf1fb;
  --salbei: #396fc2;        /* Brand-Akzent (CTA-Farbe) */
  --salbei-tief: #2f5aa8;
  --salbei-soft: #eaf1fb;
  --wollweiss: #F7FAFD;
  --wollweiss-warm: #eaf1fb;
  --wollweiss-rein: #FFFFFF;
  --senf: #D4A53D;
  --senf-tief: #B88B25;
  --senf-soft: #f1e0b4;
  --linie: #d3ddeb;
  --linie-soft: #e5eaf2;
  --linie-strong: #a9b8d0;

  /* Backend-spezifisch */
  --bg-canvas: #F7FAFD;
  --bg-card: #FFFFFF;
  --shadow-card: 0 1px 2px rgba(45,52,65,0.04), 0 8px 24px -16px rgba(45,52,65,0.12);
  --shadow-card-hover: 0 1px 2px rgba(45,52,65,0.05), 0 16px 32px -16px rgba(45,52,65,0.2);
  --shadow-overlay: 0 24px 60px -16px rgba(45,52,65,0.35);

  /* Status-Farben (Anmeldungen) — Ausgebucht-Palette, Ampel-Logik:
     neutral → in Arbeit (blau) → wartet (sand) → erledigt (grün) → Fehler (rot) */
  --st-eingang-bg: #e5eaf2;      /* neu / neutral */
  --st-eingang-fg: #55607a;
  --st-bestaetigt-bg: #eaf1fb;   /* bestätigt / in Arbeit (blau) */
  --st-bestaetigt-fg: #2f5aa8;
  --st-rechnung-bg: #fbf2df;     /* Rechnung offen (sand, wartet) */
  --st-rechnung-fg: #8a6a1e;
  --st-bezahlt-bg: #e7f4ec;      /* bezahlt / erledigt (grün) */
  --st-bezahlt-fg: #1f7a52;
  --st-durchgefuehrt-bg: #062459;/* durchgeführt (invertiert, dunkelblau) */
  --st-durchgefuehrt-fg: #dce6f6;
  --st-feedback-bg: #f4edf8;     /* Feedback (flieder) */
  --st-feedback-fg: #7a4d94;
  --st-abgeschlossen-bg: #dbe3ef;/* abgeschlossen / inaktiv */
  --st-abgeschlossen-fg: #55607a;
  --st-storniert-bg: #fdecec;    /* storniert (rot) */
  --st-storniert-fg: #b23a3a;

  /* Kurs-Status */
  --ks-aktiv-bg: #e7f4ec;        /* aktiv (grün) */
  --ks-aktiv-fg: #1f7a52;
  --ks-entwurf-bg: #fbf2df;      /* Entwurf (sand) */
  --ks-entwurf-fg: #8a6a1e;
  --ks-archiv-bg: #e5eaf2;       /* archiviert (neutral) */
  --ks-archiv-fg: #7a8090;
  --ks-vhs-bg: #f4edf8;          /* extern/vhs (flieder) */
  --ks-vhs-fg: #7a4d94;

  /* Layout */
  --sidebar-w: 252px;
  --topbar-h: 64px;
  --radius-sm: 4px;
  --radius: 8px;
  --radius-lg: 12px;
  --radius-pill: 999px;
}

html, body {
  height: 100%;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Helvetica Neue', sans-serif;
  color: var(--tinte);
  background: var(--bg-canvas);
  font-size: 14.5px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }
input, select, textarea { font: inherit; color: inherit; }

::selection { background: var(--terracotta-soft); color: var(--terracotta-dunkel); }

/* ================= APP-Layout ================= */
.app {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  min-height: 100vh;
  min-width: 1280px;
}

.main {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

/* ================= Sidebar ================= */
.sb {
  background: var(--wollweiss);
  border-right: 1px solid var(--linie-soft);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
}

.sb-brand {
  padding: 20px 22px 18px;
  border-bottom: 1px solid var(--linie-soft);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
}
.sb-brand-logo {
  width: 132px;
  max-width: 100%;
  height: auto;
  display: block;
  border-radius: 8px;
}
.sb-brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
  min-width: 0;
}
.sb-brand-name {
  font-family: 'Sora', 'Sora-fallback', sans-serif;
  font-weight: 700;
  font-size: 26px;
  color: var(--tinte);
  line-height: 0.9;
}
.sb-brand-sub {
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--tinte-muted);
  font-weight: 600;
  margin-top: 4px;
}

.sb-section {
  padding: 18px 14px 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.sb-section-title {
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--tinte-muted);
  font-weight: 700;
  padding: 4px 10px 8px;
}

.sb-link {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 12px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 500;
  color: var(--tinte-soft);
  cursor: pointer;
  transition: background 140ms ease, color 140ms ease;
  position: relative;
}
.sb-link:hover { background: var(--wollweiss-warm); color: var(--tinte); }
.sb-link.is-active {
  background: var(--terracotta);
  color: #FFFFFF;
  font-weight: 600;
}
.sb-link.is-active .sb-link-count {
  background: rgba(255,255,255,0.22);
  color: #FFFFFF;
}
.sb-link svg { flex-shrink: 0; }
.sb-link-count {
  margin-left: auto;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  background: var(--linie-soft);
  color: var(--tinte-soft);
  min-width: 22px;
  text-align: center;
}
.sb-link.has-badge::after {
  content: "";
  width: 6px;
  height: 6px;
  background: var(--senf);
  border-radius: 50%;
  margin-left: auto;
}

.sb-foot {
  margin-top: auto;
  padding: 16px 14px 18px;
  border-top: 1px solid var(--linie-soft);
}
.sb-user {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 8px 10px;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background 140ms ease;
}
.sb-user:hover { background: var(--wollweiss-warm); }
.sb-user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--salbei-soft);
  color: var(--salbei-tief);
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 13px;
  flex-shrink: 0;
  letter-spacing: -0.02em;
}
.sb-user-text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
  min-width: 0;
}
.sb-user-name {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--tinte);
}
.sb-user-role {
  font-size: 11px;
  color: var(--tinte-muted);
}

/* ================= Topbar ================= */
.tb {
  height: var(--topbar-h);
  background: var(--wollweiss-rein);
  border-bottom: 1px solid var(--linie-soft);
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 0 32px;
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(8px);
}
.tb-crumbs {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--tinte-muted);
  flex: 1;
  min-width: 0;
}
.tb-crumbs a, .tb-crumbs span { white-space: nowrap; }
.tb-crumbs a:hover { color: var(--terracotta); }
.tb-crumbs .sep { color: var(--linie-strong); }
.tb-crumbs .current { color: var(--tinte); font-weight: 600; }

.tb-search {
  position: relative;
  width: 280px;
}
.tb-search input {
  width: 100%;
  padding: 8px 12px 8px 36px;
  border: 1px solid var(--linie);
  border-radius: var(--radius-pill);
  background: var(--wollweiss);
  font-size: 13.5px;
  transition: border-color 160ms ease, background 160ms ease;
}
.tb-search input:focus {
  outline: none;
  border-color: var(--terracotta);
  background: var(--wollweiss-rein);
}
.tb-search svg {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--tinte-muted);
}

.tb-actions { display: flex; align-items: center; gap: 10px; }

.icon-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--tinte-soft);
  transition: background 140ms ease, color 140ms ease;
  position: relative;
}
.icon-btn:hover { background: var(--wollweiss-warm); color: var(--tinte); }
.icon-btn .dot {
  position: absolute;
  top: 8px; right: 8px;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--terracotta);
  border: 2px solid var(--wollweiss-rein);
}

/* ================= Page ================= */
.page {
  padding: 28px 32px 60px;
  flex: 1;
  min-width: 0;
}
.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 28px;
  flex-wrap: wrap;
}
.page-title {
  font-family: 'Sora', 'Sora-fallback', sans-serif;
  font-weight: 700;
  font-size: 56px;
  line-height: 0.92;
  color: var(--terracotta);
  letter-spacing: -0.005em;
}
.page-sub {
  font-size: 14.5px;
  color: var(--tinte-soft);
  margin-top: 6px;
  max-width: 60ch;
}
.page-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* ================= Buttons ================= */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 16px;
  border-radius: var(--radius);
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: background 140ms ease, color 140ms ease, border-color 140ms ease, transform 140ms ease;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: var(--terracotta);
  color: #FFFFFF;
}
.btn-primary:hover { background: var(--terracotta-dunkel); }
.btn-ghost {
  background: transparent;
  color: var(--tinte-soft);
  border: 1px solid var(--linie);
}
.btn-ghost:hover { background: var(--wollweiss-warm); color: var(--tinte); border-color: var(--linie-strong); }
.btn-soft {
  background: var(--wollweiss-warm);
  color: var(--tinte);
  border: 1px solid transparent;
}
.btn-soft:hover { background: var(--linie-soft); }
.btn-dark {
  background: var(--tinte);
  color: var(--wollweiss);
}
.btn-dark:hover { background: #1f2530; }
.btn-danger {
  background: transparent;
  color: var(--st-storniert-fg);
  border: 1px solid var(--st-storniert-bg);
}
.btn-danger:hover { background: var(--st-storniert-bg); }
.btn-sm { padding: 6px 12px; font-size: 12.5px; gap: 6px; }
.btn-pill { border-radius: var(--radius-pill); }

/* ================= Cards ================= */
.card {
  background: var(--bg-card);
  border: 1px solid var(--linie-soft);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
}
.card-head {
  padding: 18px 22px 14px;
  border-bottom: 1px solid var(--linie-soft);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}
.card-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--tinte);
  letter-spacing: -0.005em;
}
.card-sub { font-size: 12.5px; color: var(--tinte-muted); }
.card-body { padding: 22px; }
.card-body-tight { padding: 14px 22px; }
.card-foot {
  padding: 14px 22px;
  border-top: 1px solid var(--linie-soft);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

/* ================= KPI ================= */
.kpi {
  background: var(--bg-card);
  border: 1px solid var(--linie-soft);
  border-radius: var(--radius-lg);
  padding: 22px 24px 20px;
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  gap: 8px;
  position: relative;
  overflow: hidden;
}
.kpi-label {
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--tinte-muted);
}
.kpi-value {
  font-family: 'Sora', 'Sora-fallback', sans-serif;
  font-weight: 700;
  font-size: 52px;
  line-height: 0.95;
  color: var(--terracotta);
  letter-spacing: -0.01em;
  display: flex;
  align-items: baseline;
  gap: 8px;
}
.kpi-unit {
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  font-size: 14px;
  color: var(--tinte-muted);
  letter-spacing: 0;
}
.kpi-delta {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 600;
  color: var(--salbei-tief);
}
.kpi-delta.down { color: var(--st-storniert-fg); }
.kpi-delta-sub {
  font-size: 12px;
  color: var(--tinte-muted);
  margin-left: 4px;
  font-weight: 500;
}
.kpi-spark {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 50%;
  opacity: 0.5;
  pointer-events: none;
}

/* ================= Status-Badges ================= */
.st {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
  white-space: nowrap;
  line-height: 1.4;
}
.st::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.85;
  flex-shrink: 0;
}
.st-eingang { background: var(--st-eingang-bg); color: var(--st-eingang-fg); }
.st-bestaetigt { background: var(--st-bestaetigt-bg); color: var(--st-bestaetigt-fg); }
.st-rechnung { background: var(--st-rechnung-bg); color: var(--st-rechnung-fg); }
.st-bezahlt { background: var(--st-bezahlt-bg); color: var(--st-bezahlt-fg); }
.st-durchgefuehrt { background: var(--st-durchgefuehrt-bg); color: var(--st-durchgefuehrt-fg); }
.st-feedback { background: var(--st-feedback-bg); color: var(--st-feedback-fg); }
.st-abgeschlossen { background: var(--st-abgeschlossen-bg); color: var(--st-abgeschlossen-fg); }
.st-storniert { background: var(--st-storniert-bg); color: var(--st-storniert-fg); }

.ks-aktiv { background: var(--ks-aktiv-bg); color: var(--ks-aktiv-fg); }
.ks-entwurf { background: var(--ks-entwurf-bg); color: var(--ks-entwurf-fg); }
.ks-archiv { background: var(--ks-archiv-bg); color: var(--ks-archiv-fg); }
.ks-vhs { background: var(--ks-vhs-bg); color: var(--ks-vhs-fg); }

/* ================= Tables ================= */
.tbl-wrap {
  background: var(--bg-card);
  border: 1px solid var(--linie-soft);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}
.tbl {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.tbl thead th {
  text-align: left;
  font-size: 10.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--tinte-muted);
  padding: 14px 18px;
  background: var(--wollweiss);
  border-bottom: 1px solid var(--linie-soft);
  white-space: nowrap;
}
.tbl thead th.right { text-align: right; }
.tbl thead th.sortable { cursor: pointer; }
.tbl thead th.sortable:hover { color: var(--tinte); }
.tbl tbody td {
  padding: 14px 18px;
  border-bottom: 1px solid var(--linie-soft);
  color: var(--tinte);
  vertical-align: middle;
}
.tbl tbody tr:last-child td { border-bottom: none; }
.tbl tbody tr { cursor: pointer; transition: background 120ms ease; }
.tbl tbody tr:hover { background: var(--wollweiss); }
.tbl td.right { text-align: right; }
.tbl td.num { font-variant-numeric: tabular-nums; font-feature-settings: "tnum"; }
.tbl td.muted { color: var(--tinte-muted); font-size: 13px; }

.tbl-name { display: flex; align-items: center; gap: 12px; }
.tbl-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--salbei-soft);
  color: var(--salbei-tief);
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 11.5px;
  flex-shrink: 0;
  letter-spacing: -0.02em;
}
.tbl-avatar.av-1 { background: #f1d4c8; color: #7a4d94; }
.tbl-avatar.av-2 { background: #d5dcd6; color: #4a5b4f; }
.tbl-avatar.av-3 { background: #f1e0b4; color: #806525; }
.tbl-avatar.av-4 { background: #e5eaf2; color: #6b6253; }
.tbl-name-text { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.tbl-name-text strong { font-weight: 600; font-size: 14px; color: var(--tinte); }
.tbl-name-text small { font-size: 12px; color: var(--tinte-muted); margin-top: 2px; }

.tbl-foot {
  padding: 14px 18px;
  border-top: 1px solid var(--linie-soft);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12.5px;
  color: var(--tinte-muted);
}

/* ================= Filter bar ================= */
.filter-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--linie-soft);
  background: var(--wollweiss);
  flex-wrap: wrap;
}
.filter-bar .filter-label {
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--tinte-muted);
  margin-right: 4px;
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  font-size: 13px;
  font-weight: 500;
  background: var(--wollweiss-rein);
  border: 1px solid var(--linie);
  color: var(--tinte-soft);
  cursor: pointer;
  transition: all 140ms ease;
  white-space: nowrap;
}
.chip:hover { color: var(--tinte); border-color: var(--linie-strong); }
.chip.is-active {
  background: var(--tinte);
  color: var(--wollweiss);
  border-color: var(--tinte);
}
.chip-count {
  font-size: 11px;
  opacity: 0.7;
  font-weight: 600;
}
.chip.is-active .chip-count { opacity: 1; }

/* ================= Form ================= */
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px 20px;
}
.form-grid .col-span-2 { grid-column: 1 / -1; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label {
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--tinte-soft);
}
.field label .opt { letter-spacing: 0.04em; text-transform: none; font-weight: 500; color: var(--tinte-muted); margin-left: 6px; font-size: 11px; }
.input, .select, .textarea {
  padding: 10px 12px;
  border: 1px solid var(--linie);
  border-radius: var(--radius);
  background: var(--wollweiss-rein);
  font-size: 14px;
  color: var(--tinte);
  transition: border-color 160ms ease, background 160ms ease, box-shadow 160ms ease;
}
.input:focus, .select:focus, .textarea:focus {
  outline: none;
  border-color: var(--terracotta);
  background: var(--wollweiss-rein);
  box-shadow: 0 0 0 3px rgba(184, 92, 60, 0.12);
}
.textarea { min-height: 90px; resize: vertical; font-family: inherit; }
.select {
  appearance: none;
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="%237a8090" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="6 9 12 15 18 9"/></svg>');
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 14px;
  padding-right: 36px;
}
.input-prefix {
  position: relative;
}
.input-prefix .prefix {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 13px;
  color: var(--tinte-muted);
  font-weight: 600;
}
.input-prefix .input { padding-left: 38px; }
.help { font-size: 11.5px; color: var(--tinte-muted); line-height: 1.45; }

.radio-list { display: flex; flex-direction: column; gap: 8px; }
.radio-card {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid var(--linie);
  border-radius: var(--radius);
  background: var(--wollweiss-rein);
  cursor: pointer;
  transition: border-color 140ms ease, background 140ms ease;
}
.radio-card:hover { border-color: var(--linie-strong); }
.radio-card input { margin-top: 3px; accent-color: var(--terracotta); flex-shrink: 0; }
.radio-card-text { display: flex; flex-direction: column; gap: 2px; }
.radio-card-text strong { font-size: 14px; font-weight: 600; }
.radio-card-text small { font-size: 12.5px; color: var(--tinte-muted); line-height: 1.4; }
.radio-card:has(input:checked) {
  border-color: var(--terracotta);
  background: var(--wollweiss-warm);
  box-shadow: 0 0 0 3px rgba(184, 92, 60, 0.1);
}

/* ================= Donut/Chart ================= */
.donut-legend {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.legend-row {
  display: grid;
  grid-template-columns: 12px 1fr auto auto;
  gap: 10px;
  align-items: center;
  font-size: 13px;
  padding: 6px 0;
}
.legend-dot {
  width: 12px;
  height: 12px;
  border-radius: 3px;
  flex-shrink: 0;
}
.legend-label { color: var(--tinte); font-weight: 500; }
.legend-value { color: var(--tinte); font-weight: 700; font-variant-numeric: tabular-nums; }
.legend-share { color: var(--tinte-muted); font-size: 12px; font-variant-numeric: tabular-nums; min-width: 40px; text-align: right; }

.bar-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px dashed var(--linie);
}
.bar-row:last-child { border-bottom: none; }
.bar-row-info {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}
.bar-row-title {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--tinte);
  display: flex;
  align-items: center;
  gap: 8px;
}
.bar-row-meta {
  font-size: 12px;
  color: var(--tinte-muted);
}
.bar-track {
  width: 100%;
  height: 8px;
  background: var(--wollweiss-warm);
  border-radius: var(--radius-pill);
  overflow: hidden;
  margin-top: 2px;
}
.bar-fill {
  height: 100%;
  border-radius: var(--radius-pill);
  background: var(--terracotta);
  transition: width 400ms ease;
}
.bar-fill.warn { background: var(--senf); }
.bar-fill.full { background: var(--salbei-tief); }
.bar-value {
  font-size: 13px;
  font-weight: 700;
  color: var(--tinte);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.bar-value small { color: var(--tinte-muted); font-weight: 500; font-size: 12px; margin-left: 2px; }

/* ================= Kurse: Kachelansicht (WYSIWYG) ================= */
/* Kennzahlen */
.kc-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 26px;
}
.kc-stat {
  background: var(--bg-card);
  border: 1px solid var(--linie-soft);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
}
.kc-stat-label {
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--tinte-muted);
  margin-bottom: 10px;
}
.kc-stat-num {
  font-family: 'Sora', 'Sora-fallback', sans-serif;
  font-size: 34px;
  font-weight: 700;
  line-height: 1;
  color: var(--tinte);
}
.kc-stat-num--accent { color: var(--terracotta); }
.kc-stat-num--full { color: var(--senf-tief); }
.kc-stat-sub {
  font-size: 13px;
  color: var(--tinte-muted);
  margin-top: 6px;
}

/* Toolbar */
.kc-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}
.kc-search {
  display: flex;
  align-items: center;
  gap: 9px;
  background: var(--bg-card);
  border: 1px solid var(--linie-soft);
  border-radius: var(--radius);
  padding: 8px 13px;
  min-width: 240px;
  color: var(--tinte-muted);
}
.kc-search input {
  border: 0;
  outline: 0;
  background: transparent;
  font: 500 14px 'Inter', sans-serif;
  color: var(--tinte);
  flex: 1;
  min-width: 0;
}

/* Rubriken (analog Frontend: Nähanlässe / Nähweekends / Nähworkshops) */
.kc-rubrik { margin-bottom: 34px; }
.kc-rubrik[hidden] { display: none; }
.kc-rubrik-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: 'Sora', 'Sora-fallback', sans-serif;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--tinte);
  margin: 0 0 16px;
}
.kc-rubrik-count {
  font-family: 'Inter', sans-serif;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--tinte-muted);
  background: var(--wollweiss-warm);
  border-radius: var(--radius-pill);
  padding: 2px 10px;
  min-width: 22px;
  text-align: center;
}

/* Kachel-Grid */
.kc-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
}
.kc-card {
  background: var(--bg-card);
  border: 1px solid var(--linie-soft);
  border-radius: var(--radius-lg);
  padding: 22px 24px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  box-shadow: var(--shadow-card);
  transition: border-color 150ms ease, box-shadow 150ms ease;
}
.kc-card:hover {
  border-color: var(--linie-strong);
  box-shadow: var(--shadow-card-hover);
}
.kc-card[hidden] { display: none; }
.kc-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}
.kc-eyebrow {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--tinte-muted);
  margin-bottom: 7px;
}
.kc-draft { color: var(--senf-tief); }
.kc-title {
  font-family: 'Sora', 'Sora-fallback', sans-serif;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.15;
  color: var(--tinte);
  margin: 0;
}
.kc-rows {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.kc-row {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 14px;
  font-weight: 500;
  color: var(--tinte-soft);
}
.kc-row svg { flex-shrink: 0; }
.kc-meter-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
.kc-meter-label { font-size: 13px; font-weight: 600; color: var(--tinte-muted); }
.kc-meter-val {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--tinte);
  font-variant-numeric: tabular-nums;
}
.kc-meter-wl { color: var(--tinte-muted); font-weight: 500; }
.kc-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 16px;
  border-top: 1px solid var(--linie-soft);
}
.kc-price {
  font-family: 'Sora', 'Sora-fallback', sans-serif;
  font-size: 19px;
  font-weight: 700;
  color: var(--tinte);
}
.kc-actions { display: flex; align-items: center; gap: 8px; }
.kc-icon-btn {
  width: 38px;
  height: 38px;
  border-radius: var(--radius);
  border: 1px solid var(--linie);
  background: var(--bg-card);
  color: var(--tinte-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  transition: background 150ms ease, color 150ms ease;
}
.kc-icon-btn:hover { background: var(--wollweiss-warm); color: var(--terracotta); }
.kc-empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--tinte-muted);
  font-size: 15px;
  font-weight: 500;
}
@media (max-width: 720px) {
  .kc-stats { grid-template-columns: repeat(2, 1fr); }
  .kc-grid { grid-template-columns: 1fr; }
}

/* ================= Status-Flow (Anmeldung-Detail) ================= */
.flow {
  display: flex;
  flex-direction: column;
  gap: 0;
}
.flow-step {
  display: grid;
  grid-template-columns: 36px 1fr auto;
  gap: 14px;
  padding: 16px 0;
  position: relative;
}
.flow-step:not(:last-child)::before {
  content: "";
  position: absolute;
  top: 38px;
  left: 17px;
  bottom: -8px;
  width: 2px;
  background: var(--linie);
}
.flow-step.is-done:not(:last-child)::before { background: var(--salbei-tief); }
.flow-step-marker {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--wollweiss-warm);
  border: 2px solid var(--linie);
  display: grid;
  place-items: center;
  color: var(--tinte-muted);
  position: relative;
  z-index: 1;
  font-weight: 700;
  font-size: 13px;
}
.flow-step.is-done .flow-step-marker {
  background: var(--salbei-tief);
  border-color: var(--salbei-tief);
  color: var(--wollweiss);
}
.flow-step.is-current .flow-step-marker {
  background: var(--terracotta);
  border-color: var(--terracotta);
  color: #FFFFFF;
  box-shadow: 0 0 0 4px var(--terracotta-soft);
}
.flow-step-body { min-width: 0; padding-top: 6px; }
.flow-step-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--tinte);
  margin-bottom: 2px;
}
.flow-step.is-pending .flow-step-title { color: var(--tinte-muted); }
.flow-step-meta {
  font-size: 12.5px;
  color: var(--tinte-muted);
  line-height: 1.45;
}
.flow-step-action {
  align-self: center;
}

/* ================= Notes / Activity ================= */
.activity {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.activity-item {
  display: grid;
  grid-template-columns: 28px 1fr auto;
  gap: 10px;
  align-items: flex-start;
}
.activity-icon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--wollweiss-warm);
  display: grid;
  place-items: center;
  color: var(--tinte-soft);
  flex-shrink: 0;
}
.activity-icon.acc { background: var(--terracotta-soft); color: var(--terracotta-dunkel); }
.activity-body { min-width: 0; padding-top: 2px; }
.activity-text { font-size: 13.5px; line-height: 1.5; color: var(--tinte); }
.activity-text strong { font-weight: 600; }
.activity-time { font-size: 11.5px; color: var(--tinte-muted); white-space: nowrap; padding-top: 4px; }

.note {
  background: var(--wollweiss-warm);
  border-left: 3px solid var(--senf);
  padding: 12px 14px;
  border-radius: 0 var(--radius) var(--radius) 0;
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--tinte);
}
.note .note-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11.5px;
  color: var(--tinte-muted);
  margin-bottom: 4px;
}

/* ================= Modal ================= */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(45, 52, 65, 0.45);
  backdrop-filter: blur(3px);
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 20px;
}
.modal {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-overlay);
  max-width: 560px;
  width: 100%;
  max-height: calc(100vh - 40px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.modal-lg { max-width: 720px; }
.modal-head {
  padding: 22px 24px 16px;
  border-bottom: 1px solid var(--linie-soft);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
}
.modal-title {
  font-family: 'Sora', 'Sora-fallback', sans-serif;
  font-weight: 700;
  font-size: 36px;
  line-height: 0.95;
  color: var(--terracotta);
}
.modal-body { padding: 20px 24px; overflow-y: auto; flex: 1; }
.modal-foot {
  padding: 16px 24px;
  border-top: 1px solid var(--linie-soft);
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}
.modal-close {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  color: var(--tinte-muted);
  display: grid;
  place-items: center;
  transition: background 140ms ease;
}
.modal-close:hover { background: var(--wollweiss-warm); color: var(--tinte); }

/* ================= Misc ================= */
.muted { color: var(--tinte-muted); }
.text-sm { font-size: 13px; }
.text-xs { font-size: 12px; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.gap-6 { gap: 24px; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 12px; }
.mb-4 { margin-bottom: 16px; }
.mb-6 { margin-bottom: 24px; }
.mt-2 { margin-top: 8px; }
.mt-4 { margin-top: 16px; }
.mt-6 { margin-top: 24px; }
.grid { display: grid; }
.tabular { font-variant-numeric: tabular-nums; }
.divider { border: none; border-top: 1px solid var(--linie-soft); margin: 16px 0; }

/* Dashboard-Grid */
.grid-kpis {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}
.grid-2 {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 20px;
  margin-bottom: 20px;
}
.grid-2-eq {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 20px;
}
.grid-3-1 {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 20px;
}

/* Empty state */
.empty {
  padding: 60px 24px;
  text-align: center;
  color: var(--tinte-muted);
}
.empty-illo {
  font-family: 'Sora', 'Sora-fallback', sans-serif;
  font-size: 64px;
  color: var(--linie);
  line-height: 1;
  margin-bottom: 14px;
}
.empty-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--tinte);
  margin-bottom: 6px;
}
.empty-body { font-size: 13.5px; max-width: 40ch; margin: 0 auto 16px; line-height: 1.5; }

/* Pill list */
.pill-list { display: flex; flex-wrap: wrap; gap: 6px; }

/* ================= Focus ================= */
button:focus-visible, a:focus-visible, .chip:focus-visible, .sb-link:focus-visible, input:focus-visible, select:focus-visible {
  outline: 2px solid var(--terracotta);
  outline-offset: 2px;
  border-radius: var(--radius);
}

/* ================= Scrollbar ================= */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--linie); border-radius: 999px; border: 2px solid var(--bg-canvas); }
::-webkit-scrollbar-thumb:hover { background: var(--linie-strong); }

/* ================= Login (eigene Seite ohne Sidebar) ================= */
.login-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px;
  background: var(--bg-canvas);
}
.login-card {
  width: 100%;
  max-width: 420px;
  background: var(--bg-card);
  border: 1px solid var(--linie-soft);
  border-radius: var(--radius-lg);
  padding: 36px 36px 30px;
  box-shadow: var(--shadow-card);
}
.login-brand {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 28px;
}
.login-brand-logo {
  width: 230px;
  max-width: 100%;
  height: auto;
  display: block;
  border-radius: 10px;
}
.login-brand-text { display: flex; flex-direction: column; line-height: 1.05; }
.login-brand-name {
  font-family: 'Sora', 'Sora-fallback', sans-serif;
  font-weight: 700;
  font-size: 30px;
  color: var(--tinte);
  line-height: 0.9;
}
.login-brand-sub {
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--tinte-muted);
  font-weight: 600;
  margin-top: 4px;
}
.login-title {
  font-family: 'Sora', 'Sora-fallback', sans-serif;
  font-weight: 700;
  font-size: 40px;
  line-height: 0.95;
  color: var(--tinte);
  margin-bottom: 22px;
}
.login-foot {
  font-size: 12px;
  color: var(--tinte-muted);
  text-align: center;
  margin-top: 22px;
}
.login-foot a { color: var(--tinte-soft); }
.login-foot a:hover { color: var(--terracotta); }

/* ================= Flash ================= */
.flash {
  padding: 12px 16px;
  border-radius: var(--radius);
  margin-bottom: 18px;
  font-size: 13.5px;
  border: 1px solid transparent;
}
.flash-success { background: var(--st-bestaetigt-bg); color: var(--st-bestaetigt-fg); border-color: rgba(74,91,79,0.18); }
.flash-error   { background: var(--st-storniert-bg); color: var(--st-storniert-fg); border-color: rgba(122,40,24,0.18); }
.flash-warn    { background: var(--senf-soft);       color: var(--senf-tief);       border-color: rgba(184,139,37,0.22); }
.flash-info    { background: var(--st-eingang-bg);   color: var(--st-eingang-fg);   border-color: rgba(107,98,83,0.18); }

/* ================= Audit-Log-Tabelle (Detail-View) ================= */
.audit-row td { font-size: 12.5px; color: var(--tinte-muted); }
.audit-row td.action { color: var(--tinte); font-weight: 600; font-size: 13px; }
.audit-row code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11.5px;
  background: var(--wollweiss);
  padding: 1px 5px;
  border-radius: 3px;
}

/* ================= Topbar User-Block (rechts) ================= */
.tb-user {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--tinte-soft);
  padding-left: 6px;
}
.tb-user .logout {
  color: var(--tinte-muted);
  padding: 6px 10px;
  border-radius: var(--radius);
}
.tb-user .logout:hover { color: var(--terracotta); background: var(--wollweiss-warm); }

/* === Ausgebucht-Theme: dunkle Sidebar (Vorlage «ausgebucht Admin», 12.07.2026) === */
.sb { background: linear-gradient(180deg, #0a2158, #062459); border-right: none; }
.sb-brand { border-bottom: 1px solid rgba(255,255,255,0.08); }
.sb-brand-logo { background: #fff; padding: 8px 10px; }
.sb-brand-sub, .sb-brand-name { color: #8ea1c4; }
.sb-section-title { color: #6f84ad; }
.sb-link { color: #b8c6e0; }
.sb-link:hover { background: rgba(255,255,255,0.07); color: #fff; }
.sb-link.is-active { background: rgba(255,255,255,0.14); color: #fff; }
.sb-link-count { background: rgba(255,255,255,0.14); color: #dce6f6; }
.sb-foot { border-top: 1px solid rgba(255,255,255,0.08); }
.sb-user:hover { background: rgba(255,255,255,0.07); }
.sb-user-name { color: #fff; }
.sb-user-role { color: #8ea1c4; }

/* Demo-Banner (CC_DEMO_MODE, Backend) */
.demo-banner-be { background: #062459; color: #dce6f6; font-size: 13px; font-weight: 500; text-align: center; padding: 8px 16px; }
.demo-banner-be a { color: #85b3ea; font-weight: 600; text-decoration: none; }
