:root {
  --bg: #f1f5f9;
  --surface: #ffffff;
  --text: #0f172a;
  --muted: #64748b;
  --border: #e2e8f0;
  --subtle: #f8fafc;
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --danger: #475569;
  --danger-bg: #f1f5f9;
  --danger-border: #cbd5e1;
  --success-bg: #eff6ff;
  --success-text: #1d4ed8;
  --info-bg: #e2e8f0;
  --info-text: #334155;
  --radius: 10px;
  --shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 4px 14px rgba(15, 23, 42, 0.08);
  --font: "Segoe UI", system-ui, -apple-system, sans-serif;
  --sidebar-w: 260px;
  --sidebar-bg: #0f2847;
  --sidebar-border: rgba(255, 255, 255, 0.08);
  --sidebar-text: #e2e8f0;
  --sidebar-muted: #94a3b8;
  --topbar-h: 56px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0.5rem;
  z-index: 200;
  padding: 0.5rem 1rem;
  background: var(--accent);
  color: #fff;
  border-radius: 8px;
  font-weight: 600;
}

.skip-link:focus {
  left: 0.5rem;
  outline: 2px solid #fff;
  outline-offset: 2px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ——— App shell (CRM dashboard) ——— */
.app-shell {
  display: flex;
  min-height: 100vh;
  width: 100%;
}

.app-shell__main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  margin-left: var(--sidebar-w);
}

.sidebar {
  position: fixed;
  z-index: 120;
  top: 0;
  left: 0;
  bottom: 0;
  width: var(--sidebar-w);
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, #0f2847 0%, #0c2139 100%);
  border-right: 1px solid var(--sidebar-border);
  color: var(--sidebar-text);
}

.sidebar__brand {
  padding: 1.25rem 1rem 1rem;
  border-bottom: 1px solid var(--sidebar-border);
}

.sidebar__logo-link {
  display: block;
  line-height: 0;
  border-radius: 10px;
  outline-offset: 3px;
}

.sidebar__logo-link:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.5);
}

.sidebar__logo-img {
  max-width: 100%;
  height: auto;
  display: block;
  filter: brightness(1.05);
}

.sidebar__nav {
  flex: 1;
  overflow-y: auto;
  padding: 0.75rem 0.65rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.sidebar__label {
  margin: 1rem 0 0.35rem 0.5rem;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--sidebar-muted);
}

.sidebar__footer {
  padding: 0.5rem 0.65rem 1rem;
  border-top: 1px solid var(--sidebar-border);
}

.sidebar-nav__btn {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  width: 100%;
  text-align: left;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 500;
  padding: 0.55rem 0.65rem;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: var(--sidebar-text);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.sidebar-nav__btn:hover {
  background: rgba(255, 255, 255, 0.06);
}

.sidebar-nav__btn.is-active {
  background: rgba(37, 99, 235, 0.35);
  color: #fff;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12);
}

.sidebar-nav__btn.is-active:hover {
  background: rgba(37, 99, 235, 0.45);
}

.sidebar-nav__icon {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.92;
}

.sidebar-nav__btn--footer {
  font-size: 0.85rem;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 110;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-height: var(--topbar-h);
  padding: 0.5rem 1rem 0.5rem 0.75rem;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.topbar__sidebar-toggle {
  display: none;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  padding: 0;
  border: none;
  border-radius: 10px;
  background: var(--subtle);
  color: var(--text);
  cursor: pointer;
}

.topbar__sidebar-toggle:hover {
  background: var(--border);
}

.topbar__search {
  flex: 1;
  min-width: 0;
  max-width: 420px;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0.85rem;
  background: var(--subtle);
  border: 1px solid var(--border);
  border-radius: 10px;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.topbar__search:focus-within {
  border-color: #bfdbfe;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.topbar__search-icon {
  flex-shrink: 0;
  color: var(--muted);
  display: flex;
}

.topbar__search-input {
  flex: 1;
  min-width: 0;
  border: none;
  background: transparent;
  font: inherit;
  font-size: 0.95rem;
  color: var(--text);
  outline: none;
}

.topbar__search-input::placeholder {
  color: #94a3b8;
}

.topbar__actions {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.topbar__icon-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.topbar__icon-btn:hover {
  background: var(--subtle);
  border-color: #cbd5e1;
}

.topbar__auth {
  margin-left: auto;
}

@media (max-width: 720px) {
  .topbar__auth .auth-user-meta {
    display: none;
  }
}

.auth-user-avatar {
  flex-shrink: 0;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  background: linear-gradient(145deg, #3b82f6, #1d4ed8);
  color: #fff;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.2);
}

.auth-user-box {
  gap: 0.65rem;
}

@media (max-width: 960px) {
  .app-shell__main {
    margin-left: 0;
  }

  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.22s ease;
    box-shadow: none;
  }

  body.sidebar-open .sidebar {
    transform: translateX(0);
    box-shadow: 8px 0 32px rgba(15, 23, 42, 0.25);
  }

  body.sidebar-open::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 115;
    background: rgba(15, 23, 42, 0.45);
    pointer-events: auto;
  }

  .topbar__sidebar-toggle {
    display: inline-flex;
  }
}

.page-header {
  margin-bottom: 1.5rem;
}

.page-header__title {
  margin: 0 0 0.35rem;
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
}

.page-header__subtitle {
  margin: 0;
  font-size: 0.95rem;
  color: var(--muted);
  max-width: 48rem;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 1.75rem;
}

.kpi-card {
  text-align: left;
  font: inherit;
  cursor: pointer;
  padding: 1.25rem 1.35rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow-md);
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.12s;
}

.kpi-card:hover:not(.kpi-card--static) {
  border-color: #bfdbfe;
  box-shadow: 0 8px 24px rgba(37, 99, 235, 0.1);
}

.kpi-card:focus-visible:not(.kpi-card--static) {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.kpi-card--static {
  cursor: default;
}

.kpi-card__label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.4rem;
}

.kpi-card__value {
  display: block;
  font-size: 2rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.1;
}

.kpi-card__meta {
  display: block;
  margin-top: 0.35rem;
  font-size: 0.85rem;
  color: var(--muted);
}

.dashboard-split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 340px);
  gap: 1.25rem;
  align-items: start;
  margin-bottom: 2rem;
}

.dashboard-split__main {
  min-width: 0;
}

.dashboard-split__aside {
  min-width: 0;
}

@media (max-width: 960px) {
  .dashboard-split {
    grid-template-columns: 1fr;
  }
}

.panel-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow-md);
  padding: 1.15rem 1.25rem 1.25rem;
}

.panel-card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
}

.panel-card__title {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
}

.panel-card__lead {
  margin: 0 0 0.75rem;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.35;
}

.panel-card--accent {
  background: linear-gradient(165deg, #eff6ff 0%, #fff 55%);
  border-color: #bfdbfe;
}

.panel-meta {
  margin: 0 0 1rem;
  font-size: 0.9rem;
}

.panel-meta dt {
  margin: 0;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.panel-meta dd {
  margin: 0.15rem 0 0.65rem;
  color: var(--text);
}

.panel-card__empty {
  margin: 0.5rem 0 0;
  font-size: 0.9rem;
  color: var(--muted);
}

/* ——— Operatives Dashboard ——— */
.page-header--dashboard {
  margin-bottom: 1.75rem;
}

.page-header--dashboard .page-header__subtitle {
  max-width: 42rem;
}

.kpi-grid--dashboard {
  margin-bottom: 1.25rem;
}

.kpi-card--dash {
  padding: 1.35rem 1.4rem 1.3rem;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.06);
}

.kpi-card__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  margin-bottom: 0.65rem;
  border-radius: 10px;
  background: #eff6ff;
  color: #2563eb;
}

