/*
 * LOGIN Plattform: Gestaltung nach dem Design-Guide der LOGIN Akademie (Version 1.0).
 * Navy und Blau tragen die Fläche, Grün ist allein Handlungsfarbe (eine Hauptaktion je
 * Bereich). Montserrat als einzige Schrift, selbst gehostet. Verläufe und das Linienraster
 * nur auf dunklen Flächen (Kopfleiste, Anmeldung); helle Bereiche bleiben flach.
 */

@font-face {
  font-family: "Montserrat Variable";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url("../fonts/montserrat-latin-wght-normal.311d352d9323.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304,
    U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Montserrat Variable";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url("../fonts/montserrat-latin-ext-wght-normal.d16dfe26bcd7.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308,
    U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113,
    U+2C60-2C7F, U+A720-A7FF;
}

:root {
  /* Primärpalette */
  --navy: #013564;
  --blue: #004c9b;
  --green: #0b9a30;
  --green-700: #0a8729;
  /* Neutrals, kühl gestimmt */
  --foreground: #0f1f33;
  --body: #41546b;
  --muted: #5b6b80;
  --meta: #6b7b91;
  --line: #e5ebf3;
  --border: #e8edf4;
  --surface: #f4f6fa;
  --surface-2: #f8fafd;
  --white: #ffffff;
  /* Tints */
  --blue-50: #e8f1fa;
  --blue-100: #c9dcf0;
  --green-50: #e9f7ed;
  /* Statusfarben */
  --ok-fg: #0b7c28;
  --ok-bg: #edf9f1;
  --ok-line: #cfeed8;
  --warn-fg: #96580a;
  --warn-bg: #fdf6e9;
  --warn-line: #f2e2c0;
  --warn-bar: #f39200;
  --error-fg: #c0392b;
  --error-bg: #fbeae8;
  --error-line: #f2cfcb;
  --info-fg: var(--blue);
  --info-bg: #f1f6fc;
  --info-line: #d5e2f2;
  /* Übergangsfall LOGIN DV: Graublau, gefüllt, damit es sich von allen hellen Kennzeichen abhebt */
  --dv: #4a6584;
  /* Form */
  --font: "Montserrat Variable", system-ui, -apple-system, "Segoe UI", sans-serif;
  --radius-sm: 8px;
  /* Abstand zwischen Karten und Blöcken einer Seite */
  --space-section: 20px;
  --radius: 14px;
  --radius-lg: 22px;
  --pill: 999px;
  --shadow-sm: 0 1px 2px rgba(15, 31, 51, .05);
  --shadow: 0 8px 24px -12px rgba(1, 53, 100, .12);
  --shadow-lg: 0 24px 48px -24px rgba(1, 53, 100, .18);
  --dark-surface:
    repeating-linear-gradient(0deg, rgba(255, 255, 255, .045) 0 1px, transparent 1px 40px),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, .045) 0 1px, transparent 1px 40px),
    radial-gradient(120% 160% at 100% 0%, rgba(11, 154, 48, .22), transparent 55%),
    linear-gradient(150deg, #012c5c 0%, #013f80 60%, #004c9b 100%);
  --topbar-height: 64px;
  /* Seitenleiste der Verwaltung: leicht getönt, Hover und Auswahl eine Stufe dunkler */
  --sidebar: #f4f6fa;
  --sidebar-hover: #e9eef5;
  --sidebar-active: #dfe7f2;
  --label-width: 220px;
}

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

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: .875rem;
  font-weight: 450;
  line-height: 1.55;
  color: var(--body);
  background: var(--surface);
  font-variant-numeric: tabular-nums;
}

h1,
h2,
h3 {
  margin: 0;
  color: var(--foreground);
  line-height: 1.25;
  letter-spacing: -.01em;
  text-wrap: balance;
}

h1 {
  font-size: 1.5rem;
  font-weight: 700;
}

h2 {
  font-size: 1rem;
  font-weight: 700;
}

h3 {
  font-size: .875rem;
  font-weight: 700;
}

p {
  margin: 0 0 8px;
}

strong {
  font-weight: 700;
  color: var(--foreground);
}

a {
  color: var(--blue);
  font-weight: 600;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

a:hover {
  color: var(--navy);
}

:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.meta {
  font-size: .8125rem;
  color: var(--meta);
}

/* Kennungen und Nummern: dieselbe Schrift, gleich breite Ziffern */
.mono {
  font-variant-numeric: tabular-nums;
  font-size: .8125rem;
  font-weight: 600;
  letter-spacing: .01em;
}

.nowrap {
  white-space: nowrap;
}

/* Foto der Dozierenden: quadratischer Ausschnitt */
.portrait {
  display: block;
  width: 120px;
  height: 120px;
  margin-bottom: 14px;
  object-fit: cover;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--blue-50);
}

/* Teilnahme anlegen: Bausteine als Liste zum Ankreuzen */
.module-choice ul {
  margin: 4px 0 0;
  padding: 0;
  list-style: none;
}

.module-choice li + li {
  margin-top: 6px;
}

.module-choice label {
  display: inline-flex;
  align-items: flex-start;
  gap: 8px;
  color: var(--foreground);
}

.warn-text {
  color: var(--warn-fg);
}

/* Fehler eines Imports je Zeile */
.error-list {
  margin: 8px 0 0;
  padding-left: 20px;
  color: var(--error-fg);
}

.error-list li + li {
  margin-top: 4px;
}

/* Mehrzeilige Notizen mit ihren Zeilenumbrüchen anzeigen */
.pre-line {
  white-space: pre-line;
  overflow-wrap: anywhere;
}

/* Logo: Wortmarke, Farbe aus dem Umfeld (Design-Guide, Abschnitt 02) */
.logo {
  display: block;
  width: auto;
  height: 34px;
  flex: none;
}

/* Kopfleiste des Teilnehmerbereichs: dunkle Fläche mit Navy-Verlauf und Linienraster */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: var(--topbar-height);
  padding: 0 16px;
  color: var(--white);
  background: var(--dark-surface);
}

.topbar-brand {
  display: flex;
  align-items: center;
  gap: 24px;
  color: var(--white);
  text-decoration: none;
}

.topbar-brand:hover {
  color: var(--white);
}

.topbar-brand span {
  font-size: .8125rem;
  font-weight: 600;
  color: #bfd6ef;
  white-space: nowrap;
}

.topbar-user {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: .8125rem;
  font-weight: 500;
  color: #bfd6ef;
}

.topbar .link-button {
  padding: 6px 14px;
  border: 1.5px solid rgba(255, 255, 255, .55);
  border-radius: var(--pill);
  background: rgba(255, 255, 255, .1);
  font-weight: 700;
  color: var(--white);
  text-decoration: none;
}

.topbar .link-button:hover {
  background: rgba(255, 255, 255, .2);
}

.link-button {
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  font-weight: 600;
  color: var(--blue);
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

/* Verwaltung: Aufbau wie im Shopware-Admin. Seitenleiste auf getönter Fläche mit Logo,
   Navigation und Profil; daneben die weiße Arbeitsfläche mit Kopfzeile. */
.app {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-content: start;
  min-height: 100vh;
}

.sidebar {
  display: flex;
  flex-direction: column;
  padding: 12px 12px 0;
  border-bottom: 1px solid var(--border);
  background: var(--sidebar);
}

/* Logo bündig mit den Icons der Navigation (Abstand wie .nav-item) */
.sidebar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 0 12px 12px;
}

.sidebar-brand {
  display: flex;
  color: var(--navy);
  text-decoration: none;
}

.sidebar-brand .logo {
  height: 40px;
}

.sidebar-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-bottom: 12px;
}

.nav-toggle {
  display: none;
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.nav-list,
.nav-sub {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

/* Am Smartphone klappt die Navigation hinter „Menü“; ohne JavaScript bleibt sie offen */
.js .nav-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 6px 16px;
  border: 1.5px solid var(--blue-100);
  border-radius: var(--pill);
  background: var(--white);
  font: inherit;
  font-weight: 700;
  color: var(--blue);
  cursor: pointer;
}

.js .nav-toggle::before {
  content: "";
  width: 14px;
  height: 10px;
  border-top: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  background: linear-gradient(currentColor, currentColor) center / 100% 2px no-repeat;
}

.js .sidebar-body:not(.is-open) {
  display: none;
}

/* Bereiche mit Icon, Unterpunkte klappen darunter auf (Aufbau wie im Shopware-Admin) */
.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 40px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  color: var(--foreground);
  text-decoration: none;
  list-style: none;
  cursor: pointer;
}

.nav-item::-webkit-details-marker {
  display: none;
}

.nav-item .icon {
  flex: none;
  width: 18px;
  height: 18px;
  color: var(--meta);
}

