/* ============================================================
   KAMINABEND – Netzwerk-App Stylesheet  (v12)
   Subdomain: netzwerk.kamin-abend.de
   Design: Premium, minimalistisch, Apple-Style, Mobile-First
   ============================================================ */

/* ---- CSS Custom Properties ---- */
:root {
  --color-bg:           #0d0f14;
  --color-surface:      #13161e;
  --color-surface-2:    #1a1e28;
  --color-border:       rgba(255, 255, 255, 0.08);
  --color-border-focus: rgba(224, 123, 57, 0.6);
  --color-text:         #f0ece4;
  --color-text-muted:   rgba(240, 236, 228, 0.5);
  --color-text-subtle:  rgba(240, 236, 228, 0.3);
  --text-muted:         rgba(240, 236, 228, 0.5);
  --color-accent:       #e07b39;
  --color-accent-hover: #d06a28;
  --color-success:      #4caf7d;
  --color-error:        #e05555;

  --font-serif:   'Playfair Display', Georgia, serif;
  --font-sans:    'Inter', -apple-system, BlinkMacSystemFont, sans-serif;

  --space-xs:   0.375rem;
  --space-sm:   0.75rem;
  --space-md:   1.25rem;
  --space-lg:   2rem;
  --space-xl:   3rem;

  --radius-sm:   10px;
  --radius-md:   16px;
  --radius-lg:   24px;
  --radius-full: 9999px;

  --shadow-card:  0 4px 24px rgba(0, 0, 0, 0.4);
  --shadow-input: 0 2px 8px rgba(0, 0, 0, 0.2);
  --transition:   0.22s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ---- Reset & Base ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  background-color: var(--color-bg);
  color: var(--color-text);
  line-height: 1.6;
  min-height: 100vh;
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: var(--color-accent);
  text-decoration: none;
  transition: opacity var(--transition);
}
a:hover { opacity: 0.8; }

/* ============================================================
   VIEWS
   ============================================================ */
.view { min-height: 100vh; min-height: 100dvh; }
.view--hidden { display: none !important; }

/* ============================================================
   LOGIN-WALL
   ============================================================ */
.login-wrap {
  max-width: 400px;
  margin: 0 auto;
  padding: 3rem 1.5rem 4rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  min-height: 100vh;
  min-height: 100dvh;
  justify-content: center;
}

.login-logo-wrap {
  margin-bottom: 2rem;
}

.login-logo {
  height: 48px;
  width: auto;
  max-width: 200px;
  object-fit: contain;
}

.login-logo-text {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  color: var(--color-text);
}

.login-title {
  font-family: var(--font-serif);
  font-size: clamp(1.8rem, 6vw, 2.4rem);
  font-weight: 600;
  color: var(--color-text);
  line-height: 1.2;
  margin-bottom: 0.6rem;
}

.login-subtitle {
  font-size: 0.9rem;
  color: var(--color-text-muted);
  margin-bottom: 2rem;
  line-height: 1.6;
}

.login-form {
  width: 100%;
  text-align: left;
}

/* Passwort-Feld mit Toggle */
.password-wrap {
  position: relative;
}

.password-wrap .field-input {
  padding-right: 3rem;
}

.pw-toggle {
  position: absolute;
  right: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--color-text-subtle);
  cursor: pointer;
  padding: 0.25rem;
  display: flex;
  align-items: center;
  transition: color var(--transition);
}

.pw-toggle:hover { color: var(--color-text-muted); }

.admin-link {
  margin-top: 1.5rem;
  background: none;
  border: none;
  color: var(--color-text-subtle);
  font-size: 0.8rem;
  cursor: pointer;
  transition: color var(--transition);
  font-family: var(--font-sans);
}

.admin-link:hover { color: var(--color-text-muted); }

/* ============================================================
   HEADER
   ============================================================ */
.app-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(13, 15, 20, 0.9);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--color-border);
  padding: 0.875rem 1.25rem;
}

.header-inner {
  max-width: 900px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.header-logo {
  height: 32px;
  width: auto;
  max-width: 160px;
  object-fit: contain;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.header-badge {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--color-text-muted);
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  padding: 0.25rem 0.75rem;
  white-space: nowrap;
}

/* ============================================================
   MAIN CONTAINER
   ============================================================ */
.main-container {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 1.25rem 4rem;
}

.main-container--wide {
  max-width: 1200px;
}

/* ============================================================
   PAGE HEADER
   ============================================================ */
.page-header {
  padding: 2rem 0 1.5rem;
}

.section-label {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-accent);
  margin-bottom: 0.5rem;
}