.panel-card--dashboard-heute {
  padding: 1.35rem 1.4rem 1.25rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 6px 20px rgba(15, 23, 42, 0.07);
}

.panel-card__head--tight {
  margin-bottom: 0.5rem;
}

.panel-card__title--with-icon {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.panel-card__title-icon {
  display: flex;
  color: #2563eb;
}

.dash-heute-hint {
  margin: 0 0 0.85rem;
  font-size: 0.82rem;
}

.dash-heute-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.dash-heute-item {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  width: 100%;
  text-align: left;
  padding: 0.65rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  font: inherit;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, box-shadow 0.15s;
}

.dash-heute-item:hover {
  background: var(--subtle);
  border-color: #bfdbfe;
  box-shadow: 0 2px 10px rgba(37, 99, 235, 0.08);
}

.dash-heute-item__icon {
  flex-shrink: 0;
  display: flex;
  color: var(--muted);
}

.dash-heute-item__main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.35rem 0.65rem;
}

.dash-heute-item__count {
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--text);
  min-width: 1.5rem;
}

.dash-heute-item__label {
  font-size: 0.9rem;
  color: var(--text);
  line-height: 1.35;
}

.dash-heute-item__chev {
  flex-shrink: 0;
  color: var(--muted);
  font-size: 1rem;
}

.dashboard-split--ops {
  margin-bottom: 2.25rem;
  gap: 1.5rem;
}

.panel-card--open-cases {
  padding: 1.35rem 1.4rem 1.3rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 6px 20px rgba(15, 23, 42, 0.07);
}

.dash-open-cases-hint {
  margin: 0 0 0.75rem;
  font-size: 0.82rem;
}

.dash-open-case-row {
  cursor: pointer;
  transition: background 0.12s;
}

.dash-open-case-row:hover {
  background: var(--subtle);
}

.badge-dash-problem {
  background: #fef2f2;
  color: #b91c1c;
  border: 1px solid #fecaca;
  font-weight: 500;
  font-size: 0.78rem;
}

.badge-dash-ok {
  background: #ecfdf5;
  color: #047857;
  border: 1px solid #a7f3d0;
}

.badge-dash-warn {
  background: #fffbeb;
  color: #b45309;
  border: 1px solid #fde68a;
}

.badge-dash-muted {
  background: var(--subtle);
  color: var(--muted);
  border: 1px solid var(--border);
}

.badge-dash-neutral {
  background: #f1f5f9;
  color: #475569;
  border: 1px solid #e2e8f0;
}

.prio-hoch {
  background: #fef2f2;
  color: #991b1b;
  border: 1px solid #fecaca;
  font-size: 0.78rem;
  font-weight: 600;
}

.prio-mittel {
  background: #fffbeb;
  color: #92400e;
  border: 1px solid #fde68a;
  font-size: 0.78rem;
  font-weight: 600;
}

.prio-niedrig {
  background: #f1f5f9;
  color: #475569;
  border: 1px solid #e2e8f0;
  font-size: 0.78rem;
  font-weight: 600;
}

.dash-section--quick {
  margin-top: 0.25rem;
}

.dash-quick-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.75rem;
}

.dash-quick-tile {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.5rem;
  padding: 1rem 1rem 1.05rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: 0 3px 12px rgba(15, 23, 42, 0.05);
  font: inherit;
  cursor: pointer;
  text-align: left;
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.1s;
}

.dash-quick-tile:hover {
  border-color: #bfdbfe;
  box-shadow: 0 6px 18px rgba(37, 99, 235, 0.1);
}

.dash-quick-tile__icon {
  display: flex;
  color: #2563eb;
}

.dash-quick-tile__label {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.3;
}

.panel-card--kurs-focus {
  padding: 1.35rem 1.35rem 1.3rem;
  box-shadow: 0 8px 26px rgba(37, 99, 235, 0.12);
}

.dash-kurs-status-row {
  margin: 0 0 0.75rem;
}

.dash-kurs-status-badge {
  font-size: 0.78rem;
  font-weight: 600;
}

.panel-meta--spaced dd {
  margin-bottom: 0.55rem;
}

.dash-kurs-progress-block {
  margin: 0.25rem 0 1rem;
}

.dash-kurs-progress-label {
  font-size: 0.8rem;
  color: var(--muted);
  margin: 0 0 0.35rem;
}

.dash-kurs-progress {
  height: 8px;
  border-radius: 999px;
  background: #e2e8f0;
  overflow: hidden;
}

.dash-kurs-progress__bar {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #3b82f6, #2563eb);
  transition: width 0.35s ease;
}

.ops-filter-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.65rem 1rem;
  margin-bottom: 1rem;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 10px;
  font-size: 0.88rem;
}

.ops-filter-banner__text {
  margin: 0;
  flex: 1;
  min-width: 12rem;
  color: var(--text);
}

/* ——— Teilnehmer Arbeitsansicht (Phase 1) ——— */
.page-header--teilnehmer {
  margin-bottom: 1.25rem;
}

.page-header--teilnehmer .page-header__title {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.tn-work-toolbar {
  margin-bottom: 1rem;
}

.tn-filter-card {
  margin-bottom: 1rem;
  padding: 1.1rem 1.25rem 1.2rem;
  box-shadow: var(--shadow-md);
}

.tn-filter-card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1rem;
  padding-bottom: 0.65rem;
  border-bottom: 1px solid var(--border);
}

.tn-filter-card__title {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
}

.tn-filter-grid {
  display: grid;
  grid-template-columns: minmax(12rem, 1.4fr) repeat(3, minmax(10rem, 1fr)) minmax(14rem, 1.2fr);
  gap: 0.85rem 1rem;
  align-items: end;
}

@media (max-width: 1100px) {
  .tn-filter-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .tn-filter-field--search {
    grid-column: 1 / -1;
  }

  .tn-filter-field--toggles {
    grid-column: 1 / -1;
  }
}

@media (max-width: 560px) {
  .tn-filter-grid {
    grid-template-columns: 1fr;
  }
}

.tn-filter-label {
  display: block;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  margin-bottom: 0.35rem;
}

.tn-filter-input,
.tn-filter-select {
  width: 100%;
  padding: 0.5rem 0.65rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  font: inherit;
  font-size: 0.92rem;
  background: var(--surface);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.tn-filter-input:focus,
.tn-filter-select:focus {
  outline: none;
  border-color: #93c5fd;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.tn-filter-toggles {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem 1.1rem;
  padding: 0.35rem 0 0.1rem;
}

.tn-filter-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text);
  cursor: pointer;
  user-select: none;
}

.tn-filter-toggle input {
  width: 1rem;
  height: 1rem;
  accent-color: var(--accent);
  cursor: pointer;
}

.table-card--teilnehmer {
  box-shadow: var(--shadow-md);
}

.table-wrap--teilnehmer {
  max-height: min(70vh, 42rem);
  overflow: auto;
}

.tn-table {
  font-size: 0.9rem;
}

.tn-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--subtle);
  box-shadow: 0 1px 0 var(--border);
}

.tn-table__col-actions {
  width: 5.5rem;
  text-align: right;
}

