:root {
  /* ---------------------------------------------------------------------------
     Marken-Design-System (Block 22). Zentrale Tokens – an EINER Stelle änderbar.
     Leitprinzip: Weiß/Neutral dominiert die Flächen. Navy trägt Text/Struktur und
     die gefüllten Primär-Buttons; Rot ist ein bewusst SEHR sparsamer Signatur-Akzent.
     Die Ampel-Statusfarben (Block 9) sind bewusst NICHT hier definiert und bleiben
     unangetastet (kommen inline aus server/utils/ampel.js) – kein Vermischen mit dem
     Marken-Rot.
     --------------------------------------------------------------------------- */
  --navy: #24195c;         /* Marken-Navy (RGB 36, 25, 92) */
  --navy-700: #33266f;     /* Hover auf Navy */
  --navy-900: #1a1240;     /* Press / tiefes Navy */
  --navy-100: #eceaf4;     /* helle Navy-Tönung (Fokusfläche, aktive Nav-Tönung) */
  --navy-050: #f6f5fb;     /* kaum sichtbare Navy-Tönung */
  --brand-red: #de0813;    /* Marken-Rot (RGB 222, 8, 19) – Signatur-Akzent, sehr sparsam */
  --brand-red-hover: #b00610;
  --brand-red-050: #fdecec;

  /* Bestehende Token-Namen auf die Marke gemappt -> kaskadiert automatisch durch die App */
  --color-bg: #fbfbfc;         /* nahezu weiße, neutrale Arbeitsfläche */
  --color-surface: #ffffff;
  --color-primary: #24195c;    /* = Navy (Buttons, Fokus, Überschriften-Akzent, Links) */
  --color-primary-dark: #1a1240;
  --color-text: #20202b;       /* Tinte mit feinem Navy-Unterton */
  --color-muted: #616874;
  --color-error: #c0271f;      /* Fehler/Validierung – rot, aber klar vom Marken-Rot getrennt */
  --color-danger: #b4231b;     /* Zerstörend (Löschen/Sperren) – Outline-Rot, eigene Signatur */
  --color-ok: #1e8449;
  --color-vip: #a8710a;
  --color-info: #24195c;
  --color-warning: #b9770e;
  --color-accent: #0f766e;

  /* Struktur-Tokens */
  --color-border: #e7e9ee;     /* Standard-Rahmen/Hairline */
  --color-hairline: #eef0f3;   /* noch feinere Trennlinie (Tabellenzeilen) */
  --border-radius: 10px;
  --radius-lg: 14px;
  --shadow-sm: 0 1px 2px rgba(20, 18, 45, 0.05);
  --shadow-md: 0 4px 16px rgba(20, 18, 45, 0.06);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--color-bg);
  color: var(--color-text);
  min-height: 100vh;
}

.container {
  max-width: 480px;
  margin: 0 auto;
  padding: 24px 20px 48px;
}

h1 {
  font-size: 1.5rem;
  margin-bottom: 4px;
}

.subtitle {
  color: var(--color-muted);
  text-align: center;
  margin-top: 0;
  margin-bottom: 24px;
}

.brand-title {
  text-align: center;
  font-size: 1.7rem;
  line-height: 1.25;
  color: var(--color-primary);
  margin: 12px 0 6px;
}

label {
  display: block;
  font-weight: 600;
  margin: 16px 0 6px;
  font-size: 0.9rem;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="search"],
select {
  width: 100%;
  padding: 12px 14px;
  font-size: 1rem;
  border: 1px solid #d1d5db;
  border-radius: var(--border-radius);
  background: var(--color-surface);
}

input:focus,
select:focus {
  outline: 2px solid var(--color-primary);
  outline-offset: 1px;
}

button {
  width: 100%;
  padding: 14px;
  margin-top: 24px;
  font-size: 1rem;
  font-weight: 600;
  color: #fff;
  background: var(--color-primary);
  border: none;
  border-radius: var(--border-radius);
  cursor: pointer;
}

button:active {
  background: var(--color-primary-dark);
}

button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

button.secondary-btn {
  background: transparent;
  color: var(--color-primary);
  border: 1px solid var(--color-primary);
  width: auto;
  margin-top: 0;
  padding: 8px 16px;
}

fieldset {
  border: 1px solid #e2e4e9;
  border-radius: var(--border-radius);
  padding: 12px 16px 16px;
  margin: 20px 0;
}

legend {
  font-weight: 700;
  padding: 0 6px;
}

.radio-option,
.checkbox-option {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 400;
  margin: 10px 0;
}

.radio-option input,
.checkbox-option input {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.companion-block {
  border-top: 1px dashed #e2e4e9;
  padding-top: 12px;
  margin-top: 12px;
}

.companion-block:first-child {
  border-top: none;
  padding-top: 0;
  margin-top: 0;
}

.companion-block h3 {
  font-size: 1rem;
  margin: 0 0 4px;
  color: var(--color-primary);
}

.feedback {
  min-height: 1.2em;
  font-size: 0.9rem;
  margin: 10px 0 0;
}

.feedback-error {
  color: var(--color-error);
}

.feedback-ok {
  color: var(--color-ok);
}

.feedback-pending {
  color: var(--color-muted);
}

.closed-banner {
  margin: 4px 0 16px;
  padding: 14px 16px;
  border: 1px solid #f0c9c2;
  border-radius: var(--border-radius);
  background: #fdf4f2;
  color: var(--color-error);
  font-weight: 600;
  font-size: 0.95rem;
  text-align: center;
}

.button-link {
  display: block;
  text-align: center;
  padding: 14px;
  margin-top: 16px;
  border-radius: var(--border-radius);
  background: var(--color-primary);
  color: #fff;
  text-decoration: none;
  font-weight: 600;
}

.button-link.secondary {
  background: transparent;
  color: var(--color-primary);
  border: 1px solid var(--color-primary);
}

.admin-container {
  max-width: 1040px;
}

.admin-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.admin-header h1 {
  margin-bottom: 0;
}

.admin-brand {
  margin: 2px 0 0;
  color: var(--color-muted);
  font-size: 0.85rem;
}

.admin-section {
  margin-top: 32px;
}

.admin-section h2 {
  font-size: 1.1rem;
  margin-bottom: 4px;
}

.section-hint {
  color: var(--color-muted);
  font-size: 0.85rem;
  margin: 4px 0 0;
}

.invitations-list {
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.invitation-card {
  background: var(--color-surface);
  border: 1px solid #e2e4e9;
  border-radius: var(--border-radius);
  padding: 14px 16px;
}

.invitation-card-vip {
  border: 1px solid #f0d9a8;
  background: #fffaf0;
  box-shadow: 0 0 0 1px #f0d9a8 inset;
}

.invitation-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}

.invitation-name-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.vip-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--color-vip);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.03em;
}

