:root {
  --gk-page: linear-gradient(165deg, #e4eaf2 0%, #d0dae8 45%, #c2cfdf 100%);
  --gk-text: #1a2230;
  --gk-text-muted: #5a6578;
  --gk-primary: #003d99;
  --gk-primary-pressed: #002f75;
  --gk-accent: #0d5cb5;
  --gk-card: rgba(255, 255, 255, 0.94);
  --gk-card-border: rgba(0, 40, 100, 0.1);
  --gk-card-shadow: 0 12px 40px rgba(15, 35, 80, 0.1), 0 2px 8px rgba(15, 35, 80, 0.06);
  --gk-radius-lg: 22px;
  --gk-radius-md: 16px;
  --gk-success: #0d7a3e;

  --admin-sidebar: #0c1628;
  --admin-sidebar-hover: rgba(255, 255, 255, 0.06);
  --admin-sidebar-active: rgba(255, 255, 255, 0.1);
  --admin-sidebar-border: rgba(255, 255, 255, 0.12);
  --admin-topbar-h: 64px;
  --admin-sidebar-w: 260px;
}

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

html {
  height: 100%;
  height: -webkit-fill-available;
}

html, body {
  margin: 0;
  min-height: 100%;
  min-height: 100dvh;
  font-family: system-ui, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  background: var(--gk-page);
  color: var(--gk-text);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

body {
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
  touch-action: manipulation;
}

/* Desktop: nur Inhaltsbereich scrollt, kein „Halb-Sidebar“ durch Body-Scroll */
@media (min-width: 901px) {
  html, body {
    height: 100%;
    max-height: 100%;
    overflow: hidden;
  }
}

.admin-layout {
  display: grid;
  grid-template-columns: var(--admin-sidebar-w) minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr);
  align-items: stretch;
  min-height: 100%;
  min-height: 100dvh;
  min-height: -webkit-fill-available;
  max-height: 100dvh;
  max-height: -webkit-fill-available;
  overflow: hidden;
}

.admin-layout > .sidebar {
  min-height: 0;
  align-self: stretch;
}

.admin-layout > .main-shell {
  min-height: 0;
}

/* ----- Sidebar ----- */
.sidebar {
  position: relative;
  z-index: 10045;
  background: var(--admin-sidebar);
  color: rgba(255, 255, 255, 0.92);
  display: flex;
  flex-direction: column;
  padding: 20px 0 16px;
  border-right: 1px solid rgba(255, 255, 255, 0.06);
  min-height: 100%;
  min-height: -webkit-fill-available;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 16px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

a.sidebar-brand {
  text-decoration: none;
  color: inherit;
  cursor: pointer;
}

a.sidebar-brand:hover {
  opacity: 0.92;
}

.sidebar-brand-text {
  font-weight: 700;
  font-size: 17px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.sidebar-brand-sub {
  font-size: 11px;
  opacity: 0.55;
  font-weight: 500;
  letter-spacing: 0.02em;
  margin-top: 2px;
}

.nav {
  flex: 1;
  min-height: 0;
  padding: 12px 10px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 12px;
  color: rgba(255, 255, 255, 0.82);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid transparent;
  margin-bottom: 4px;
  transition: background 0.15s ease, border-color 0.15s ease;
}

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

.nav-item.is-active {
  background: var(--admin-sidebar-active);
  border-color: var(--admin-sidebar-border);
  border-left: 3px solid #fff;
  padding-left: 12px;
}

.nav-item svg { opacity: 0.85; flex-shrink: 0; }

.nav-item .chev { margin-left: auto; opacity: 0.5; }


.sidebar-user-wrap {
  margin-top: auto;
  padding: 12px 12px 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  position: relative;
  z-index: 10050;
}

.sidebar-user-trigger {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 10px;
  border: none;
  border-radius: 12px;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s ease;
}

.sidebar-user-trigger:hover {
  background: var(--admin-sidebar-hover);
}

.sidebar-user-trigger[aria-expanded='true'] {
  background: var(--admin-sidebar-active);
}

.sidebar-user-chev {
  margin-left: auto;
  flex-shrink: 0;
  opacity: 0.55;
  transition: transform 0.2s ease;
}

.sidebar-user-trigger[aria-expanded='true'] .sidebar-user-chev {
  transform: rotate(180deg);
}

.sidebar-user-menu {
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: calc(100% + 6px);
  padding: 6px;
  border-radius: 14px;
  background: #121a2a;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 -12px 40px rgba(0, 0, 0, 0.45);
}

.sidebar-user-menu-item {
  display: block;
  padding: 10px 12px;
  border-radius: 10px;
  color: rgba(255, 255, 255, 0.92);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.3;
}

.sidebar-user-menu-item:hover {
  background: var(--admin-sidebar-hover);
}

.sidebar-user-menu-item:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.35);
  outline-offset: 2px;
}

.avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--gk-accent), var(--gk-primary));
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 700;
  color: #fff;
}

.sidebar-user-meta .name { font-size: 13px; font-weight: 600; }
.sidebar-user-meta .role { font-size: 11px; opacity: 0.55; margin-top: 2px; }

.sidebar-user-trigger .sidebar-user-meta {
  min-width: 0;
  flex: 1;
}

.sidebar-user-trigger .name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ----- Main shell ----- */
.main-shell {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  flex: 1;
  overflow: hidden;
}

.topbar {
  position: relative;
  z-index: 10045;
  height: var(--admin-topbar-h);
  padding: 0 clamp(16px, 3vw, 28px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.55);
  border-bottom: 1px solid var(--gk-card-border);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.topbar-title {
  min-width: 0;
  flex: 1;
}

.topbar-title h1 {
  margin: 0;
  font-size: clamp(16px, 2vw, 20px);
  font-weight: 700;
  color: var(--gk-primary);
  letter-spacing: -0.02em;
}

.topbar-title p {
  margin: 4px 0 0;
  font-size: 13px;
  color: var(--gk-text-muted);
  overflow-wrap: anywhere;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-shrink: 0;
}

.pill-online {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(13, 122, 62, 0.12);
  color: var(--gk-success);
  font-size: 12px;
  font-weight: 600;
}

.pill-online::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--gk-success);
  box-shadow: 0 0 0 2px rgba(13, 122, 62, 0.35);
}

.icon-btn {
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 12px;
  background: rgba(0, 61, 153, 0.08);
  color: var(--gk-primary);
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: background 0.15s ease;
}

.icon-btn:hover { background: rgba(0, 61, 153, 0.14); }

.topbar-actions .icon-btn[aria-label="Benachrichtigungen"] {
  position: relative;
  overflow: visible;
}

/* Fängt Klicks außerhalb des Panels (z. B. über iframes), damit das Fenster schließt */
.notify-backdrop {
  position: fixed;
  inset: 0;
  z-index: 10040;
  background: transparent;
  cursor: default;
}

.notify-backdrop[hidden] {
  display: none !important;
}

.notify-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: #b91c1c;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
  box-sizing: border-box;
  pointer-events: none;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.95);
}

.notify-panel {
  position: fixed;
  z-index: 10050;
  max-height: min(420px, 70vh);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: var(--gk-card);
  border: 1px solid var(--gk-card-border);
  border-radius: var(--gk-radius-lg);
  box-shadow: 0 20px 50px rgba(15, 35, 80, 0.18), 0 4px 12px rgba(15, 35, 80, 0.08);
}

/* display:flex würde sonst das native [hidden]-Verhalten überschreiben — Panel blieb sichtbar */
.notify-panel[hidden] {
  display: none !important;
}

.notify-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--gk-card-border);
  font-size: 14px;
  font-weight: 700;
  color: var(--gk-text);
  flex-shrink: 0;
}

.notify-panel-link {
  font-size: 12px;
  font-weight: 600;
  color: var(--gk-accent);
  text-decoration: none;
}

.notify-panel-link:hover {
  text-decoration: underline;
}

.notify-panel-inner {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 8px 0;
  max-height: min(360px, 60vh);
}

.notify-loading,
.notify-empty,
.notify-error {
  margin: 16px 18px;
  font-size: 13px;
  color: var(--gk-text-muted);
}

.notify-error {
  color: #b45309;
}

.notify-item {
  padding: 10px 14px;
  border-bottom: 1px solid rgba(0, 40, 100, 0.06);
}

.notify-item:last-child {
  border-bottom: none;
}

.notify-item-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}

.notify-item-time {
  font-size: 12px;
  font-weight: 600;
  color: var(--gk-text-muted);
  font-variant-numeric: tabular-nums;
}

.notify-item-event {
  font-size: 12px;
  font-weight: 700;
  color: var(--gk-primary);
}

.notify-item-detail {
  margin: 0;
  font-size: 13px;
  line-height: 1.4;
  color: var(--gk-text);
}

.content {
  flex: 1;
  min-width: 0;
  min-height: 0;
  padding: clamp(12px, 2vw, 24px) clamp(14px, 2.5vw, 28px);
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}

.page-head {
  margin-bottom: 22px;
}