.tn-data-row {
  cursor: pointer;
  transition: background 0.12s ease;
}

.tn-data-row:hover {
  background: #f0f7ff;
}

.tn-data-row.is-selected {
  background: #e8f1fe;
  box-shadow: inset 3px 0 0 var(--accent);
}

.tn-data-row:focus {
  outline: none;
}

.tn-data-row:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

.tn-data-row td {
  vertical-align: middle;
}

.tn-cell-name {
  font-weight: 600;
  color: var(--text);
}

.tn-cell-kurs {
  max-width: 14rem;
}

.tn-cell-kurs-inner {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tn-cell-kt {
  max-width: 12rem;
  font-size: 0.88rem;
  color: var(--text);
}

.tn-unterlagen {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  padding: 0.2rem 0.45rem;
  border-radius: 6px;
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1.25;
}

.tn-unterlagen--ok {
  background: #ecfdf5;
  color: #047857;
  border: 1px solid #a7f3d0;
}

.tn-unterlagen--warn {
  background: #fffbeb;
  color: #b45309;
  border: 1px solid #fde68a;
}

.tn-unterlagen--teilweise {
  background: #fffbeb;
  color: #b45309;
  border: 1px solid #fde68a;
}

.tn-unterlagen--fehlt {
  background: #fef2f2;
  color: #b91c1c;
  border: 1px solid #fecaca;
}

.tn-unterlagen--muted {
  background: var(--subtle);
  color: var(--muted);
  border: 1px solid var(--border);
  font-weight: 500;
}

.tn-offen-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.65rem;
  padding: 0.2rem 0.45rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
}

.tn-offen-badge--null {
  background: var(--subtle);
  color: var(--muted);
  border: 1px solid var(--border);
  font-weight: 600;
}

.tn-offen-badge--ok {
  background: #ecfdf5;
  color: #047857;
  border: 1px solid #a7f3d0;
}

.tn-offen-badge--warn {
  background: #fef2f2;
  color: #b91c1c;
  border: 1px solid #fecaca;
}

.tn-row-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.25rem;
}

.tn-row-actions .btn {
  padding: 0.3rem 0.45rem;
  font-size: 0.75rem;
  line-height: 1.2;
}

.meta-bar--teilnehmer {
  margin-top: 0.85rem;
}

.meta-bar--kurse {
  margin-top: 0.85rem;
}

/* Kurse / Maßnahmen — Steuerungsansicht */
.view-kurse-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem 1.25rem;
  margin-bottom: 1rem;
}

.view-title--kurse {
  margin-bottom: 0.15rem;
}

.view-kurse-head__sub {
  margin: 0;
  max-width: 40rem;
}

.view-kurse-head__link {
  display: inline;
  margin: 0;
  padding: 0;
  border: none;
  background: none;
  font: inherit;
  color: var(--accent);
  text-decoration: underline;
  cursor: pointer;
}

.view-kurse-head__link:hover {
  color: var(--accent-hover, var(--accent));
}

.view-kurse-head__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.tn-filter-bar--kurse {
  margin-bottom: 1rem;
}

.tn-work-split--kurse {
  margin-bottom: 0.25rem;
}

.table-card--kurse {
  margin-bottom: 0;
}

.table-wrap--kurse {
  max-height: min(58vh, 520px);
  overflow: auto;
}

.kurs-table {
  width: 100%;
  font-size: 0.88rem;
}

.kurs-table tbody tr.kurs-data-row {
  cursor: pointer;
  transition: background 0.12s ease;
}

.kurs-table tbody tr.kurs-data-row:hover {
  background: var(--subtle);
}

.kurs-table tbody tr.kurs-data-row.is-selected {
  background: color-mix(in srgb, var(--accent) 12%, var(--surface));
  box-shadow: inset 3px 0 0 var(--accent);
}

.badge-kurs-geplant {
  background: #2563eb;
  color: #fff;
  border-color: #2563eb;
}

.badge-kurs-laufend {
  background: #16a34a;
  color: #fff;
  border-color: #16a34a;
}

.badge-kurs-abgeschlossen {
  background: #64748b;
  color: #fff;
  border-color: #64748b;
}

.badge-kurs-offen {
  background: var(--muted);
  color: var(--surface);
  border-color: var(--border);
}

.kurs-detail-panel {
  min-height: 12rem;
}

.kurs-detail-progress-block {
  margin-top: 0.25rem;
}

.kurs-kpi-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.65rem;
}

@media (max-width: 720px) {
  .kurs-kpi-cards {
    grid-template-columns: 1fr;
  }
}

.kurs-kpi-card {
  padding: 0.65rem 0.75rem;
  background: var(--subtle);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.kurs-kpi-card__val {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
}

.kurs-kpi-card__lab {
  margin-top: 0.2rem;
  font-size: 0.72rem;
  color: var(--muted);
  line-height: 1.35;
}

.kurs-detail-issues-breakdown {
  margin: 0.65rem 0 0;
  padding-left: 1.1rem;
  font-size: 0.82rem;
  color: var(--text);
  line-height: 1.45;
}

.kurs-detail-issues-breakdown:empty {
  display: none;
}

.kurs-tn-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  max-height: 220px;
  overflow-y: auto;
}

.kurs-tn-list__item {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.5rem;
  padding: 0.45rem 0.55rem;
  background: var(--subtle);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.84rem;
}

.kurs-tn-list__name {
  font-weight: 600;
  color: var(--text);
  flex: 1;
  min-width: 0;
}

.kurs-tn-list__status {
  font-size: 0.72rem;
  color: var(--muted);
}

.kurs-tn-pill {
  display: inline-block;
  padding: 0.1rem 0.35rem;
  border-radius: 999px;
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: none;
}

.kurs-tn-pill--heute {
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #fcd34d;
}

.kurs-tn-pill--problem {
  background: #fee2e2;
  color: #991b1b;
  border: 1px solid #fecaca;
}

.kurs-tn-pill--ok {
  background: #dcfce7;
  color: #166534;
  border: 1px solid #bbf7d0;
}

@media (max-width: 1100px) {
  .tn-work-split--kurse {
    grid-template-columns: 1fr;
  }

  .kurs-detail-panel {
    position: static;
    max-height: none;
  }

  .table-wrap--kurse {
    max-height: none;
  }
}

/* Teilnehmer Phase 2: Liste + Detailpanel */
.tn-work-split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 380px);
  gap: 1.25rem;
  align-items: start;
  margin-bottom: 0.25rem;
}

.tn-work-split__list {
  min-width: 0;
}

.tn-detail-panel {
  position: sticky;
  top: calc(var(--topbar-h) + 1rem);
  max-height: calc(100vh - var(--topbar-h) - 2rem);
  overflow-y: auto;
  overflow-x: hidden;
  padding: 1.15rem 1.2rem 1.25rem;
  box-shadow: var(--shadow-md);
  align-self: start;
}

.tn-detail-placeholder {
  padding: 2rem 1rem;
  text-align: center;
  color: var(--muted);
}

.tn-detail-placeholder__text {
  margin: 0 0 0.5rem;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text);
}

.tn-detail-placeholder__hint {
  margin: 0;
  font-size: 0.88rem;
  line-height: 1.45;
  max-width: 16rem;
  margin-inline: auto;
}

.tn-detail-content {
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}

.tn-detail-head {
  padding-bottom: 0.85rem;
  border-bottom: 1px solid var(--border);
}

