/*
 * 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;
  /* Form */
  --font: "Montserrat Variable", system-ui, -apple-system, "Segoe UI", sans-serif;
  --radius-sm: 8px;
  --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);
}

/* Tagesdokumentation: Inhalte je UE */
.log-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 16px;
  margin-top: 10px;
}

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

.log-tools input[type="search"] {
  flex: 1 1 16rem;
  min-width: 0;
}

.log-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.log-table th.ue,
.log-table td.ue {
  width: 3.25rem;
  text-align: center;
}

.log-table tr.log-day th {
  background: var(--blue-50);
  color: var(--navy);
}

.log-table tr.is-taught td {
  color: var(--meta);
}

/* Plan des Tages hervorheben */
.log-table tbody tr.is-planned td {
  background: var(--info-bg);
}

.log-table tr.is-planned td.mono {
  font-weight: 800;
  color: var(--blue);
}

/* 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-send { color: #0a7fb8; }
.nav-item .icon-euro { color: #d0581b; }
.nav-item .icon-book { color: #c73a78; }
.nav-item .icon-presentation { color: #4f55d6; }
.nav-item .icon-database,
.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: 16px;
}

/* 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;
}

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

.toolbar select,
.panel-head select {
  width: auto;
}

/* 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;
}

.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: 16px;
  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);
}

/* 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;
}

.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;
}

.msg {
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-left: 3px solid var(--muted);
  border-radius: 10px;
  background: var(--surface-2);
  font-weight: 500;
  color: var(--foreground);
}

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

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

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

.msg-error {
  border-color: var(--error-line);
  border-left-color: var(--error-fg);
  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);
}

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

/* Reiter auf Detailseiten */
.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin: 0;
  padding: 0;
  list-style: none;
  border-bottom: 1px solid var(--border);
}

.tabs a {
  display: block;
  margin-bottom: -1px;
  padding: 10px 14px;
  border-bottom: 2px solid transparent;
  font-weight: 600;
  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;
}

.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;
}