.invitation-code {
  color: var(--color-muted);
  font-size: 0.85rem;
  margin-top: 2px;
}

.invitation-details {
  margin-top: 8px;
  font-size: 0.9rem;
  color: var(--color-text);
}

.invitation-created {
  margin-top: 4px;
  font-size: 0.8rem;
  color: var(--color-muted);
}

.status-badge {
  flex-shrink: 0;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  white-space: nowrap;
}

.status-badge.status-accepted {
  background: #e5f5ec;
  color: var(--color-ok);
}

.status-badge.status-declined {
  background: #fbeae7;
  color: var(--color-error);
}

.status-badge.status-pending {
  background: #eceef1;
  color: var(--color-muted);
}

.registration-status-display {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin: 12px 0 4px;
}

.status-pill {
  display: inline-block;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 700;
}

.status-pill-open {
  background: #e5f5ec;
  color: var(--color-ok);
}

.status-pill-closed {
  background: #fbeae7;
  color: var(--color-error);
}

.registration-deadline-text {
  font-size: 0.85rem;
  color: var(--color-muted);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 12px;
  margin: 16px 0 20px;
}

.stat-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 4px;
  padding: 16px 10px;
  border-radius: var(--border-radius);
  background: var(--color-surface);
  border: 1px solid #e2e4e9;
  border-top: 4px solid transparent;
}

.stat-value {
  font-size: 1.9rem;
  font-weight: 700;
  line-height: 1;
}

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

.stat-card-invited {
  border-top-color: var(--color-info);
}
.stat-card-invited .stat-value {
  color: var(--color-info);
}

.stat-card-registered {
  border-top-color: var(--color-ok);
}
.stat-card-registered .stat-value {
  color: var(--color-ok);
}

.stat-card-pending {
  border-top-color: var(--color-warning);
}
.stat-card-pending .stat-value {
  color: var(--color-warning);
}

.stat-card-cancelled {
  border-top-color: var(--color-error);
}
.stat-card-cancelled .stat-value {
  color: var(--color-error);
}

.stat-card-attendees {
  border-top-color: var(--color-accent);
  background: #f0fdfb;
}
.stat-card-attendees .stat-value {
  color: var(--color-accent);
}

.companions-block {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px dashed #e2e4e9;
}

.companions-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-primary);
  margin-bottom: 6px;
}

.companion-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.companion-list li {
  font-size: 0.9rem;
}

.companion-empty {
  margin: 0;
  font-size: 0.85rem;
  color: var(--color-muted);
}

.invitation-actions {
  margin-top: 12px;
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
}

.danger-btn {
  background: var(--color-error);
}

.danger-btn:active {
  background: #96291d;
}

.small-btn {
  width: auto;
  margin-top: 0;
  padding: 8px 14px;
  font-size: 0.85rem;
}

.admin-section-danger {
  border: 1px solid #f0c9c2;
  border-radius: var(--border-radius);
  padding: 16px;
  background: #fdf4f2;
}

input[type="file"] {
  width: 100%;
  padding: 10px 0;
  font-size: 0.9rem;
}

.qr-preview {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed #e2e4e9;
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}

.qr-person {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.qr-person-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--color-primary);
  text-align: center;
  max-width: 160px;
}

.qr-image {
  width: 160px;
  height: 160px;
  border: 1px solid #e2e4e9;
  border-radius: 8px;
  background: #fff;
}

.import-preview {
  margin-top: 20px;
}

.import-summary {
  font-size: 0.9rem;
  font-weight: 600;
  margin: 0 0 12px;
}