.tn-detail-head__title-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
  margin-bottom: 0.75rem;
}

.tn-detail-name {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
  line-height: 1.25;
  flex: 1;
  min-width: 0;
}

.tn-detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.tn-detail-actions .btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.tn-detail-section {
  margin: 0;
}

.tn-detail-section__title {
  margin: 0 0 0.5rem;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}

.tn-detail-unterlagen-inline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
  margin: 0 0 0.45rem;
}

.tn-detail-unterlagen-inline__hint {
  font-size: 0.75rem;
  color: var(--muted);
  line-height: 1.35;
}

.tn-detail-status-wrap {
  position: relative;
}

.tn-detail-status-trigger {
  cursor: pointer;
  border: none;
  font: inherit;
  font-size: 0.8rem;
}

.tn-detail-status-trigger:disabled {
  cursor: default;
  opacity: 0.85;
}

.tn-detail-status-menu {
  position: absolute;
  z-index: 30;
  top: calc(100% + 4px);
  left: 0;
  min-width: 11rem;
  padding: 0.35rem;
  margin: 0;
  list-style: none;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.tn-detail-status-option {
  text-align: left;
  padding: 0.4rem 0.55rem;
  border: none;
  border-radius: 6px;
  background: transparent;
  font-size: 0.85rem;
  color: var(--text);
  cursor: pointer;
}

.tn-detail-status-option:hover {
  background: var(--subtle);
}

.tn-detail-save-toast {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--success-text);
  opacity: 0;
  transition: opacity 0.25s ease;
}

.tn-detail-save-toast.is-visible {
  opacity: 1;
}

.tn-detail-content--readonly .tn-detail-editable__view {
  cursor: default;
}

.tn-detail-editable__view {
  cursor: pointer;
  display: inline-block;
  min-height: 1.35em;
  border-radius: 4px;
  padding: 0.1rem 0.25rem;
  margin: -0.1rem -0.25rem;
  outline: none;
}

.tn-detail-content:not(.tn-detail-content--readonly) .tn-detail-editable__view:hover {
  background: var(--subtle);
}

.tn-detail-editable__view.is-empty {
  color: var(--muted);
}

.tn-detail-editable__input {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  font: inherit;
  font-size: 0.88rem;
  padding: 0.25rem 0.4rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text);
}

.tn-detail-address-form {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  width: 100%;
}

.tn-detail-address-form__row {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.tn-detail-address-form__field {
  flex: 1;
  min-width: 0;
  font: inherit;
  font-size: 0.88rem;
  padding: 0.25rem 0.4rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text);
}

.tn-detail-address-form__row .tn-detail-address-form__field:first-child {
  flex: 0 0 5.5rem;
}

.tn-detail-bg-static {
  margin: 0;
  font-size: 0.88rem;
  color: var(--muted);
  font-style: italic;
}

.tn-detail-notizen-list {
  list-style: none;
  margin: 0 0 0.65rem;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  max-height: 14rem;
  overflow-y: auto;
}

.tn-detail-notiz-item {
  margin: 0;
  padding: 0.45rem 0.5rem;
  background: var(--subtle);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.84rem;
  line-height: 1.4;
}

.tn-detail-notiz-item__time {
  display: block;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 0.2rem;
}

.tn-detail-notiz-item__text {
  white-space: pre-wrap;
  word-break: break-word;
}

.tn-detail-notizen-empty {
  margin: 0 0 0.5rem;
  font-size: 0.85rem;
  color: var(--muted);
  font-style: italic;
}

.tn-detail-notiz-add {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
}

.tn-detail-notiz-add__input {
  flex: 1;
  min-width: 8rem;
  font: inherit;
  font-size: 0.88rem;
  padding: 0.35rem 0.5rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text);
}

#modalTnDetailKurs #selectTnDetailKurs {
  width: 100%;
  max-width: 100%;
  margin-top: 0.35rem;
  font: inherit;
  padding: 0.4rem 0.5rem;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
}

.tn-detail-section__hint {
  margin: 0 0 0.5rem;
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.4;
}

.tn-detail-dl {
  margin: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.45rem 0.85rem;
  font-size: 0.88rem;
}

.tn-detail-dl dt {
  margin: 0;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.tn-detail-dl dd {
  margin: 0.1rem 0 0;
  color: var(--text);
  line-height: 1.35;
  word-break: break-word;
}

.tn-detail-dl__full {
  grid-column: 1 / -1;
}

.tn-detail-dok-actions {
  margin: 0 0 0.5rem;
}

.tn-detail-dok-register-host {
  overflow-x: auto;
  margin: 0;
}

.tn-modal-dok-register-host {
  overflow-x: auto;
  margin: 0.35rem 0 0.25rem;
}

.tn-detail-dok-register {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}

.tn-detail-dok-register th,
.tn-detail-dok-register td {
  border: 1px solid var(--border);
  padding: 0.35rem 0.4rem;
  text-align: left;
  vertical-align: middle;
}

.tn-detail-dok-register th {
  background: var(--subtle);
  font-weight: 600;
  color: var(--text);
}

.tn-detail-dok-register__act {
  width: 5.5rem;
  white-space: nowrap;
}

.tn-detail-dok-register input[type="date"],
.tn-detail-dok-register input[type="text"],
.tn-detail-dok-register select.tn-dok-reg-status {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  font: inherit;
  padding: 0.2rem 0.35rem;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
}

.tn-detail-dok-register select.tn-dok-reg-status {
  min-width: 6.5rem;
}

.tn-detail-dok-register__muted {
  color: var(--muted);
  font-style: italic;
  font-size: 0.8rem;
}

.tn-detail-doc-table {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.tn-detail-doc-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.35rem 0.65rem;
  padding: 0.45rem 0.55rem;
  background: var(--subtle);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-sizing: border-box;
}

.tn-detail-doc-item .tn-detail-doc-row {
  width: 100%;
}

.tn-detail-doc-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
  min-width: 7rem;
}

.tn-detail-doc-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}

.tn-doc-pill {
  display: inline-block;
  padding: 0.12rem 0.4rem;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: lowercase;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--border);
}

.tn-doc-pill.is-active {
  color: #fff;
  background: var(--accent);
  border-color: var(--accent);
}

.tn-detail-doc-row .tn-doc-pill.is-active {
  text-transform: none;
}

.tn-detail-doc-meta {
  font-size: 0.82rem;
  color: var(--muted);
}

.tn-detail-doc-meta--muted {
  font-style: italic;
}

.tn-detail-doc-hit {
  appearance: none;
  width: 100%;
  margin: 0;
  text-align: left;
  cursor: pointer;
  font: inherit;
  color: inherit;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.35rem 0.65rem;
  padding: 0.45rem 0.55rem;
  background: var(--subtle);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-sizing: border-box;
}

.tn-detail-doc-hit:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.tn-detail-doc-row--static {
  cursor: default;
}

.tn-detail-issues {
  margin: 0;
  padding-left: 1.15rem;
  font-size: 0.88rem;
  color: var(--text);
  line-height: 1.45;
}

.tn-detail-issues li {
  margin-bottom: 0.25rem;
}

.tn-detail-issues-empty {
  margin: 0;
  font-size: 0.85rem;
  color: var(--muted);
  font-style: italic;
}

.tn-detail-notizen {
  width: 100%;
  font-size: 0.88rem;
  resize: vertical;
  min-height: 5rem;
  background: var(--subtle);
  color: var(--text);
  cursor: default;
}