/* Jeder Bereich mit eigener Icon-Farbe wie im Shopware-Admin; die Schrift bleibt dunkel */
.nav-item .icon-home { color: #2563c9; }
.nav-item .icon-inbox { color: #c77700; }
.nav-item .icon-users { color: #0b8a7a; }
.nav-item .icon-calendar { color: #7c4ddb; }
.nav-item .icon-clipboard { color: #0b9a30; }
.nav-item .icon-euro { color: #d0581b; }
.nav-item .icon-book { color: #c73a78; }
.nav-item .icon-building { color: #0a7fb8; }
.nav-item .icon-landmark { color: #a16207; }
.nav-item .icon-presentation { color: #4f55d6; }
.nav-item .icon-shield,
.nav-item .icon-settings { color: #5b6b80; }

.nav-item:hover {
  background: var(--sidebar-hover);
  color: var(--navy);
}

.nav-item.is-current,
.nav-item[aria-current="page"] {
  color: var(--navy);
}

.nav-item[aria-current="page"] {
  background: var(--sidebar-active);
}

.nav-item .nav-chevron {
  width: 16px;
  height: 16px;
  margin-left: auto;
  transition: transform .15s ease;
}

.nav-group[open] > .nav-item .nav-chevron {
  transform: rotate(180deg);
}

/* Unterpunkte beginnen auf Höhe der Beschriftung darüber */
.nav-sub {
  margin: 2px 0 8px;
  padding-left: 30px;
}

.nav-sub a {
  display: block;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: .8125rem;
  font-weight: 500;
  color: var(--muted);
  text-decoration: none;
}

.nav-sub a:hover {
  background: var(--sidebar-hover);
  color: var(--navy);
}

.nav-sub a[aria-current="page"] {
  background: var(--white);
  box-shadow: var(--shadow-sm);
  font-weight: 700;
  color: var(--blue);
}

/* Selten gebrauchte Bereiche abgesetzt, auf dem Desktop am unteren Rand */
.nav-footer {
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

/* Profil unten links: Initialen, Name und Rolle; Menü öffnet nach oben */
.profile {
  position: relative;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.profile-button {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px;
  border-radius: var(--radius-sm);
  list-style: none;
  cursor: pointer;
}

.profile-button::-webkit-details-marker {
  display: none;
}

.profile-button:hover,
.profile[open] .profile-button {
  background: var(--sidebar-hover);
}

.avatar {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--navy);
  font-size: .8125rem;
  font-weight: 700;
  color: var(--white);
}

.avatar img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}

.avatar-xl {
  width: 112px;
  height: 112px;
  font-size: 2.25rem;
}

/* Profilseite: Bild mit Kamera-Knopf und Menü, daneben der Hinweis */
.photo-editor {
  display: flex;
  align-items: center;
  gap: 20px;
  margin: 0 0 24px;
}

.photo-avatar {
  position: relative;
  flex: none;
}

.photo-button {
  position: absolute;
  right: -2px;
  bottom: -2px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border: 3px solid var(--white);
  border-radius: 50%;
  background: var(--blue);
  color: var(--white);
  list-style: none;
  cursor: pointer;
  transition: background-color .18s ease;
}

.photo-button::-webkit-details-marker {
  display: none;
}

.photo-button:hover,
.photo-menu[open] .photo-button {
  background: var(--navy);
}

.photo-button .icon {
  width: 16px;
  height: 16px;
}

.photo-menu-list {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  z-index: 20;
  display: flex;
  flex-direction: column;
  gap: 2px;
  width: max-content;
  min-width: 224px;
  padding: 6px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--white);
  box-shadow: var(--shadow-lg);
}

.photo-menu-list > [hidden] {
  display: none;
}

.photo-nojs {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 6px 10px 8px;
}

.photo-nojs label {
  font-weight: 600;
  color: var(--foreground);
}

.photo-nojs input {
  max-width: 220px;
}

.photo-text {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  max-width: 420px;
}

.photo-text strong {
  color: var(--foreground);
}

.photo-text .meta {
  margin: 0;
}

/* Dialog zum Platzieren: Bild unter einem Kreis, außerhalb abgedunkelt */
.photo-dialog {
  width: min(400px, calc(100vw - 32px));
  max-height: calc(100dvh - 32px);
  padding: 24px;
  border: 0;
  border-radius: var(--radius-lg);
  background: var(--white);
  box-shadow: var(--shadow-lg);
  color: var(--body);
}

.photo-dialog::backdrop {
  background: rgba(1, 53, 100, .45);
}

.photo-dialog h2 {
  font-size: 1.125rem;
}

.photo-dialog .meta {
  margin: 6px 0 16px;
}

.photo-stage {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--navy);
  cursor: grab;
  touch-action: none;
  user-select: none;
}

.photo-stage.is-dragging {
  cursor: grabbing;
}

.photo-stage img {
  position: absolute;
  top: 0;
  left: 0;
  max-width: none;
  pointer-events: none;
}

.photo-ring {
  position: absolute;
  inset: 8%;
  border-radius: 50%;
  box-shadow: 0 0 0 100vmax rgba(1, 53, 100, .62);
  outline: 2px solid rgba(255, 255, 255, .9);
  pointer-events: none;
}

.photo-zoom {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 16px 0 20px;
}

.photo-zoom input {
  flex: 1;
  min-width: 0;
  accent-color: var(--blue);
}

.photo-zoom button {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 1.5px solid var(--blue-100);
  border-radius: 50%;
  background: var(--white);
  color: var(--blue);
  cursor: pointer;
}

.photo-zoom button:hover {
  background: var(--blue-50);
}

.photo-zoom .icon {
  width: 16px;
  height: 16px;
}

.photo-dialog .actions {
  justify-content: flex-end;
}

.profile-note {
  margin: 12px 0 16px;
}

/* „Zwei-Faktor-Authentifizierung verwalten“ bricht am Smartphone um, statt überzustehen */
.profile-actions .btn {
  white-space: normal;
  text-align: center;
}

.profile-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.3;
}

.profile-text strong {
  overflow: hidden;
  font-size: .875rem;
  color: var(--foreground);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-text span {
  font-size: .75rem;
  color: var(--meta);
}

.profile-button .profile-chevron {
  flex: none;
  width: 16px;
  height: 16px;
  margin-left: auto;
  color: var(--meta);
}

.profile-menu {
  position: absolute;
  right: 0;
  bottom: calc(100% + 6px);
  left: 0;
  z-index: 20;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 6px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--white);
  box-shadow: var(--shadow-lg);
}

.profile-menu a,
.profile-menu button,
.photo-menu-list > button,
.photo-nojs button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 10px;
  border: 0;
  border-radius: var(--radius-sm);
  background: none;
  font: inherit;
  font-weight: 600;
  color: var(--foreground);
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}

.profile-menu a:hover,
.profile-menu button:hover,
.photo-menu-list > button:hover,
.photo-nojs button:hover {
  background: var(--surface);
  color: var(--navy);
}

.photo-menu-list > .is-danger,
.photo-menu-list > .is-danger:hover,
.photo-menu-list > .is-danger .icon {
  color: var(--error-fg);
}

.photo-menu-list > .is-danger:hover {
  background: var(--error-bg);
}

.profile-menu .icon,
.photo-menu-list .icon {
  flex: none;
  width: 16px;
  height: 16px;
  color: var(--meta);
}

.profile-menu form {
  margin-top: 4px;
  padding-top: 4px;
  border-top: 1px solid var(--line);
}

/* Arbeitsfläche mit Kopfzeile: Suche nach Teilnehmenden, rechts die offenen Aufgaben */
.workspace {
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: var(--white);
}

.workspace-head {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 64px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--white);
}

.global-search {
  position: relative;
  flex: 1;
  max-width: 560px;
}

.global-search .icon {
  position: absolute;
  top: 50%;
  left: 12px;
  width: 18px;
  height: 18px;
  color: var(--meta);
  transform: translateY(-50%);
  pointer-events: none;
}

.global-search input {
  min-height: 40px;
  padding-left: 40px;
  background: var(--surface-2);
}

.workspace-tools {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.tool-button {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--pill);
  color: var(--foreground);
}

.tool-button:hover,
.tool-button[aria-current="page"] {
  background: var(--surface);
  color: var(--navy);
}

.tool-button .icon {
  width: 20px;
  height: 20px;
}

.tool-badge {
  position: absolute;
  top: 2px;
  right: 0;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border: 2px solid var(--white);
  border-radius: var(--pill);
  background: var(--error-fg);
  font-size: .6875rem;
  font-weight: 700;
  line-height: 16px;
  color: var(--white);
  text-align: center;
}

.main {
  min-width: 0;
  padding: 20px 16px 56px;
  display: flex;
  flex-direction: column;
  gap: var(--space-section);
}

/* Wrapper innerhalb der Seite halten denselben Kartenabstand wie .main */
.stack,
.akte,
.akte-body {
  display: flex;
  flex-direction: column;
  gap: var(--space-section);
  min-width: 0;
}

/* Pfad */
.breadcrumbs ol {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 6px;
  font-size: .8125rem;
  color: var(--meta);
}

.breadcrumbs a {
  font-weight: 500;
  color: var(--muted);
  text-decoration: none;
}

.breadcrumbs a:hover {
  color: var(--blue);
  text-decoration: underline;
}

.breadcrumbs li + li::before {
  content: "/";
  margin-right: 6px;
  color: var(--blue-100);
}

/* Seitenkopf mit Werkzeugleiste */
.page-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 20px;
  padding-bottom: 4px;
}

.page-title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 12px;
}

.record-key {
  padding: 3px 10px;
  border-radius: var(--pill);
  background: var(--blue-50);
  font-size: .75rem;
  font-weight: 700;
  color: var(--blue);
  font-variant-numeric: tabular-nums;
}

.toolbar,
.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

/* Die Werkzeugleiste wird nie breiter als der Seitenkopf; Auswahlfelder darin schrumpfen */
.toolbar {
  min-width: 0;
  max-width: 100%;
}

/* Kleine Formulare in Werkzeugleisten und Kastenköpfen: Auswahl und Button nebeneinander */
.toolbar form,
.panel-head form {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  max-width: 100%;
}

/* Lange Einträge (z. B. Maßnahmentitel) dürfen die Auswahl nicht über den Rand schieben */
.toolbar select,
.panel-head select {
  width: auto;
  min-width: 0;
  max-width: 100%;
}

/* Schaltflächen: Grün nur für die Hauptaktion, sonst Blau oder weiß mit blauem Rahmen */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 36px;
  padding: 6px 16px;
  border: 1.5px solid var(--blue-100);
  border-radius: var(--pill);
  background: var(--white);
  font-family: inherit;
  font-size: .8125rem;
  font-weight: 700;
  line-height: 1.2;
  color: var(--blue);
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: transform .18s ease, box-shadow .18s ease, background-color .18s ease;
}

.btn:hover {
  border-color: var(--blue-100);
  background: var(--blue-50);
  color: var(--navy);
}

.btn-primary {
  border-color: var(--green);
  background: var(--green);
  color: var(--white);
  box-shadow: 0 10px 24px -14px rgba(4, 36, 14, .5);
}

/* Markenzeichen des Primär-Buttons: leichte Neigung statt Farbwechsel */
.btn-primary:hover {
  border-color: var(--green);
  background: var(--green);
  color: var(--white);
  transform: rotate(-1.5deg);
  box-shadow: 0 12px 24px rgba(11, 154, 48, .34);
}

.btn-primary:active {
  transform: rotate(0);
  box-shadow: 0 4px 10px rgba(11, 154, 48, .28);
}

.btn-secondary {
  border-color: var(--blue);
  background: var(--blue);
  color: var(--white);
}

.btn-secondary:hover {
  border-color: var(--navy);
  background: var(--navy);
  color: var(--white);
}

.btn-tertiary {
  border-color: var(--blue-100);
}

.btn-danger {
  border-color: var(--error-line);
  color: var(--error-fg);
}

.btn-danger:hover {
  border-color: var(--error-line);
  background: var(--error-bg);
  color: var(--error-fg);
}

.btn-small {
  min-height: 28px;
  padding: 3px 12px;
  font-size: .75rem;
}

/* Kästen: weiße Karte auf grauer Fläche */
.panel,
.card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--white);
  box-shadow: var(--shadow-sm);
}

.panel-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 12px;
  min-height: 48px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--line);
}

.panel-body,
.card {
  padding: 16px 18px;
}

.panel-body > :last-child {
  margin-bottom: 0;
}

/* Zwischenüberschriften und Hinweise in Karten mit Luft zum Block davor */
.panel-body > h3 {
  margin: 20px 0 8px;
}

.panel-body > h3:first-child {
  margin-top: 0;
}

.panel-body > .msg {
  margin: 12px 0;
}

.panel-body > .msg:first-child {
  margin-top: 0;
}

.panel > .table-wrap {
  border: 0;
  border-radius: 0 0 var(--radius) var(--radius);
  box-shadow: none;
}

/* Zwei Spalten auf breiten Bildschirmen, z. B. auf dem Dashboard */
.columns {
  display: grid;
  gap: var(--space-section);
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
}

/* Kopfdaten als Raster aus Beschriftung und Wert; die Werte behalten ihre Mindestbreite
   (z. B. Status), lange Bezeichnungen brechen um */
.facts {
  display: grid;
  grid-template-columns: minmax(min(140px, 35%), max-content) minmax(min-content, 1fr);
  gap: 6px 20px;
  margin: 0;
}

.facts dt {
  font-weight: 500;
  color: var(--muted);
  hyphens: auto;
  overflow-wrap: break-word;
}

/* Lange E-Mail-Adressen und Kennungen dürfen am Smartphone umbrechen */
.facts dd {
  margin: 0;
  font-weight: 600;
  color: var(--foreground);
  overflow-wrap: anywhere;
}

/* Tabellen: nur Zeilenlinien, ruhiger Kopf */
/* position: relative hält unsichtbare Beschriftungen (.sr-only) in der scrollbaren Tabelle */
.table-wrap {
  position: relative;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--white);
  box-shadow: var(--shadow-sm);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: .8125rem;
}