.page-title {
  font-family: var(--font-serif);
  font-size: clamp(1.6rem, 5vw, 2.2rem);
  font-weight: 600;
  color: var(--color-text);
  line-height: 1.2;
  margin-bottom: 0.4rem;
}

.page-subtitle {
  font-size: 0.9rem;
  color: var(--color-text-muted);
}

/* ============================================================
   SUCHLEISTE
   ============================================================ */
.search-wrap {
  position: relative;
  margin-bottom: 1.5rem;
}

.search-icon {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--color-text-subtle);
  pointer-events: none;
}

.search-input {
  width: 100%;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  color: var(--color-text);
  font-family: var(--font-sans);
  font-size: 0.95rem;
  padding: 0.75rem 2.75rem 0.75rem 2.75rem;
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
  -webkit-appearance: none;
  appearance: none;
}

.search-input::placeholder { color: var(--color-text-subtle); }

.search-input:focus {
  border-color: var(--color-border-focus);
  box-shadow: 0 0 0 3px rgba(224, 123, 57, 0.1);
}

.search-clear {
  position: absolute;
  right: 0.875rem;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255,255,255,0.08);
  border: none;
  color: var(--color-text-muted);
  width: 24px;
  height: 24px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition);
}

.search-clear:hover { background: rgba(255,255,255,0.15); }

/* ============================================================
   LADE-ANZEIGE
   ============================================================ */
.loading-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  padding: 3rem 0;
}

.loading-spinner {
  width: 36px;
  height: 36px;
  border: 3px solid var(--color-border);
  border-top-color: var(--color-accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.loading-text {
  font-size: 0.85rem;
  color: var(--color-text-subtle);
}

/* ============================================================
   LEERER ZUSTAND
   ============================================================ */
.empty-state {
  text-align: center;
  padding: 3rem 1rem;
}

.empty-icon {
  width: 64px;
  height: 64px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1rem;
  color: var(--color-text-subtle);
}

.empty-title {
  font-family: var(--font-serif);
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 0.4rem;
}

.empty-text {
  font-size: 0.85rem;
  color: var(--color-text-muted);
  line-height: 1.6;
}

/* ============================================================
   TEILNEHMER-GRID
   ============================================================ */
.participants-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}

/* ============================================================
   TEILNEHMER-KARTE
   ============================================================ */
.participant-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  animation: cardIn 0.4s cubic-bezier(0.4, 0, 0.2, 1) both;
  transition: border-color var(--transition);
}

@keyframes cardIn {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Karten-Header: Avatar + Name */
.card-header {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  margin-bottom: 1rem;
}

/* Avatar: Initialen-Variante */
.card-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(224, 123, 57, 0.3), rgba(224, 123, 57, 0.1));
  border: 1px solid rgba(224, 123, 57, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-serif);
  font-size: 1rem;
  font-weight: 600;
  color: var(--color-accent);
  flex-shrink: 0;
  letter-spacing: 0.02em;
}

/* Avatar: Foto-Variante */
.card-avatar--photo {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid rgba(224, 123, 57, 0.25);
  flex-shrink: 0;
  display: block;
}

.card-name {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--color-text);
  line-height: 1.3;
}

.card-firma {
  font-size: 0.78rem;
  color: var(--color-accent);
  margin-top: 0.15rem;
}

.card-meta {
  font-size: 0.75rem;
  color: var(--color-text-subtle);
  margin-top: 0.25rem;
}

/* Matching-Felder */
.card-matching {
  margin-bottom: 1rem;
}

.card-matching-item {
  margin-bottom: 0.6rem;
}

.card-matching-label {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-text-subtle);
  margin-bottom: 0.2rem;
}

.card-matching-text {
  font-size: 0.82rem;
  color: var(--color-text-muted);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Karten-Footer */
.card-footer {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  padding-top: 1rem;
  border-top: 1px solid var(--color-border);
}

.card-contact-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--color-text-muted);
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  padding: 0.35rem 0.75rem;
  text-decoration: none;
  transition: all var(--transition);
}

.card-contact-btn:hover {
  background: rgba(224, 123, 57, 0.1);
  border-color: rgba(224, 123, 57, 0.3);
  color: var(--color-accent);
}

/* ============================================================
   ADMIN-TABS
   ============================================================ */
.admin-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 0.35rem;
  width: fit-content;
}

.admin-tab {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: none;
  border: none;
  color: var(--color-text-muted);
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 500;
  padding: 0.5rem 1rem;
  border-radius: calc(var(--radius-md) - 4px);
  cursor: pointer;
  transition: all var(--transition);
}