.tn-detail-section--notes .tn-detail-notizen {
  margin-top: 0.25rem;
}

@media (max-width: 1024px) {
  .tn-work-split {
    grid-template-columns: 1fr;
  }

  .tn-detail-panel {
    position: relative;
    top: auto;
    max-height: none;
    order: 2;
  }

  .tn-work-split__list {
    order: 1;
  }
}

@media (max-width: 640px) {
  .tn-detail-dl {
    grid-template-columns: 1fr;
  }
}

.table-wrap--compact table {
  font-size: 0.9rem;
}

.btn-sm {
  font-size: 0.8rem;
  padding: 0.35rem 0.65rem;
}

.btn-block {
  width: 100%;
  justify-content: center;
}

.placeholder-panel {
  padding: 1.25rem 1.35rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  max-width: 42rem;
  color: var(--muted);
  line-height: 1.55;
}

.placeholder-panel p {
  margin: 0;
  max-width: 40rem;
  font-size: 0.95rem;
  line-height: 1.55;
}

.app-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 1rem 1.5rem;
  box-shadow: var(--shadow);
}

.app-header-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem 1.5rem;
}

.app-header-right {
  display: flex;
  align-items: center;
  gap: 0.75rem 1rem;
  flex-shrink: 0;
}

.auth-bar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

.auth-user-box {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.auth-user-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.1rem;
  text-align: right;
  max-width: 14rem;
}

.auth-user-name {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text);
  line-height: 1.2;
}

.auth-user-role {
  font-size: 0.75rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.auth-dropdown-wrap {
  position: relative;
}

.auth-dropdown {
  position: absolute;
  right: 0;
  top: calc(100% + 4px);
  min-width: 10rem;
  padding: 0.35rem 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  z-index: 50;
}

.auth-dropdown-item {
  display: block;
  width: 100%;
  padding: 0.45rem 0.85rem;
  text-align: left;
  border: none;
  background: none;
  font: inherit;
  color: var(--text);
  cursor: pointer;
}

.auth-dropdown-item:hover {
  background: var(--subtle);
}

.auth-hint-banner {
  padding: 0.85rem 1rem;
  margin-bottom: 1rem;
  background: var(--success-bg);
  border: 1px solid rgba(37, 99, 235, 0.2);
  border-radius: var(--radius);
  font-size: 0.9rem;
}

.auth-login-demo-hint {
  font-size: 0.8rem;
  color: var(--muted);
}

.auth-login-demo-picks {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 0.5rem;
  margin-bottom: 1rem;
}

.auth-logout-btn {
  font-size: 0.8rem;
  padding: 0.25rem 0.5rem;
}

.auth-error {
  color: #b91c1c;
  font-size: 0.85rem;
  margin-top: 0.5rem;
}

.auth-profile-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--muted);
  margin-bottom: 0.15rem;
}

.auth-profile-value {
  margin: 0 0 0.75rem;
  font-size: 0.95rem;
}

.btn-auth-login {
  white-space: nowrap;
}

.app-header-brand {
  flex: 1;
  min-width: 0;
}

.app-header h1 {
  margin: 0 0 0.25rem;
  font-size: 1.35rem;
  font-weight: 600;
}

.app-header p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.app-header-logo {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  line-height: 0;
  text-decoration: none;
}

.app-header-logo:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
  border-radius: 6px;
}

.app-header-logo img {
  height: clamp(40px, 10vw, 56px);
  width: auto;
  max-width: min(280px, 42vw);
  object-fit: contain;
  display: block;
}

@media (max-width: 520px) {
  .app-header-inner {
    flex-wrap: wrap;
  }

  .app-header-logo {
    margin-left: auto;
  }

  .app-header-logo img {
    max-width: min(220px, 85vw);
  }
}

main.page-content {
  flex: 1;
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  padding: 1.5rem clamp(1rem, 2.5vw, 2rem) 2.5rem;
  min-width: 0;
}

.dash-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 1.25rem;
  padding: 0.25rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.dash-nav-btn {
  font: inherit;
  font-weight: 500;
  font-size: 0.9rem;
  padding: 0.5rem 0.9rem;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.dash-nav-btn:hover {
  color: var(--text);
  background: var(--subtle);
}

.dash-nav-btn.is-active {
  background: var(--accent);
  color: #fff;
}

.dash-nav-btn.is-active:hover {
  background: var(--accent-hover);
  color: #fff;
}

.sidebar .sidebar-nav__btn.dash-nav-btn {
  color: var(--sidebar-text);
  background: transparent;
}

.sidebar .sidebar-nav__btn.dash-nav-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.06);
}

.sidebar .sidebar-nav__btn.dash-nav-btn.is-active {
  background: rgba(37, 99, 235, 0.4);
  color: #fff;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12);
}

.sidebar .sidebar-nav__btn.dash-nav-btn.is-active:hover {
  background: rgba(37, 99, 235, 0.5);
  color: #fff;
}

.view-title {
  margin: 0 0 1rem;
  font-size: 1.2rem;
  font-weight: 600;
}

.dash-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 1rem;
}

.dash-card {
  text-align: left;
  font: inherit;
  cursor: pointer;
  padding: 1.15rem 1.25rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.dash-card:hover {
  border-color: #bfdbfe;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.08);
}

.dash-card:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.dash-card-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.35rem;
}

.dash-card-value {
  display: block;
  font-size: 2rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.1;
}

.dash-card-meta {
  display: block;
  margin-top: 0.35rem;
  font-size: 0.85rem;
  color: var(--muted);
}

.dash-hint {
  margin: 0;
  font-size: 0.9rem;
  color: var(--muted);
}

.dash-section {
  margin-top: 1.75rem;
  padding-top: 1.35rem;
  border-top: 1px solid var(--border);
}

.dash-section-title {
  margin: 0 0 0.25rem;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text);
}

.dash-section-intro {
  margin: 0 0 1rem;
  font-size: 0.88rem;
  color: var(--muted);
}