.import-bulk-action {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.import-bulk-action label {
  margin: 0;
}

.import-bulk-action select {
  width: auto;
}

.import-bulk-action button {
  width: auto;
  margin-top: 0;
}

.table-wrapper {
  overflow-x: auto;
  margin-top: 12px;
  border: 1px solid #e2e4e9;
  border-radius: var(--border-radius);
}

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

th,
td {
  text-align: left;
  padding: 8px 10px;
  border-bottom: 1px solid #e2e4e9;
  white-space: nowrap;
}

/* Detail-Spalte des Audit-Logs darf umbrechen und wird begrenzt, damit die Tabelle lesbar bleibt. */
td.audit-details {
  white-space: normal;
  max-width: 360px;
  color: #4a4f57;
  font-size: 0.8rem;
}

/* "Weitere anzeigen"-Button für blockweise gerenderte, große Listen. */
.load-more-btn {
  display: block;
  width: 100%;
  margin-top: 12px;
}

/* Klickbare Platzhalter-Chips im Vorlagen-Editor (Klick kopiert in die Zwischenablage). */
.placeholder-chip {
  display: inline-block;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.78rem;
  background: #eef2f4;
  color: #334;
  border: 1px solid #dbe1e6;
  border-radius: 5px;
  padding: 1px 6px;
  margin: 2px 4px 2px 0;
  cursor: pointer;
}
.placeholder-chip:hover { background: #e2e8ec; }
.placeholder-chip.copied { background: #e8f6ec; border-color: #bfe3c8; color: #15803d; }

/* Rollen-Hinweis in der Navigationsleiste (z. B. für Check-in-Mitarbeiter). */
.admin-nav-role {
  align-self: center;
  font-size: 0.78rem;
  font-weight: 600;
  color: #b45309;
  background: #fdf3e3;
  border: 1px solid #f3d9a8;
  border-radius: 20px;
  padding: 2px 10px;
  margin-left: auto;
  margin-right: 8px;
}

/* Unveränderliche Gast-ID / Ursprungs-Code als monospace-Chip. */
.guest-uid-chip {
  display: inline-block;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: .5px;
  background: #eef2f4;
  color: #334;
  border: 1px solid #dbe1e6;
  border-radius: 5px;
  padding: 1px 6px;
  margin-right: 6px;
}

/* Gast-ID-Anzeige + Foto im Formularkopf. */
.guest-id-photo-row {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  align-items: flex-start;
  margin-bottom: 8px;
}
.guest-id-box { flex: 1 1 240px; min-width: 240px; }
.guest-photo-box { flex: 0 0 auto; }
.guest-uid-value {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--primary, #0f766e);
  padding: 6px 0;
}
.guest-photo-preview {
  display: block;
  width: 96px;
  height: 96px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid #dbe1e6;
  margin-bottom: 6px;
}
.guest-detail-photo {
  width: 140px;
  height: 140px;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid #dbe1e6;
  margin-bottom: 10px;
}

th {
  background: var(--color-bg);
}

.import-action-select {
  width: auto;
  padding: 6px 8px;
  font-size: 0.85rem;
}

.import-status-new {
  color: var(--color-ok);
}

.import-status-duplicate {
  color: #b8860b;
}

.import-status-error {
  color: var(--color-error);
}

.import-status-no_email {
  color: #b8860b;
  font-weight: 600;
}

/* ---------------------------------------------------------------------------
   Teilnehmerbegrenzung (Kapazitätsanzeige)
   --------------------------------------------------------------------------- */
.capacity-box {
  margin: 8px 0 4px;
  padding: 10px 12px;
  border: 1px solid #dbe3ef;
  border-radius: 8px;
  background: #f7f9fc;
}

.capacity-numbers {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  font-size: 0.88rem;
  color: var(--color-muted);
}

.capacity-numbers strong {
  color: var(--color-primary);
}

.capacity-bar {
  margin-top: 8px;
  height: 8px;
  border-radius: 999px;
  background: #e3e8f0;
  overflow: hidden;
}

.capacity-bar-fill {
  height: 100%;
  background: var(--color-ok);
  transition: width 0.3s ease;
}

.capacity-bar-fill.capacity-bar-warn {
  background: #e0a800;
}

.capacity-bar-fill.capacity-bar-full {
  background: var(--color-error);
}

.capacity-warn {
  display: inline-block;
  margin-top: 8px;
  font-size: 0.82rem;
  font-weight: 700;
  color: #b8860b;
}

.capacity-warn-full {
  color: var(--color-error);
}

/* Kapazitäts-Infostreifen unter dem Aktives-Event-Banner im Dashboard */
.active-event-capacity {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 18px;
  margin: -14px 0 22px;
  padding: 10px 16px;
  border: 1px solid #dbe3ef;
  border-top: none;
  border-radius: 0 0 10px 10px;
  background: #f7f9fc;
  font-size: 0.88rem;
  color: var(--color-muted);
}

.active-event-capacity strong {
  color: var(--color-primary);
}

.import-actions {
  display: flex;
  gap: 10px;
  margin-top: 16px;
}

.import-actions button {
  margin-top: 0;
  flex: 1;
}

/* ---------------------------------------------------------------------------
   Check-in / Einlass
   --------------------------------------------------------------------------- */
.checkin-back-link {
  margin-top: 0;
  padding: 8px 16px;
  font-size: 0.9rem;
  white-space: nowrap;
}

.checkin-stats {
  margin-top: 4px;
}

.result-panel {
  margin: 20px 0;
  padding: 20px;
  border-radius: var(--border-radius);
  border: 2px solid #e2e4e9;
  text-align: center;
}

.result-panel.result-success {
  background: #e5f5ec;
  border-color: var(--color-ok);
}

.result-panel.result-warning {
  background: #fff6e5;
  border-color: var(--color-warning);
}

.result-panel.result-error {
  background: #fbeae7;
  border-color: var(--color-error);
}

.result-status {
  font-size: 1.3rem;
  font-weight: 800;
  margin-bottom: 6px;
}

.result-success .result-status {
  color: var(--color-ok);
}
.result-warning .result-status {
  color: var(--color-warning);
}
.result-error .result-status {
  color: var(--color-error);
}

.result-name {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--color-text);
}

.result-details {
  font-size: 0.9rem;
  color: var(--color-muted);
  margin-top: 4px;
}

.result-time {
  font-size: 0.85rem;
  color: var(--color-muted);
  margin-top: 6px;
}

.camera-wrapper {
  margin-top: 12px;
  border-radius: var(--border-radius);
  overflow: hidden;
  background: #000;
  max-width: 360px;
}

#camera-video {
  width: 100%;
  display: block;
}

.lookup-result {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.lookup-header {
  font-weight: 700;
  color: var(--color-primary);
}

.lookup-person {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid #e2e4e9;
  border-radius: var(--border-radius);
  background: var(--color-surface);
}

.lookup-person-meta {
  font-size: 0.8rem;
  color: var(--color-muted);
  margin-top: 2px;
}

.lookup-person-action {
  flex-shrink: 0;
}

.lookup-person-action button {
  margin-top: 0;
}

/* Check-in-Badges (auch im Dashboard verwendet) */
.checkin-badge {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  white-space: nowrap;
}

.checkin-badge-in {
  background: #e5f5ec;
  color: var(--color-ok);
}

.checkin-badge-out {
  background: #eceef1;
  color: var(--color-muted);
}

/* Header-Aktionen (Dashboard): Check-in-Link + Abmelden nebeneinander */
.admin-header-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.header-link-btn {
  display: inline-block;
  text-decoration: none;
  white-space: nowrap;
}

/* Check-in-Statistikkacheln im Dashboard */
.stat-card-checkedin {
  border-top-color: var(--color-ok);
}
.stat-card-checkedin .stat-value {
  color: var(--color-ok);
}

.stat-card-notcheckedin {
  border-top-color: var(--color-muted);
}
.stat-card-notcheckedin .stat-value {
  color: var(--color-muted);
}

/* ---------------------------------------------------------------------------
   E-Mail-Kommunikation (Rundmail-Modul)
   --------------------------------------------------------------------------- */
textarea {
  width: 100%;
  padding: 12px 14px;
  font-size: 1rem;
  font-family: inherit;
  border: 1px solid #d1d5db;
  border-radius: var(--border-radius);
  background: var(--color-surface);
  resize: vertical;
  line-height: 1.5;
}

textarea:focus {
  outline: 2px solid var(--color-primary);
  outline-offset: 1px;
}

.placeholder-help {
  margin-top: 14px;
}

.placeholder-help-label {
  font-size: 0.8rem;
  color: var(--color-muted);
  font-weight: 600;
}

.placeholder-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.placeholder-chip {
  width: auto;
  margin-top: 0;
  padding: 4px 10px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--color-primary);
  background: #eef2f8;
  border: 1px solid #d3ddec;
  border-radius: 999px;
  cursor: pointer;
}

.placeholder-chip:active {
  background: #dde6f3;
}

.preview-summary {
  background: var(--color-surface);
  border: 1px solid #e2e4e9;
  border-radius: var(--border-radius);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.92rem;
}

.preview-label {
  color: var(--color-muted);
  font-weight: 600;
}

.preview-mail {
  margin-top: 14px;
  border: 1px solid #e2e4e9;
  border-radius: var(--border-radius);
  overflow: hidden;
}

.preview-mail-subject {
  padding: 12px 16px;
  background: #f5f6fa;
  border-bottom: 1px solid #e2e4e9;
  font-size: 0.95rem;
}

.preview-mail-body {
  padding: 16px;
  background: #fff;
}

.progress-bar-wrapper {
  width: 100%;
  height: 22px;
  background: #eceef1;
  border-radius: 999px;
  overflow: hidden;
  margin-top: 8px;
}

.progress-bar {
  height: 100%;
  width: 0%;
  background: var(--color-primary);
  transition: width 0.3s ease;
}

.progress-text {
  margin-top: 10px;
  font-weight: 600;
}

.progress-failures {
  margin-top: 12px;
  font-size: 0.9rem;
}

.failures-title {
  font-weight: 700;
  color: var(--color-error);
  margin-bottom: 4px;
}

.progress-failures ul,
.history-failures ul {
  margin: 4px 0 0;
  padding-left: 20px;
}

.history-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 12px;
}