.admin-tab--active {
  background: var(--color-surface-2);
  color: var(--color-text);
}

.tab-badge {
  background: var(--color-accent);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.1rem 0.45rem;
  border-radius: var(--radius-full);
  min-width: 20px;
  text-align: center;
}

/* ============================================================
   ADMIN-TABELLE
   ============================================================ */
.admin-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
}

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

.admin-table thead {
  background: var(--color-surface-2);
  border-bottom: 1px solid var(--color-border);
}

.admin-table th {
  padding: 0.75rem 1rem;
  text-align: left;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--color-text-subtle);
  white-space: nowrap;
}

.admin-table td {
  padding: 0.875rem 1rem;
  border-bottom: 1px solid var(--color-border);
  color: var(--color-text-muted);
  vertical-align: top;
}

.admin-table tr:last-child td {
  border-bottom: none;
}

.admin-table tr:hover td {
  background: rgba(255,255,255,0.02);
}

.admin-table a {
  color: var(--color-accent);
  text-decoration: none;
}

.name-cell {
  font-weight: 600;
  color: var(--color-text) !important;
  white-space: nowrap;
}

.text-cell {
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.date-cell {
  white-space: nowrap;
  font-size: 0.78rem;
}

.action-btns {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.action-btn {
  font-family: var(--font-sans);
  font-size: 0.75rem;
  font-weight: 500;
  padding: 0.3rem 0.65rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border);
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
}

.action-btn--edit {
  background: rgba(224, 123, 57, 0.08);
  color: var(--color-accent);
  border-color: rgba(224, 123, 57, 0.2);
}

.action-btn--edit:hover {
  background: rgba(224, 123, 57, 0.18);
  border-color: rgba(224, 123, 57, 0.4);
}

.action-btn--delete {
  background: rgba(224, 85, 85, 0.08);
  color: var(--color-error);
  border-color: rgba(224, 85, 85, 0.2);
}

.action-btn--delete:hover {
  background: rgba(224, 85, 85, 0.18);
  border-color: rgba(224, 85, 85, 0.4);
}

/* ============================================================
   MODAL (allgemein)
   ============================================================ */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 1rem;
}

.modal {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 520px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.6);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--color-border);
}

.modal-title {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--color-text);
}

.modal-close {
  background: rgba(255,255,255,0.06);
  border: none;
  color: var(--color-text-muted);
  font-size: 1.3rem;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition), color var(--transition);
  flex-shrink: 0;
}

.modal-close:hover {
  background: rgba(255,255,255,0.12);
  color: var(--color-text);
}

.modal-body {
  padding: 1.5rem;
  max-height: 70vh;
  overflow-y: auto;
}

.modal-footer {
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
  padding-top: 1.25rem;
  border-top: 1px solid var(--color-border);
  margin-top: 1.25rem;
}

/* ============================================================
   FELDER (wiederverwendet im Modal)
   ============================================================ */
.field-group { margin-bottom: 1rem; }

.field-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--color-text-muted);
  margin-bottom: 0.4rem;
}

.field-input,
.field-textarea {
  width: 100%;
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  color: var(--color-text);
  font-family: var(--font-sans);
  font-size: 0.95rem;
  padding: 0.75rem 0.875rem;
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
  -webkit-appearance: none;
  appearance: none;
}

.field-input::placeholder,
.field-textarea::placeholder { color: var(--color-text-subtle); }

.field-input:focus,
.field-textarea:focus {
  border-color: var(--color-border-focus);
  box-shadow: 0 0 0 3px rgba(224, 123, 57, 0.1);
}

.field-textarea {
  resize: vertical;
  min-height: 80px;
  line-height: 1.6;
}

.field-error {
  display: none;
  font-size: 0.78rem;
  color: var(--color-error);
  margin-top: 0.35rem;
}

.field-error.show { display: block; }

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-family: var(--font-sans);
  font-size: 0.95rem;
  font-weight: 600;
  border: none;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
  white-space: nowrap;
  padding: 0.85rem 1.75rem;
}

.btn-primary {
  background: var(--color-accent);
  color: #fff;
  box-shadow: 0 4px 16px rgba(224, 123, 57, 0.3);
}

.btn-primary:hover {
  background: var(--color-accent-hover);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(224, 123, 57, 0.4);
}

.btn-ghost {
  background: transparent;
  color: var(--color-text-muted);
  border: 1px solid var(--color-border);
}