.page-head h2 {
  margin: 0;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.page-head p {
  margin: 6px 0 0;
  font-size: 14px;
  color: var(--gk-text-muted);
  max-width: 72ch;
  overflow-wrap: anywhere;
}

.page-head--actions {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px 16px;
}

.page-head--actions > div:first-child {
  flex: 1 1 240px;
  min-width: 0;
}

.page-head--actions .page-head-tools {
  flex: 0 0 auto;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.uw-meta-line {
  margin: 0;
  font-size: 13px;
  color: var(--gk-text-muted);
}

/* Unterweisungen: klare Abschnitte */
.uw-stack {
  display: flex;
  flex-direction: column;
  gap: clamp(16px, 2vw, 22px);
  min-width: 0;
}

/* Unterweisungen: Kachel = Video + Quiz */
.uw-module-tile .uw-section-head {
  margin-bottom: 14px;
}

.uw-module-tile--extra {
  border-color: rgba(0, 61, 153, 0.14);
}

.uw-module-tile-head {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.uw-module-tile-titles {
  flex: 1 1 200px;
  min-width: 0;
}

.uw-module-tile-actions {
  flex: 0 1 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 10px;
  justify-content: flex-end;
  margin-left: auto;
}

.btn-compact {
  padding: 6px 12px;
  font-size: 13px;
}

.uw-module-quiz-block {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid rgba(0, 61, 153, 0.12);
}

.uw-module-quiz-block--nested {
  margin-top: 14px;
  padding-top: 12px;
}

.uw-module-quiz-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.uw-module-quiz-title {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--gk-text-muted);
}

.uw-quiz-empty {
  margin: 0;
}

.uw-extra-summary {
  display: grid;
  gap: 10px;
  padding: 12px 14px;
  border-radius: var(--gk-radius-md);
  background: rgba(0, 61, 153, 0.04);
  border: 1px solid rgba(0, 61, 153, 0.1);
  font-size: 13px;
}

.uw-extra-summary-row {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
}

@media (max-width: 520px) {
  .uw-extra-summary-row {
    grid-template-columns: 1fr;
  }
}

.uw-extra-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--gk-text-muted);
}

.uw-extra-value {
  min-width: 0;
  word-break: break-word;
}

.uw-additional-tiles {
  display: flex;
  flex-direction: column;
  gap: clamp(16px, 2vw, 22px);
}

.uw-additional-empty {
  margin: 0;
  padding: 12px 14px;
  border-radius: var(--gk-radius-md);
  background: rgba(0, 0, 0, 0.03);
  border: 1px dashed rgba(0, 61, 153, 0.2);
}

.uw-add-medium-card .uw-add-medium-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.uw-add-medium-title {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
}

.uw-add-medium-lead {
  margin-top: 6px;
  max-width: 52ch;
}

.uw-step--warn {
  background: #c45c2a;
  font-size: 18px;
}

.uw-orphan-section .uw-section-head {
  margin-bottom: 12px;
}

.uw-section .uw-section-head {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 16px;
}

.uw-section-head--inline {
  margin-bottom: 0;
  flex: 1;
  min-width: 0;
}

.uw-section-bar {
  align-items: flex-start;
  margin-bottom: 14px;
}

.uw-section-bar .btn-secondary {
  flex-shrink: 0;
}

.uw-step {
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--gk-primary);
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  display: grid;
  place-items: center;
  line-height: 1;
  margin-top: 2px;
}

.uw-section-titles h3 {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
}

.uw-section-lead {
  margin: 6px 0 0;
  font-size: 13px;
  font-weight: 400;
  color: var(--gk-text-muted);
  line-height: 1.45;
  max-width: 62ch;
}

.uw-form-section-label {
  margin: 0 0 8px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--gk-text-muted);
}

.uw-main-split {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  gap: clamp(16px, 2.5vw, 28px);
  align-items: start;
}

@media (max-width: 900px) {
  .uw-main-split {
    grid-template-columns: 1fr;
  }
}

.uw-main-col--preview {
  padding: 14px 16px;
  border-radius: var(--gk-radius-md);
  background: rgba(0, 61, 153, 0.04);
  border: 1px solid rgba(0, 61, 153, 0.1);
}

.uw-thumb {
  margin-top: 0;
}

.uw-preview-meta {
  margin-left: 0;
  margin-right: 0;
}

.uw-preview-meta:first-of-type {
  margin-top: 10px;
}

.uw-form-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

@media (max-width: 520px) {
  .uw-form-row-2 {
    grid-template-columns: 1fr;
  }
}

.uw-form-grid--tight {
  margin-bottom: 0;
  gap: 9px;
}

.uw-table-wrap {
  margin-top: 0;
}

.uw-cell-muted {
  color: var(--gk-text-muted);
  font-size: 13px;
}

.uw-quiz-list {
  margin-top: 4px;
}

.uw-quiz-group {
  margin-bottom: 18px;
}

.uw-quiz-group:last-child {
  margin-bottom: 0;
}

.uw-quiz-group-title {
  margin: 0 0 10px;
  font-size: 13px;
  font-weight: 700;
  color: var(--gk-primary);
  letter-spacing: -0.01em;
}

.uw-media-cell {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
}

.uw-media-tag {
  display: inline-block;
  margin-right: 6px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--gk-primary);
  opacity: 0.9;
}

.uw-main-preview-img {
  max-width: 100%;
  max-height: 220px;
  object-fit: contain;
  display: block;
  margin: 0 auto;
}

/* Responsives 16:9 (zuverlässiger als aspect-ratio auf iframe in Grid) */
.uw-yt-wrap {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%;
  height: 0;
  overflow: hidden;
  border-radius: 12px;
  background: #0c1628;
}

.uw-yt-wrap .uw-yt-embed {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.uw-form-grid {
  display: grid;
  gap: 10px;
  margin-bottom: 12px;
}

.uw-form-grid label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 13px;
  color: var(--gk-text-muted);
}

.uw-form-grid .input,
.uw-form-grid textarea {
  font-size: 14px;
}

.uw-checkbox-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--gk-text);
}

.uw-checkbox-row input {
  width: 16px;
  height: 16px;
  accent-color: var(--gk-primary);
}

.thumb-video-wrap {
  margin-top: 8px;
  border-radius: var(--gk-radius-md);
  overflow: hidden;
  background: rgba(0, 0, 0, 0.06);
  min-height: 120px;
  display: block;
}

.thumb-video-wrap video {
  width: 100%;
  max-height: 220px;
  display: block;
  vertical-align: middle;
}

.thumb-video-wrap--empty {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gk-text-muted);
  font-size: 13px;
  padding: 24px;
  text-align: center;
  min-height: 120px;
}

.thumb-video-wrap .uw-preview-fail {
  margin: 0;
  max-width: 100%;
  line-height: 1.45;
}

.uw-dialog-form {
  display: grid;
  gap: 12px;
  min-width: min(100vw - 48px, 400px);
}

.uw-dialog-form label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 13px;
  color: var(--gk-text-muted);
}

.uw-field-hint {
  display: block;
  margin-top: 6px;
  font-size: 12px;
  font-weight: 400;
  color: var(--gk-text-muted);
  line-height: 1.4;
  max-width: 42ch;
}

.uw-field-inline-hint {
  font-weight: 500;
  font-size: 11px;
  color: var(--gk-text-muted);
  text-transform: lowercase;
}

.uw-dialog-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 4px;
}

dialog.admin-dialog {
  border: 1px solid var(--gk-card-border);
  border-radius: var(--gk-radius-md);
  padding: 18px 20px;
  box-shadow: var(--gk-card-shadow);
  max-width: calc(100vw - 32px);
}

dialog.admin-dialog::backdrop {
  background: rgba(15, 35, 80, 0.35);
}

/*
  Einstellungen: drei Spalten per Flexbox (stabiler als CSS-Grid/fr bei tiefem Inhalt).
*/
.dashboard-grid {
  display: flex;
  flex-direction: column;
  gap: clamp(12px, 1.8vw, 20px);
  align-items: stretch;
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.dashboard-grid > *,
.dashboard-grid .settings-nav {
  min-width: 0;
}

.dashboard-grid .card {
  max-width: 100%;
  box-sizing: border-box;
}

/* Desktop / breiter Bereich: Nav links, zwei Inhaltsspalten gleich breit */
@media (min-width: 901px) {
  .dashboard-grid {
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: flex-start;
    gap: clamp(14px, 2vw, 26px);
  }

  .dashboard-grid > .settings-nav {
    flex: 0 0 clamp(200px, 18vw, 280px);
    width: clamp(200px, 18vw, 280px);
    max-width: 300px;
    min-width: 160px;
  }

  .dashboard-grid > .stack-gap {
    flex: 1 1 0;
    min-width: 0;
  }
}

/* Mittlere Breite: Baukasten-Navigation zuerst volle Breite, darunter zwei Spalten */
@media (min-width: 901px) and (max-width: 1200px) {
  .dashboard-grid {
    flex-wrap: wrap;
  }

  .dashboard-grid > .settings-nav {
    flex: 1 1 100%;
    width: 100%;
    max-width: none;
  }

  .dashboard-grid > .stack-gap {
    flex: 1 1 calc(50% - 10px);
    min-width: min(100%, 280px);
  }
}

@media (min-width: 1024px) and (orientation: landscape) {
  :root {
    --admin-sidebar-w: 220px;
  }
  .page-head { margin-bottom: 14px; }
  .page-head h2 { font-size: 20px; }
}

@media (max-width: 900px) {
  .admin-layout { grid-template-columns: 1fr; max-height: none; }
  .sidebar {
    flex-direction: row;
    flex-wrap: wrap;
    padding: 12px 16px;
  }
  .nav { display: flex; flex-wrap: wrap; padding: 8px 0; }
  .sidebar-user-wrap { width: 100%; border-top: 1px solid rgba(255, 255, 255, 0.08); margin-top: 8px; }
  .dashboard-grid > .settings-nav,
  .dashboard-grid > .stack-gap {
    flex: none;
    width: 100%;
    max-width: none;
  }
}

.card {
  background: var(--gk-card);
  border: 1px solid var(--gk-card-border);
  box-shadow: var(--gk-card-shadow);
  border-radius: var(--gk-radius-lg);
  padding: 20px 22px;
}

.card-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.card-title-row h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
}