th,
td {
  padding: 9px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

thead th {
  background: var(--surface-2);
  font-size: .75rem;
  font-weight: 700;
  color: var(--muted);
  white-space: nowrap;
}

tbody th {
  min-width: 12rem;
  font-weight: 600;
  color: var(--foreground);
  white-space: normal;
}

tbody tr:last-child > * {
  border-bottom: 0;
}

tbody tr:hover > td {
  background: var(--surface-2);
}

td.num,
th.num {
  text-align: right;
}

/* Belegnummern und Kennungen nicht umbrechen */
td.mono {
  white-space: nowrap;
}

td.empty {
  padding: 24px 12px;
  color: var(--meta);
  text-align: center;
}

/* Rauminventar: ein Abschnitt je Platz, der Platz steht einmal links */
.seat-table tbody + tbody > tr:first-child > * {
  border-top: 2px solid var(--border);
}

.seat-table tbody th {
  min-width: 0;
  white-space: nowrap;
}

/* Vergleich bisher/danach: Zeilenköpfe ohne Mindestbreite (Trennstellen stehen im Text), damit alle
   Spalten aufs Telefon passen */
.compare-table tbody th {
  min-width: 0;
}

.list-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.list-count {
  font-size: .8125rem;
  color: var(--muted);
}

/* Kennzahlen im Cockpit */
.figures {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(12rem, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.figure {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 16px 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--white);
  box-shadow: var(--shadow-sm);
}

.figure-value {
  font-size: 1.75rem;
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -.02em;
  color: var(--navy);
  font-variant-numeric: tabular-nums;
}

.figure-label {
  font-size: .8125rem;
  font-weight: 600;
  color: var(--muted);
}

.figure-warn {
  border-color: var(--warn-line);
  background: var(--warn-bg);
}

/* Formulare: Beschriftung links, Feld rechts */
input,
select,
textarea {
  width: 100%;
  min-height: 38px;
  padding: 7px 12px;
  border: 1.5px solid var(--blue-100);
  border-radius: 10px;
  background: var(--white);
  font-family: inherit;
  font-size: .875rem;
  font-weight: 500;
  color: var(--foreground);
  transition: border-color .15s ease, box-shadow .15s ease;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--blue);
  outline: none;
  box-shadow: 0 0 0 3px rgba(0, 76, 155, .15);
}

input::placeholder,
textarea::placeholder {
  color: var(--meta);
}

textarea {
  min-height: 80px;
}

input[type="checkbox"],
input[type="radio"] {
  justify-self: start;
  width: 16px;
  height: 16px;
  min-height: 0;
  margin: 10px 0 0;
  padding: 0;
  accent-color: var(--blue);
}

input[type="file"] {
  padding: 6px 8px;
}

.search input {
  width: min(100%, 360px);
}

.form,
form.card {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.form > div:not(.actions) {
  display: grid;
  grid-template-columns: var(--label-width) minmax(0, 1fr);
  column-gap: 20px;
  row-gap: 4px;
  align-items: start;
  max-width: 900px;
}

.form > div:not(.actions) > label {
  grid-column: 1;
  grid-row: 1 / span 3;
  padding-top: 9px;
  font-weight: 600;
  color: var(--foreground);
}

.form > div:not(.actions) > :not(label) {
  grid-column: 2;
}

.form > div:not(.actions) > .errorlist {
  order: 2;
}

.form > div:not(.actions) > .helptext {
  order: 3;
}

.form > div.required > label::after {
  content: " *";
  color: var(--error-fg);
}

.form > div.has-error input,
.form > div.has-error select,
.form > div.has-error textarea {
  border-color: var(--error-fg);
}

.form fieldset {
  margin: 0;
  padding: 0;
  border: 0;
}

.form legend {
  padding: 0;
  font-weight: 600;
  color: var(--foreground);
}

.helptext {
  font-size: .75rem;
  color: var(--meta);
}

.errorlist {
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: .8125rem;
  font-weight: 600;
  color: var(--error-fg);
}

/* Eingaben in Tabellenzellen, z. B. im Anwesenheitsbogen */
.cell-form {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 8px;
}

.cell-form select {
  width: auto;
}

.cell-form .minutes {
  display: none;
  align-items: center;
  gap: 6px;
  color: var(--muted);
}

.cell-form:has(option[value="partial"]:checked) .minutes {
  display: flex;
}

.cell-form .minutes input {
  width: 5rem;
}

/* Positionstabellen mit Eingaben, z. B. im Rechnungsentwurf */
.line-table td:first-child {
  width: 55%;
}

.line-table td.num input {
  text-align: right;
}

.form .actions {
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

/* Meldungen: Kasten mit Rahmen, Fläche und Farbbalken (Design-Guide, Abschnitt 13) */
.messages {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Hinweise: ganzer Rahmen und Fläche in der Statusfarbe, davor ein rundes Symbol */
.msg {
  --msg-accent: var(--muted);
  position: relative;
  margin: 0;
  padding: 10px 14px 10px 40px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-2);
  font-weight: 500;
  color: var(--foreground);
}

.msg::before {
  content: "i";
  position: absolute;
  top: 12px;
  left: 14px;
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--msg-accent);
  font-size: .6875rem;
  font-weight: 800;
  line-height: 1;
  color: var(--white);
}

.msg-success {
  --msg-accent: var(--green);
  border-color: var(--ok-line);
  background: var(--ok-bg);
}

.msg-success::before {
  content: "✓";
}

.msg-info {
  --msg-accent: var(--blue);
  border-color: var(--info-line);
  background: var(--info-bg);
}

.msg-warning {
  --msg-accent: var(--warn-bar);
  border-color: var(--warn-line);
  background: var(--warn-bg);
}

.msg-warning::before,
.msg-error::before {
  content: "!";
}

.msg-error {
  --msg-accent: var(--error-fg);
  border-color: var(--error-line);
  background: var(--error-bg);
}

/* Kennzeichen als Chips */
.chip,
.status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 10px;
  border: 1px solid var(--border);
  border-radius: var(--pill);
  background: var(--surface);
  font-size: .75rem;
  font-weight: 700;
  line-height: 1.6;
  color: var(--muted);
  white-space: nowrap;
}

.chip-ok,
.status-ok {
  border-color: var(--ok-line);
  background: var(--green-50);
  color: var(--ok-fg);
}

.chip-warn,
.status-warn {
  border-color: var(--warn-line);
  background: var(--warn-bg);
  color: var(--warn-fg);
}

.status-error {
  border-color: var(--error-line);
  background: var(--error-bg);
  color: var(--error-fg);
}

.status-info {
  border-color: var(--info-line);
  background: var(--blue-50);
  color: var(--blue);
}

.status-dv {
  border-color: var(--dv);
  background: var(--dv);
  color: var(--white);
}

.overdue td:first-child {
  box-shadow: inset 3px 0 0 var(--error-fg);
}

/* Reiter auf Detailseiten */
/* Eine Zeile; reicht der Platz nicht, scrollt die Reiterleiste seitlich statt umzubrechen
   (ohne sichtbare Scrollleiste). Die Grundlinie ist ein Schatten, weil overflow sonst den
   überlappenden Rand abschneidet. */
.tabs {
  display: flex;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
  overflow-x: auto;
  scrollbar-width: none;
  box-shadow: inset 0 -1px 0 var(--border);
}

.tabs::-webkit-scrollbar {
  display: none;
}

.tabs li {
  flex: none;
}

/* Kompakt, damit die neun Reiter der Teilnehmerakte bei 1440 px in eine Zeile passen */
.tabs a {
  display: block;
  padding: 10px 8px;
  border-bottom: 2px solid transparent;
  font-size: .8125rem;
  font-weight: 600;
  white-space: nowrap;
  color: var(--muted);
  text-decoration: none;
}

.tabs a:hover {
  color: var(--blue);
}

.tabs a[aria-current="page"] {
  border-bottom-color: var(--blue);
  font-weight: 700;
  color: var(--blue);
}

/* Listen innerhalb von Kästen */
.checklist,
.plain-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* Modulplan bearbeiten: Häkchen „aus dem Plan entfernen“ rechts im Kopf jeder Zeile */
.plan-remove {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
  font-size: .875rem;
  font-weight: 600;
  color: var(--error-fg);
  cursor: pointer;
}

.plan-row:has(.plan-remove input:checked) .panel-body {
  opacity: .45;
}

/* Ausnahme in der Startfreigabe: kleiner Aufklapper unter dem offenen Punkt */
.checklist .override {
  margin-top: 6px;
}

.checklist .override > summary,
.cell-action > summary {
  display: inline-block;
  font-size: .8125rem;
  font-weight: 700;
  color: var(--blue);
  cursor: pointer;
}

/* Modulplan: „Abrechnung eintragen“ als kleiner Aufklapper unter dem Stand */
.cell-action {
  margin-top: 4px;
}

.override-form {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
}

.override-form input[name="reason"] {
  flex: 1 1 18rem;
  min-width: 0;
}

.override-log {
  margin: 0;
  padding-left: 18px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: .875rem;
}

.history ol {
  margin: 0;
  padding-left: 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.pager {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: .8125rem;
}

/* Anmeldeseiten: weiße Karte auf dunkler Markenfläche */
.auth {
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 32px 16px;
  background: var(--dark-surface);
}

.auth-card {
  width: min(100%, 440px);
  border-radius: var(--radius-lg);
  background: var(--white);
  box-shadow: 0 32px 64px -28px rgba(0, 12, 30, .55);
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 32px 28px 28px;
}

/* Kopf, Überschrift und Hinweise mittig, Felder linksbündig */
.auth-head {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
  color: var(--navy);
  text-align: center;
}

.auth-head .logo {
  height: 48px;
}

.auth-head p {
  margin: 0;
  font-size: .8125rem;
  font-weight: 600;
  color: var(--muted);
}

.auth-card h1,
.auth-card > p {
  text-align: center;
}

.auth-card h1 {
  font-size: 1.25rem;
}

.auth-card > p {
  margin: 0;
}

.auth-card form p {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 0 0 12px;
}

.auth-card form p label {
  font-weight: 600;
  color: var(--foreground);
}

.auth-card form p:has(> input[type="checkbox"]) {
  flex-direction: row;
  align-items: center;
  gap: 8px;
}

.auth-card form p:has(> input[type="checkbox"]) input {
  margin: 0;
}

.auth-card form p:has(> input[type="checkbox"]) label {
  font-size: .8125rem;
  font-weight: 500;
  color: var(--muted);
}

/* „Angemeldet bleiben“ links, „Passwort vergessen?“ rechts; auf schmalen Bildschirmen bricht der Link um */
.auth-options {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 0 0 12px;
}

.auth-card .auth-options p {
  margin: 0;
}

.auth-options .helptext {
  margin-left: auto;
  font-size: .8125rem;
  line-height: 1.5;
}

/* Schwebende Beschriftung: liegt im leeren Feld, rutscht bei Fokus oder Inhalt auf den Rahmen */
.auth-card form p.floating {
  position: relative;
}

.auth-card form p.floating > input {
  min-height: 48px;
  padding: 12px 14px;
  font-size: 1rem;
}

.auth-card form p.floating > input::placeholder {
  color: transparent;
}

.auth-card form p.floating > label {
  position: absolute;
  top: 24px;
  left: 11px;
  max-width: calc(100% - 22px);
  padding: 0 4px;
  border-radius: 4px;
  background: var(--white);
  font-size: 1rem;
  font-weight: 500;
  line-height: 1.2;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  pointer-events: none;
  transform: translateY(-50%);
  transition: top .15s ease, font-size .15s ease, color .15s ease;
}

.auth-card form p.floating:has(> input:focus) > label,
.auth-card form p.floating:has(> input:not(:placeholder-shown)) > label {
  top: 0;
  font-size: .75rem;
  font-weight: 600;
}

/* Eigene Regel, damit Browser ohne :autofill die Regeln darüber nicht verwerfen */
.auth-card form p.floating:has(> input:autofill) > label {
  top: 0;
  font-size: .75rem;
  font-weight: 600;
}

.auth-card form p.floating:has(> input:focus) > label {
  color: var(--blue);
}

.auth-card .btn {
  width: 100%;
  min-height: 44px;
}

.auth-card .btn-primary {
  min-height: 48px;
  margin-top: 6px;
  font-size: 1rem;
}

.auth-card hr {
  width: 100%;
  margin: 4px 0;
  border: 0;
  border-top: 1px solid var(--line);
}

.auth-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 16px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  font-size: .8125rem;
}

/* Teilnehmerbereich: gleiche Sprache, größere Bedienelemente */
.portal {
  font-size: 1rem;
}

.portal .main {
  width: 100%;
  max-width: 680px;
  margin: 0 auto;
}

.portal .btn {
  min-height: 44px;
  padding: 8px 20px;
  font-size: .9375rem;
}

.portal input,
.portal select,
.portal textarea {
  min-height: 44px;
  font-size: 1rem;
}

.portal-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 10px 16px;
  background: var(--white);
  border-bottom: 1px solid var(--border);
}