.btn-ghost:hover {
  border-color: rgba(255,255,255,0.2);
  color: var(--color-text);
}

.btn-sm {
  font-size: 0.82rem;
  padding: 0.5rem 1rem;
}

.btn-full { width: 100%; }

.btn-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

/* ============================================================
   FOOTER
   ============================================================ */
.app-footer {
  text-align: center;
  padding: 2rem 1.5rem;
  font-size: 0.78rem;
  color: var(--color-text-subtle);
}

/* ============================================================
   PROFIL-MODAL
   ============================================================ */

/* Klickbare Karte */
.participant-card--clickable {
  cursor: pointer;
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}
.participant-card--clickable:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 32px rgba(224, 123, 57, 0.18);
  border-color: rgba(224, 123, 57, 0.35);
}
.participant-card--clickable:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 3px;
}

/* Profil-Modal Größe */
.modal--profile {
  max-width: 480px;
  width: 95%;
  padding: var(--space-lg);
  position: relative;
  max-height: 90vh;
  overflow-y: auto;
}

/* Schließen-Button */
.modal--profile .modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: rgba(255,255,255,0.06);
  border: none;
  color: var(--color-text-muted);
  font-size: 1.4rem;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition), color var(--transition);
}
.modal--profile .modal-close:hover {
  background: rgba(255,255,255,0.12);
  color: var(--color-text);
}

/* Header: Avatar + Name */
.profile-header {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  margin-bottom: var(--space-md);
  padding-right: 2.5rem;
}

/* Avatar: Initialen-Variante */
.profile-avatar {
  width: 64px;
  height: 64px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, var(--color-accent), #c05a20);
  color: #fff;
  font-size: 1.4rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  letter-spacing: 0.02em;
  overflow: hidden;
}

/* Avatar: Foto-Variante */
.profile-avatar-img {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
}

.profile-name {
  font-family: var(--font-serif);
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--color-text);
  line-height: 1.2;
  margin-bottom: 0.2rem;
}

.profile-firma {
  font-size: 0.85rem;
  color: var(--color-accent);
  font-weight: 500;
}

/* Kontakt-Buttons */
.profile-contact {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: var(--space-sm);
}

.profile-contact-btn {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.65rem 1rem;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  color: var(--color-text);
  text-decoration: none;
  font-size: 0.875rem;
  transition: background var(--transition), border-color var(--transition);
  word-break: break-all;
}
.profile-contact-btn:hover {
  background: rgba(224, 123, 57, 0.12);
  border-color: rgba(224, 123, 57, 0.4);
  color: var(--color-accent);
}
.profile-contact-btn svg {
  flex-shrink: 0;
  color: var(--color-accent);
}

/* ============================================================
   KONTAKT SPEICHERN BUTTON
   ============================================================ */
.profile-save-contact-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  width: 100%;
  padding: 0.75rem 1rem;
  margin-bottom: var(--space-md);
  background: rgba(76, 175, 125, 0.1);
  border: 1px solid rgba(76, 175, 125, 0.3);
  border-radius: var(--radius-sm);
  color: var(--color-success);
  font-family: var(--font-sans);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition), transform var(--transition);
  letter-spacing: 0.01em;
}

.profile-save-contact-btn:hover {
  background: rgba(76, 175, 125, 0.18);
  border-color: rgba(76, 175, 125, 0.5);
  transform: translateY(-1px);
}

.profile-save-contact-btn:active {
  transform: translateY(0);
}

.profile-save-contact-btn svg {
  flex-shrink: 0;
}

/* Divider */
.profile-divider {
  height: 1px;
  background: var(--color-border);
  margin-bottom: var(--space-md);
}

/* Matching-Blöcke */
.profile-matching {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  margin-bottom: var(--space-md);
}

.profile-matching-block {
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: var(--space-sm) var(--space-md);
}

.profile-matching-label {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-accent);
  margin-bottom: 0.35rem;
}

.profile-matching-text {
  font-size: 0.9rem;
  color: var(--color-text);
  line-height: 1.55;
  white-space: pre-wrap;
}

/* Meta (Geburtstag) */
.profile-meta {
  margin-top: 0.25rem;
}

.profile-meta-item {
  font-size: 0.8rem;
  color: var(--color-text-muted);
}