.dash-cards--sub {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.dash-card--sub {
  min-height: 5.5rem;
}

.dash-card--sub .dash-card-label {
  text-transform: none;
  letter-spacing: normal;
  font-size: 0.95rem;
  color: var(--text);
}

.dash-card-subtitle {
  display: block;
  margin-top: 0.35rem;
  font-size: 0.85rem;
  font-weight: 400;
  color: var(--muted);
  line-height: 1.35;
}

.view-lead {
  margin: -0.35rem 0 1.25rem;
  font-size: 0.95rem;
  color: var(--muted);
  max-width: 42rem;
}

.view-lead--tight {
  margin: -0.25rem 0 0.9rem;
}

.form-section-title {
  margin: 0 0 0.35rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.form-section-hint {
  margin: 0 0 0.9rem;
  font-size: 0.85rem;
  color: var(--muted);
  line-height: 1.45;
  max-width: 36rem;
}

.view-toolbar {
  margin-bottom: 0.75rem;
}

.kunde-csv-hint code {
  font-size: 0.8em;
  background: var(--subtle);
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
}

.kunde-form {
  padding: 1.25rem 1.5rem 1.5rem;
}

.kunde-form-footer {
  margin-top: 1.1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
}

.kunde-ap-section-title {
  margin-top: 1.35rem;
}

.kunde-ap-add-wrap {
  margin: 0 0 0.25rem;
}

.kunde-ap-empty {
  margin: 0 0 0.75rem;
  font-size: 0.92rem;
  color: var(--muted);
}

.kunde-ap-head,
.kunde-ap-row {
  display: grid;
  grid-template-columns:
    6.5rem minmax(4.5rem, 0.65fr) minmax(5.5rem, 1.15fr) minmax(4.5rem, 0.95fr) minmax(5.5rem, 1.15fr) auto;
  gap: 0.5rem 0.65rem;
  align-items: end;
}

.kunde-ap-head {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--muted);
  padding-bottom: 0.35rem;
  border-bottom: 1px solid var(--border);
}

.kunde-ap-col-sel {
  min-width: 0;
}

.kunde-ap-col-act {
  display: flex;
  justify-content: flex-end;
}

.kunde-ap-radio-label {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  cursor: pointer;
  margin: 0;
}

.kunde-ap-radio-text {
  font-size: 0.72rem;
  color: var(--muted);
  white-space: nowrap;
}

.kunde-ap-row {
  padding: 0.55rem 0;
  border-bottom: 1px solid var(--border);
}

.kunde-ap-row:last-of-type {
  border-bottom: none;
}

.teilnehmer-modul-wrap {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  margin-bottom: 0.75rem;
  max-width: 100%;
}

.teilnehmer-mod-check {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  font-size: 0.92rem;
  line-height: 1.35;
}

.teilnehmer-mod-check input {
  margin-top: 0.2rem;
  width: auto;
  flex-shrink: 0;
}

.teilnehmer-doc-toolbar {
  margin-bottom: 0.5rem;
}

.teilnehmer-doc-list {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-bottom: 0.75rem;
  max-width: 100%;
}

.teilnehmer-doc-empty {
  margin: 0;
}

.teilnehmer-doc-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto auto auto auto;
  gap: 0.35rem 0.5rem;
  align-items: center;
  padding: 0.45rem 0.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--subtle);
  font-size: 0.88rem;
}

@media (max-width: 640px) {
  .teilnehmer-doc-row {
    grid-template-columns: 1fr;
  }

  .teilnehmer-doc-btn {
    justify-self: start;
  }
}

.teilnehmer-doc-name {
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.teilnehmer-doc-meta {
  color: var(--muted);
  font-size: 0.82rem;
  white-space: nowrap;
}

.teilnehmer-doc-btn {
  padding: 0.3rem 0.5rem;
  font-size: 0.82rem;
}

.massnahme-modul-section-title {
  margin-top: 0.35rem;
}

.massnahme-modul-add-wrap {
  margin: 0 0 0.5rem;
}

.massnahme-modul-empty {
  margin: 0 0 0.75rem;
  font-size: 0.92rem;
  color: var(--muted);
}

.massnahme-modul-head,
.massnahme-modul-row {
  display: grid;
  grid-template-columns:
    5.5rem minmax(5rem, 1.2fr) minmax(4rem, 0.75fr) minmax(4.5rem, 0.85fr) minmax(4.5rem, 0.85fr) auto;
  gap: 0.45rem 0.55rem;
  align-items: end;
}

.massnahme-modul-head {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--muted);
  padding-bottom: 0.3rem;
  border-bottom: 1px solid var(--border);
}

.massnahme-modul-row {
  padding: 0.45rem 0;
  border-bottom: 1px solid var(--border);
}

.massnahme-modul-row:last-of-type {
  border-bottom: none;
}

.massnahme-modul-badge {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted);
}

.massnahme-modul-col-act {
  display: flex;
  justify-content: flex-end;
}

@media (max-width: 960px) {
  .massnahme-modul-head {
    display: none;
  }

  .massnahme-modul-row {
    grid-template-columns: 1fr;
    padding: 0.75rem;
    margin-bottom: 0.6rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
  }

  .massnahme-modul-col-nr {
    padding-bottom: 0.35rem;
    margin-bottom: 0.35rem;
    border-bottom: 1px solid var(--border);
  }

  .massnahme-modul-col-act {
    justify-content: flex-start;
    margin-top: 0.25rem;
  }

  .kunde-ap-head {
    display: none;
  }

  .kunde-ap-row {
    grid-template-columns: 1fr;
    padding: 0.85rem;
    margin-bottom: 0.65rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    align-items: stretch;
  }

  .kunde-ap-col-sel {
    order: -1;
    padding-bottom: 0.35rem;
    border-bottom: 1px solid var(--border);
    margin-bottom: 0.35rem;
  }

  .kunde-ap-col-act {
    justify-content: flex-start;
    margin-top: 0.25rem;
  }
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  margin-bottom: 1rem;
}

.teilnehmer-csv-hint {
  margin: -0.35rem 0 1.1rem;
  max-width: 56rem;
  font-size: 0.84rem;
  line-height: 1.55;
}

.search-wrap {
  flex: 1;
  min-width: 200px;
}

.search-wrap input {
  width: 100%;
  padding: 0.55rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font: inherit;
}

.filter-wrap select {
  padding: 0.55rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font: inherit;
  background: var(--surface);
  min-width: 160px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.55rem 1rem;
  border: none;
  border-radius: var(--radius);
  font: inherit;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
}

.btn-primary:hover {
  background: var(--accent-hover);
}

.btn-secondary {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  background: var(--bg);
}

.btn-danger {
  background: var(--danger-bg);
  color: var(--danger);
  border: 1px solid var(--danger-border);
}

.btn-danger:hover {
  background: #e2e8f0;
}

.btn-ghost {
  background: transparent;
  color: var(--muted);
}

.btn-ghost:hover {
  color: var(--text);
  background: var(--bg);
}

.table-card {
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}

th,
td {
  padding: 0.65rem 0.85rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

th {
  font-weight: 600;
  color: var(--muted);
  background: var(--subtle);
  white-space: nowrap;
}

tbody tr:hover {
  background: var(--subtle);
}

tbody tr:last-child td {
  border-bottom: none;
}

.badge {
  display: inline-block;
  padding: 0.2rem 0.5rem;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 500;
}

.badge-aktiv {
  background: var(--success-bg);
  color: var(--success-text);
}

.badge-pausiert {
  background: #fffbeb;
  color: #b45309;
}

.badge-beendet {
  background: var(--info-bg);
  color: var(--info-text);
}

.badge-abgeschlossen {
  background: var(--info-bg);
  color: var(--info-text);
}

.badge-abgebrochen {
  background: var(--danger-bg);
  color: var(--danger);
}

.badge-massnahme-planung {
  background: #f1f5f9;
  color: #475569;
}

.badge-massnahme-aktiv {
  background: var(--success-bg);
  color: var(--success-text);
}

.badge-massnahme-abgeschlossen {
  background: var(--info-bg);
  color: var(--info-text);
}

.actions-cell {
  white-space: nowrap;
}

.actions-cell .btn {
  padding: 0.35rem 0.6rem;
  font-size: 0.85rem;
}

.empty-state {
  padding: 2.5rem 1.5rem;
  text-align: center;
  color: var(--muted);
}

.empty-state strong {
  display: block;
  color: var(--text);
  margin-bottom: 0.35rem;
}

.empty-hint {
  display: block;
}

/* Modal */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 2rem 1rem;
  z-index: 100;
  overflow-y: auto;
}

.modal-backdrop[hidden] {
  display: none;
}

.modal {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: 0 24px 48px rgba(15, 23, 42, 0.14);
  width: 100%;
  max-width: 560px;
  margin: auto;
}

.modal--wide {
  max-width: 720px;
}