.portal-nav a {
  padding: 8px 14px;
  border-radius: var(--pill);
  font-weight: 600;
  color: var(--foreground);
  text-decoration: none;
}

.portal-nav a:hover {
  background: var(--surface);
}

.portal-nav a[aria-current="page"] {
  background: var(--blue-50);
  font-weight: 700;
  color: var(--blue);
}

@media (min-width: 1024px) {
  .topbar {
    padding: 0 24px;
  }

  /* Seitenleiste immer offen und volle Höhe; sie scrollt für sich */
  .app {
    grid-template-columns: 264px minmax(0, 1fr);
  }

  .sidebar {
    position: sticky;
    top: 0;
    align-self: start;
    height: 100vh;
    overflow-y: auto;
    padding: 16px 12px 12px;
    border-bottom: 0;
  }

  .sidebar-head {
    padding: 8px 0 24px 12px;
  }

  .sidebar-body {
    flex: 1;
    padding-bottom: 0;
  }

  .js .sidebar-body:not(.is-open) {
    display: flex;
  }

  .js .nav-toggle {
    display: none;
  }

  .nav {
    flex: 1;
  }

  .nav-footer {
    margin-top: auto;
  }

  .workspace {
    min-height: calc(100vh - 16px);
    margin: 8px 8px 8px 0;
    border: 1px solid var(--border);
    border-radius: var(--radius);
  }

  /* Suche mittig wie im Shopware-Admin, Werkzeuge rechts */
  .workspace-head {
    position: sticky;
    top: 0;
    z-index: 10;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 640px) minmax(0, 1fr);
    padding: 12px 24px;
    border-radius: var(--radius) var(--radius) 0 0;
  }

  .global-search {
    grid-column: 2;
    max-width: none;
  }

  .workspace-tools {
    grid-column: 3;
    justify-self: end;
  }

  .main {
    padding: 28px 32px 64px;
  }
}

@media (min-width: 1100px) {
  .columns {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  /* Kopfleiste am Smartphone: Zusatz ausblenden, langer Name wird gekürzt */
  .topbar-brand span {
    display: none;
  }

  .topbar-user {
    min-width: 0;
    gap: 10px;
  }

  .topbar-user > span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  h1 {
    font-size: 1.25rem;
  }

  .form > div:not(.actions) {
    grid-template-columns: minmax(0, 1fr);
  }

  .form > div:not(.actions) > label,
  .form > div:not(.actions) > :not(label) {
    grid-column: 1;
    grid-row: auto;
  }

  .form > div:not(.actions) > label {
    padding-top: 0;
  }

  .auth-card {
    padding: 24px 16px 20px;
  }
}

/* Schmale Smartphones (z. B. 360 px): beide etwas kleiner, damit sie in einer Zeile bleiben */
@media (max-width: 374px) {
  .auth-card form p:has(> input[type="checkbox"]) label,
  .auth-options .helptext {
    font-size: .75rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .btn,
  input,
  select,
  textarea,
  .auth-card form p.floating > label,
  .nav-item .nav-chevron {
    transition: none;
  }

  .btn-primary:hover {
    transform: none;
  }
}

@media print {
  .topbar,
  .sidebar,
  .workspace-head,
  .toolbar,
  .actions,
  .search,
  .pager,
  .breadcrumbs {
    display: none;
  }

  .app {
    display: block;
  }

  .workspace {
    margin: 0;
    border: 0;
  }

  body {
    background: #ffffff;
  }

  .panel,
  .table-wrap {
    border-color: #0f1f33;
    box-shadow: none;
  }
}

.checkin-code {
  margin: 0 0 8px;
  font-size: 2.5rem;
  font-weight: 800;
  letter-spacing: .12em;
  color: var(--navy);
  font-variant-numeric: tabular-nums;
}

.qr svg {
  width: 12rem;
  height: auto;
}

/* Ablagefeld für Dateien: die ganze Fläche nimmt Klick und abgelegte Datei an */
.dropzone {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: 120px;
  padding: 20px;
  border: 2px dashed var(--blue-100);
  border-radius: 10px;
  background: var(--blue-50);
  color: var(--navy);
  text-align: center;
}

.dropzone.is-dragging {
  border-color: var(--blue);
  background: var(--blue-100);
}

.dropzone.has-file {
  border-style: solid;
}

.dropzone-input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.dropzone-file {
  font-weight: 600;
  overflow-wrap: anywhere;
}

.form > div.check-row {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

.form > div.check-row > label {
  padding-top: 0;
  font-weight: 400;
}

/* Kontrollkästchen stehen in der Spalte der Eingabefelder */
@media (min-width: 721px) {
  .plan-form .form > div.check-row {
    padding-left: calc(var(--label-width) + 20px);
  }
}

.module-picks input[type="checkbox"] {
  margin: 0;
}

/* Unterschrift am Bildschirm: Zeichenfeld in voller Breite mit Linie */
.form > div.signature-pad {
  display: block;
  position: relative;
  max-width: 900px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
}

.signature-pad canvas {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 900 / 260;
  touch-action: none;
  cursor: crosshair;
}

.signature-line {
  position: absolute;
  left: 6%;
  right: 6%;
  bottom: 18%;
  padding-top: 4px;
  border-top: 1px solid var(--meta);
  font-size: .75rem;
  color: var(--meta);
  pointer-events: none;
}

.gap-list {
  margin: 0;
}

/* Modulplanung: Beschriftung ohne label-Element, Auswahl in einer Zeile */
.form > div:not(.actions) > .field-label {
  grid-column: 1;
  grid-row: 1 / span 3;
  padding-top: 9px;
  font-weight: 600;
  color: var(--foreground);
}

.form > div.required > .field-label::after {
  content: " *";
  color: var(--error-fg);
}

.radio-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 16px;
  padding-top: 8px;
}

.radio-row label {
  margin-right: 8px;
}

.module-picks {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.module-picks li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  cursor: grab;
}

.module-picks li.is-dragging {
  opacity: .5;
}

.module-picks li.is-unavailable label {
  color: var(--meta);
}

.module-picks label {
  flex: 1;
  min-width: 0;
  overflow-wrap: anywhere;
}

.module-picks .move {
  display: flex;
  gap: 4px;
}

.icon-btn {
  width: 30px;
  height: 30px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--navy);
  font-size: .875rem;
  cursor: pointer;
}

.icon-btn:hover {
  background: var(--blue-50);
}

.inline-form {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
}

.inline-form input[type="date"],
.inline-form input[type="text"] {
  width: auto;
  max-width: 170px;
  padding: 4px 8px;
}

.head-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.plan-table tfoot th,
.plan-table tfoot td {
  font-weight: 700;
  border-top: 2px solid var(--border);
}

/* Modulplan: elf Spalten; mit umbrechenden Überschriften („Wartetage davor“, „Kosten je UE“)
   und etwas weniger seitlichem Abstand passt die Spalte „Abrechnung“ ab 1440 px ohne Scrollen */
.plan-table th,
.plan-table td {
  padding-right: 10px;
  padding-left: 10px;
}

.plan-table thead th {
  white-space: normal;
}

/* Abweichungen beim Kostensatz: Köpfe brechen um (Trennstelle in „Maßnahmenummer“), der Zeitraum
   steht zweizeilig; so passen beide Tabellen samt Aktion ab 1440 px ohne Scrollen */
.rate-table thead th {
  white-space: normal;
}

.rate-table th,
.rate-table td {
  padding-right: 10px;
  padding-left: 10px;
}

.rate-table td.period {
  min-width: 7.25rem;
}

tr.muted td {
  color: var(--meta);
  text-decoration: line-through;
}

/* Varianten als Reiter */
.variant-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px 20px 0;
}

.variant-tab {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  color: var(--foreground);
  font: inherit;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
}

.variant-tab[aria-selected="true"] {
  border-color: var(--blue);
  background: var(--blue-50);
  color: var(--navy);
}

.variant + .variant {
  border-top: 1px solid var(--border);
}

/* Kalenderansicht: Zeitstrahl und Monatskalender */
[data-view-panel][hidden],
[data-variant][hidden] {
  display: none;
}

.plan-view {
  display: grid;
  gap: 12px;
  margin-top: 8px;
}

.view-switch {
  display: flex;
  gap: 6px;
}

.view-switch [aria-pressed="true"] {
  border-color: var(--blue);
  background: var(--blue-50);
  color: var(--navy);
}

.timeline-wrap {
  overflow-x: auto;
}

.timeline {
  display: block;
  width: 100%;
  min-width: 560px;
  height: auto;
}

.timeline text {
  font-family: inherit;
  fill: var(--foreground);
}

.timeline .tick {
  font-size: .75rem;
  fill: var(--meta);
}

.timeline .bar-label {
  font-size: .8125rem;
}

.month-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}

.month {
  width: 100%;
  border-collapse: separate;
  border-spacing: 2px;
  table-layout: fixed;
}

.month caption {
  padding-bottom: 4px;
  font-weight: 700;
  text-align: left;
  color: var(--navy);
}

.month th {
  padding: 2px 0;
  border: 0;
  background: none;
  font-size: .6875rem;
  font-weight: 600;
  text-align: center;
  color: var(--meta);
}

.month td {
  position: relative;
  height: 26px;
  padding: 0;
  border: 0;
  border-radius: 4px;
  font-size: .75rem;
  text-align: center;
  vertical-align: middle;
}

.month td.out {
  background: none;
}

.month td.closed {
  background: #c9d1dc;
  color: var(--foreground);
}

.month td span {
  position: relative;
}

.month td.module span {
  color: #fff;
  font-weight: 700;
}

.day-fill {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border-radius: 4px;
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: .8125rem;
}

.legend li {
  display: flex;
  align-items: center;
  gap: 6px;
}

.legend svg {
  width: 14px;
  height: 14px;
  flex: none;
}

.legend li:last-child svg {
  width: 24px;
}

.materials-preview,
.add-material {
  margin-top: 12px;
}

.materials-preview summary,
.add-material summary {
  font-weight: 600;
  color: var(--navy);
  cursor: pointer;
}

@media print {
  .view-switch {
    display: none;
  }

  [data-view-panel] {
    display: block !important;
  }
}

.doc-links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
}

.doc-list {
  margin: 0 0 10px;
  padding-left: 18px;
}

/* Eignungsfeststellung: Abschnitte A bis F, fehlende Angaben, bedingte Felder */
.section-key {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 22px;
  margin-right: 8px;
  padding: 0 6px;
  border-radius: 6px;
  background: var(--navy);
  font-size: .75rem;
  font-weight: 700;
  color: #fff;
}

.missing-list .section-key {
  min-width: 20px;
  height: 18px;
  margin-right: 6px;
  font-size: .6875rem;
}

.section-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.section-nav a {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--white);
  font-weight: 600;
  color: var(--foreground);
  text-decoration: none;
}

.assessment-form > .panel,
.assessment-form > .msg,
.assessment-form > .missing-summary {
  margin-bottom: 16px;
}

.missing-summary {
  padding: 12px 16px;
  border: 1px solid var(--warn-line);
  border-radius: var(--radius-sm);
  background: var(--warn-bg);
  color: var(--foreground);
}

.missing-summary summary {
  cursor: pointer;
}

.missing-summary strong {
  color: var(--warn-fg);
}

.missing-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr));
  gap: 4px 16px;
  margin: 10px 0 0;
  padding: 0;
  list-style: none;
}