.btn-secondary {
  padding: 8px 14px;
  border-radius: 12px;
  border: 1px solid rgba(0, 61, 153, 0.25);
  background: #fff;
  color: var(--gk-primary);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.btn-secondary:hover {
  background: rgba(0, 61, 153, 0.06);
}

.btn-success,
.btn-danger,
.btn-warning {
  padding: 8px 14px;
  border-radius: 12px;
  border: 1px solid transparent;
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.btn-success {
  background: #0d7a3e;
  border-color: #0d7a3e;
}

.btn-success:hover { background: #0a6432; }

.btn-danger {
  background: #b91c1c;
  border-color: #b91c1c;
}

.btn-danger:hover { background: #991b1b; }

.btn-warning {
  background: #b7791f;
  border-color: #b7791f;
}

.btn-warning:hover { background: #975f19; }

/* Settings sub-nav */
.settings-nav .card { padding: 12px; }

.settings-nav-item {
  display: flex;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 14px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.settings-nav-item:hover { background: rgba(0, 61, 153, 0.05); }

.settings-nav-item.is-active {
  background: rgba(0, 61, 153, 0.1);
  border-color: rgba(0, 61, 153, 0.2);
}

.settings-nav-item .sn-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: rgba(0, 61, 153, 0.1);
  display: grid;
  place-items: center;
  flex-shrink: 0;
  color: var(--gk-primary);
}

.settings-nav-item .sn-t { font-size: 14px; font-weight: 600; }
.settings-nav-item .sn-d { font-size: 12px; color: var(--gk-text-muted); margin-top: 2px; }

.settings-nav-group {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(0, 40, 100, 0.1);
}

.settings-nav-group-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--gk-text-muted);
  padding: 0 14px 10px;
}

a.settings-nav-link {
  text-decoration: none;
  color: inherit;
  display: flex;
  align-items: flex-start;
  box-sizing: border-box;
}

a.settings-nav-link:focus-visible {
  outline: 2px solid rgba(0, 61, 153, 0.45);
  outline-offset: 2px;
}

/* Einstellungen – schlanke Einspalt-Ansicht */
.settings-page-wrap {
  max-width: 720px;
}

.settings-page-wrap--wide {
  max-width: 1100px;
}

.settings-section-lead {
  margin: 0 0 16px;
  font-size: 14px;
  line-height: 1.55;
  color: var(--gk-text-muted);
}

.settings-more-list {
  margin: 0;
  padding-left: 1.25rem;
  font-size: 14px;
  line-height: 1.75;
  color: var(--gk-text);
}

.settings-more-list li {
  margin: 0.4em 0;
}

.settings-more-list a {
  font-weight: 600;
  color: var(--gk-primary);
  text-decoration: none;
}

.settings-more-list a:hover {
  text-decoration: underline;
}

/* Module toggles – Mindestbreite pro Kachel, sonst bricht Text buchstabenweise (kein starres 3-Spalten-Raster) */
.module-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
  min-width: 0;
  width: 100%;
}

@media (max-width: 520px) {
  .module-grid {
    grid-template-columns: 1fr;
  }
}

.module-tile {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-radius: var(--gk-radius-md);
  border: 1px solid var(--gk-card-border);
  background: rgba(255, 255, 255, 0.7);
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}

.module-tile-lead {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  flex: 1 1 0;
  min-width: 0;
}

.module-tile .mt-body {
  min-width: 0;
  flex: 1 1 auto;
}

.module-tile .mt-body h4 {
  margin: 0 0 4px;
  font-size: 14px;
  font-weight: 700;
}

.module-tile .mt-body p {
  margin: 0;
  font-size: 12px;
  color: var(--gk-text-muted);
  line-height: 1.45;
  overflow-wrap: break-word;
  word-break: normal;
}

.module-tile .mt-ico {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: rgba(0, 61, 153, 0.08);
  display: grid;
  place-items: center;
  flex-shrink: 0;
  color: var(--gk-primary);
}

/* Toggle */
.switch {
  position: relative;
  width: 44px;
  height: 24px;
  flex: 0 0 44px;
  flex-shrink: 0;
  align-self: flex-start;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}

.switch-slider {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: rgba(0, 40, 100, 0.2);
  cursor: pointer;
  transition: background 0.2s ease;
}

.switch-slider::after {
  content: "";
  position: absolute;
  width: 20px;
  height: 20px;
  left: 2px;
  top: 2px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
  transition: transform 0.2s ease;
}

.switch input:checked + .switch-slider {
  background: linear-gradient(90deg, var(--gk-accent), var(--gk-primary));
}

.switch input:checked + .switch-slider::after {
  transform: translateX(20px);
}

/* Badge preview */
.badge-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  align-items: start;
  min-width: 0;
  width: 100%;
}

@media (max-width: 700px) {
  .badge-layout { grid-template-columns: 1fr; }
}

.badge-preview {
  aspect-ratio: 54 / 86;
  max-height: 280px;
  margin: 0 auto;
  width: 100%;
  max-width: 200px;
  border-radius: 12px;
  border: 1px dashed rgba(0, 61, 153, 0.25);
  background: linear-gradient(180deg, #fff 0%, #f4f7fb 100%);
  padding: 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.8);
}

.badge-preview .bp-logo {
  font-size: 10px;
  font-weight: 800;
  color: var(--gk-primary);
  letter-spacing: 0.06em;
  margin-bottom: 8px;
}

.badge-preview .bp-type {
  font-size: 9px;
  font-weight: 700;
  color: var(--gk-text-muted);
  letter-spacing: 0.12em;
}

.badge-preview .bp-name {
  font-size: 15px;
  font-weight: 700;
  margin: 10px 0 4px;
  color: var(--gk-text);
}

.badge-preview .bp-co {
  font-size: 11px;
  color: var(--gk-text-muted);
}

.badge-preview .bp-date {
  font-size: 10px;
  margin-top: 8px;
  color: var(--gk-text-muted);
}

.badge-preview .bp-qr {
  margin-top: auto;
  width: 56px;
  height: 56px;
  background: repeating-linear-gradient(
    90deg,
    #1a2230 0px,
    #1a2230 4px,
    transparent 4px,
    transparent 8px
  ),
  repeating-linear-gradient(
    0deg,
    #1a2230 0px,
    #1a2230 4px,
    transparent 4px,
    transparent 8px
  );
  background-size: 8px 8px;
  background-blend-mode: multiply;
  opacity: 0.85;
  border-radius: 4px;
}

.field-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.field-list--drag-active .field-chip:not(.field-chip--drag) {
  opacity: 0.88;
}

.field-chip--drop-before {
  box-shadow: inset 0 3px 0 0 var(--gk-primary, #003d99);
  border-radius: 12px;
}

.field-chip--drop-after {
  box-shadow: inset 0 -3px 0 0 var(--gk-primary, #003d99);
  border-radius: 12px;
}

.field-chip {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(0, 61, 153, 0.06);
  font-size: 13px;
  font-weight: 500;
  border: 1px solid rgba(0, 61, 153, 0.1);
  cursor: grab;
}

.field-chip span.muted { color: var(--gk-text-muted); font-size: 12px; }

/* Video + Quiz */
.video-card {
  max-width: 100%;
  min-width: 0;
}

.video-card .thumb {
  position: relative;
  border-radius: 14px;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  background: linear-gradient(135deg, #1a2a44 0%, #0c1628 100%);
  margin-bottom: 12px;
}

.video-card .thumb::after {
  content: "";
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M8 5v14l11-7z'/%3E%3C/svg%3E") center/48px no-repeat;
  opacity: 0.9;
}

.video-card .thumb.has-media::after {
  display: none;
}

.video-card .thumb.has-media .uw-yt-wrap {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  padding-bottom: 0;
  border-radius: 14px;
}

.video-card .thumb.has-media .uw-yt-wrap .uw-yt-embed {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.video-card .thumb .settings-thumb-video,
.video-card .thumb .settings-thumb-img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #0c1628;
}

.video-card .thumb .settings-thumb-img {
  object-fit: cover;
}

.video-meta {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 4px;
}

.video-meta-sub {
  font-size: 12px;
  color: var(--gk-text-muted);
  margin-bottom: 14px;
}

.quiz-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.quiz-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--gk-card-border);
  background: rgba(255, 255, 255, 0.65);
  font-size: 13px;
  line-height: 1.45;
}

.quiz-item .qi-num {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  border-radius: 8px;
  background: var(--gk-primary);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  display: grid;
  place-items: center;
}

.quiz-item .qi-edit {
  margin-left: auto;
  flex-shrink: 0;
  opacity: 0.45;
  cursor: pointer;
}

.uw-quiz-body {
  flex: 1;
  min-width: 0;
}

.uw-quiz-actions {
  margin-left: auto;
  flex-shrink: 0;
  white-space: nowrap;
  font-size: 12px;
}

.stack-gap {
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-width: 0;
}

/* ----- Navigation links ----- */
a.nav-item {
  text-decoration: none;
  color: inherit;
}

/* Seite deaktiviert: Fahrer & Slots nicht mehr in Navigation anzeigen */
.nav-item[href="fahrer-slots.html"] {
  display: none !important;
}

/* ----- Allgemeine Unterseiten-Layouts ----- */
.content-grid {
  display: flex;
  flex-direction: column;
  gap: 18px;
  width: 100%;
  max-width: min(100%, 1600px);
  box-sizing: border-box;
}

.content-grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  align-items: start;
}

@media (max-width: 960px) {
  .content-grid-2 { grid-template-columns: 1fr; }
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  width: 100%;
  min-width: 0;
}

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

@media (max-width: 520px) {
  .stat-grid { grid-template-columns: 1fr; }
}

.stat-card {
  padding: 16px 18px;
  border-radius: var(--gk-radius-lg);
  background: var(--gk-card);
  border: 1px solid var(--gk-card-border);
  box-shadow: var(--gk-card-shadow);
  min-width: 0;
}

.stat-card .stat-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--gk-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 6px;
  white-space: normal;
  overflow-wrap: anywhere;
  line-height: 1.3;
}