.history-card {
  background: var(--color-surface);
  border: 1px solid #e2e4e9;
  border-radius: var(--border-radius);
  padding: 14px 16px;
}

.history-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
}

.history-time {
  font-size: 0.8rem;
  color: var(--color-muted);
  white-space: nowrap;
}

.history-meta {
  margin-top: 6px;
  font-size: 0.85rem;
  color: var(--color-muted);
}

.history-failures {
  margin-top: 8px;
  font-size: 0.85rem;
}

.history-failures summary {
  cursor: pointer;
  color: var(--color-error);
}

.history-actions {
  margin-top: 12px;
  display: flex;
  justify-content: flex-end;
}

/* ---------------------------------------------------------------------------
   Zentrale Gästedatenbank
   --------------------------------------------------------------------------- */
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0 16px;
}

.guest-card-archived {
  opacity: 0.7;
  background: #f7f8fa;
}

.detail-block {
  margin-bottom: 20px;
  padding: 14px 16px;
  border: 1px solid #e2e4e9;
  border-radius: var(--border-radius);
  background: var(--color-surface);
}

.detail-block h3 {
  margin: 0 0 10px;
  font-size: 1rem;
  color: var(--color-primary);
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 6px 16px;
  font-size: 0.9rem;
}

.detail-list {
  margin: 0;
  padding-left: 20px;
  font-size: 0.9rem;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.origin-badge {
  display: inline-block;
  margin-top: 6px;
  padding: 2px 8px;
  border-radius: 999px;
  background: #eef2f8;
  color: var(--color-primary);
  font-size: 0.72rem;
  font-weight: 600;
}

/* Schreibgeschützte Felder (z. B. Name im Event) klar als nicht-editierbar zeigen */
input[readonly] {
  background: #f0f1f4;
  color: var(--color-muted);
  cursor: not-allowed;
}

/* ---------------------------------------------------------------------------
   Events / Multi-Event (Phase 2)
   --------------------------------------------------------------------------- */

/* Banner "Aktives Event" (Dashboard-Kopf + Events-Seite) */
.active-event-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 20px;
  padding: 14px 18px;
  border-radius: 10px;
  background: #eef2f8;
  border: 1px solid #dbe3ef;
}