.anwesenheit-legend {
  font-size: 0.85rem;
  color: var(--muted);
  margin: 0 0 0.85rem;
  line-height: 1.45;
}

.anwesenheit-legend strong {
  color: var(--text);
  font-weight: 600;
}

.anwesenheit-add-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 0.75rem;
  align-items: flex-end;
  margin-bottom: 1rem;
}

.anwesenheit-add-label {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--muted);
}

.anwesenheit-date-input {
  width: auto;
  min-width: 10rem;
}

.anwesenheit-status-dd-mount {
  width: auto;
  min-width: 12rem;
  max-width: 18rem;
}

.anwesenheit-table-wrap .table-wrap {
  max-height: min(50vh, 22rem);
  overflow-y: auto;
}

.modal--wide .anwesenheit-status-mount .single-select,
.modal--wide .anwesenheit-kurs-status-mount .single-select {
  width: 100%;
  max-width: 18rem;
}

.btn-anw-delete {
  padding: 0.35rem 0.6rem;
  font-size: 0.85rem;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
}

.modal-header h2 {
  margin: 0;
  font-size: 1.1rem;
}

.modal-body {
  padding: 1.25rem;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.85rem 1rem;
}

@media (max-width: 520px) {
  .form-grid {
    grid-template-columns: 1fr;
  }
}

.form-grid .full {
  grid-column: 1 / -1;
}

.ba-fehl-grid {
  align-items: end;
}

.ba-fehl-actions {
  display: flex;
  align-items: flex-end;
}

.ba-fehl-actions .btn {
  width: 100%;
}

.avgs-abschluss-wrap textarea {
  min-height: 4.5rem;
}

.avgs-abschluss-actions {
  margin-top: 0.75rem;
}

label {
  display: block;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--muted);
  margin-bottom: 0.25rem;
}

input,
select,
textarea {
  width: 100%;
  padding: 0.5rem 0.65rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  font: inherit;
}

textarea {
  min-height: 72px;
  resize: vertical;
}

.modal-footer {
  display: flex;
  gap: 0.5rem;
  justify-content: flex-end;
  padding: 1rem 1.25rem;
  border-top: 1px solid var(--border);
  background: var(--subtle);
}

.meta-bar {
  font-size: 0.85rem;
  color: var(--muted);
  margin-top: 0.75rem;
}

/* Anwesenheitsliste Gesamt (Vorlage PDF) */
.anwesenheit-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  margin-bottom: 1rem;
}

.anwesenheit-toolbar .filter-wrap input[type="date"] {
  width: auto;
  min-width: 10rem;
}

.anw-toolbar-kurs-mount {
  min-width: 14rem;
  max-width: min(100%, 32rem);
}

.anw-kurs-chosen {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
  min-height: 2.5rem;
  padding: 0.15rem 0;
}

.anw-kurs-chosen-label {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text, #0f172a);
  max-width: min(100%, 28rem);
}

.anw-kurs-chosen-btn {
  flex-shrink: 0;
  padding: 0.35rem 0.65rem;
  font-size: 0.85rem;
}

/* Mehrfach-Dropdown (wiederverwendbar) */
.multi-select {
  position: relative;
  width: 100%;
  font-size: 0.9rem;
}

.multi-select--disabled {
  opacity: 0.55;
  pointer-events: none;
}

.multi-select__trigger {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem;
  width: 100%;
  min-height: 2.5rem;
  padding: 0.4rem 0.6rem;
  text-align: left;
  line-height: 1.35;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
  color: var(--text, #0f172a);
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.multi-select__trigger:hover:not(:disabled) {
  border-color: #94a3b8;
}

.multi-select__trigger:focus {
  outline: none;
  border-color: var(--accent, #2563eb);
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.2);
}

.multi-select--open .multi-select__trigger {
  border-color: #94a3b8;
}

.multi-select__summary {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
}

.multi-select__empty {
  color: var(--muted);
  font-size: 0.88rem;
}

.multi-select__tag {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  max-width: 100%;
  padding: 0.12rem 0.35rem;
  font-size: 0.8rem;
  line-height: 1.2;
  background: #e2e8f0;
  color: #1e293b;
  border-radius: 4px;
}

.multi-select__tag-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 10rem;
}

.multi-select__tag-remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.1rem;
  height: 1.1rem;
  padding: 0;
  margin: 0;
  border: none;
  border-radius: 2px;
  background: transparent;
  color: #64748b;
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
}

.multi-select__tag-remove:hover {
  background: #cbd5e1;
  color: #0f172a;
}

.multi-select__more {
  font-size: 0.8rem;
  color: var(--muted);
}

.multi-select__chevron {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  color: var(--muted);
  transition: transform 0.15s;
}

.multi-select--open .multi-select__chevron {
  transform: rotate(180deg);
}

.multi-select__panel {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 4px);
  z-index: 50;
  display: flex;
  flex-direction: column;
  max-height: min(20rem, 70vh);
  padding: 0.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow, 0 8px 24px rgba(15, 23, 42, 0.12));
}

.multi-select__toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 0.75rem;
  margin-bottom: 0.4rem;
  padding-bottom: 0.35rem;
  border-bottom: 1px solid #e2e8f0;
}

.multi-select__linkbtn {
  padding: 0;
  border: none;
  background: none;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--accent, #2563eb);
  text-decoration: underline;
  cursor: pointer;
}

.multi-select__linkbtn:hover {
  color: #1d4ed8;
}

.multi-select__search {
  width: 100%;
  margin-bottom: 0.4rem;
  padding: 0.4rem 0.5rem;
  font-size: 0.88rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.multi-select__search:focus {
  outline: none;
  border-color: var(--accent, #2563eb);
}

.multi-select__list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  margin: 0 -0.25rem;
  padding: 0 0.25rem;
}

.multi-select__row {
  display: flex;
  align-items: flex-start;
  gap: 0.45rem;
  padding: 0.35rem 0.25rem;
  border-radius: 4px;
  cursor: pointer;
}

.multi-select__row:hover {
  background: #f1f5f9;
}

.multi-select__row input {
  margin-top: 0.15rem;
  flex-shrink: 0;
}

.multi-select__row-label {
  flex: 1;
  line-height: 1.35;
}

.multi-select__noresults {
  padding: 0.75rem 0.25rem;
  font-size: 0.88rem;
  color: var(--muted);
  text-align: center;
}

/* Einzelauswahl-Dropdown */
.single-select {
  position: relative;
  width: 100%;
  font-size: 0.9rem;
}

.single-select--disabled {
  opacity: 0.55;
  pointer-events: none;
}

.single-select__trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  width: 100%;
  min-height: 2.5rem;
  padding: 0.4rem 0.6rem;
  text-align: left;
  line-height: 1.35;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
  color: var(--text, #0f172a);
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.single-select__trigger:hover:not(:disabled) {
  border-color: #94a3b8;
}

.single-select__trigger:focus {
  outline: none;
  border-color: var(--accent, #2563eb);
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.2);
}

.single-select--open .single-select__trigger {
  border-color: #94a3b8;
}

.single-select__summary {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.single-select__summary--placeholder {
  color: var(--muted);
  font-size: 0.88rem;
}

.single-select__chevron {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  color: var(--muted);
  transition: transform 0.15s;
}

.single-select--open .single-select__chevron {
  transform: rotate(180deg);
}

.single-select__panel {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 4px);
  z-index: 50;
  display: flex;
  flex-direction: column;
  max-height: min(18rem, 60vh);
  padding: 0.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow, 0 8px 24px rgba(15, 23, 42, 0.12));
}

.modal .single-select__panel,
.modal .multi-select__panel {
  z-index: 200;
}

.single-select__search {
  width: 100%;
  margin-bottom: 0.4rem;
  padding: 0.4rem 0.5rem;
  font-size: 0.88rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.single-select__search:focus {
  outline: none;
  border-color: var(--accent, #2563eb);
}

.single-select__list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  margin: 0 -0.25rem;
  padding: 0 0.25rem;
}

.single-select__option {
  display: block;
  width: 100%;
  padding: 0.4rem 0.45rem;
  margin: 0.1rem 0;
  border: none;
  border-radius: 4px;
  background: transparent;
  font: inherit;
  font-size: 0.88rem;
  text-align: left;
  color: var(--text, #0f172a);
  cursor: pointer;
}

.single-select__option:hover {
  background: #f1f5f9;
}

.single-select__option.is-selected {
  background: #e0e7ff;
  font-weight: 600;
}

.single-select__noresults {
  padding: 0.75rem 0.25rem;
  font-size: 0.88rem;
  color: var(--muted);
  text-align: center;
}

/* Schnellerfassung Anwesenheit (Kurs + Tag) */
.anw-fast-panel {
  margin-bottom: 1.25rem;
}

.anw-fast-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 1rem 1.25rem;
  margin-bottom: 1rem;
}

.anw-fast-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-width: 9.5rem;
}

.anw-fast-field--grow {
  flex: 1 1 14rem;
  min-width: 12rem;
}

.anw-fast-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.anw-fast-input,
.anw-fast-select {
  font: inherit;
  padding: 0.45rem 0.6rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
}

.anw-fast-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  margin-left: auto;
  align-items: center;
  font-size: 0.92rem;
}