.stat-card .stat-value {
  font-size: 26px;
  font-weight: 700;
  color: var(--gk-primary);
  letter-spacing: -0.02em;
}

.stat-card .stat-hint {
  font-size: 12px;
  color: var(--gk-text-muted);
  margin-top: 8px;
}

.dash-chart-card {
  width: 100%;
  min-width: 0;
}

.dash-chart-meta {
  font-size: 12px;
  color: var(--gk-text-muted);
  font-weight: 500;
}

.dash-chart-wrap {
  position: relative;
  min-height: 260px;
  width: 100%;
  margin-top: 4px;
}

.dash-chart-loading,
.dash-chart-empty {
  margin: 0;
  padding: 24px;
  text-align: center;
  color: var(--gk-text-muted);
  font-size: 14px;
}

.dash-chart-msg {
  margin: 0 0 10px;
  font-size: 13px;
  color: #b45309;
  background: rgba(180, 83, 9, 0.08);
  padding: 8px 12px;
  border-radius: 10px;
}

/* Native Balkendiagramm (ohne Chart.js) */
.dash-native-chart {
  display: flex;
  gap: 10px;
  align-items: stretch;
  min-height: 240px;
  padding: 4px 0 0;
}

.dash-native-y {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  flex-shrink: 0;
  width: 28px;
  padding-bottom: 28px;
  font-size: 11px;
  font-weight: 600;
  color: var(--gk-text-muted);
  text-align: right;
  line-height: 1;
}

.dash-native-scroll {
  flex: 1;
  min-width: 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-bottom: 2px solid rgba(0, 40, 100, 0.15);
  padding-bottom: 2px;
}

.dash-native-bars {
  display: flex;
  align-items: stretch;
  justify-content: flex-start;
  gap: 8px;
  min-height: 240px;
  padding: 0 8px 0 4px;
}

.dash-nc-col {
  flex: 0 0 44px;
  width: 44px;
  min-width: 44px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  min-height: 240px;
}

.dash-nc-val {
  font-size: 12px;
  font-weight: 700;
  color: var(--gk-primary);
  min-height: 18px;
}

.dash-nc-bar-track {
  flex: 1 1 auto;
  width: 100%;
  min-height: 140px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  background: linear-gradient(
    180deg,
    rgba(0, 40, 100, 0.06) 0%,
    rgba(0, 40, 100, 0.02) 100%
  );
  border-radius: 8px 8px 0 0;
}

.dash-nc-bar {
  width: 100%;
  max-width: 32px;
  min-height: 3px;
  border-radius: 6px 6px 2px 2px;
  background: linear-gradient(180deg, #0d5cb5 0%, #003d99 100%);
  box-shadow: 0 -1px 0 rgba(255, 255, 255, 0.25) inset;
  transition: height 0.2s ease;
}

.dash-nc-lbl {
  font-size: 10px;
  color: var(--gk-text-muted);
  text-align: center;
  line-height: 1.15;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 4px;
}

.toolbar-spacer { flex: 1; min-width: 8px; }

/* Besucherliste: breitere Suche, Aktionen rechts gebündelt */
.besucher-toolbar .besucher-search {
  flex: 1 1 320px;
  min-width: min(100%, 260px);
  max-width: 560px;
  width: 100%;
}

.besucher-toolbar-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  flex: 0 1 auto;
  justify-content: flex-end;
}

@media (max-width: 720px) {
  .besucher-toolbar .besucher-search {
    flex-basis: 100%;
    max-width: none;
  }
}

.besucher-toolbar-msg {
  margin: 0 0 8px;
  font-size: 13px;
  min-height: 1.2em;
  color: var(--gk-text-muted);
}

/* Split-Button: Import + Info als eine Einheit, Export separat */
.besucher-import-split {
  display: inline-flex;
  align-items: stretch;
  position: relative;
  border-radius: 12px;
  border: 1px solid rgba(0, 61, 153, 0.25);
  background: #fff;
  overflow: visible;
}

.besucher-import-main {
  border: none;
  border-radius: 11px 0 0 11px;
  background: transparent;
  margin: 0;
}

.besucher-import-main:hover {
  background: rgba(0, 61, 153, 0.06);
}

.besucher-csv-info {
  position: relative;
  display: flex;
  align-items: stretch;
}

.besucher-csv-info > summary {
  list-style: none;
  cursor: pointer;
}

.besucher-csv-info > summary::-webkit-details-marker {
  display: none;
}

.besucher-csv-info-btn {
  box-sizing: border-box;
  min-width: 38px;
  padding: 0 10px;
  border: none;
  border-left: 1px solid rgba(0, 61, 153, 0.22);
  border-radius: 0 11px 11px 0;
  background: transparent;
  color: var(--gk-primary);
  display: grid;
  place-items: center;
  font: inherit;
  line-height: 1;
  transition: background 0.15s ease;
}

.besucher-csv-info-btn:hover {
  background: rgba(0, 61, 153, 0.08);
}

.besucher-csv-info-btn:focus-visible {
  outline: 2px solid var(--gk-primary);
  outline-offset: 2px;
  z-index: 1;
}

.besucher-csv-info-icon {
  font-size: 15px;
  font-weight: 600;
  font-style: italic;
}

.besucher-csv-hint-popover {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 20;
  min-width: min(100vw - 32px, 320px);
  max-width: min(100vw - 32px, 420px);
  margin: 0;
  padding: 12px 14px;
  font-size: 13px;
  color: var(--gk-text-muted);
  line-height: 1.45;
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
}

.besucher-csv-hint-popover p {
  margin: 0;
}

.besucher-import-opt {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--gk-text-muted);
  white-space: nowrap;
}

.besucher-import-opt input {
  width: 16px;
  height: 16px;
  accent-color: var(--gk-primary);
}

.input,
.select {
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--gk-card-border);
  background: #fff;
  font-size: 14px;
  color: var(--gk-text);
  min-width: 160px;
}

.input:focus,
.select:focus {
  outline: none;
  border-color: rgba(0, 61, 153, 0.45);
  box-shadow: 0 0 0 3px rgba(0, 61, 153, 0.12);
}

.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 0 -4px;
  padding: 0 4px;
}

.table-wrap-scroll {
  max-height: 420px;
  overflow-y: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.data-table th {
  text-align: left;
  padding: 10px 12px;
  font-weight: 600;
  color: var(--gk-text-muted);
  border-bottom: 1px solid var(--gk-card-border);
  white-space: normal;
  vertical-align: bottom;
}

.data-table td {
  padding: 12px;
  border-bottom: 1px solid rgba(0, 40, 100, 0.06);
  vertical-align: middle;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.data-table tr:hover td {
  background: rgba(0, 61, 153, 0.04);
}

.data-table .cell-actions {
  text-align: right;
  white-space: nowrap;
}

/* Voranmeldungen – Dialog & Formular */
.admin-dialog {
  border: none;
  border-radius: 16px;
  padding: 0;
  max-width: min(520px, 96vw);
  box-shadow: 0 20px 50px rgba(0, 40, 100, 0.2);
}
.admin-dialog::backdrop {
  background: rgba(15, 23, 42, 0.45);
}
.admin-dialog-inner {
  padding: 22px 24px;
}
.admin-dialog h3 {
  margin: 0 0 16px;
  font-size: 18px;
  font-weight: 700;
  color: var(--gk-text);
}
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 16px;
}
.form-grid .full {
  grid-column: 1 / -1;
}
.form-field label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--gk-text-muted);
  margin-bottom: 4px;
}
.form-field .hint {
  font-size: 11px;
  font-weight: 400;
  color: var(--gk-text-muted);
  margin-top: 2px;
}
.form-field .input,
.form-field .select {
  width: 100%;
  box-sizing: border-box;
  min-width: 0;
}
.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--gk-card-border);
}
.admin-msg {
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 13px;
  margin-bottom: 12px;
  line-height: 1.4;
}
.admin-msg--error {
  background: #fef2f2;
  color: #991b1b;
  border: 1px solid #fecaca;
}
.admin-msg--ok,
.admin-msg--success {
  background: #f0fdf4;
  color: #166534;
  border: 1px solid #bbf7d0;
}
@media (max-width: 540px) {
  .form-grid {
    grid-template-columns: 1fr;
  }
}

.tag {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
}

.tag-success {
  background: rgba(13, 122, 62, 0.12);
  color: var(--gk-success);
}

.tag-warn {
  background: rgba(180, 120, 0, 0.15);
  color: #8a6a00;
}

.tag-muted {
  background: rgba(0, 40, 100, 0.08);
  color: var(--gk-text-muted);
}

.tag-danger {
  background: rgba(185, 28, 28, 0.12);
  color: #b91c1c;
}

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 14px;
}

.tab {
  padding: 8px 14px;
  border-radius: 12px;
  border: 1px solid transparent;
  background: transparent;
  font-size: 13px;
  font-weight: 600;
  color: var(--gk-text-muted);
  cursor: pointer;
}

.tab:hover {
  background: rgba(0, 61, 153, 0.06);
  color: var(--gk-text);
}

.tab.is-active {
  background: rgba(0, 61, 153, 0.12);
  color: var(--gk-primary);
  border-color: rgba(0, 61, 153, 0.2);
}

.link-quiet {
  color: var(--gk-accent);
  font-weight: 600;
  font-size: 13px;
  text-decoration: none;
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
  font: inherit;
}

.link-quiet:hover {
  text-decoration: underline;
}

.empty-state {
  text-align: center;
  padding: 32px 20px;
  color: var(--gk-text-muted);
  font-size: 14px;
}

.device-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
}

.device-card h4 {
  margin: 0 0 6px;
  font-size: 15px;
}