.active-event-info {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.active-event-label {
  font-size: 0.85rem;
  color: var(--color-muted);
}

.active-event-info strong {
  font-size: 1.05rem;
  color: var(--color-primary);
}

.active-event-switch {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.active-event-switch-label {
  font-size: 0.85rem;
  color: var(--color-muted);
  margin: 0;
}

.active-event-switch select {
  width: auto;
  min-width: 180px;
  margin: 0;
}

/* Raster für die Freischaltung optionaler Felder (Event-Formular) */
.checkbox-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 4px 16px;
}

/* Begleitung austauschen am Einlass (Block: Companion-Exchange) */
.lookup-companion{
  margin:2px 0 6px 22px;
  padding:6px 10px;
  border-left:2px solid var(--color-border,#dbe3ef);
  background:rgba(0,0,0,.015);
  border-radius:0 8px 8px 0;
}
.lookup-companion-line{
  display:flex; align-items:center; justify-content:space-between; gap:10px; flex-wrap:wrap;
}
.lookup-companion-name{ font-size:.9rem; }
.companion-exchange-form{
  display:flex; gap:8px; flex-wrap:wrap; align-items:center; margin-top:8px;
}
.companion-exchange-form input{ max-width:150px; }
.companion-exchange-feedback{ margin:0; font-size:.82rem; }

/* Ampelsystem (Block 9) */
.ampel-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 1px 9px 1px 8px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  color: #fff;
  background: var(--ampel-color, #8a8f98);
  margin-right: 8px;
  white-space: nowrap;
}

.ampel-chip::before {
  content: '';
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.85);
}

/* Planungstools (Block 10) */
.planner-panel {
  border: 1px solid var(--color-border, #dbe3ef);
  border-radius: 8px;
  padding: 10px 14px;
  margin: 12px 0;
  background: rgba(0, 0, 0, 0.015);
}

.planner-panel > summary {
  cursor: pointer;
  font-weight: 600;
}

.planner-panel h3 {
  margin: 14px 0 4px;
  font-size: 0.98rem;
}

.events-overview-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 6px 0;
  border-bottom: 1px solid var(--color-border, #eef1f6);
}

.events-overview-meta {
  color: var(--color-muted);
  font-size: 0.85rem;
}

.planner-tickboxes {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 2px 16px;
  max-height: 220px;
  overflow-y: auto;
  border: 1px solid var(--color-border, #dbe3ef);
  border-radius: 8px;
  padding: 8px 10px;
  margin-top: 8px;
}

/* Ampel-Kennzahlen im Event-Planungspanel (Block 10) */
.ampel-counts {
  display: inline-flex;
  gap: 6px;
  flex-wrap: wrap;
}

.ampel-count {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.8rem;
  padding: 1px 8px;
  border-radius: 999px;
  color: #fff;
  background: var(--ampel-color, #8a8f98);
}

/* Anzeigenkunde-Markierung (Block 8) */
.ad-customer-badge {
  background: #6b4fbb;
  color: #fff;
}

.detail-ad-customer {
  margin-top: 12px;
  font-weight: 600;
}

/* Selbst-Löschung / DSGVO (Block 7) */
.deletion-section {
  margin-top: 24px;
}

.deletion-divider {
  border: none;
  border-top: 1px solid var(--color-border, #dbe3ef);
  margin: 16px 0;
}

.deletion-btn {
  width: 100%;
}

/* Gelöschte Gäste in der Admin-Liste deutlich ausgrauen (Daten bleiben lesbar). */
.guest-card-deleted {
  opacity: 0.6;
  filter: grayscale(0.7);
}

.deleted-detail-banner {
  border: 1px solid var(--color-danger, #d64545);
  border-radius: 8px;
  padding: 12px 14px;
  background: rgba(214, 69, 69, 0.06);
}

/* Pflichtfeld-Markierung (Block 6) */
.required-star {
  color: var(--color-danger, #d64545);
  font-weight: 700;
}

.pair-hint {
  margin-top: -4px;
}

/* Zusatzfelder mit Pflicht-Schalter (Block 6) */
.field-config-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 4px 20px;
}

.field-config-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 2px 0;
}

.field-config-row .checkbox-option {
  margin: 0;
}

.field-required-option {
  font-size: 0.85rem;
  color: var(--color-muted);
  white-space: nowrap;
}

.field-required-option.is-disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* Paar-Modi (mind. 1 von 2) */
.pair-modes-block {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--color-border, #dbe3ef);
}

.pair-modes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 8px 20px;
}

.pair-mode-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.pair-mode-row label {
  font-size: 0.9rem;
}

.pair-mode-select {
  min-width: 180px;
}

/* Gäste-Auswahl beim Einladen */
.invite-guest-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin: 10px 0;
}

.invite-selected-count {
  font-size: 0.85rem;
  color: var(--color-muted);
  margin-left: auto;
}

.invite-guest-list {
  max-height: 320px;
  overflow-y: auto;
  border: 1px solid var(--color-border, #dbe3ef);
  border-radius: 8px;
  padding: 6px 10px;
}

.invite-guest-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 4px;
  border-bottom: 1px solid #eef1f5;
  cursor: pointer;
  font-size: 0.92rem;
}

.invite-guest-row:last-child {
  border-bottom: none;
}

.invite-guest-row input[type="checkbox"] {
  width: auto;
  margin: 0;
  flex-shrink: 0;
}

/* Status-Pill in der Event-Liste etwas kompakter */
.invitation-name-row .status-pill {
  padding: 3px 10px;
  font-size: 0.72rem;
}

/* ---------------------------------------------------------------------------
   Einheitliche Admin-Hauptnavigation (per nav.js injiziert)
   --------------------------------------------------------------------------- */
.admin-nav {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  padding: 10px 16px;
  margin-bottom: 26px;
  background: var(--color-primary);
  border-radius: 12px;
  box-shadow: 0 4px 14px rgba(31, 58, 95, 0.18);
}

.admin-nav-brand {
  display: flex;
  align-items: center;
  gap: 9px;
  text-decoration: none;
  color: #fff;
  font-weight: 700;
}

.admin-nav-logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: #fff;
  color: var(--color-primary);
  font-weight: 800;
  font-size: 0.85rem;
  letter-spacing: 0.5px;
}

.admin-nav-brand-text {
  font-size: 1rem;
  white-space: nowrap;
}

.admin-nav-links {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  flex: 1;
  margin-left: 6px;
}

.admin-nav-link {
  text-decoration: none;
  color: rgba(255, 255, 255, 0.85);
  padding: 8px 14px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.92rem;
  white-space: nowrap;
  transition: background 0.15s, color 0.15s;
}

.admin-nav-link:hover {
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
}

.admin-nav-link.active {
  background: #fff;
  color: var(--color-primary);
}

.admin-nav-logout {
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  border: none;
  padding: 8px 16px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.92rem;
}

.admin-nav-logout:hover {
  background: rgba(255, 255, 255, 0.3);
}

/* Seitentitel unterhalb der Navigation */
.admin-pagetitle {
  margin-bottom: 22px;
}

.admin-pagetitle h1 {
  margin: 0 0 2px;
}

/* Gruppierungs-Überschrift in der Gästeliste (nach Datenursprung) */
.guest-group-heading {
  margin: 22px 0 8px;
  padding-bottom: 6px;
  border-bottom: 2px solid #e3e8f0;
  color: var(--color-primary);
  font-size: 1.05rem;
}

.filter-group-toggle {
  margin-top: 26px;
}

@media (max-width: 640px) {
  .admin-nav {
    gap: 8px;
  }
  .admin-nav-links {
    order: 3;
    width: 100%;
    margin-left: 0;
  }
}

/* ==========================================================================
   Veranstaltungs-Vorstellung (Block: Event-Info auf der Anmeldeseite)
   ========================================================================== */

/* --- Admin: Logo-Upload + Rich-Text-Editor --- */
.logo-upload-row {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}
.event-logo-preview {
  max-width: 160px;
  max-height: 90px;
  object-fit: contain;
  border: 1px solid #d5dbe3;
  border-radius: 6px;
  padding: 4px;
  background: #fff;
}
.logo-upload-controls {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.richtext-toolbar {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}
.richtext-toolbar button {
  width: auto;
  flex: 0 0 auto;
  margin: 0;
  padding: 4px 12px;
  font-size: 0.85rem;
  background: #eef2f7;
  border: 1px solid #cfd7e0;
  border-radius: 5px;
  cursor: pointer;
  color: #263a52;
}
.richtext-toolbar button:hover { background: #e1e8f0; }
.richtext-editor {
  min-height: 120px;
  border: 1px solid #cfd7e0;
  border-radius: 6px;
  padding: 10px 12px;
  background: #fff;
  font-size: 0.95rem;
  line-height: 1.5;
  overflow-y: auto;
}
.richtext-editor:focus { outline: 2px solid #1c527f; outline-offset: 1px; }
.richtext-editor ul, .richtext-editor ol { margin: 6px 0; padding-left: 22px; }

/* --- Anmeldeseite: Vorstellung (Logo, Beschreibung, Fakten) --- */
.event-hero {
  margin: 0 0 22px;
  padding-bottom: 18px;
  border-bottom: 1px solid #e3e9f1;
}
.event-hero-logo {
  display: block;
  max-width: 220px;
  max-height: 120px;
  object-fit: contain;
  margin: 0 auto 16px;
}
.event-hero-title {
  margin: 0 0 10px;
  text-align: center;
  font-size: 1.35rem;
  color: #0f2a4a;
}
.event-hero-description {
  color: #33404f;
  line-height: 1.6;
  margin-bottom: 16px;
}
.event-hero-description p { margin: 0 0 8px; }
.event-hero-description ul, .event-hero-description ol { margin: 6px 0; padding-left: 22px; }
.event-facts {
  margin: 0;
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 6px 14px;
  background: #f6f9fc;
  border: 1px solid #e3e9f1;
  border-radius: 8px;
  padding: 14px 16px;
}
.event-facts dt {
  font-weight: 600;
  color: #56657a;
}
.event-facts dd {
  margin: 0;
  color: #1f2733;
}
.event-facts a { color: #1c527f; }

@media (max-width: 480px) {
  .event-facts { grid-template-columns: 1fr; gap: 2px; }
  .event-facts dd { margin-bottom: 8px; }
}

/* ==========================================================================
   Rechtstexte / Einwilligungserklärungen (Admin + Modal auf der Anmeldeseite)
   ========================================================================== */
.consent-editor { min-height: 260px; }
.consent-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin: 12px 0 6px;
}
.consent-badge {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 1px 8px;
  border-radius: 9px;
  color: #fff;
}
.consent-badge-ok { background: #1e8449; }
.consent-badge-draft { background: #d68910; }
.consent-history {
  list-style: none;
  padding: 0;
  margin: 6px 0 0;
}
.consent-history li {
  padding: 6px 0;
  border-bottom: 1px solid #e3e9f1;
  font-size: 0.92rem;
}
.link-btn {
  width: auto;
  background: none;
  border: none;
  color: #1c527f;
  cursor: pointer;
  text-decoration: underline;
  padding: 0 2px;
  font-size: 0.92rem;
}

/* Modal / Overlay (Ansicht einer Fassung – Admin & Anmeldeseite) */
.consent-modal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 16px;
}
.consent-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 42, 74, 0.55);
}
.consent-modal-box {
  position: relative;
  background: #fff;
  border-radius: 10px;
  max-width: 720px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  padding: 24px 26px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
}
.consent-modal-close {
  position: absolute;
  top: 8px;
  right: 10px;
  width: auto;
  background: none;
  border: none;
  font-size: 1.8rem;
  line-height: 1;
  color: #56657a;
  cursor: pointer;
  padding: 4px 8px;
}
.consent-view { color: #33404f; line-height: 1.6; }
.consent-view h2 { font-size: 1.15rem; color: #0f2a4a; margin: 16px 0 6px; }
.consent-view h3 { font-size: 1rem; color: #12457a; margin: 12px 0 4px; }
.consent-view p { margin: 0 0 8px; }
.consent-view ul, .consent-view ol { margin: 6px 0; padding-left: 22px; }

/* „Erklärung anzeigen"-Link neben den Checkboxen auf der Anmeldeseite */
.consent-link {
  width: auto;
  background: none;
  border: none;
  color: #1c527f;
  cursor: pointer;
  text-decoration: underline;
  padding: 0;
  font-size: 0.9rem;
  margin-left: 4px;
}

/* ==========================================================================
   Namensschild-Status auf der Check-in-Seite (Block 16)
   ========================================================================== */
.nametag-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin: 12px 0 4px;
  padding: 10px 14px;
  border-radius: var(--border-radius);
  border: 1px solid #cfe0f2;
  background: #f2f8fd;
  font-size: 0.92rem;
  color: #1c3a5e;
}
.nametag-status.nametag-ok {
  border-color: #a9dfbf;
  background: #eafaf1;
  color: #1e5a37;
}
.nametag-status.nametag-error {
  border-color: #f1c40f;
  background: #fef9e7;
  color: #7a5c00;
}
.nametag-status button { margin: 0; flex: 0 0 auto; }

/* ==========================================================================
   Offline-Check-in: Verbindungsstatus + Konflikt-Übersicht (Block 20)
   ========================================================================== */
.connection-status {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin: 0 0 16px;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 0.92rem;
  border: 1px solid transparent;
}
.connection-dot {
  width: 11px;
  height: 11px;
  min-width: 11px;
  border-radius: 50%;
  background: #999;
  display: inline-block;
}
.connection-queue { margin-left: auto; font-size: 0.82rem; opacity: 0.85; }
.connection-status.connection-online { background: #e9f7ef; border-color: #b7e0c6; color: #1e5c3f; }
.connection-status.connection-online .connection-dot { background: #2e7d32; }
.connection-status.connection-ready { background: #fff6e6; border-color: #f2d69a; color: #7a5310; }
.connection-status.connection-ready .connection-dot { background: #e07b00; }
.connection-status.connection-stale { background: #fdeaea; border-color: #f2b6b6; color: #93231f; }
.connection-status.connection-stale .connection-dot { background: #c62828; }

.conflict-panel {
  margin: 0 0 16px;
  padding: 12px 16px;
  border: 1px solid #f2b6b6;
  border-radius: 8px;
  background: #fdeaea;
}
.conflict-panel-head { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; color: #93231f; }
.conflict-count { font-size: 0.8rem; font-weight: 700; background: #c62828; color: #fff; border-radius: 20px; padding: 1px 9px; }
.conflict-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-top: 1px solid #f2c6c6;
}
.conflict-row strong { font-size: 0.95rem; }
.conflict-meta { font-size: 0.8rem; color: #7a3b38; margin-top: 2px; }
.conflict-row button { margin: 0 0 0 auto; flex: 0 0 auto; width: auto; }

/* ==========================================================================
   Lookup: eingeladen, aber nicht angemeldet -> Info + Spontan-Check-in (Block 17)
   ========================================================================== */
.lookup-notice {
  margin-top: 12px;
  padding: 14px 16px;
  border: 1px solid #cfe0f2;
  border-radius: var(--border-radius);
  background: #f2f8fd;
  color: #1c3a5e;
}
.lookup-notice-text {
  margin: 0 0 6px;
  font-weight: 600;
  font-size: 1rem;
}
.lookup-notice-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}
.lookup-notice-actions button { margin: 0; }

/* ==========================================================================
   Block 18 – Ampel-Marker in der Einladungsplanung + geführte Filterleiste
   ========================================================================== */
.invite-guest-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.invite-guest-text { flex: 1 1 auto; }
.ampel-markers { display: inline-flex; gap: 4px; flex: 0 0 auto; margin-left: auto; }
.ampel-marker {
  display: inline-block;
  width: 16px;
  height: 16px;
  min-width: 16px;
  margin: 0;
  padding: 0;
  border-radius: 50%;
  border: 1px solid rgba(0, 0, 0, 0.15);
  background: var(--ampel-color, #999);
  cursor: pointer;
  vertical-align: middle;
}
.ampel-marker:focus { outline: 2px solid var(--color-primary); outline-offset: 1px; }

/* Event-Historie-Modal (Teil B): Kennzahlen oben + Personenliste */
#event-history-counts { margin: 4px 0 14px; }
.event-history-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 0;
  border-bottom: 1px solid #e3e9f1;
  font-size: 0.93rem;
}
.event-history-name { font-weight: 600; }
.event-history-status { color: #56657a; }
.event-history-sub { color: #8a97a8; margin-left: auto; }
.ampel-popover {
  position: absolute;
  z-index: 1000;
  background: #1f2733;
  color: #fff;
  font-size: 0.82rem;
  padding: 5px 9px;
  border-radius: 6px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3);
  pointer-events: none;
  max-width: 260px;
}

/* Geführte Filterleiste (Teil C) */
.planner-filterbar {
  margin: 8px 0 12px;
  padding: 14px 16px;
  border: 1px solid #dbe4ef;
  border-radius: var(--border-radius);
  background: #fbfcfe;
}
.planner-filterbar h3 { margin: 0 0 8px; }
.planner-count {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--color-primary);
  margin-bottom: 6px;
}
.planner-hint {
  margin: 0 0 8px;
  font-size: 0.9rem;
  color: #4a5568;
  background: #eef4fb;
  border-left: 3px solid var(--color-primary);
  padding: 6px 10px;
  border-radius: 4px;
}
.planner-mode-fieldset {
  margin: 10px 0;
  border: 1px solid #d5dbe3;
  border-radius: 8px;
  padding: 8px 12px 10px;
}
.planner-mode-fieldset legend { font-size: 0.85rem; font-weight: 700; padding: 0 4px; }
.planner-mode-fieldset .radio-option { margin: 6px 0; font-size: 0.92rem; }
.planner-exclusion-hint {
  margin: 8px 0;
  font-size: 0.9rem;
  color: #7a5c00;
  background: #fef9e7;
  border: 1px solid #f1c40f;
  border-radius: 6px;
  padding: 7px 11px;
}

/* ==========================================================================
   Management-Dashboard / Auswertungen (Block 21)
   ========================================================================== */
.stats-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.stats-actions button { width: auto; flex: 0 0 auto; }
.stats-kpis { margin-bottom: 8px; }
.chart-section .chart-wrap { width: 100%; overflow-x: auto; }
.stats-chart { width: 100%; height: auto; display: block; }
.chart-axis-label { font-size: 11px; fill: #6b7684; }
.chart-x-label { font-size: 10px; fill: #6b7684; }
.chart-empty { font-size: 13px; fill: #8a97a8; }
.stats-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.stats-table th, .stats-table td { padding: 7px 9px; border-bottom: 1px solid #e3e9f1; text-align: left; }
.stats-table th { background: #f4f7fb; font-weight: 700; }
.stats-table td.num { text-align: right; font-variant-numeric: tabular-nums; }
.table-scroll { width: 100%; overflow-x: auto; }

/* Druck-Kopf nur beim Drucken/PDF sichtbar */
.print-only { display: none; }
.print-header h2 { margin: 0 0 4px; }
.print-filter-summary { font-weight: 600; color: #1f3a5f; }
.print-date { font-size: 0.85rem; color: #6b7684; margin-top: 2px; }

/* Druckansicht (PDF via Browser „Als PDF speichern"): Navigation + Bedienelemente ausblenden,
   nur Kennzahlen, Diagramme, Tabelle und der Druck-Kopf mit aktivem Filterzustand bleiben. */
@media print {
  .admin-nav, .no-print, .stats-controls, .admin-nav-logout { display: none !important; }
  .print-only { display: block; }
  body { background: #fff; }
  .admin-container { max-width: 100%; }
  .admin-section, .stat-card { break-inside: avoid; box-shadow: none; }
  .chart-section { page-break-inside: avoid; }
  a[href]:after { content: ''; }
}

/* ==========================================================================
   BLOCK 22 · Marken-Redesign (Navy #24195C / Rot #DE0813)
   Rein visuell – keine Funktionsänderung. Leitprinzip: weiße/neutrale Flächen,
   Navy als Tinte + gefüllter Primär-Button, Rot nur als winziger Signatur-Akzent.
   Alles über die zentralen Tokens oben; hier die daraus abgeleiteten Feinheiten.
   ========================================================================== */

/* --- Typografie: hochwertiger Kontrast über Gewicht/Größe/Tracking ---------- */
body { -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
h1, h2, h3 { color: var(--navy); letter-spacing: -0.015em; }
h1 { font-weight: 800; line-height: 1.15; }
h2 { font-weight: 700; }
.admin-pagetitle h1 { font-size: 1.65rem; }

/* --- Guest-Seiten (Anmeldeseite): luftig, weiß, eine kurze rote Keyline ------
   Gilt nur für die öffentlichen Seiten (kein data-page). Die Keyline ist der
   einzige feste Farbtupfer im Gast-Chrome – der Rest lebt von Weißraum + Typo. */
body:not([data-page]) .container { padding-top: 32px; }
body:not([data-page]) .container::before {
  content: "";
  display: block;
  width: 34px;
  height: 3px;
  border-radius: 2px;
  background: var(--brand-red);
  margin: 0 0 18px;
}
.brand-title { color: var(--navy); font-weight: 800; letter-spacing: -0.02em; }
.subtitle { color: var(--color-muted); }

/* --- Buttons ---------------------------------------------------------------- */
button, .button-link { border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); }
button { transition: background 0.15s ease, box-shadow 0.15s ease; }
button:hover:not(:disabled):not(.secondary-btn):not(.danger-btn) { background: var(--navy-700); }
button:active { background: var(--navy-900); }

/* Sekundär: ruhige, neutrale Outline statt kräftigem Navy-Rahmen */
button.secondary-btn, .button-link.secondary {
  background: var(--color-surface);
  color: var(--navy);
  border: 1.5px solid var(--color-border);
  box-shadow: none;
}
button.secondary-btn:hover { background: var(--navy-050); border-color: var(--navy-100); }

/* Danger/Löschen: rote OUTLINE – klar destruktiv, hebt sich von der (gefüllten)
   Navy-Primäraktion UND vom winzigen Marken-Rot-Akzent ab. */
button.danger-btn {
  background: transparent;
  color: var(--color-danger);
  border: 1.5px solid var(--color-danger);
  box-shadow: none;
}
button.danger-btn:hover { background: var(--brand-red-050); }
button.danger-btn:active { background: #f7d7d4; }

/* --- Formularfelder: sanfter Navy-Fokusring statt harter Outline ------------ */
input[type="text"], input[type="email"], input[type="password"],
input[type="search"], input[type="date"], input[type="time"], input[type="number"],
select, textarea {
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-lg);
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--navy);
  box-shadow: 0 0 0 3px var(--navy-100);
}

/* --- Admin/Check-in-Navigation: weiße, ruhige Leiste (kein blauer Block) ----- */
.admin-nav {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 8px 16px;
}
.admin-nav-brand { color: var(--navy); }
.admin-nav-logo {
  background: var(--navy);
  color: #fff;
  position: relative;
}
/* winziges rotes Signet am Logo – die Marken-Signatur im Admin, sonst kein Rot */
.admin-nav-logo::after {
  content: "";
  position: absolute;
  right: -3px;
  bottom: -3px;
  width: 8px;
  height: 8px;
  background: var(--brand-red);
  border-radius: 2px;
  border: 2px solid var(--color-surface);
}
.admin-nav-links { gap: 2px; }
.admin-nav-link {
  color: var(--color-muted);
  background: transparent;
  border-radius: 0;
  border-bottom: 2px solid transparent;
  padding: 8px 12px;
}
.admin-nav-link:hover { background: transparent; color: var(--navy); }
.admin-nav-link.active {
  background: transparent;
  color: var(--navy);
  border-bottom-color: var(--navy);
}
.admin-nav-logout {
  background: transparent;
  color: var(--navy);
  border: 1.5px solid var(--color-border);
  box-shadow: none;
}
.admin-nav-logout:hover { background: var(--navy-050); }
.admin-nav-role {
  background: var(--navy-100);
  color: var(--navy);
}

/* --- Cards / Sektionen / Trennlinien: weiche, neutrale Hairlines ------------- */
.invitation-card, .table-wrapper, .qr-image { border-color: var(--color-border); }
fieldset { border-color: var(--color-border); border-radius: var(--radius-lg); }
th, td { border-color: var(--color-hairline); }
.table-wrapper table th { background: #fafbfc; color: #3a3550; }

/* --- Guest-Hero (Veranstaltungs-Vorstellung, Block 14): Navy-Titel, ruhig ---- */
.event-hero-title { color: var(--navy); font-weight: 800; letter-spacing: -0.015em; }

/* --- Check-in: größere, touchfreundliche Bedienelemente am Einlass ----------- */
body[data-page="checkin"] #scan-form button,
body[data-page="checkin"] #lookup-form button,
body[data-page="checkin"] #search-form button,
body[data-page="checkin"] #camera-toggle-btn {
  padding: 16px;
  font-size: 1.05rem;
}
body[data-page="checkin"] .stat-value { font-size: 2rem; }