.anw-fast-summary__item strong {
  font-variant-numeric: tabular-nums;
}

.anw-fast-summary__item--ok {
  color: #166534;
}

.anw-fast-summary__item--bad {
  color: #991b1b;
}

.anw-fast-table-wrap {
  margin: 0;
}

.anw-fast-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}

.anw-fast-table th,
.anw-fast-table td {
  padding: 0.55rem 0.65rem;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: middle;
}

.anw-fast-table th {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  background: var(--surface-2, #f8fafc);
}

.anw-fast-table tbody tr:hover {
  background: rgba(99, 102, 241, 0.04);
}

.anw-fast-status {
  min-width: 9.5rem;
  justify-content: center;
  text-align: center;
  font-weight: 600;
  font-size: 0.86rem;
  padding: 0.4rem 0.65rem;
  border-radius: var(--radius);
  border-width: 2px;
  cursor: pointer;
  transition: transform 0.08s ease, box-shadow 0.12s ease;
}

.anw-fast-status:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm, 0 1px 3px rgba(0, 0, 0, 0.08));
}

.anw-fast-status:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.anw-fast-status--a {
  background: #dcfce7;
  border-color: #22c55e;
  color: #14532d;
}

.anw-fast-status--abs {
  background: #fee2e2;
  border-color: #f87171;
  color: #7f1d1d;
}

.anw-fast-status--k {
  background: #fef9c3;
  border-color: #eab308;
  color: #713f12;
}

.anw-fast-status--empty {
  background: #f1f5f9;
  border-color: #cbd5e1;
  color: #64748b;
}

.anw-print-details {
  margin-top: 1.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.65rem 1rem 1rem;
  background: var(--surface);
}

.anw-print-details__summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--text);
  padding: 0.35rem 0;
}

.anw-print-details__summary::-webkit-details-marker {
  color: var(--muted);
}

.anw-print-document {
  margin-top: 0.5rem;
}

.anw-print-placeholder {
  margin: 0;
  padding: 1rem;
  color: var(--muted);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
}

.anw-doc {
  background: #fff;
  color: #111;
  padding: 1rem 1.25rem 1.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.anw-doc-brand {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 0.5rem;
}

.anw-doc-title {
  margin: 0 0 0.75rem;
  font-size: 1.25rem;
  font-weight: 700;
}

.anw-doc-meta {
  margin: 0.15rem 0;
  font-size: 0.9rem;
}

.anw-doc-listtitle {
  margin: 0.85rem 0 0.5rem;
  font-weight: 600;
  font-size: 0.95rem;
}

.anw-doc-table-wrap {
  overflow-x: auto;
  margin: 0.5rem 0 1rem;
  -webkit-overflow-scrolling: touch;
}

.anw-doc-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.72rem;
  min-width: 480px;
}

.anw-doc-table th,
.anw-doc-table td {
  border: 1px solid #cbd5e1;
  padding: 0.25rem 0.35rem;
  text-align: center;
  vertical-align: middle;
}

.anw-doc-table thead th {
  background: #f1f5f9;
  font-weight: 600;
  color: #334155;
}

.anw-doc-col-name,
.anw-doc-name {
  text-align: left !important;
  min-width: 8rem;
}

.anw-doc-col-nr,
.anw-doc-nr {
  width: 2rem;
}

.anw-doc-col-bg,
.anw-doc-bg {
  min-width: 5.5rem;
  text-align: left !important;
  font-size: 0.68rem;
}

.anw-doc-th-day {
  min-width: 2.1rem;
  line-height: 1.2;
  padding: 0.2rem !important;
}

.anw-doc-wd {
  display: block;
  font-size: 0.65rem;
  color: #64748b;
}

.anw-doc-dm {
  display: block;
  font-size: 0.68rem;
}

.anw-doc-cell {
  font-weight: 600;
}

.anw-doc-cell--a {
  background: #dcfce7 !important;
  color: #166534 !important;
}

.anw-doc-cell--abs {
  background: #fee2e2 !important;
  color: #991b1b !important;
}

.anw-doc-empty {
  text-align: center !important;
  color: var(--muted);
  padding: 1rem !important;
}

.anw-doc-legend {
  font-size: 0.8rem;
  color: #64748b;
  margin: 0.5rem 0 1rem;
}

.anw-doc-footer {
  font-size: 0.75rem;
  color: #64748b;
  line-height: 1.45;
  border-top: 1px solid #e2e8f0;
  padding-top: 0.75rem;
}

.anw-doc-footer p {
  margin: 0.25rem 0;
}

@media print {
  @page {
    size: A4 landscape;
    margin: 10mm;
  }

  body {
    background: #fff !important;
  }

  .app-header,
  .sidebar,
  .topbar,
  .dash-nav,
  .no-print-anw,
  .anwesenheit-toolbar,
  .meta-bar {
    display: none !important;
  }

  main.page-content {
    padding: 0 !important;
    max-width: none !important;
    margin: 0 !important;
  }

  .app-shell__main {
    margin-left: 0 !important;
  }

  #view-anwesenheiten {
    display: block !important;
  }

  .anw-print-document {
    margin: 0;
  }

  .anw-doc {
    border: none;
    box-shadow: none;
    padding: 0;
  }

  .anw-doc-table th,
  .anw-doc-table td {
    border: 1px solid #000;
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }

  .anw-doc-table th {
    background: #f1f5f9 !important;
  }

  .anw-doc-cell--a {
    background: #bbf7d0 !important;
    color: #14532d !important;
  }

  .anw-doc-cell--abs {
    background: #fecaca !important;
    color: #7f1d1d !important;
  }
}