.device-card .dc-meta {
  font-size: 12px;
  color: var(--gk-text-muted);
  margin-bottom: 12px;
}

.dc-row {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  padding: 6px 0;
  border-top: 1px solid var(--gk-card-border);
}

.dc-code {
  font-size: 12px;
  font-family: ui-monospace, monospace;
  background: rgba(0, 40, 100, 0.08);
  padding: 1px 6px;
  border-radius: 4px;
}

.device-card .dc-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.device-card .btn-dc {
  flex: 1 1 auto;
  min-width: 0;
  justify-content: center;
}

.device-card .btn-dc-danger {
  color: #a33;
  background: rgba(180, 40, 40, 0.08);
}

.device-card .btn-dc-danger:hover {
  background: rgba(180, 40, 40, 0.15);
}

.gate-devices-error {
  color: #a33;
  font-size: 14px;
  margin: 0 0 12px;
}

.gate-device-dialog.label-dialog {
  max-width: 520px;
  width: calc(100vw - 32px);
}

.gate-page-hero-card {
  padding: 16px 18px;
}

.gate-page-hero-head {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 16px;
  align-items: flex-end;
  justify-content: space-between;
}

.gate-page-hero-head h3 {
  margin: 0;
  font-size: 17px;
}

.gate-page-hero-head p {
  margin: 6px 0 0;
  font-size: 13px;
  color: var(--gk-text-muted);
}

.gate-page-toolbar {
  margin: 0;
}

.gate-devices-grid-card .card-title-row {
  margin-bottom: 14px;
}

.gate-dlg-section-title {
  margin: 16px 0 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--gk-text-muted);
}

#gate-dlg-block-terminal,
#gate-dlg-block-printer,
#gate-dlg-block-accessory,
#gate-dlg-block-connect {
  border-top: 1px solid rgba(0, 40, 100, 0.08);
  padding-top: 12px;
  margin-top: 8px;
}

.slot-day {
  display: grid;
  grid-template-columns: 100px 1fr;
  gap: 12px;
  align-items: start;
  padding: 12px 0;
  border-bottom: 1px solid rgba(0, 40, 100, 0.06);
  font-size: 13px;
}

.slot-day:last-child { border-bottom: none; }

/* Fahrer & Slots (Demo-UI) */

/* KPI Section */
.fs-kpi-section {
  margin-bottom: 32px;
  padding: 20px;
  background: var(--gk-card);
  border-radius: var(--gk-radius-md);
  border: 1px solid var(--gk-card-border);
  box-shadow: var(--gk-card-shadow);
}

.section-header {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 16px;
}

.section-header h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: var(--gk-text);
}

.section-subtitle {
  font-size: 13px;
  color: var(--gk-text-muted);
  font-weight: 400;
}

/* Controls Section */
.fs-controls-section {
  margin-bottom: 32px;
  padding: 20px;
  background: var(--gk-card);
  border-radius: var(--gk-radius-md);
  border: 1px solid var(--gk-card-border);
  box-shadow: var(--gk-card-shadow);
}

.fs-controls-section--table {
  margin-bottom: 16px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid rgba(0, 40, 100, 0.06);
  border-radius: 12px;
}

.fs-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  align-items: center;
  margin-bottom: 16px;
}

.filter-group {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  min-width: 140px;
  flex: 0 0 auto;
}

.filter-group .label-toolbar-label {
  margin: 0;
  min-width: 50px;
  flex-shrink: 0;
}

.filter-group .select,
.filter-group .input {
  min-width: 100px;
  flex: 1;
}

.filter-group--search {
  flex: 1;
  min-width: 250px;
  max-width: 350px;
}

.filter-group--search .label-toolbar-label {
  min-width: 120px;
}

.fs-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding-top: 12px;
  border-top: 1px solid var(--gk-card-border);
}

/* Main Section */
.fs-main-section {
  margin-bottom: 24px;
}

.fs-ramps-card,
.fs-queue-card {
  height: fit-content;
}

.fs-ramps-card {
  max-height: 400px;
  display: flex;
  flex-direction: column;
}

.fs-ramps-card .card-title-row {
  flex-shrink: 0;
  border-bottom: 2px solid var(--gk-primary);
  padding-bottom: 12px;
  margin-bottom: 16px;
}

.fs-ramps-card #fs-ramp-list {
  flex: 1;
  overflow-y: auto;
  max-height: 320px;
  padding-right: 8px;
}

/* Custom scrollbar for ramp list */
.fs-ramps-card #fs-ramp-list::-webkit-scrollbar {
  width: 6px;
}

.fs-ramps-card #fs-ramp-list::-webkit-scrollbar-track {
  background: rgba(0, 40, 100, 0.05);
  border-radius: 3px;
}

.fs-ramps-card #fs-ramp-list::-webkit-scrollbar-thumb {
  background: rgba(0, 40, 100, 0.2);
  border-radius: 3px;
}

.fs-ramps-card #fs-ramp-list::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 40, 100, 0.3);
}

.fs-queue-card {
  max-height: 400px;
  display: flex;
  flex-direction: column;
}

.fs-queue-card .card-title-row {
  flex-shrink: 0;
  border-bottom: 2px solid var(--gk-primary);
  padding-bottom: 12px;
  margin-bottom: 16px;
}

.fs-queue-card #fs-queue-list {
  flex: 1;
  overflow-y: auto;
  max-height: 280px;
  padding-right: 8px;
}

/* Custom scrollbar for queue list */
.fs-queue-card #fs-queue-list::-webkit-scrollbar {
  width: 6px;
}

.fs-queue-card #fs-queue-list::-webkit-scrollbar-track {
  background: rgba(0, 40, 100, 0.05);
  border-radius: 3px;
}

.fs-queue-card #fs-queue-list::-webkit-scrollbar-thumb {
  background: rgba(0, 40, 100, 0.2);
  border-radius: 3px;
}

.fs-queue-card #fs-queue-list::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 40, 100, 0.3);
}

.fs-ramps-card h3,
.fs-queue-card h3 {
  font-size: 15px;
  font-weight: 600;
  margin: 0;
}

/* Table Section */
.fs-table-card {
  margin-bottom: 32px;
  max-height: 500px;
  display: flex;
  flex-direction: column;
}

.fs-table-card .card-title-row {
  flex-shrink: 0;
  border-bottom: 2px solid var(--gk-accent);
  padding-bottom: 12px;
  margin-bottom: 16px;
}

.fs-table-card .table-wrap {
  flex: 1;
  overflow-y: auto;
  max-height: 420px;
}

/* Custom scrollbar for table */
.fs-table-card .table-wrap::-webkit-scrollbar {
  width: 8px;
}

.fs-table-card .table-wrap::-webkit-scrollbar-track {
  background: rgba(0, 40, 100, 0.05);
  border-radius: 4px;
}

.fs-table-card .table-wrap::-webkit-scrollbar-thumb {
  background: rgba(0, 40, 100, 0.2);
  border-radius: 4px;
}

.fs-table-card .table-wrap::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 40, 100, 0.3);
}

/* Rules Section */
.fs-rules-card {
  opacity: 0.8;
}

.fs-rules-card .card-title-row {
  border-bottom: 1px solid var(--gk-card-border);
  padding-bottom: 8px;
  margin-bottom: 12px;
}

.fs-rules-card h3 {
  font-size: 14px;
  font-weight: 500;
  margin: 0;
  color: var(--gk-text-muted);
}

/* Responsive */
@media (max-width: 768px) {
  .fs-filters {
    flex-direction: column;
    gap: 16px;
    align-items: stretch;
  }
  
  .filter-group {
    min-width: auto;
    flex-direction: row;
  }
  
  .filter-group--search {
    min-width: auto;
    max-width: none;
    flex: 1;
  }
  
  .fs-actions {
    flex-direction: column;
  }
  
  .section-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }
}
.fs-demo-pill {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(59, 130, 246, 0.12);
  color: var(--gk-primary, #1d4ed8);
  vertical-align: middle;
}

.fs-demo-banner {
  margin: 0 0 16px;
  padding: 10px 14px;
  font-size: 13px;
  border-radius: var(--gk-radius-lg, 12px);
  background: rgba(59, 130, 246, 0.1);
  border: 1px solid rgba(59, 130, 246, 0.22);
  color: var(--gk-text, #0f172a);
}

.fs-toolbar .fs-search {
  min-width: 140px;
  flex: 1;
  max-width: 260px;
}

.fs-kpi-section .stat-grid {
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}

.fs-kpi-section .stat-card {
  padding: 16px;
  text-align: center;
  border: 1px solid var(--gk-card-border);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.6);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.fs-kpi-section .stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 40, 100, 0.1);
}

.fs-kpi-section .stat-value {
  font-size: 24px;
  font-weight: 700;
  color: var(--gk-primary);
  margin-bottom: 4px;
}

.fs-kpi-section .stat-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--gk-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 2px;
}

.fs-kpi-section .stat-hint {
  font-size: 11px;
  color: var(--gk-text-muted);
  opacity: 0.8;
}

.fs-ramp-row {
  padding: 12px 0;
  border-bottom: 1px solid rgba(0, 40, 100, 0.06);
}

.fs-ramp-row:last-child {
  border-bottom: none;
}

.fs-ramp-row strong {
  color: var(--gk-primary);
  font-weight: 600;
}

.fs-ramp-sub {
  margin-top: 6px;
  color: var(--gk-text-muted);
  font-size: 12px;
}

.fs-ramp-line {
  margin-top: 8px;
  font-size: 13px;
  line-height: 1.5;
  padding: 6px 8px;
  border-radius: 6px;
  transition: background-color 0.2s ease;
}

.fs-ramp-line:first-child {
  margin-top: 0;
}

.fs-ramp-line--free {
  color: var(--gk-text-muted);
  background-color: rgba(13, 122, 62, 0.05);
  border-left: 3px solid var(--gk-success);
}