.missing-list a {
  color: var(--foreground);
}

.confirm-box {
  border-color: var(--warn-line);
  background: var(--warn-bg);
}

/* Fehlende Pflichtangabe: ganze Zeile hinterlegt, Hinweis „fehlt“ unter dem Feld */
.form > div.is-missing {
  margin: 0 -10px;
  padding: 8px 10px;
  border: 1px solid var(--warn-line);
  border-radius: var(--radius-sm);
  background: var(--warn-bg);
}

.missing-note {
  justify-self: start;
  order: 4;
  font-size: .75rem;
  font-weight: 700;
  color: var(--warn-fg);
}

/* Bedingte Felder: das Raster der Formularzeilen darf hidden nicht überstimmen */
.form > div[hidden]:not(.actions) {
  display: none;
}

.form > div.row-check {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

.form > div.row-check > label {
  padding-top: 0;
  font-weight: 400;
}

.choice-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  padding-top: 8px;
}

.choice {
  display: inline-flex;
  align-items: flex-start;
  gap: 6px;
  font-weight: 400;
}

.choice input {
  margin: 3px 0 0;
}

.rated-by {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 10px;
  margin-top: 4px;
  font-size: .8125rem;
}

.rated-by label {
  color: var(--muted);
}

.rated-by select {
  width: auto;
  max-width: 100%;
}

.form > div.derived > p,
.form > div.recommendation p {
  margin: 0;
  padding-top: 8px;
}

.matrix {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr));
  gap: 8px 24px;
}

.matrix-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(110px, 40%);
  align-items: center;
  gap: 4px 10px;
  padding: 6px 0;
  border-bottom: 1px solid var(--line);
}

.matrix-item label {
  font-weight: 500;
  overflow-wrap: anywhere;
}

.matrix-item .meta {
  display: block;
  font-size: .75rem;
  font-weight: 400;
}

table.compact th,
table.compact td {
  padding: 6px 10px;
}

/* Aktionen bleiben bei der langen Maske am unteren Rand erreichbar */
.form-actions {
  position: sticky;
  bottom: 0;
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
  background: var(--surface);
}

/* Am Smartphone schmalere Knöpfe, damit die klebende Leiste einzeilig bleibt */
@media (max-width: 480px) {
  .form-actions .btn {
    padding-inline: 10px;
  }
}

.filter-form {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px 20px;
  margin-bottom: 16px;
}

.filter-form > div {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.filter-form > div.check-row {
  flex-direction: row;
  align-items: center;
  gap: 8px;
}

.filter-form > div.actions {
  flex-direction: row;
  gap: 8px;
}

.rank-list {
  margin: 4px 0 12px;
  padding-left: 20px;
}

@media (min-width: 721px) {
  .form > div.row-check {
    padding-left: calc(var(--label-width) + 20px);
  }
}

@media (max-width: 720px) {
  .form > div.is-missing {
    margin: 0;
  }
}

/* Listenwerkzeuge (table-tools.js): Sortieren, Filtern, Export */
.sort-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.sort-button:hover,
.sort-button:focus-visible {
  color: var(--blue);
}

.sort-arrow {
  display: inline-block;
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid var(--blue-100);
}

th[aria-sort="ascending"] .sort-arrow {
  border-top: 0;
  border-bottom: 5px solid var(--blue);
}

th[aria-sort="descending"] .sort-arrow {
  border-top-color: var(--blue);
}

th[aria-sort="ascending"],
th[aria-sort="descending"] {
  color: var(--blue);
}

.table-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 10px 14px;
  margin-bottom: 10px;
}

.table-filter {
  display: grid;
  gap: 3px;
  font-size: .75rem;
  font-weight: 600;
  color: var(--muted);
}

.table-filter select {
  min-width: 9rem;
  max-width: 100%;
}

.table-export {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.table-count {
  font-size: .75rem;
  color: var(--meta);
}

/* Uploads (uploads.js) */
.dropzone-error {
  color: var(--error-fg);
  font-size: .8125rem;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.dropzone-error:empty {
  display: none;
}

.dropzone.has-error {
  border-color: var(--error-line);
  background: var(--error-bg);
}

.upload-progress {
  display: grid;
  gap: 6px;
  margin-top: 12px;
  font-size: .8125rem;
  color: var(--navy);
}

.upload-progress progress {
  width: 100%;
  height: 10px;
  accent-color: var(--blue);
}

.page-drop {
  position: fixed;
  inset: 12px;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 24px;
  border: 3px dashed var(--blue);
  border-radius: 16px;
  background: rgba(232, 241, 250, .94);
  color: var(--navy);
  font-size: 1.125rem;
  font-weight: 700;
  text-align: center;
  pointer-events: none;
}

.page-drop[hidden] {
  display: none;
}

.page-drop .upload-progress {
  width: min(28rem, 100%);
}

/* Listenwerkzeuge innerhalb eines Kastens: gleicher Innenabstand wie die Kopfzeile */
.panel > .table-tools {
  margin: 0;
  padding: 12px 18px;
  border-bottom: 1px solid var(--line);
}

/* Kommunikation und Memos */
.inline-action {
  display: inline;
  margin: 0;
}

tr.row-memo > td {
  background: var(--warn-bg);
}

.panel > .filter-form {
  margin: 0;
  border-bottom: 1px solid var(--line);
}

.memo-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 16rem), 1fr));
  gap: 12px;
  margin: 0;
  padding: 16px 18px;
  list-style: none;
}

.memo {
  display: grid;
  gap: 6px;
  padding: 12px 14px;
  border: 1px solid var(--warn-line);
  border-radius: 10px;
  background: var(--warn-bg);
  color: var(--foreground);
}

.memo p {
  margin: 0;
  overflow-wrap: anywhere;
}

/* Ampeln im Kopf der Akte (Job Coaching, Akte vollständig) */
.light {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--white);
  font-size: .75rem;
  font-weight: 700;
  color: var(--foreground);
  text-decoration: none;
  white-space: nowrap;
}

.light-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--meta);
}

.light-green .light-dot {
  background: var(--ok-fg);
}

.light-yellow .light-dot {
  background: var(--warn-bar);
}

.light-red .light-dot,
.light-urgent .light-dot {
  background: var(--error-fg);
}

.light-red,
.light-urgent {
  border-color: var(--error-line);
  background: var(--error-bg);
  color: var(--error-fg);
}

.light-urgent .light-dot {
  animation: light-blink 1.2s steps(2, start) infinite;
}

@keyframes light-blink {
  to {
    visibility: hidden;
  }
}

@media (prefers-reduced-motion: reduce) {
  .light-urgent .light-dot {
    animation: none;
  }
}

/* Coaching und gemeinsame Angaben */
.panel-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.light-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 0;
}

.shared-block {
  display: grid;
  gap: 12px;
  margin-top: 8px;
  padding: 16px 18px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-2);
}

.shared-block[hidden] {
  display: none;
}

.shared-block h2 {
  margin: 0;
  font-size: 1rem;
}

.taken-from {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 1px 8px;
  border: 1px solid var(--blue-100);
  border-radius: 999px;
  background: var(--blue-50);
  color: var(--blue);
  font-size: .75rem;
  font-weight: 600;
}

.taken-from::before {
  content: "↩";
}

.field-hint {
  margin: 4px 0 0;
  color: var(--warn-fg);
  font-size: .8125rem;
  font-weight: 600;
}

.field-hint:empty {
  display: none;
}

/* Kachel mit dringenden Einträgen: ganzer Rahmen in der Warnfarbe */
.panel-alert {
  border-color: var(--error-line);
}

.panel-alert > .panel-head {
  background: var(--error-bg);
}

/* Auswahlgruppen (Radio, mehrere Kästchen): Legende in der Beschriftungsspalte wie ein Label */
.form > div:not(.actions) > fieldset {
  display: contents;
}

.form > div:not(.actions) > fieldset > legend {
  grid-column: 1;
  grid-row: 1 / span 3;
  padding-top: 2px;
}

.form > div:not(.actions) > fieldset > :not(legend) {
  grid-column: 2;
}

.form > div.required > fieldset > legend::after {
  content: " *";
  color: var(--error-fg);
}

@media (max-width: 720px) {
  .form > div:not(.actions) > fieldset > legend,
  .form > div:not(.actions) > fieldset > :not(legend) {
    grid-column: 1;
    grid-row: auto;
  }
}

/* Gruppierte Kästchen (z. B. Stärken je Kompetenzbereich): Gruppentitel hervorheben */
.form fieldset > div[id] > div > label:not([for]) {
  display: block;
  margin: 10px 0 4px;
  font-weight: 700;
  color: var(--navy);
}

.form fieldset > div[id] > div:first-child > label:not([for]) {
  margin-top: 0;
}

/* Checkliste „Akte vollständig?“: Zeilen über die ganze Kartenbreite, Stand als Punkt mit Text in
   fester Spalte, damit die Bezeichnungen bündig stehen */
.status-rows {
  margin: 0;
  padding: 0;
  list-style: none;
}

.status-rows li {
  display: grid;
  grid-template-columns: 7rem minmax(0, 1fr) auto;
  align-items: baseline;
  gap: 2px 16px;
  padding: 10px 18px;
}

.status-rows li + li {
  border-top: 1px solid var(--line);
}

.status-rows a {
  font-weight: 600;
  color: var(--foreground);
  text-decoration: none;
}

.status-rows a:hover,
.status-rows a:focus-visible {
  color: var(--blue);
  text-decoration: underline;
}

.status-rows .meta {
  text-align: right;
}

.state {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: .8125rem;
  font-weight: 600;
  white-space: nowrap;
}

.state::before {
  content: "";
  flex: none;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
}

.state-missing {
  color: var(--error-fg);
}

.state-soon {
  color: var(--warn-fg);
}

.state-later {
  color: var(--muted);
}

.state-ok {
  color: var(--ok-fg);
}

.status-done {
  border-top: 1px solid var(--line);
}

.status-done > summary {
  padding: 10px 18px;
  font-size: .8125rem;
  font-weight: 600;
  color: var(--ok-fg);
  cursor: pointer;
}

.status-done[open] > summary {
  border-bottom: 1px solid var(--line);
}

@media (max-width: 640px) {
  .status-rows li {
    grid-template-columns: 6.5rem minmax(0, 1fr);
  }

  .status-rows .meta {
    grid-column: 2;
    text-align: left;
  }
}

/* Datenblatt: zwei Abschnitte nebeneinander, fehlende Angaben als Text statt Pille */
.facts-columns {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 20rem), 1fr));
  gap: 20px 40px;
}

.facts-columns h3 {
  margin: 0 0 10px;
  font-size: .8125rem;
  color: var(--muted);
}

.facts-columns .facts {
  grid-template-columns: minmax(7rem, 38%) minmax(0, 1fr);
  gap: 8px 16px;
}

.value-missing {
  font-weight: 600;
  color: var(--warn-fg);
}

/* Schmale Bildschirme: Bezeichnung über dem Wert statt einer engen Label-Spalte */
@media (max-width: 520px) {
  .facts-columns .facts {
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
  }

  .facts-columns .facts dt {
    margin-top: 10px;
    font-size: .75rem;
  }

  .facts-columns .facts dt:first-child {
    margin-top: 0;
  }
}

/* Auswahl mit Erläuterung (z. B. Person löschen) */
.choice-panel {
  display: grid;
  gap: 12px;
}

.choice-panel h2 {
  margin: 0;
  font-size: 1rem;
}

.choice-option {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-2);
}

.choice-option.is-disabled {
  opacity: .65;
}

/* Aktionsmenü (details[data-menu]): selten gebrauchte Aktionen wie Bearbeiten, Export oder Löschen
   hinter einem Knopf; nav.js schließt es bei Klick daneben und mit Escape */
.menu {
  position: relative;
  display: inline-block;
}