/* Modal-Backdrop Fade-Animation */
.modal-backdrop--visible {
  animation: fadeIn 0.22s ease forwards;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.modal-backdrop--visible .modal--profile {
  animation: slideUp 0.25s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes slideUp {
  from { transform: translateY(24px) scale(0.97); opacity: 0; }
  to   { transform: translateY(0)    scale(1);    opacity: 1; }
}

/* ============================================================
   TOAST-BENACHRICHTIGUNGEN
   ============================================================ */
.toast-container {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  align-items: center;
  pointer-events: none;
}

.toast {
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  color: var(--color-text);
  font-size: 0.85rem;
  font-weight: 500;
  padding: 0.6rem 1.25rem;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
  animation: toastIn 0.25s ease forwards;
  white-space: nowrap;
  pointer-events: auto;
}

.toast--success { border-color: rgba(76, 175, 125, 0.4); color: var(--color-success); }
.toast--error   { border-color: rgba(224, 85, 85, 0.4);  color: var(--color-error);   }

.toast-out {
  animation: toastOut 0.3s ease forwards;
}

@keyframes toastIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes toastOut {
  from { opacity: 1; transform: translateY(0); }
  to   { opacity: 0; transform: translateY(8px); }
}

/* ============================================================
   ADMIN AVATAR IM EDIT-MODAL
   ============================================================ */

/* Admin-Tabelle: Avatar-Zelle */
.admin-avatar-cell {
  width: 48px;
  padding: 0.4rem 0.5rem;
  text-align: center;
  vertical-align: middle;
}

.admin-table-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
  margin: 0 auto;
  border: 1.5px solid rgba(224, 123, 57, 0.3);
}

.admin-table-avatar-initials {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(224, 123, 57, 0.2), rgba(224, 123, 57, 0.06));
  border: 1.5px solid rgba(224, 123, 57, 0.25);
  color: var(--color-accent);
  font-size: 0.75rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
  font-family: var(--font-serif);
}

.admin-avatar-wrap {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem;
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
}

.admin-avatar-preview {
  position: relative;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(224, 123, 57, 0.25), rgba(224, 123, 57, 0.08));
  border: 2px solid rgba(224, 123, 57, 0.3);
  flex-shrink: 0;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.admin-avatar-preview img {
  width: 64px;
  height: 64px;
  object-fit: cover;
  display: block;
}

.admin-avatar-initials {
  font-family: var(--font-serif);
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--color-accent);
  display: flex;
  align-items: center;
  justify-content: center;
}

.admin-avatar-actions {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  flex: 1;
}

.admin-avatar-upload-label {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(224, 123, 57, 0.08);
  border: 1px solid rgba(224, 123, 57, 0.25);
  border-radius: var(--radius-full);
  color: var(--color-accent);
  font-size: 0.82rem;
  font-weight: 500;
  padding: 0.45rem 0.9rem;
  cursor: pointer;
  transition: all var(--transition);
  user-select: none;
  -webkit-user-select: none;
  width: fit-content;
}

.admin-avatar-upload-label:hover {
  background: rgba(224, 123, 57, 0.16);
  border-color: rgba(224, 123, 57, 0.5);
}

.admin-avatar-delete-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(224, 85, 85, 0.08);
  border: 1px solid rgba(224, 85, 85, 0.25);
  border-radius: var(--radius-full);
  color: var(--color-error);
  font-family: var(--font-sans);
  font-size: 0.82rem;
  font-weight: 500;
  padding: 0.45rem 0.9rem;
  cursor: pointer;
  transition: all var(--transition);
  width: fit-content;
}

.admin-avatar-delete-btn:hover {
  background: rgba(224, 85, 85, 0.16);
  border-color: rgba(224, 85, 85, 0.5);
}

/* ============================================================
   ADMIN-BADGE
   ============================================================ */
.admin-badge {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-accent);
  background: rgba(224, 123, 57, 0.12);
  border: 1px solid rgba(224, 123, 57, 0.3);
  border-radius: var(--radius-full);
  padding: 0.2rem 0.65rem;
}