.fs-ramp-line:not(.fs-ramp-line--free) {
  background-color: rgba(0, 61, 153, 0.03);
  border-left: 3px solid var(--gk-primary);
}

.fs-delay {
  font-size: 12px;
  color: #b45309;
}

.fs-queue-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.fs-queue-empty {
  margin: 0;
  font-size: 14px;
  color: var(--gk-text-muted);
}

.fs-queue-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.8);
  border-radius: 8px;
  border: 1px solid rgba(0, 40, 100, 0.08);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.fs-queue-item:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0, 40, 100, 0.1);
}

.fs-queue-pos {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 13px;
  border-radius: 8px;
  background: var(--gk-card, #fff);
  border: 1px solid rgba(0, 40, 100, 0.1);
}

.fs-queue-body {
  flex: 1;
  min-width: 0;
  font-size: 14px;
}

.fs-queue-actions {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex-shrink: 0;
}

.fs-queue-sub {
  margin-top: 4px;
  font-size: 12px;
  color: var(--gk-text-muted);
}

.fs-queue-hint {
  margin: 12px 0 0;
  font-size: 12px;
  color: var(--gk-text-muted);
}

.fs-rules-list {
  margin: 0;
  padding-left: 20px;
  font-size: 14px;
  color: var(--gk-text-muted);
  line-height: 1.6;
}

.fs-btn-sm {
  font-size: 12px;
  padding: 5px 10px;
  margin-right: 4px;
  margin-bottom: 4px;
}

.fs-btn-danger {
  color: #a33;
  background: rgba(180, 40, 40, 0.08);
}

.fs-btn-danger:hover {
  background: rgba(180, 40, 40, 0.15);
}

.fs-table-card .data-table {
  border-collapse: separate;
  border-spacing: 0;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 40, 100, 0.1);
}

.fs-table-card .data-table thead {
  background: #6b8cae;
  color: white;
}

.fs-table-card .data-table th {
  font-weight: 600;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 12px 8px;
}

.fs-table-card .data-table tbody tr {
  transition: background-color 0.2s ease;
}

.fs-table-card .data-table tbody tr:hover {
  background-color: rgba(0, 61, 153, 0.02);
}

.fs-table-card .data-table td {
  padding: 10px 8px;
  border-top: 1px solid var(--gk-card-border);
}

.fs-td-actions {
  white-space: normal;
  max-width: 220px;
  vertical-align: middle;
}

#fs-btn-live.is-active {
  border-color: rgba(59, 130, 246, 0.45);
  background: rgba(59, 130, 246, 0.12);
}

.pager {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 14px;
  font-size: 13px;
  color: var(--gk-text-muted);
}

a.link-quiet { text-decoration: none; }
a.link-quiet:hover { text-decoration: underline; }

/* ----- Desktop / PC (große Viewports, Maus & Präzisionszeiger) ----- */
@media (min-width: 1280px) {
  :root {
    --admin-sidebar-w: 272px;
    --admin-topbar-h: 68px;
  }

  .sidebar {
    padding: 22px 0 18px;
  }

  .sidebar-brand-text {
    font-size: 18px;
  }

  .nav-item {
    font-size: 14.5px;
    padding: 11px 16px;
  }

  .content {
    padding: clamp(20px, 2.2vw, 32px) clamp(24px, 3vw, 48px);
    scrollbar-gutter: stable;
  }

  .content-grid {
    max-width: min(100%, 1760px);
  }

  .page-head {
    margin-bottom: 26px;
  }

  .page-head h2 {
    font-size: 24px;
  }

  .page-head p {
    font-size: 15px;
  }

  .topbar-title h1 {
    font-size: 21px;
  }

  .topbar-title p {
    font-size: 14px;
  }

  .dashboard-grid {
    gap: 24px;
  }

  .data-table {
    font-size: 14px;
  }

  .data-table th,
  .data-table td {
    padding: 12px 14px;
  }

  .stat-card .stat-value {
    font-size: 30px;
  }

  .stat-grid {
    gap: 18px;
  }

  .device-grid {
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 18px;
  }

  .card {
    padding: 22px 24px;
  }
}

@media (min-width: 1600px) {
  .content-grid {
    max-width: min(100%, 1920px);
  }

  .dashboard-grid {
    gap: 28px;
  }
}

@media (min-width: 1280px) and (hover: hover) and (pointer: fine) {
  body {
    touch-action: auto;
  }

  .btn-secondary:focus-visible,
  .icon-btn:focus-visible,
  .tab:focus-visible,
  .nav-item:focus-visible,
  a.sidebar-brand:focus-visible {
    outline: 2px solid rgba(0, 61, 153, 0.45);
    outline-offset: 2px;
  }

  .card {
    transition: box-shadow 0.18s ease, border-color 0.18s ease;
  }

  .card:hover {
    box-shadow: 0 16px 48px rgba(15, 35, 80, 0.12), 0 4px 14px rgba(15, 35, 80, 0.07);
    border-color: rgba(0, 40, 100, 0.14);
  }

  .stat-card:hover {
    border-color: rgba(0, 40, 100, 0.14);
  }
}

@media (min-width: 1400px) {
  .content-grid-2 {
    gap: 22px;
  }
}

/* Öffentliche Seite: Zugang anfragen (eigenes Layout, scrollbar) */
html:has(body.za-page) {
  overflow: auto;
  height: auto;
  max-height: none;
}

body.za-page {
  margin: 0;
  min-height: 100%;
  min-height: 100dvh;
  overflow: auto;
  max-height: none;
  background: var(--gk-page);
}

.za-wrap {
  box-sizing: border-box;
  max-width: 440px;
  margin: 0 auto;
  padding: clamp(28px, 5vw, 48px) clamp(18px, 4vw, 28px) 56px;
}

.za-hero {
  text-align: center;
  margin-bottom: clamp(20px, 4vw, 28px);
}

.za-brand-mark {
  display: inline-grid;
  place-items: center;
  width: 56px;
  height: 56px;
  margin: 0 auto 14px;
  border-radius: 16px;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.95), rgba(230, 238, 250, 0.9));
  border: 1px solid rgba(0, 61, 153, 0.14);
  box-shadow: 0 8px 28px rgba(15, 35, 80, 0.08);
  color: var(--gk-primary);
}

.za-brand-title {
  margin: 0;
  font-size: clamp(1.15rem, 3vw, 1.35rem);
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gk-text);
}

.za-lead {
  margin: 10px auto 0;
  max-width: 34rem;
  font-size: 14px;
  color: var(--gk-text-muted);
  line-height: 1.55;
}

body.za-page .za-card.card {
  padding: clamp(22px, 4vw, 28px) clamp(20px, 4vw, 26px) clamp(22px, 4vw, 26px);
  border-radius: var(--gk-radius-lg);
  box-shadow: var(--gk-card-shadow);
  border: 1px solid var(--gk-card-border);
}

.za-card-head {
  margin-bottom: 20px;
  padding-bottom: 18px;
  border-bottom: 1px solid rgba(0, 40, 100, 0.08);
}

.za-title {
  margin: 0 0 8px;
  font-size: clamp(1.25rem, 3.2vw, 1.45rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--gk-text);
}

.za-hint {
  margin: 0;
  font-size: 13px;
  color: var(--gk-text-muted);
  line-height: 1.55;
  max-width: 52ch;
}

.za-hint strong {
  color: var(--gk-text);
  font-weight: 600;
}

.za-form {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.za-field {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
  margin-bottom: 16px;
}

.za-field--grow {
  margin-bottom: 20px;
}

.za-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--gk-text);
  line-height: 1.3;
}

.za-optional {
  font-weight: 500;
  font-size: 11px;
  color: var(--gk-text-muted);
  text-transform: lowercase;
  letter-spacing: 0.02em;
}

.za-form .req {
  color: #b91c1c;
  text-decoration: none;
  font-weight: 700;
}