.menu > summary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  list-style: none;
  cursor: pointer;
}

.menu > summary::-webkit-details-marker {
  display: none;
}

.menu > summary .icon {
  width: 14px;
  height: 14px;
  transition: transform .15s ease;
}

.menu > summary .icon > svg {
  top: 0;
}

.menu[open] > summary .icon {
  transform: rotate(180deg);
}

.menu-list {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 30;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 17rem;
  max-width: min(22rem, calc(100vw - 32px));
  padding: 6px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--white);
  box-shadow: var(--shadow-lg);
}

.menu-list form {
  margin: 0;
}

.menu-list a,
.menu-list button {
  display: block;
  width: 100%;
  padding: 8px 10px;
  border: 0;
  border-radius: var(--radius-sm);
  background: none;
  font: inherit;
  font-weight: 600;
  color: var(--foreground);
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}

.menu-list a:hover,
.menu-list button:hover,
.menu-list a:focus-visible,
.menu-list button:focus-visible {
  background: var(--surface);
  color: var(--navy);
}

.menu-list hr {
  margin: 4px 6px;
  border: 0;
  border-top: 1px solid var(--line);
}

.menu-list .is-danger,
.menu-list .is-danger:hover {
  color: var(--error-fg);
}

.menu-list .is-danger:hover {
  background: var(--error-bg);
}

@media (prefers-reduced-motion: reduce) {
  .menu > summary .icon {
    transition: none;
  }
}

/* Dashboard: eine Spalte mit „Heute“ und „Offen“. Unter „Offen“ eine Zeile je Thema mit Zahl;
   die Einzelposten klappen erst auf Wunsch auf */
.dash {
  display: grid;
  gap: 32px;
  max-width: 56rem;
}

/* Datum auf derselben Grundlinie wie die Überschrift */
.dash-heading {
  align-items: baseline;
}

.dash-section-title {
  margin: 0 0 10px;
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -.01em;
  line-height: 1.2;
  color: var(--foreground);
}

/* Gruppierte Liste: eine weiße Fläche, Zeilen durch Linien getrennt */
.dash-list,
.dash-box {
  margin: 0;
  padding: 0;
  list-style: none;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: clip;
}

.dash-list > li + li {
  border-top: 1px solid var(--line);
}

.dash-empty {
  margin: 0;
  padding: 14px 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-2);
  color: var(--muted);
}

/* Zeilenkopf: Thema links, Zahl rechts, Pfeil ganz rechts */
.dash-entry-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto 16px;
  align-items: center;
  gap: 16px;
  min-height: 60px;
  padding: 12px 18px;
  color: inherit;
  text-decoration: none;
  list-style: none;
  cursor: pointer;
  transition: background-color .15s ease;
}

.dash-entry-head::-webkit-details-marker {
  display: none;
}

.dash-entry-head.is-static {
  cursor: default;
}

.dash-entry-head:not(.is-static):hover {
  background: var(--surface-2);
}

/* Rückmeldung schon beim Drücken, nicht erst beim Loslassen */
.dash-entry-head:not(.is-static):active {
  background: var(--surface);
  transition-duration: 0s;
}

.dash-entry-head:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: -2px;
}

.dash-entry-label {
  display: grid;
  gap: 2px;
  min-width: 0;
  font-weight: 600;
  color: var(--foreground);
  overflow-wrap: break-word;
}

.dash-entry-hint {
  font-size: .8125rem;
  font-weight: 600;
  color: var(--meta);
}

.dash-entry-value {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -.01em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  color: var(--foreground);
}

/* Überfälliges: nur Zahl und Hinweis rot, die Zeile bleibt ruhig */
.is-alert .dash-entry-hint,
.is-alert .dash-entry-value {
  color: var(--error-fg);
}

.dash-entry-icon {
  width: 16px;
  height: 16px;
  color: var(--meta);
  transition: transform .3s cubic-bezier(.2, .8, .2, 1);
}

.dash-entry-icon > svg {
  top: 0;
}

/* Verweis auf eine andere Seite: Pfeil nach rechts */
.dash-entry-head.is-link .dash-entry-icon {
  transform: rotate(-90deg);
}

.dash-entry[open] > .dash-entry-head {
  border-bottom: 1px solid var(--line);
}

.dash-entry[open] > .dash-entry-head .dash-entry-icon {
  transform: rotate(180deg);
}

/* Aufklappen gleitet, statt zu springen (wo der Browser es kann) */
.dash-entry,
.dash-more {
  interpolate-size: allow-keywords;
}

.dash-entry::details-content,
.dash-more::details-content {
  height: 0;
  overflow: clip;
  transition: height .3s cubic-bezier(.2, .8, .2, 1), content-visibility .3s allow-discrete;
}

.dash-entry[open]::details-content,
.dash-more[open]::details-content {
  height: auto;
}

.dash-entry-body,
.dash-box {
  container-type: inline-size;
}

.dash-entry-body {
  background: var(--surface-2);
}

/* Teilnahmezertifikat: Modultabelle mit Eingaben, Vorschau der Seiten */
.certificate-modules input[type="date"] {
  min-width: 9.5rem;
}

.certificate-modules input[type="number"] {
  min-width: 5.5rem;
}

.certificate-modules select {
  min-width: 16rem;
}

.certificate-modules input[type="checkbox"] {
  margin: 0;
}

.certificate-more fieldset {
  display: grid;
  gap: 6px;
  margin: 0 0 12px;
  padding: 0;
  border: 0;
}

.certificate-more legend {
  margin-bottom: 6px;
  font-weight: 600;
}

.certificate-more label {
  display: flex;
  align-items: center;
  gap: 8px;
}

.certificate-more input[type="checkbox"] {
  margin: 0;
}

.certificate-preview {
  display: grid;
  justify-items: center;
  gap: 16px;
  margin-bottom: 16px;
}

.certificate-preview img {
  width: 100%;
  max-width: 655px;
  height: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
}

.certificate-actions {
  gap: 12px;
}

.certificate-actions > li {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
}

/* Akten-Scan aufteilen: Seiten als Raster, daneben (schmal: darunter) das Ergebnis */
.scan-steps {
  margin: 0 0 16px;
  padding-left: 1.25rem;
}

.scan-intro {
  max-width: 75ch;
  margin: 0 0 16px;
}

.scan-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
  gap: var(--space-section);
}

.scan-pages {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 230px), 1fr));
  gap: 14px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.scan-page {
  --scan-pad: 12px;
  display: grid;
  align-content: start;
  gap: 8px;
  padding: var(--scan-pad);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--white);
  box-shadow: var(--shadow-sm);
}

.scan-thumb,
.scan-thumb img,
.scan-page select {
  border-radius: calc(var(--radius-lg) - var(--scan-pad));
}

.scan-thumb {
  display: block;
}

.scan-thumb img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 210 / 297;
  object-fit: contain;
  border: 1px solid var(--line);
  background: var(--surface-2);
}

.scan-page-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 2px 8px;
}

.scan-page-head label {
  font-weight: 600;
  color: var(--foreground);
}

.scan-note {
  font-size: .75rem;
  color: var(--meta);
}

/* Beginnt hier ein Dokument, hebt sich die Karte ab; weggelassene Seiten treten zurück */
.scan-page[data-state="start"] {
  border-color: var(--blue);
  box-shadow: 0 0 0 1px var(--blue);
}

.scan-page[data-state="start"] .scan-note {
  font-weight: 600;
  color: var(--blue);
}

.scan-page[data-state="skip"] .scan-thumb img {
  opacity: .35;
}

.scan-page.has-error {
  border-color: var(--error-fg);
}

.scan-result {
  display: grid;
  gap: 10px;
  margin: 0 0 16px;
  padding-left: 1.25rem;
}

.scan-result .meta {
  display: block;
}

/* Smartphone: je Seite eine Zeile, Bild links, Auswahl rechts; die dritte Zeile nimmt die
   übrige Bildhöhe auf, damit das Auswahlfeld nicht mitwächst */
@media (max-width: 599px) {
  .scan-page {
    grid-template-columns: 96px minmax(0, 1fr);
    grid-template-rows: auto auto 1fr;
    column-gap: 12px;
  }

  .scan-thumb {
    grid-row: 1 / 4;
  }

  .scan-page > :not(.scan-thumb) {
    grid-column: 2;
  }
}

@media (min-width: 1100px) {
  .scan-layout {
    grid-template-columns: minmax(0, 1fr) 300px;
  }

  /* bleibt beim Scrollen unter der mitlaufenden Kopfzeile (64 px und Rand) stehen */
  .scan-summary {
    position: sticky;
    top: 81px;
  }
}

/* Teilnehmerübersicht: Blöcke zum Auf- und Zuklappen, Kopf wie die Zeilen im Dashboard */
.list-blocks {
  display: flex;
  flex-direction: column;
  gap: var(--space-section);
}

.list-block > .dash-entry-head {
  border-radius: calc(var(--radius) - 1px);
}

.list-block[open] > .dash-entry-head {
  border-radius: calc(var(--radius) - 1px) calc(var(--radius) - 1px) 0 0;
}

.list-block .list-block-title {
  font-weight: 700;
}

.list-block-empty {
  margin: 0;
  padding: 14px 18px;
}

.dash-foot {
  padding: 12px 18px;
  border-top: 1px solid var(--line);
  font-size: .8125rem;
}

/* Einzelposten: Zeilen statt Tabellen */
.dash-rows {
  margin: 0;
  padding: 0;
  list-style: none;
}

.dash-rows > li {
  display: grid;
  grid-template-columns: 6.5rem minmax(0, 1fr) auto;
  align-items: center;
  gap: 4px 14px;
  padding: 10px 18px;
}

.dash-rows > li + li {
  border-top: 1px solid var(--line);
}

.dash-rows.is-plain > li {
  grid-template-columns: minmax(0, 1fr) auto;
}

.dash-when {
  display: grid;
  justify-items: start;
  gap: 2px;
  font-size: .8125rem;
  font-weight: 700;
  color: var(--foreground);
  font-variant-numeric: tabular-nums;
}

.dash-when .meta {
  font-weight: 500;
}

/* Überfällig: rotes Datum mit Punkt */
.dash-when.is-late {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--error-fg);
}

.dash-when.is-late::before {
  content: "";
  flex: none;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
}

.dash-what {
  display: grid;
  gap: 2px;
  min-width: 0;
  overflow-wrap: anywhere;
}

.dash-what strong,
.dash-title {
  font-weight: 600;
  color: var(--foreground);
}

a.dash-title {
  text-decoration: none;
}

a.dash-title:hover,
a.dash-title:focus-visible {
  color: var(--blue);
  text-decoration: underline;
}

.dash-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 12px;
  font-size: .8125rem;
  color: var(--meta);
}

.dash-do {
  justify-self: end;
}

/* Ampel in der Zeile: nur der Punkt, die Farbe steht im Titel und für Screenreader im Text */
.dash-do .light {
  padding: 4px;
  border: 0;
  background: none;
}

/* Weitere Zeilen aufklappen; der Text wechselt zwischen „anzeigen“ und „weniger“ */
.dash-more {
  border-top: 1px solid var(--line);
}

.dash-more > summary {
  padding: 10px 18px;
  font-size: .8125rem;
  font-weight: 700;
  color: var(--blue);
  cursor: pointer;
}

.dash-more[open] > summary {
  border-bottom: 1px solid var(--line);
}

.dash-more[open] .dash-more-closed,
.dash-more:not([open]) .dash-more-open {
  display: none;
}