/* ============================================================
   SHAKE-ANIMATION (falsches Passwort)
   ============================================================ */
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%       { transform: translateX(-6px); }
  40%       { transform: translateX(6px); }
  60%       { transform: translateX(-4px); }
  80%       { transform: translateX(4px); }
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (min-width: 600px) {
  .login-wrap { padding: 4rem 2rem 5rem; }
  .main-container { padding: 0 2rem 4rem; }
  .participants-grid { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
}

@media (min-width: 900px) {
  .participants-grid { grid-template-columns: repeat(3, 1fr); }
}

/* ============================================================
   v13 – Login per E-Mail-Link, Mein Profil, Dashboard
   ============================================================ */
[hidden] { display: none !important; }

.login-sent { text-align: center; margin-top: 0.5rem; }
.login-sent__icon {
  width: 60px; height: 60px; margin: 0 auto 1rem; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: rgba(224, 123, 57, 0.12); color: var(--color-accent);
}
.login-sent__title { font-family: var(--font-serif); font-size: 1.3rem; color: var(--color-text); margin-bottom: 0.5rem; }
.login-sent__text { font-size: 0.9rem; color: var(--color-text-muted); line-height: 1.6; margin-bottom: 1rem; }
.login-sent__text strong { color: var(--color-text); word-break: break-all; }
.login-help { margin-top: 2rem; font-size: 0.8rem; color: var(--color-text-subtle); text-align: center; line-height: 1.6; }

.card-du {
  display: inline-block; margin-left: 0.35rem; padding: 0.05rem 0.5rem; border-radius: 99px;
  font-family: var(--font-sans); font-size: 0.65rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--color-accent); background: rgba(224, 123, 57, 0.12); vertical-align: middle;
}

.danger-zone { margin-top: 1.75rem; padding-top: 1.25rem; border-top: 1px solid var(--color-border); }
.danger-zone__text { font-size: 0.8rem; color: var(--color-text-subtle); line-height: 1.6; margin-bottom: 0.75rem; }

/* ---- Dashboard ---- */
.dash-top { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; flex-wrap: wrap; margin: 2rem 0 1.25rem; }
.dash-abend { display: flex; gap: 0.5rem; flex-wrap: wrap; align-items: center; }
.dash-select { width: auto; min-width: 260px; padding: 0.6rem 2.2rem 0.6rem 0.9rem; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23e07b39' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 0.8rem center; }
.dash-select option { background: #13161e; }
.dash-status { font-size: 0.82rem; color: var(--color-text-muted); }
.txt-ok { color: var(--color-success) !important; }
.txt-rot { color: var(--color-error) !important; }

.kpis { display: grid; grid-template-columns: 2fr repeat(4, 1fr); gap: 0.75rem; margin-bottom: 1.75rem; }
.kpi { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-md); padding: 1rem 1.1rem; }
.kpi__label { font-size: 0.68rem; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--color-text-subtle); margin-bottom: 0.4rem; }
.kpi__wert { font-family: var(--font-serif); font-size: 1.9rem; font-weight: 600; color: var(--color-text); line-height: 1.1; font-variant-numeric: tabular-nums; }
.kpi__wert span { font-size: 1.1rem; color: var(--color-text-subtle); }
.kpi__wert--klein { font-size: 1.3rem; padding-top: 0.35rem; }
.kpi__wert--rot { color: var(--color-error); }
.kpi__balken { height: 6px; background: var(--color-surface-2); border-radius: 99px; overflow: hidden; margin: 0.7rem 0 0.5rem; }
.kpi__balken span { display: block; height: 100%; background: var(--color-accent); border-radius: 99px; transition: width 0.4s; }
.kpi__sub { font-size: 0.75rem; color: var(--color-text-muted); }

.dash-toolbar { display: flex; gap: 0.75rem; align-items: center; margin: 1rem 0; }
.dash-search { max-width: 320px; padding: 0.6rem 0.9rem; }
.dash-mini { font-size: 0.75rem; color: var(--color-text-subtle); }
.dash-hinweis { font-size: 0.8rem; color: var(--color-text-muted); line-height: 1.6; margin: 0.5rem 0 1rem; }
.dash-check { display: flex; gap: 0.6rem; align-items: center; font-size: 0.88rem; color: var(--color-text-muted); margin: 0.25rem 0 0.5rem; cursor: pointer; }
.dash-check input { accent-color: var(--color-accent); width: 16px; height: 16px; }
.dash-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }
.dash-grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.75rem; }