body.za-page .za-input {
  width: 100%;
  min-width: 0;
  margin: 0;
  padding: 11px 14px;
  border-radius: 14px;
  border: 1px solid rgba(0, 40, 100, 0.14);
  background: #fff;
  font-size: 15px;
  line-height: 1.4;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

body.za-page .za-input::placeholder {
  color: #94a0b4;
}

body.za-page .za-textarea {
  min-height: 120px;
  resize: vertical;
  font-family: inherit;
  line-height: 1.5;
}

.za-actions {
  margin-top: 4px;
  padding-top: 4px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
}

.za-btn {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 20px;
  border: none;
  border-radius: 14px;
  font-size: 15px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  color: #fff;
  background: linear-gradient(165deg, var(--gk-accent), var(--gk-primary));
  box-shadow: 0 4px 14px rgba(0, 61, 153, 0.28), 0 1px 2px rgba(15, 35, 80, 0.12);
  transition: transform 0.12s ease, box-shadow 0.15s ease, filter 0.15s ease;
}

.za-btn:hover {
  filter: brightness(1.05);
  box-shadow: 0 6px 20px rgba(0, 61, 153, 0.32), 0 2px 4px rgba(15, 35, 80, 0.1);
}

.za-btn:active {
  transform: translateY(1px);
  filter: brightness(0.97);
}

.za-btn:focus-visible {
  outline: 2px solid rgba(0, 61, 153, 0.55);
  outline-offset: 3px;
}

.za-footer {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid rgba(0, 40, 100, 0.08);
  text-align: center;
  font-size: 13px;
  color: var(--gk-text-muted);
  line-height: 1.5;
}

.za-footer-link {
  color: var(--gk-primary);
  font-weight: 600;
  text-decoration: none;
  border-bottom: 1px solid rgba(0, 61, 153, 0.25);
  transition: color 0.15s ease, border-color 0.15s ease;
}

.za-footer-link:hover {
  color: var(--gk-accent);
  border-bottom-color: rgba(13, 92, 181, 0.45);
}

.za-footer-note {
  display: block;
  margin-top: 6px;
  font-size: 12px;
  color: var(--gk-text-muted);
  opacity: 0.92;
}

@media (min-width: 480px) {
  .za-wrap {
    max-width: 460px;
  }

  .za-actions {
    align-items: flex-start;
  }

  .za-btn {
    width: auto;
    min-width: 200px;
  }
}

/* Zugangsanfragen-Tabelle + HTTP-Audit */
.ar-meta {
  font-size: 12px;
  color: var(--gk-text-muted, #5a6578);
  margin-top: 4px;
}

.ar-msg {
  font-size: 13px;
  margin-top: 8px;
  white-space: pre-wrap;
  word-break: break-word;
  max-width: 42rem;
}

.ar-note {
  font-size: 12px;
  margin-top: 6px;
  color: var(--gk-text-muted, #5a6578);
}

.ar-actions {
  white-space: nowrap;
}

.bv-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.bv-kpi-card {
  background: var(--gk-card-bg);
  border: 1px solid var(--gk-card-border);
  border-radius: var(--gk-radius-lg);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.bv-kpi-label {
  font-size: 12px;
  color: var(--gk-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.bv-kpi-value {
  font-size: 24px;
  line-height: 1;
  color: var(--gk-primary);
}

.bv-section-card .table-wrap {
  margin-top: 6px;
}

.bv-section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px 16px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.bv-section-head h3 {
  margin: 0;
  font-size: 18px;
}

.bv-section-head p {
  margin: 6px 0 0;
  font-size: 13px;
  color: var(--gk-text-muted);
}

.au-actions,
.ar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.audit-path {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 12px;
  word-break: break-all;
  max-width: min(100%, 28rem);
}

/* Profil-Seite */
.profile-grid {
  display: flex;
  flex-direction: column;
  gap: clamp(16px, 2vw, 22px);
  max-width: 640px;
}

.profile-avatar-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 18px;
}

.profile-avatar-wrap {
  position: relative;
  width: 120px;
  height: 120px;
  flex-shrink: 0;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid rgba(0, 61, 153, 0.15);
  background: linear-gradient(135deg, rgba(0, 61, 153, 0.08), rgba(13, 92, 181, 0.12));
}

.profile-avatar-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.profile-avatar-ph {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  font-size: 36px;
  font-weight: 700;
  color: var(--gk-primary);
}

.profile-avatar-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
}

.profile-avatar-label {
  cursor: pointer;
  margin: 0;
}

.profile-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.profile-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--gk-text);
}

.profile-field .input {
  width: 100%;
  min-width: 0;
  max-width: 100%;
}

.profile-role-line {
  margin: 0 0 8px;
  font-size: 15px;
  color: var(--gk-text);
}

.profile-hint {
  margin: 0;
  font-size: 13px;
  color: var(--gk-text-muted);
  line-height: 1.45;
}

/* ----- Eingebettete Dokumentation (/admin/documentation.html) ----- */
.doc-page-grid {
  display: grid;
  grid-template-columns: minmax(200px, 260px) minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}

@media (max-width: 900px) {
  .doc-page-grid {
    grid-template-columns: 1fr;
  }
}

.doc-nav-card .doc-nav-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.doc-nav-link {
  display: block;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  color: var(--gk-text);
  text-decoration: none;
  transition: background 0.15s ease, color 0.15s ease;
}

.doc-nav-link:hover {
  background: rgba(0, 61, 153, 0.08);
  color: var(--gk-primary);
}

.doc-nav-link.is-active {
  background: rgba(0, 61, 153, 0.12);
  color: var(--gk-primary);
}

.doc-body-card {
  min-width: 0;
}

.doc-html-wrap {
  min-width: 0;
}

.doc-loading {
  margin: 0;
  color: var(--gk-text-muted);
  font-size: 14px;
}

.doc-md {
  font-size: 15px;
  line-height: 1.55;
  color: var(--gk-text);
}

.doc-md > *:first-child {
  margin-top: 0;
}

.doc-md > *:last-child {
  margin-bottom: 0;
}

.doc-md h1,
.doc-md h2,
.doc-md h3,
.doc-md h4 {
  margin: 1.15em 0 0.5em;
  font-weight: 700;
  color: var(--gk-text);
  line-height: 1.25;
}

.doc-md h1 { font-size: 1.5rem; }
.doc-md h2 { font-size: 1.25rem; border-bottom: 1px solid rgba(0, 40, 100, 0.12); padding-bottom: 0.35em; }
.doc-md h3 { font-size: 1.1rem; }
.doc-md h4 { font-size: 1rem; }

.doc-md p {
  margin: 0.65em 0;
}

.doc-md ul,
.doc-md ol {
  margin: 0.65em 0;
  padding-left: 1.35em;
}

.doc-md li {
  margin: 0.35em 0;
}

.doc-md a {
  color: var(--gk-accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.doc-md a:hover {
  color: var(--gk-primary);
}

.doc-md code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.9em;
  background: rgba(0, 40, 100, 0.07);
  padding: 0.15em 0.4em;
  border-radius: 6px;
}

.doc-md pre {
  margin: 1em 0;
  padding: 14px 16px;
  overflow-x: auto;
  background: rgba(12, 22, 40, 0.92);
  color: #e8edf5;
  border-radius: var(--gk-radius-md);
  font-size: 13px;
  line-height: 1.45;
}

.doc-md pre code {
  background: none;
  padding: 0;
  color: inherit;
  font-size: inherit;
}

.doc-md blockquote {
  margin: 1em 0;
  padding: 10px 14px;
  border-left: 4px solid rgba(0, 61, 153, 0.35);
  background: rgba(0, 61, 153, 0.06);
  color: var(--gk-text-muted);
}

.doc-md table {
  width: 100%;
  border-collapse: collapse;
  margin: 1em 0;
  font-size: 14px;
}

.doc-md th,
.doc-md td {
  border: 1px solid rgba(0, 40, 100, 0.15);
  padding: 8px 10px;
  text-align: left;
  vertical-align: top;
}

.doc-md th {
  background: rgba(0, 61, 153, 0.08);
  font-weight: 600;
}

.doc-md hr {
  border: none;
  border-top: 1px solid rgba(0, 40, 100, 0.12);
  margin: 1.5em 0;
}

/* Klebeetikett-Designer (Zebra / Thermo) */
.toolbar--wrap {
  flex-wrap: wrap;
  gap: 8px;
}

.label-save-status {
  font-size: 13px;
  font-weight: 600;
  color: var(--gk-accent, #0a7);
  margin-right: 8px;
  white-space: nowrap;
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.label-save-status:not([hidden]) {
  display: inline-block;
  vertical-align: middle;
}

.label-help {
  margin: 0 0 12px;
  font-size: 13px;
  color: var(--gk-text-muted);
}

.label-toolbar-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--gk-text-muted);
  margin-right: 4px;
}

.label-toolbar .select {
  min-width: 160px;
  max-width: 240px;
}

/* Bühne: Etikett hebt sich vom Karten-Hintergrund ab */
.label-preview-shell {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 28px 20px 32px;
  margin: 4px 0 0;
  border-radius: 16px;
  background:
    radial-gradient(ellipse 120% 80% at 50% 45%, rgba(255, 255, 255, 0.95) 0%, transparent 65%),
    linear-gradient(180deg, rgba(0, 61, 153, 0.06) 0%, rgba(12, 22, 44, 0.04) 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.65);
}

/* Vorschau: Thermo-/Klebeetikett */
.label-preview {
  position: relative;
  width: 100%;
  max-width: min(100%, 380px);
  margin: 0 auto;
  border-radius: 6px;
  border: 1px solid rgba(20, 22, 28, 0.22);
  background: linear-gradient(155deg, #ffffff 0%, #f2f1ee 42%, #e8e6e1 100%);
  padding: 12px 16px 14px;
  box-sizing: border-box;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.95) inset,
    0 0 0 1px rgba(0, 0, 0, 0.04),
    0 14px 36px rgba(12, 28, 60, 0.18),
    0 4px 12px rgba(12, 28, 60, 0.1);
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transform: translateZ(0);
}

.label-preview::before,
.label-preview::after {
  content: "";
  position: absolute;
  left: 10px;
  right: 10px;
  height: 0;
  border-top: 1px dashed rgba(0, 0, 0, 0.1);
  pointer-events: none;
}

.label-preview::before {
  top: 7px;
}

.label-preview::after {
  bottom: 7px;
}

.label-preview-inner {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: space-between;
  gap: 2px;
  min-height: 0;
  flex: 1 1 auto;
  width: 100%;
  padding: 6px 4px;
  margin: 5px 0 4px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.04) inset;
  overflow-y: auto;
  overflow-x: hidden;
  box-sizing: border-box;
  -webkit-overflow-scrolling: touch;
}

.label-block {
  width: 100%;
  max-width: 100%;
  flex-shrink: 0;
}

.label-block--bold .label-block-text {
  font-weight: 600;
}

.label-block--bold.label-block--visit_type .label-block-text {
  font-weight: 600;
}

.label-block-text {
  font-size: clamp(9px, 2.1vw, 12px);
  line-height: 1.25;
  color: var(--gk-text);
  word-break: break-word;
}

.label-block--logo .label-block-text {
  font-size: clamp(7px, 1.65vw, 9px);
  font-weight: 600;
  letter-spacing: 0.05em;
  color: var(--gk-primary);
}

.label-block--logo.label-block--bold .label-block-text {
  font-weight: 600;
  letter-spacing: 0.05em;
}

.label-block--visit_type .label-block-text {
  font-size: clamp(7px, 1.6vw, 9px);
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--gk-text-muted);
}

.label-block--visitor_name .label-block-text {
  font-size: clamp(8px, 1.9vw, 11px);
  font-weight: 500;
}

.label-block--visitor_name.label-block--bold .label-block-text {
  font-weight: 600;
  font-size: clamp(8px, 1.9vw, 11px);
}

.label-block--company .label-block-text,
.label-block--host .label-block-text {
  font-size: clamp(8px, 1.9vw, 11px);
  color: var(--gk-text-muted);
}

.label-block--datetime .label-block-text,
.label-block--plate .label-block-text {
  font-size: clamp(7px, 1.7vw, 10px);
  color: var(--gk-text-muted);
}

.label-barcode {
  font-family: ui-monospace, monospace;
  font-size: clamp(8px, 1.8vw, 11px);
  letter-spacing: 0.15em;
  padding: 4px 0 2px;
  border-top: 2px solid #111;
  margin-top: 2px;
}

.field-chip:active {
  cursor: grabbing;
}

.field-chip--drag {
  opacity: 0.65;
}

.field-chip-main {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 1 1 140px;
}

.field-chip-grip {
  color: var(--gk-text-muted);
  font-size: 14px;
  line-height: 1;
  user-select: none;
}

.field-chip-title {
  font-weight: 500;
  min-width: 0;
}

.field-chip-tools {
  display: grid;
  grid-template-columns: minmax(92px, 1fr) 28px;
  align-items: center;
  gap: 8px;
  flex: 1 1 auto;
  justify-content: flex-end;
  justify-items: end;
}

@media (max-width: 520px) {
  .field-chip-tools {
    grid-template-columns: 1fr auto;
    width: 100%;
  }
}

.select--compact {
  min-width: 88px;
  max-width: 110px;
  width: 100%;
  padding: 6px 8px;
  font-size: 12px;
}

.field-chip-tools .select--compact {
  justify-self: end;
}

/* Alte badge-design.js: „Fett (F)“-Checkbox — nicht mehr verwenden, aus Layout nehmen */
#label-field-list .field-chip-bold,
#label-field-list input[type='checkbox'] {
  display: none !important;
}