/* Schmale Flächen: Datum über dem Inhalt, Schaltfläche rechts daneben */
@container (max-width: 26rem) {
  .dash-rows > li {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .dash-when {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 8px;
  }

  .dash-when,
  .dash-what {
    grid-column: 1;
  }

  .dash-rows:not(.is-plain) .dash-do {
    grid-column: 2;
    grid-row: 1 / span 2;
  }
}

@media (max-width: 480px) {
  .dash {
    gap: 24px;
  }

  .dash-entry-head {
    gap: 12px;
    padding-inline: 14px;
  }

  .dash-rows > li,
  .dash-more > summary,
  .dash-foot {
    padding-inline: 14px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .dash-entry-head,
  .dash-entry-icon {
    transition: none;
  }

  .dash-entry::details-content,
  .dash-more::details-content {
    transition: none;
  }
}

/* Aufklappbares Formular unter dem Kastenkopf, z. B. „Memo notieren“ */
.panel-compose {
  border-bottom: 1px solid var(--line);
}

.panel-compose > summary {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 18px;
  font-weight: 700;
  color: var(--blue);
  list-style: none;
  cursor: pointer;
}

.panel-compose > summary::-webkit-details-marker {
  display: none;
}

.panel-compose > summary::before {
  content: "+";
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--blue-50);
  font-weight: 800;
  line-height: 1;
}

.panel-compose[open] > summary::before {
  content: "−";
}

.panel-compose > form {
  padding: 0 18px 16px;
}

/* Filterzeilen: gleich breite Felder, die Knöpfe direkt daneben */
.filter-form > div:not(.actions):not(.check-row) {
  flex: 1 1 9rem;
  max-width: 15rem;
}

/* Freistehende Liste: Werkzeugleiste (Filter, Trefferzahl, Export) als Kopf der Tabellenkarte */
.table-tools.is-card {
  margin: 0;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-bottom-color: var(--line);
  border-radius: var(--radius) var(--radius) 0 0;
  background: var(--white);
}

.table-wrap.has-tools {
  border-top: 0;
  border-radius: 0 0 var(--radius) var(--radius);
}

.table-tools .list-count {
  margin: 0;
}

.table-tools .list-count:has(+ .table-count:not(:empty)) {
  display: none;
}

.panel-compose:last-child {
  border-bottom: 0;
}

.panel-body + .panel-compose {
  border-top: 1px solid var(--line);
}

/* Menüs, die rechts nicht in die Seite passen, öffnen nach links (nav.js setzt die Klasse) */
.menu-list.is-end {
  right: 0;
  left: auto;
}

/* Kontaktangabe mit Kopier-Knopf (copy.js): kleines Icon direkt hinter dem Wert */
/* Ansprechpartner: Name als Link, Vorschau mit Telefon, E-Mail und Dienststelle bei Hover und
   Fokus. Auf dem Smartphone als Leiste am unteren Rand, damit nichts seitlich übersteht. */
.contact-card {
  position: relative;
}

.contact-name[tabindex] {
  border-bottom: 1px dotted var(--meta);
  cursor: help;
}

.contact-preview {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  z-index: 30;
  width: max-content;
  max-width: 20rem;
  margin-top: 6px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--white);
  box-shadow: var(--shadow-lg);
  font-size: .8125rem;
  font-weight: 400;
  line-height: 1.45;
  color: var(--body);
  overflow-wrap: anywhere;
}

/* Brücke über den Abstand, damit die Vorschau beim Weg mit der Maus offen bleibt */
.contact-preview::before {
  content: "";
  position: absolute;
  top: -7px;
  right: 0;
  left: 0;
  height: 7px;
}

/* Mit JavaScript: fest am Bildschirm, damit sie weder über den Rand ragt noch abgeschnitten wird */
.contact-preview.is-fixed {
  position: fixed;
  max-width: min(20rem, calc(100vw - 32px));
  margin-top: 0;
}

.contact-preview strong {
  color: var(--foreground);
}

.contact-card:hover > .contact-preview,
.contact-card:focus-within > .contact-preview {
  display: grid;
  gap: 2px;
}

@media (max-width: 720px) {
  .contact-preview {
    position: fixed;
    top: auto;
    right: 16px;
    bottom: 16px;
    left: 16px;
    width: auto;
    max-width: none;
  }
}

.copyable {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
}

.copyable > span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.copy-button {
  display: inline-grid;
  flex: none;
  place-items: center;
  width: 26px;
  height: 26px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: none;
  color: var(--meta);
  cursor: pointer;
}

.copy-button:hover,
.copy-button:focus-visible {
  border-color: var(--border);
  background: var(--surface);
  color: var(--blue);
}

.copy-button .icon {
  width: 15px;
  height: 15px;
}

.copy-button .icon-copied,
.copy-button.is-copied .icon-copy {
  display: none;
}

.copy-button.is-copied .icon-copied {
  display: block;
  color: var(--ok-fg);
}

/* In Tabellen bleibt die Angabe in einer Zeile; die Tabelle scrollt bei Bedarf selbst */
td .copyable > span {
  overflow-wrap: normal;
  white-space: nowrap;
}

/* Tagesdokumentation: eine Zeile je Lehrinhalt, Auswahl in kleinen Fenstern */
.log-table td {
  vertical-align: baseline;
}

.log-content {
  min-width: 16rem;
}

/* ID, UE und F/G/I nur so breit wie ihr Inhalt; UE und F/G/I mittig unter der Überschrift */
.log-table .log-id-head,
.log-table .log-id,
.log-table .log-narrow-head,
.log-table .log-ue,
.log-table .log-fgi {
  width: 1%;
  white-space: nowrap;
}

.log-table .log-narrow-head,
.log-table .log-ue,
.log-table .log-fgi {
  padding-inline: 8px;
  text-align: center;
}

.log-title {
  overflow-wrap: anywhere;
}

.log-free {
  color: var(--muted);
  font-style: italic;
}

.log-coverage {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.log-coverage [hidden],
.lesson-log [data-free-add][hidden] {
  display: none;
}

.log-flags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.log-flags [hidden] {
  display: none;
}

.log-flags:has(> :not([hidden])) {
  margin-top: 4px;
}

.log-pencil,
.log-x {
  display: inline-grid;
  flex: none;
  place-items: center;
  width: 28px;
  height: 28px;
  vertical-align: middle;
  padding: 0;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: none;
  color: var(--blue);
  cursor: pointer;
}

.log-pencil:hover,
.log-pencil:focus-visible,
.log-x:hover,
.log-x:focus-visible {
  border-color: var(--info-line);
  background: var(--info-bg);
}

/* Der Stift sitzt im rechten Innenabstand des Texts, so bricht er nie allein in die nächste Zeile */
.log-title [data-row-title] {
  padding-right: 28px;
}

.log-pencil {
  position: relative;
  top: -3px;
  width: 24px;
  height: 24px;
  margin: -4px 0 -4px -24px;
}

.log-pencil[hidden] {
  display: none;
}

.log-x {
  font-size: 1.25rem;
  line-height: 1;
  color: var(--muted);
}

.log-x[hidden] {
  display: none;
}

.log-chip {
  min-width: 2.5rem;
  padding: 3px 9px;
  border: 1px solid var(--info-line);
  border-radius: var(--pill);
  background: var(--info-bg);
  color: var(--navy);
  font: inherit;
  font-size: .8125rem;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
}

.log-chip:hover,
.log-chip:focus-visible {
  border-color: var(--blue);
}

.log-remark-head,
.log-remark-cell {
  width: 30%;
}

/* Feld bis an die Spalte mit dem X: Abstand links vom X wie rechts zum Rand */
.log-table .log-remark-cell {
  padding-right: 0;
}

.log-remark-cell input {
  width: 100%;
  min-width: 14rem;
  padding: 4px 8px;
  font-size: .8125rem;
}

.log-table tr.is-invalid td {
  background: var(--error-bg);
}

/* Auswahlfenster (popover); das Skript setzt die Lage neben dem Knopf */
.log-pop {
  position: absolute;
  inset: auto;
  width: min(22rem, calc(100vw - 32px));
  max-height: min(28rem, calc(100vh - 32px));
  margin: 0;
  padding: 14px;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--white);
  color: var(--foreground);
  text-align: start;
  white-space: normal;
  box-shadow: 0 12px 32px rgb(15 31 51 / 18%);
}

/* UE: kleine Kacheln in einer Zeile, darunter klein der Bedienhinweis */
.log-pop-ue {
  width: max-content;
  max-width: calc(100vw - 32px);
  padding: 10px 12px;
}

/* Der Hinweis bestimmt die Breite nicht mit, er bricht auf Breite der Kacheln um */
.ue-hint {
  width: 0;
  min-width: 100%;
  margin: 8px 0 0;
  font-size: .6875rem;
  line-height: 1.35;
  color: var(--meta);
}

/* Erst zeigen, wenn das Skript das Fenster neben den Knopf gesetzt hat */
.log-pop:popover-open:not([data-placed]) {
  visibility: hidden;
}

@media (scripting: none) {
  .log-pop:popover-open:not([data-placed]) {
    visibility: visible;
  }
}

.log-pop > * + * {
  margin-top: 8px;
}

.log-pop-label {
  display: block;
  margin: 0;
  font-size: .8125rem;
  font-weight: 700;
  color: var(--foreground);
}

.ue-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  touch-action: none;
  user-select: none;
}

.ue-tile {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--surface-2);
  font-size: .75rem;
  font-weight: 700;
  color: var(--body);
  cursor: pointer;
}

.ue-tile input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.ue-tile:has(input:checked) {
  border-color: var(--blue);
  background: var(--blue);
  color: var(--white);
}

.ue-tile:has(input:focus-visible) {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}

.fgi-list {
  display: grid;
  gap: 6px;
}

.fgi-option {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 10px;
  line-height: 1.2;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: .875rem;
  cursor: pointer;
}

.fgi-option input {
  flex: none;
  margin: 0;
}

.fgi-code {
  flex: none;
  width: 1rem;
  color: var(--navy);
}

.fgi-option:has(input:checked) {
  border-color: var(--info-line);
  background: var(--info-bg);
}

/* Dialog „Inhalt bearbeiten“: Kopf, Inhalt in Abschnitten, Fußzeile; zweite Ansicht zum Wählen */
.log-dialog {
  width: min(40rem, calc(100vw - 32px));
  max-height: calc(100dvh - 32px);
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: var(--radius-lg);
  background: var(--white);
  box-shadow: var(--shadow-lg);
  color: var(--foreground);
}

.log-dialog[open] {
  display: flex;
  flex-direction: column;
}

.log-dialog::backdrop {
  background: rgba(1, 53, 100, .45);
}

.log-dialog [hidden] {
  display: none;
}

.log-dialog-head {
  display: flex;
  flex: none;
  align-items: center;
  gap: 8px;
  padding: 14px 16px 14px 24px;
  border-bottom: 1px solid var(--line);
}

.log-dialog-head h2 {
  flex: 1;
  margin: 0;
  font-size: 1.125rem;
}

.log-dialog-head:has([data-dialog-back]:not([hidden])) {
  padding-left: 16px;
}

.log-dialog-icon {
  display: grid;
  flex: none;
  place-items: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: none;
  color: var(--muted);
  cursor: pointer;
}

.log-dialog-icon:hover,
.log-dialog-icon:focus-visible {
  background: var(--blue-50);
  color: var(--navy);
}

.log-dialog-edit {
  overflow: auto;
}

.log-dialog-section {
  display: grid;
  gap: 8px;
  padding: 20px 24px;
}

.log-dialog-section + .log-dialog-section {
  border-top: 1px solid var(--line);
}

.log-dialog-section > * {
  margin: 0;
}

.log-dialog-label {
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--meta);
}

.log-current {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: start;
  gap: 4px 12px;
}

.log-current .record-key {
  margin-top: 1px;
}

.log-current-text p {
  margin: 0;
}