.chip { display: inline-block; padding: 0.15rem 0.6rem; border-radius: 99px; font-size: 0.72rem; font-weight: 600; letter-spacing: 0.03em; white-space: nowrap; margin-bottom: 0.25rem; }
.chip--neu   { background: rgba(224, 123, 57, 0.15); color: var(--color-accent); }
.chip--warte { background: rgba(181, 157, 122, 0.18); color: #d4bc97; }
.chip--offen { background: rgba(90, 150, 230, 0.15); color: #8ab6f0; }
.chip--warn  { background: rgba(224, 85, 85, 0.15); color: var(--color-error); }
.chip--ok    { background: rgba(76, 175, 125, 0.15); color: var(--color-success); }
.chip--aus   { background: rgba(255, 255, 255, 0.06); color: var(--color-text-subtle); }

.action-btn--ok { color: var(--color-success); border-color: rgba(76, 175, 125, 0.35); }
.action-btn--ok:hover { background: rgba(76, 175, 125, 0.12); }
.action-btn:disabled { opacity: 0.4; pointer-events: none; }

@media (max-width: 900px) {
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .kpi--gross { grid-column: 1 / -1; }
}
@media (max-width: 520px) {
  .dash-grid2, .dash-grid3 { grid-template-columns: 1fr; }
  .dash-select { min-width: 0; width: 100%; }
  .header-actions .btn-sm { padding: 0.4rem 0.7rem; font-size: 0.75rem; }
}
@media (max-width: 560px) {
  #viewNetwork .header-badge { display: none; }
  #viewNetwork .header-actions { gap: 0.4rem; }
  #viewNetwork .header-logo { height: 26px; }
}

.btn-icon-only { padding: 0.45rem 0.6rem; }
.btn-icon-only svg { display: block; }
.btn-icon-only.is-spinning svg { animation: drehen 0.8s linear infinite; }
@keyframes drehen { to { transform: rotate(360deg); } }
@media (max-width: 560px) {
  #viewNetwork .app-header { padding-left: 1rem; padding-right: 1rem; }
  #viewNetwork .header-actions .btn-sm { padding: 0.4rem 0.65rem; font-size: 0.75rem; }
  #viewNetwork .header-actions .btn-icon-only { padding: 0.4rem 0.5rem; }
}
@media (max-width: 360px) {
  #viewNetwork .header-logo { height: 22px; }
}
@media (max-width: 560px) {
  #viewNetwork .header-inner { gap: 0.5rem; }
}
@media (max-width: 400px) {
  .nur-breit { display: none; }
  #viewNetwork .header-logo { height: 22px; }
}

/* ---- v13-3: Reiter Abend / Gesamtes Netzwerk ---- */
.netz-tabs {
  display: flex;
  gap: 0.35rem;
  margin: 0 0 1.25rem;
  padding: 0.3rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.netz-tabs::-webkit-scrollbar { display: none; }
.netz-tab {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 0.95rem;
  border: none;
  border-radius: calc(var(--radius-md) - 4px);
  background: none;
  color: var(--color-text-muted);
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
}
.netz-tab:hover { color: var(--color-text); }
.netz-tab--aktiv { background: var(--color-surface-2); color: var(--color-text); }
.netz-tab__zahl {
  min-width: 22px;
  padding: 0.05rem 0.45rem;
  border-radius: 99px;
  font-size: 0.72rem;
  font-weight: 700;
  text-align: center;
  background: rgba(255, 255, 255, 0.08);
  color: var(--color-text-muted);
}
.netz-tab--aktiv .netz-tab__zahl { background: var(--color-accent); color: #fff; }
@media (max-width: 560px) {
  .netz-tabs { flex-wrap: wrap; overflow: visible; }
  .netz-tab { flex: 1 1 auto; justify-content: space-between; padding: 0.5rem 0.75rem; font-size: 0.8rem; }
}

/* ---- v14: großes Abend-Formular ---- */
.modal--gross { max-width: 720px; }
.modal--gross .modal-body { max-height: 78vh; }
.dash-abschnitt {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-accent);
  margin: 0.5rem 0 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--color-border);
}
.dash-abschnitt:first-child { border-top: none; padding-top: 0; margin-top: 0; }
.modal--gross .modal-footer { flex-wrap: wrap; }

.dash-grid-plz { display: grid; grid-template-columns: 1fr 2fr; gap: 0.75rem; }

/* ---- v20: Mein Profil – Quittungsadresse & Meine Quittungen ---- */
.profil-abschnitt { margin-top: 1.5rem; padding-top: 1.25rem; border-top: 1px solid var(--color-border); }
.profil-abschnitt__titel { font-size: 0.72rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--color-accent); margin-bottom: 0.4rem; }
.profil-abschnitt__text { font-size: 0.8rem; color: var(--color-text-subtle); line-height: 1.55; margin-bottom: 0.9rem; }
.profil-plz-ort { display: grid; grid-template-columns: 1fr 2fr; gap: 0.75rem; }
.quittung-liste { display: flex; flex-direction: column; gap: 0.5rem; }
.quittung-zeile { display: flex; justify-content: space-between; align-items: center; gap: 0.75rem; flex-wrap: wrap;
  padding: 0.75rem 0.9rem; border: 1px solid var(--color-border); border-radius: var(--radius-sm); background: var(--color-surface-2); }
.quittung-zeile--alt { opacity: 0.55; }
.quittung-zeile__titel { font-size: 0.88rem; font-weight: 600; color: var(--color-text); }
.quittung-zeile__info { font-size: 0.76rem; color: var(--color-text-muted); margin-top: 0.15rem; line-height: 1.5; }
.quittung-zeile__tag { font-size: 0.65rem; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; color: var(--color-text-subtle);
  border: 1px solid var(--color-border); border-radius: 99px; padding: 0.05rem 0.45rem; margin-left: 0.3rem; }
.quittung-zeile__aktionen { display: flex; gap: 0.4rem; flex-wrap: wrap; }

/* ---- v22: Matching „Passt zu dir“ ---- */
.match-box { margin: 0 0 1.5rem; padding: 1rem; border: 1px solid rgba(224, 123, 57, 0.28); border-radius: var(--radius-md);
  background: linear-gradient(180deg, rgba(224, 123, 57, 0.08), rgba(224, 123, 57, 0.02)); }
.match-box__kopf { display: flex; justify-content: space-between; align-items: baseline; gap: 0.75rem; flex-wrap: wrap; margin-bottom: 0.75rem; }
.match-box__titel { font-family: var(--font-serif); font-size: 1.15rem; font-weight: 600; color: var(--color-text); }
.match-box__info { font-size: 0.72rem; color: var(--color-text-subtle); }
.match-liste { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 0.6rem; }
.match-karte { display: flex; gap: 0.75rem; align-items: flex-start; text-align: left; width: 100%; padding: 0.75rem;
  border: 1px solid var(--color-border); border-radius: var(--radius-sm); background: var(--color-surface); cursor: pointer;
  font-family: var(--font-sans); color: inherit; transition: border-color var(--transition), transform var(--transition); }
.match-karte:hover { border-color: rgba(224, 123, 57, 0.5); transform: translateY(-1px); }
.match-karte .card-avatar { width: 44px; height: 44px; font-size: 0.95rem; flex-shrink: 0; }
.match-karte__text { display: flex; flex-direction: column; gap: 0.15rem; min-width: 0; }
.match-karte__name { font-weight: 600; font-size: 0.92rem; color: var(--color-text); }
.match-karte__firma { font-size: 0.75rem; color: var(--color-accent); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.match-karte__gruende { display: flex; flex-direction: column; gap: 0.25rem; margin-top: 0.35rem; }
.match-grund { font-size: 0.72rem; line-height: 1.35; padding: 0.2rem 0.5rem; border-radius: 6px; width: fit-content; }
.match-grund--bietet { background: rgba(76, 175, 125, 0.14); color: #7fd1a3; }
.match-grund--sucht { background: rgba(90, 150, 230, 0.14); color: #8ab6f0; }
.match-leer { font-size: 0.85rem; color: var(--color-text-muted); line-height: 1.6; }
.match-link { background: none; border: none; padding: 0; color: var(--color-accent); font: inherit; text-decoration: underline; cursor: pointer; }
.match-warum { font-size: 0.82rem; line-height: 1.55; color: var(--color-text); background: rgba(224, 123, 57, 0.1);
  border: 1px solid rgba(224, 123, 57, 0.25); border-radius: var(--radius-sm); padding: 0.6rem 0.75rem; margin-bottom: 0.9rem; }
@media (max-width: 560px) { .match-liste { grid-template-columns: 1fr; } }

/* ---- Demo-Ansicht ---- */
.demo-banner { position: sticky; top: 0; z-index: 200; text-align: center; font-size: 0.75rem; font-weight: 600; letter-spacing: 0.04em;
  padding: 0.4rem 1rem; background: var(--color-accent); color: #fff; }
.demo-banner a { color: #fff; text-decoration: underline; }
body.demo .app-header { top: 28px; }
.match-mehr { grid-column: 1 / -1; background: none; border: 1px dashed var(--color-border); border-radius: var(--radius-sm);
  padding: 0.55rem; color: var(--color-text-muted); font-family: var(--font-sans); font-size: 0.8rem; cursor: pointer; }
.match-mehr:hover { color: var(--color-accent); border-color: rgba(224, 123, 57, 0.5); }

/* ---- v25: Dashboard – Profil-Übersicht ---- */
.kpis { grid-template-columns: 2fr repeat(5, 1fr); }
.kpi__sub { margin-top: 0.35rem; }
.btn--aktiv { border-color: var(--color-accent); color: var(--color-accent); }
.dash-toolbar { flex-wrap: wrap; }
@media (max-width: 900px) { .kpis { grid-template-columns: repeat(2, 1fr); } }