.btn-icon-remove {
  border: none;
  background: rgba(180, 40, 40, 0.1);
  color: #a33;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}

.btn-icon-remove:hover {
  background: rgba(180, 40, 40, 0.18);
}

.label-dialog {
  border: none;
  border-radius: 16px;
  padding: 0;
  max-width: 400px;
  box-shadow: 0 16px 48px rgba(0, 20, 60, 0.2);
  opacity: 0;
  transform: translateY(10px) scale(0.98);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.label-dialog::backdrop {
  background: rgba(12, 22, 44, 0.45);
}

.label-dialog[open] {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.label-dialog-form {
  padding: 20px 22px;
}

.label-dialog-title {
  margin: 0 0 14px;
  font-size: 18px;
}

.label-dialog-label {
  display: block;
  font-size: 13px;
  color: var(--gk-text-muted);
  margin-bottom: 6px;
}

.label-dialog-hint {
  margin: 0 0 12px;
  font-size: 13px;
  color: var(--gk-text-muted);
  line-height: 1.45;
}

.label-dialog-form .input {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.label-dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 18px;
}

.app-footer-version {
  position: fixed;
  right: 14px;
  bottom: 10px;
  z-index: 10030;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(12, 22, 40, 0.78);
  color: #e8edf5;
  font-size: 11px;
  letter-spacing: 0.04em;
  backdrop-filter: blur(6px);
}

.app-version-card {
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--gk-card-border);
  background: rgba(255, 255, 255, 0.72);
}

.app-version-label {
  font-size: 12px;
  color: var(--gk-text-muted);
  margin-right: 6px;
}

.app-version-value {
  font-weight: 700;
  color: var(--gk-primary);
}

/* Global 403: blur main area only (sidebar stays sharp); overlay non-blocking for nav (see api.js) */
body.it-rosinski-unauthorized,
.main-shell.it-rosinski-unauthorized {
  filter: blur(4px);
}

#it-rosinski-unauthorized-overlay {
  position: fixed;
  inset: 0;
  z-index: 2147483647;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 24px;
  box-sizing: border-box;
  pointer-events: none;
  background: rgba(12, 22, 40, 0.38);
}

.it-rosinski-unauthorized-card {
  pointer-events: auto;
  width: 100%;
  max-width: 22rem;
  padding: 28px 26px 26px;
  border-radius: var(--gk-radius-lg);
  text-align: center;
  background: linear-gradient(165deg, #182236 0%, var(--admin-sidebar, #0c1628) 100%);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.45), 0 2px 12px rgba(0, 0, 0, 0.25);
}

.it-rosinski-unauthorized-icon-wrap {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  margin: 0 auto 16px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.it-rosinski-unauthorized-icon-svg {
  width: 28px;
  height: 28px;
  display: block;
}

.it-rosinski-unauthorized-title {
  margin: 0 0 10px;
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.25;
  color: #fff;
}

.it-rosinski-unauthorized-sub {
  margin: 0;
  font-size: 0.9375rem;
  font-weight: 400;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.74);
}

.settings-actions-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

/* DGUV & Compliance — Dashboard */
.compliance-dashboard-card .card-title-row {
  margin-bottom: 10px;
}

.compliance-meta-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 16px;
  margin-bottom: 18px;
}

.compliance-server-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 14px;
  background: rgba(0, 61, 153, 0.06);
  border: 1px solid rgba(0, 61, 153, 0.12);
  font-size: 14px;
  color: var(--gk-text);
}

.compliance-server-pill strong {
  color: var(--gk-primary);
  font-weight: 700;
}

.compliance-server-icon {
  display: grid;
  place-items: center;
  color: var(--gk-primary);
  flex-shrink: 0;
}

.compliance-checks-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
}

.compliance-loading {
  margin: 0;
  font-size: 14px;
  color: var(--gk-text-muted);
}

.compliance-check-card {
  border-radius: var(--gk-radius-md);
  padding: 14px 16px;
  border: 1px solid var(--gk-card-border);
  background: rgba(255, 255, 255, 0.85);
  min-height: 0;
}

.compliance-check-card--ok {
  border-color: rgba(13, 122, 62, 0.35);
  background: linear-gradient(135deg, rgba(13, 122, 62, 0.12), rgba(255, 255, 255, 0.95));
}

.compliance-check-card--partial {
  border-color: rgba(180, 83, 9, 0.4);
  background: linear-gradient(135deg, rgba(180, 83, 9, 0.1), rgba(255, 255, 255, 0.95));
}

.compliance-check-card--missing {
  border-color: rgba(185, 28, 28, 0.35);
  background: linear-gradient(135deg, rgba(185, 28, 28, 0.08), rgba(255, 255, 255, 0.95));
}

.compliance-check-head {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 8px;
}

.compliance-status-ico {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  font-size: 14px;
  font-weight: 800;
  line-height: 1;
}

.compliance-status-ico--ok {
  background: rgba(13, 122, 62, 0.2);
  color: #0d7a3e;
}

.compliance-status-ico--partial {
  background: rgba(180, 83, 9, 0.2);
  color: #b45309;
}

.compliance-status-ico--missing {
  background: rgba(185, 28, 28, 0.18);
  color: #b91c1c;
}

.compliance-check-title {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.35;
  color: var(--gk-text);
}

.compliance-check-hint {
  margin: 0;
  font-size: 12px;
  line-height: 1.45;
  color: var(--gk-text-muted);
}

.compliance-presence-dialog {
  max-width: min(920px, 98vw);
}

.compliance-dialog-lead {
  margin: 0 0 14px;
  font-size: 13px;
  color: var(--gk-text-muted);
  line-height: 1.45;
}

.compliance-presence-table-wrap {
  max-height: min(420px, 55vh);
}

.compliance-evacuation-title {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.compliance-evacuation-title::before {
  content: "⚠";
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  background: rgba(185, 28, 28, 0.14);
  color: #b91c1c;
  font-weight: 700;
}

dialog.admin-dialog {
  opacity: 0;
  transform: translateY(10px) scale(0.98);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

dialog.admin-dialog[open] {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.admin-dialog .form-actions .btn-secondary:last-child,
.label-dialog-actions .btn-secondary:last-child {
  background: linear-gradient(180deg, #ffffff 0%, #f4f7fb 100%);
  border-color: rgba(0, 61, 153, 0.35);
}

.integration-grid {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(220px, 1fr) auto;
  gap: 10px 14px;
  align-items: end;
}

.integration-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  color: var(--gk-text);
  font-weight: 600;
}

.integration-field .select,
.integration-field .input {
  width: 100%;
}

.integration-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--gk-text);
  font-weight: 600;
}

.integration-toggle input {
  width: 16px;
  height: 16px;
  accent-color: var(--gk-primary);
}

.integration-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 14px;
  margin-top: 12px;
}

.integration-actions {
  margin-top: 12px;
}

@media (max-width: 720px) {
  .integration-grid {
    grid-template-columns: 1fr;
  }
  .integration-fields {
    grid-template-columns: 1fr;
  }
}

/* DSGVO / Privacy settings (admin/index.html) */
.gdpr-settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 14px;
  align-items: end;
}

.gdpr-settings-grid .gdpr-toggle-span {
  grid-column: 1 / -1;
  padding-top: 4px;
}

.gdpr-settings-advanced {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 14px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid rgba(0, 40, 100, 0.08);
}

.gdpr-last-run {
  margin: 12px 0 0;
  font-size: 13px;
  color: var(--gk-text-muted);
}

.gdpr-settings-card .integration-actions {
  margin-top: 14px;
}

@media (max-width: 720px) {
  .gdpr-settings-grid,
  .gdpr-settings-advanced {
    grid-template-columns: 1fr;
  }
}