.log-current-text p:first-child {
  font-size: .9375rem;
  font-weight: 600;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.log-current-text .meta {
  margin-top: 2px;
}

.log-dialog textarea {
  width: 100%;
  min-height: 5rem;
  padding: 10px 12px;
  font-size: .9375rem;
  line-height: 1.45;
  resize: vertical;
}

.log-dialog-state {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 4px 16px;
}

.log-dialog-state .meta {
  margin: 0;
}

.log-link {
  padding: 0;
  border: 0;
  background: none;
  color: var(--blue);
  font: inherit;
  font-size: .8125rem;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}

.log-propose {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 4px;
  padding: 12px 14px;
  border: 1px solid var(--info-line);
  border-radius: var(--radius-sm);
  background: var(--info-bg);
  font-size: .875rem;
  cursor: pointer;
}

.log-propose input {
  flex: none;
  margin: 3px 0 0;
}

.log-propose > span {
  display: grid;
  gap: 2px;
}

.log-dialog-foot {
  display: grid;
  flex: none;
  grid-template-columns: repeat(2, minmax(0, 10rem));
  justify-content: end;
  gap: 8px;
  padding: 14px 24px;
  border-top: 1px solid var(--line);
  background: var(--surface-2);
}

.log-dialog-pick {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.log-pick-tools {
  display: grid;
  flex: none;
  gap: 12px;
  padding: 16px 24px;
  border-bottom: 1px solid var(--line);
}

.log-pick-search {
  position: relative;
}

.log-pick-search svg {
  position: absolute;
  top: 50%;
  left: 12px;
  color: var(--meta);
  transform: translateY(-50%);
  pointer-events: none;
}

.log-pick-search input {
  width: 100%;
  padding: 9px 12px 9px 36px;
  font-size: .9375rem;
}

/* Umschalter: zwei gleich breite Knöpfe in einer Kapsel */
.log-seg {
  display: grid;
  grid-auto-columns: 1fr;
  grid-auto-flow: column;
  gap: 2px;
  padding: 3px;
  border-radius: var(--pill);
  background: var(--surface);
}

.log-seg button {
  min-height: 30px;
  padding: 4px 12px;
  border: 0;
  border-radius: var(--pill);
  background: none;
  color: var(--body);
  font: inherit;
  font-size: .8125rem;
  font-weight: 700;
  cursor: pointer;
}

.log-seg button[aria-pressed="true"] {
  background: var(--white);
  color: var(--navy);
  box-shadow: var(--shadow-sm);
}

/* Feste Höhe, damit das Fenster beim Suchen und Umschalten nicht springt */
.log-pick-list {
  position: relative;
  height: min(26rem, calc(100dvh - 15rem));
  overflow: auto;
  overscroll-behavior: contain;
}

.log-pick-count {
  margin: 0;
  padding: 10px 24px;
  font-size: .8125rem;
  color: var(--meta);
}

.log-pick-group h4 {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 7px 24px;
  border-block: 1px solid var(--line);
  background: var(--surface-2);
  font-size: .75rem;
  font-weight: 700;
  color: var(--body);
}

.log-pick-group:first-child h4 {
  border-top: 0;
}

.log-pick {
  display: grid;
  grid-template-columns: 2.75rem 1fr auto;
  align-items: baseline;
  gap: 12px;
  width: 100%;
  padding: 10px 24px;
  border: 0;
  background: none;
  color: var(--foreground);
  font: inherit;
  font-size: .875rem;
  line-height: 1.4;
  text-align: left;
  cursor: pointer;
}

.log-pick + .log-pick {
  border-top: 1px solid var(--line);
}

.log-pick > span:empty {
  display: none;
}

.log-pick-code {
  color: var(--blue);
  font-weight: 700;
}

.log-pick-title {
  overflow-wrap: anywhere;
}

.log-pick-title .meta {
  display: block;
  margin-top: 2px;
}

.log-pick:hover,
.log-pick:focus-visible {
  outline: 0;
  background: var(--info-bg);
}

.log-pick:focus-visible {
  box-shadow: inset 0 0 0 2px var(--blue);
}

.log-pick[aria-current] {
  background: var(--blue-50);
}

.log-pick:disabled {
  color: var(--meta);
  cursor: default;
}

.log-pick:disabled:hover {
  background: none;
}

.log-pick:disabled .log-pick-code {
  color: inherit;
}

.log-pick mark {
  padding: 0 1px;
  border-radius: 2px;
  background: #ffe9a8;
  color: inherit;
}

/* Noch nachzuholen: Box mit Rahmen, Hintergrund und Icon */
.log-backlog {
  margin-bottom: 16px;
  padding: 16px;
  border: 1px solid var(--warn-line);
  border-radius: var(--radius);
  background: var(--warn-bg);
}

.log-backlog-head {
  display: flex;
  align-items: center;
  gap: 10px;
}

.log-backlog-head h2 {
  margin: 0;
  font-size: 1rem;
}

.log-backlog-icon {
  display: grid;
  flex: none;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--white);
  color: var(--warn-fg);
}

.log-backlog > .meta {
  margin: 6px 0 10px;
}

.log-backlog-list {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.log-backlog-list li {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 10px;
  padding: 8px 10px;
  border-radius: 6px;
  background: var(--white);
  font-size: .875rem;
}

.log-backlog-list li > span:nth-child(2) {
  flex: 1 1 12rem;
  min-width: 0;
}

.log-backlog-list [hidden] {
  display: none;
}

.lesson-log .actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.log-reset {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-left: auto;
}

.lesson-log .actions .msg {
  flex: 1 1 100%;
  margin: 0;
}

.lesson-log .actions .msg[hidden],
.lesson-log [data-row-add][hidden] {
  display: none;
}

.log-reason {
  display: grid;
  flex: 1 1 100%;
  gap: 6px;
}

.log-reason textarea {
  width: 100%;
}

/* Änderung prüfen: alt und neu, Unterschiede markiert */
.log-compare td {
  vertical-align: top;
}

.log-compare td > span {
  display: block;
}

.log-compare tr.is-changed td {
  background: var(--warn-bg);
}

.log-compare .is-diff {
  font-weight: 700;
  color: var(--warn-fg);
}

.log-decide {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 8px;
}

.log-decide .field {
  flex: 1 1 16rem;
}

/* Schmale Smartphones: neun UE bleiben in einer Zeile */
@media (max-width: 380px) {
  .log-pop-ue {
    padding: 8px;
  }

  .log-pop-ue .ue-grid {
    gap: 3px;
  }

  .log-pop-ue .ue-tile {
    width: 26px;
    height: 26px;
  }
}

/* Smartphone: jede Zeile als Karte */
@media (max-width: 640px) {
  .log-table thead {
    display: none;
  }

  .log-table,
  .log-table tbody {
    display: block;
  }

  .log-table tr {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 8px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--line);
  }

  .log-table td {
    display: block;
    padding: 0;
    border: 0;
  }

  .log-table td.log-id,
  .log-table td.log-ue,
  .log-table td.log-fgi {
    width: auto;
    padding: 0;
    text-align: start;
  }

  .log-table td.mono {
    grid-column: 1;
  }

  .log-table td.log-content {
    grid-column: 2;
    min-width: 0;
  }

  .log-table td.log-remove {
    grid-column: 3;
    grid-row: 1;
  }

  .log-table td.log-ue,
  .log-table td.log-fgi {
    grid-column: span 1;
  }

  .log-table td.log-ue {
    grid-column: 1 / 3;
  }

  .log-table td.log-fgi {
    grid-column: 3;
  }

  .log-table td.log-remark-cell {
    grid-column: 1 / -1;
    width: auto;
  }

  .log-remark-cell input {
    min-width: 0;
  }

  /* Untereinander stehende Knöpfe nehmen die volle Breite */
  .lesson-log .actions > .btn {
    flex: 1 1 100%;
  }

  .log-current {
    grid-template-columns: auto 1fr;
  }

  .log-current .btn {
    grid-column: 1 / -1;
    justify-self: start;
    margin-top: 6px;
  }

  .log-dialog-foot {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .log-seg button {
    padding-inline: 4px;
    white-space: nowrap;
  }

  .log-dialog-head,
  .log-dialog-section,
  .log-dialog-foot,
  .log-pick-tools,
  .log-pick-count,
  .log-pick-group h4,
  .log-pick {
    padding-inline: 16px;
  }

  /* Hinweis (nachholen, aktuell) unter den Text statt daneben */
  .log-pick {
    grid-template-columns: 2.75rem 1fr;
    gap: 4px 10px;
  }

  .log-pick > .status {
    grid-column: 2;
    justify-self: start;
  }
}

/* Fahrtkosten je Förderfall: Vermerk „direkt mit der Agentur geklärt“ */
.travel-direct {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--line);
}

.travel-direct li {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
  padding: 12px 18px;
}

.travel-direct li + li {
  border-top: 1px solid var(--line);
}

.travel-direct li > span {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 12px;
  min-width: 0;
}

.travel-direct form {
  margin: 0;
}

/* Rückmeldung nach dem Lesen des Gutscheins, unter dem Hilfetext des Ablagefelds */
.form > div:not(.actions) > .voucher-status {
  order: 4;
  margin-top: 6px;
}

/* Formular unter einer Liste im selben Kasten, z. B. Schriftverkehr mit dem Kostenträger */
.panel-divider {
  border-top: 1px solid var(--line);
}

/* Nachfragen zur Integration: drei Termine untereinander */
.follow-ups {
  list-style: none;
  margin: 0;
  padding: 0;
}

.follow-ups li {
  white-space: nowrap;
}

/* Mehrere Schaltflächen nebeneinander gleich breit; ist das Formular schmal, untereinander in
   voller Breite (gemessen am Formular, nicht am Fenster, wegen der Seitenleiste) */
form:has(> .actions-equal) {
  container-type: inline-size;
}

.actions.actions-equal {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(0, 1fr);
  grid-auto-rows: 1fr;
  align-items: stretch;
  max-width: 900px;
}

@container (max-width: 840px) {
  .actions.actions-equal {
    grid-auto-flow: row;
  }
}

/* Titelspalte, die am Smartphone nicht Wort für Wort umbrechen soll; die Tabelle scrollt dann */
th.col-title {
  min-width: 180px;
}

/* Schaltflächen nebeneinander sind gleich groß (button-groups.js); passt eine Gruppe nicht in
   eine Zeile, stehen alle untereinander in voller Breite */
.btn-group-stacked {
  flex-direction: column;
  align-items: stretch;
}

.btn-group-stacked > .btn,
.btn-group-stacked > form,
.btn-group-stacked > details,
.btn-group-stacked > form > .btn,
.btn-group-stacked > details > summary.btn {
  width: 100%;
}

.btn-group-stacked .btn {
  white-space: normal;
  text-align: center;
}

/* Auf sehr schmalen Bildschirmen brechen lange Beschriftungen um, statt überzustehen */
@media (max-width: 360px) {
  .btn {
    max-width: 100%;
    white-space: normal;
    text-align: center;
  }
}

/* Lernmittel-Zeile: Schaltflächen und Feld untereinander in einer Breite */
.material-actions {
  display: inline-grid;
  grid-auto-flow: row;
  grid-auto-rows: 1fr;
  align-items: stretch;
  justify-items: stretch;
}

.material-actions input[type="text"] {
  max-width: none;
  width: 100%;
}

/* Testumgebung (LOGIN Campus): Hinweisband über der Arbeitsfläche und auf der Anmeldung */
.test-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 16px;
  padding: 8px 16px;
  background: var(--warn-bg);
  border: 1px solid var(--warn-line);
  border-radius: var(--radius-sm);
  color: var(--warn-fg);
  font-size: .8125rem;
  line-height: 1.4;
}

.workspace > .test-banner {
  margin: 8px 12px 0;
}

.auth-card > .test-banner {
  margin-bottom: 16px;
}

.test-banner a,
.test-banner button {
  color: inherit;
  font: inherit;
  font-weight: 600;
  text-decoration: underline;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}

.test-banner form {
  display: inline;
}
