/**
 * FitnessHub Pro – Haupt-Stylesheet
 * Rücken- und Gelenkzentrum Stendal
 *
 * © AltmarkCloud UG (hb)
 * Thüringer Straße 14, 39576 Stendal
 * Tel: 03931/2157070 | hallo@altmark.cloud | https://altmark.cloud
 * Software mit Liebe entwickelt – maßgeschneidert für Ihre Bedürfnisse.
 */

/* ============================================================
   0. Bootstrap 5 – CSS-Variablen-Overrides
   (Einheitliches Design für alle Bootstrap-Komponenten)
   ============================================================ */
:root {
  --bs-primary:             #E07B77;
  --bs-primary-rgb:         224, 123, 119;
  --bs-link-color:          #E07B77;
  --bs-link-hover-color:    #C96360;
  --bs-body-font-family:    'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --bs-body-color:          #2C2C2C;
  --bs-body-bg:             #F8F9FA;
  --bs-body-font-size:      0.9375rem;
  --bs-border-color:        #E5E7EB;
  --bs-border-radius:       10px;
  --bs-border-radius-sm:    7px;
  --bs-border-radius-lg:    14px;
  --bs-border-radius-xl:    20px;
  --bs-border-radius-pill:  9999px;
  --bs-box-shadow:          0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.04);
  --bs-box-shadow-sm:       0 1px 2px rgba(0,0,0,0.05);
  --bs-box-shadow-lg:       0 10px 24px rgba(0,0,0,0.10), 0 4px 8px rgba(0,0,0,0.05);
  --bs-card-bg:             #FFFFFF;
  --bs-card-border-color:   #E5E7EB;
  --bs-card-cap-bg:         transparent;
  --bs-modal-border-radius: 16px;
  --bs-badge-font-size:     0.72em;
  --bs-badge-font-weight:   600;
  --bs-badge-border-radius: 6px;
}

/* ============================================================
   1. CSS-Variablen & Design-Tokens
   ============================================================ */
:root {
  /* Marken-Farben */
  --color-primary:        #E07B77;
  --color-primary-dark:   #C96360;
  --color-primary-light:  #F0A09D;
  --color-secondary:      #7DC4C3;
  --color-secondary-dark: #5AABAA;
  --color-secondary-light:#A8DEDD;
  --color-accent:         #A8C060;
  --color-accent-dark:    #8DAA45;
  --color-accent-light:   #C5D98A;
  --color-neutral:        #9B9B9B;
  --color-neutral-light:  #D4D4D4;

  /* Semantische Farben */
  --color-bg:             #F8F9FA;
  --color-surface:        #FFFFFF;
  --color-text:           #2C2C2C;
  --color-text-muted:     #6B7280;
  --color-text-light:     #9CA3AF;
  --color-border:         #E5E7EB;
  --color-border-focus:   #E07B77;

  --color-danger:         #EF4444;
  --color-danger-dark:    #DC2626;
  --color-danger-light:   #FEE2E2;
  --color-warning:        #F59E0B;
  --color-warning-dark:   #D97706;
  --color-warning-light:  #FEF3C7;
  --color-success:        #10B981;
  --color-success-dark:   #059669;
  --color-success-light:  #D1FAE5;
  --color-info:           #3B82F6;
  --color-info-dark:      #2563EB;
  --color-info-light:     #DBEAFE;

  /* Spacing */
  --space-xs:  0.25rem;   /*  4px */
  --space-sm:  0.5rem;    /*  8px */
  --space-md:  1rem;      /* 16px */
  --space-lg:  1.5rem;    /* 24px */
  --space-xl:  2rem;      /* 32px */
  --space-2xl: 3rem;      /* 48px */
  --space-3xl: 4rem;      /* 64px */

  /* Border-Radius */
  --radius-sm:   6px;
  --radius-md:   10px;
  --radius-lg:   16px;
  --radius-xl:   24px;
  --radius-full: 9999px;

  /* Schatten */
  --shadow-xs:  0 1px 2px rgba(0,0,0,0.05);
  --shadow-sm:  0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.06);
  --shadow-md:  0 4px 12px rgba(0,0,0,0.10), 0 2px 4px rgba(0,0,0,0.06);
  --shadow-lg:  0 8px 24px rgba(0,0,0,0.12), 0 4px 8px rgba(0,0,0,0.06);
  --shadow-xl:  0 20px 40px rgba(0,0,0,0.14);

  /* Übergänge */
  --transition-fast:   0.15s ease;
  --transition-normal: 0.25s ease;
  --transition-slow:   0.4s ease;

  /* Typographie */
  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  --font-size-xs:   0.75rem;    /* 12px */
  --font-size-sm:   0.875rem;   /* 14px */
  --font-size-base: 1rem;       /* 16px */
  --font-size-lg:   1.125rem;   /* 18px */
  --font-size-xl:   1.25rem;    /* 20px */
  --font-size-2xl:  1.5rem;     /* 24px */
  --font-size-3xl:  1.875rem;   /* 30px */
  --font-size-4xl:  2.25rem;    /* 36px */

  --font-weight-normal:   400;
  --font-weight-medium:   500;
  --font-weight-semibold: 600;
  --font-weight-bold:     700;

  --line-height-tight:  1.25;
  --line-height-normal: 1.5;
  --line-height-relaxed: 1.75;

  /* Layout */
  --container-max:       1200px;
  --container-padding:   var(--space-md);
  --bottom-nav-height:   64px;
  --top-nav-height:      60px;
}

/* ============================================================
   2. CSS-Reset & Basis
   ============================================================ */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

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

body {
  font-family: var(--font-family);
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-normal);
  line-height: var(--line-height-normal);
  color: var(--color-text);
  background-color: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
}

img,
video {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--color-primary);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--color-primary-dark);
  text-decoration: underline;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

input,
textarea,
select {
  font-family: inherit;
  font-size: inherit;
}

ul,
ol {
  list-style: none;
}

hr {
  border: none;
  border-top: 1px solid var(--color-border);
  margin: var(--space-lg) 0;
}

/* ============================================================
   3. Typographie
   ============================================================ */
h1, h2, h3, h4, h5, h6 {
  font-weight: var(--font-weight-semibold);
  line-height: var(--line-height-tight);
  color: var(--color-text);
}

h1 { font-size: var(--font-size-3xl); }
h2 { font-size: var(--font-size-2xl); }
h3 { font-size: var(--font-size-xl); }
h4 { font-size: var(--font-size-lg); }
h5 { font-size: var(--font-size-base); }
h6 { font-size: var(--font-size-sm); }

p {
  line-height: var(--line-height-relaxed);
  color: var(--color-text);
}

.text-xs    { font-size: var(--font-size-xs); }
.text-sm    { font-size: var(--font-size-sm); }
.text-base  { font-size: var(--font-size-base); }
.text-lg    { font-size: var(--font-size-lg); }
.text-xl    { font-size: var(--font-size-xl); }
.text-2xl   { font-size: var(--font-size-2xl); }

.text-muted   { color: var(--color-text-muted); }
.text-light   { color: var(--color-text-light); }
.text-primary { color: var(--color-primary); }
.text-success { color: var(--color-success); }
.text-danger  { color: var(--color-danger); }
.text-warning { color: var(--color-warning); }

.font-normal   { font-weight: var(--font-weight-normal); }
.font-medium   { font-weight: var(--font-weight-medium); }
.font-semibold { font-weight: var(--font-weight-semibold); }
.font-bold     { font-weight: var(--font-weight-bold); }

.text-center { text-align: center; }
.text-left   { text-align: left; }
.text-right  { text-align: right; }

/* ============================================================
   4. Layout & Container
   ============================================================ */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--container-padding);
}

.container-sm { max-width: 640px; }
.container-md { max-width: 768px; }
.container-lg { max-width: 1024px; }

.app-content {
  padding-top: calc(var(--top-nav-height) + var(--space-md));
  padding-bottom: calc(var(--bottom-nav-height) + var(--space-lg));
  padding-inline: var(--container-padding);
  max-width: var(--container-max);
  margin-inline: auto;
  min-height: 100vh;
}

.page-header {
  margin-bottom: var(--space-lg);
}

.page-title {
  font-size: var(--font-size-2xl);
  font-weight: var(--font-weight-bold);
  color: var(--color-text);
  margin-bottom: var(--space-xs);
}

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

.section {
  margin-bottom: var(--space-xl);
}

.section-title {
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-semibold);
  margin-bottom: var(--space-md);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

/* Grid */
.grid {
  display: grid;
  gap: var(--space-md);
}

.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

/* Flex-Hilfeklassen */
.flex         { display: flex; }
.flex-col     { flex-direction: column; }
.flex-wrap    { flex-wrap: wrap; }
.items-center { align-items: center; }
.items-start  { align-items: flex-start; }
.items-end    { align-items: flex-end; }
.justify-between { justify-content: space-between; }
.justify-center  { justify-content: center; }
.justify-end     { justify-content: flex-end; }
.gap-xs  { gap: var(--space-xs); }
.gap-sm  { gap: var(--space-sm); }
.gap-md  { gap: var(--space-md); }
.gap-lg  { gap: var(--space-lg); }
.flex-1  { flex: 1; }

/* Spacing-Utilities */
.mt-xs  { margin-top: var(--space-xs); }
.mt-sm  { margin-top: var(--space-sm); }
.mt-md  { margin-top: var(--space-md); }
.mt-lg  { margin-top: var(--space-lg); }
.mt-xl  { margin-top: var(--space-xl); }
.mb-xs  { margin-bottom: var(--space-xs); }
.mb-sm  { margin-bottom: var(--space-sm); }
.mb-md  { margin-bottom: var(--space-md); }
.mb-lg  { margin-bottom: var(--space-lg); }
.mb-xl  { margin-bottom: var(--space-xl); }

/* Footer */
.app-footer {
  text-align: center;
  padding: var(--space-md);
  font-size: var(--font-size-xs);
  color: var(--color-text-muted);
  border-top: 1px solid var(--color-border);
  margin-top: var(--space-2xl);
  padding-bottom: calc(var(--bottom-nav-height) + var(--space-md));
}

/* ============================================================
   5. Buttons
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: 0.625rem var(--space-lg);
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-medium);
  font-family: var(--font-family);
  line-height: 1.25;
  border-radius: var(--radius-md);
  border: 2px solid transparent;
  cursor: pointer;
  transition: background-color var(--transition-fast),
              border-color var(--transition-fast),
              color var(--transition-fast),
              box-shadow var(--transition-fast),
              transform var(--transition-fast);
  white-space: nowrap;
  user-select: none;
  text-decoration: none;
  min-height: 44px;
  position: relative;
  overflow: hidden;
}

.btn:hover {
  text-decoration: none;
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(0);
}

.btn:disabled,
.btn[disabled] {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
  pointer-events: none;
}

/* Primär */
.btn-primary {
  background-color: var(--color-primary);
  border-color: var(--color-primary);
  color: #FFFFFF;
}
.btn-primary:hover {
  background-color: var(--color-primary-dark);
  border-color: var(--color-primary-dark);
  color: #FFFFFF;
  box-shadow: 0 4px 12px rgba(224,123,119,0.4);
}

/* Sekundär (Türkis) */
.btn-secondary {
  background-color: var(--color-secondary);
  border-color: var(--color-secondary);
  color: #FFFFFF;
}
.btn-secondary:hover {
  background-color: var(--color-secondary-dark);
  border-color: var(--color-secondary-dark);
  color: #FFFFFF;
  box-shadow: 0 4px 12px rgba(125,196,195,0.4);
}

/* Erfolg / Accent-Grün */
.btn-success {
  background-color: var(--color-success);
  border-color: var(--color-success);
  color: #FFFFFF;
}
.btn-success:hover {
  background-color: var(--color-success-dark);
  border-color: var(--color-success-dark);
  color: #FFFFFF;
}

/* Gefahr */
.btn-danger {
  background-color: var(--color-danger);
  border-color: var(--color-danger);
  color: #FFFFFF;
}
.btn-danger:hover {
  background-color: var(--color-danger-dark);
  border-color: var(--color-danger-dark);
  color: #FFFFFF;
  box-shadow: 0 4px 12px rgba(239,68,68,0.4);
}

/* Outline */
.btn-outline {
  background-color: transparent;
  border-color: var(--color-primary);
  color: var(--color-primary);
}
.btn-outline:hover {
  background-color: var(--color-primary);
  color: #FFFFFF;
}

.btn-outline-secondary {
  background-color: transparent;
  border-color: var(--color-secondary);
  color: var(--color-secondary);
}
.btn-outline-secondary:hover {
  background-color: var(--color-secondary);
  color: #FFFFFF;
}

/* Ghost */
.btn-ghost {
  background-color: transparent;
  border-color: var(--color-border);
  color: var(--color-text-muted);
}
.btn-ghost:hover {
  background-color: var(--color-bg);
  border-color: var(--color-neutral);
  color: var(--color-text);
}

/* Warnung */
.btn-warning {
  background-color: var(--color-warning);
  border-color: var(--color-warning);
  color: #FFFFFF;
}
.btn-warning:hover {
  background-color: var(--color-warning-dark);
  border-color: var(--color-warning-dark);
  color: #FFFFFF;
}

/* Größen */
.btn-xs {
  padding: 0.25rem 0.625rem;
  font-size: var(--font-size-xs);
  min-height: 28px;
  border-radius: var(--radius-sm);
}

.btn-sm {
  padding: 0.375rem 0.875rem;
  font-size: var(--font-size-sm);
  min-height: 36px;
}

.btn-lg {
  padding: 0.875rem var(--space-xl);
  font-size: var(--font-size-lg);
  min-height: 54px;
  border-radius: var(--radius-lg);
}

.btn-xl {
  padding: 1.125rem var(--space-2xl);
  font-size: var(--font-size-xl);
  min-height: 64px;
  border-radius: var(--radius-lg);
}

/* Block (volle Breite) */
.btn-block {
  width: 100%;
}

/* Rund */
.btn-round {
  border-radius: var(--radius-full);
}

/* Icon-only */
.btn-icon {
  padding: 0.625rem;
  width: 44px;
  height: 44px;
}

/* Loading-Zustand */
.btn-loading {
  pointer-events: none;
  opacity: 0.85;
}

/* Spinner im Button */
.spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255,255,255,0.4);
  border-top-color: #FFFFFF;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  vertical-align: middle;
}

.btn-ghost .spinner,
.btn-outline .spinner {
  border-color: rgba(0,0,0,0.2);
  border-top-color: var(--color-text);
}

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

/* ============================================================
   6. Formular-Elemente
   ============================================================ */
.form-group {
  margin-bottom: var(--space-md);
  position: relative;
}

.form-row {
  display: flex;
  gap: var(--space-sm);
}

.form-row .form-group-half {
  flex: 1;
  min-width: 0;
}

.form-label-hint {
  font-weight: var(--font-weight-normal, 400);
  color: var(--color-text-muted);
  font-size: var(--font-size-xs);
}

.form-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  color: var(--color-text);
  margin-bottom: var(--space-xs);
}

.form-label-link {
  font-size: var(--font-size-xs);
  color: var(--color-primary);
  font-weight: var(--font-weight-normal);
}

.form-label-link:hover {
  color: var(--color-primary-dark);
}

.form-input,
.form-select,
.form-textarea {
  display: block;
  width: 100%;
  padding: 0.75rem var(--space-md);
  font-size: var(--font-size-base);
  font-family: var(--font-family);
  color: var(--color-text);
  background-color: var(--color-surface);
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-md);
  transition: border-color var(--transition-fast),
              box-shadow var(--transition-fast);
  min-height: 44px;
  appearance: none;
  -webkit-appearance: none;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--color-border-focus);
  box-shadow: 0 0 0 3px rgba(224,123,119,0.15);
}

.form-input::placeholder,
.form-textarea::placeholder {
  color: var(--color-text-light);
}

.form-input.input-error,
.form-select.input-error,
.form-textarea.input-error {
  border-color: var(--color-danger);
  background-color: #fff8f8;
}

.form-input.input-error:focus,
.form-select.input-error:focus {
  box-shadow: 0 0 0 3px rgba(239,68,68,0.15);
}

.form-textarea {
  resize: vertical;
  min-height: 100px;
}

.form-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='%236B7280'%3E%3Cpath fill-rule='evenodd' d='M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z' clip-rule='evenodd'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  background-size: 1.25em;
  padding-right: 2.5rem;
}

.field-error {
  color: var(--color-danger);
  font-size: var(--font-size-xs);
  margin-top: var(--space-xs);
}

.field-hint {
  color: var(--color-text-muted);
  font-size: var(--font-size-xs);
  margin-top: var(--space-xs);
}

/* Checkbox & Radio */
.form-check {
  display: flex;
  align-items: flex-start;
  gap: var(--space-sm);
  cursor: pointer;
  margin-bottom: var(--space-sm);
}

.form-check-input {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  margin-top: 2px;
  border: 1.5px solid var(--color-border);
  border-radius: 4px;
  background-color: var(--color-surface);
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  transition: background-color var(--transition-fast), border-color var(--transition-fast);
}

.form-check-input:checked {
  background-color: var(--color-primary);
  border-color: var(--color-primary);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='white'%3E%3Cpath d='M13.854 3.646a.5.5 0 0 1 0 .708l-7 7a.5.5 0 0 1-.708 0l-3.5-3.5a.5.5 0 1 1 .708-.708L6.5 10.293l6.646-6.647a.5.5 0 0 1 .708 0z'/%3E%3C/svg%3E");
  background-size: 12px;
  background-repeat: no-repeat;
  background-position: center;
}

.form-check-input[type="radio"] {
  border-radius: 50%;
}

.form-check-input[type="radio"]:checked {
  background-image: none;
  box-shadow: inset 0 0 0 4px white, inset 0 0 0 9px var(--color-primary);
}

.form-check-label {
  font-size: var(--font-size-sm);
  color: var(--color-text);
  user-select: none;
}

/* Toggle-Switch */
.form-toggle {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  cursor: pointer;
}

.toggle-track {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}

.toggle-track input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}

.toggle-thumb {
  position: absolute;
  inset: 0;
  background-color: var(--color-neutral-light);
  border-radius: var(--radius-full);
  transition: background-color var(--transition-normal);
  cursor: pointer;
}

.toggle-thumb::before {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  left: 3px;
  top: 3px;
  background-color: white;
  border-radius: 50%;
  transition: transform var(--transition-normal);
  box-shadow: var(--shadow-sm);
}

.toggle-track input:checked + .toggle-thumb {
  background-color: var(--color-primary);
}

.toggle-track input:checked + .toggle-thumb::before {
  transform: translateX(20px);
}

/* Input-Gruppe (Icon + Input) */
.input-group {
  position: relative;
}

.input-group .input-icon {
  position: absolute;
  left: var(--space-md);
  top: 50%;
  transform: translateY(-50%);
  color: var(--color-text-muted);
  pointer-events: none;
}

.input-group .form-input {
  padding-left: 2.75rem;
}

/* ============================================================
   7. Cards
   ============================================================ */
.card {
  background-color: var(--color-surface);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--color-border);
  overflow: hidden;
}

.card-header {
  padding: var(--space-md) var(--space-lg);
  border-bottom: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
}

.card-title {
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-semibold);
  margin: 0;
}

.card-body {
  padding: var(--space-lg);
}

.card-footer {
  padding: var(--space-md) var(--space-lg);
  border-top: 1px solid var(--color-border);
  background-color: var(--color-bg);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-sm);
}

/* Stat-Card (Dashboard) */
.stat-card {
  background: var(--color-surface);
  border-radius: var(--radius-md);
  padding: var(--space-lg);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--color-border);
  display: flex;
  align-items: flex-start;
  gap: var(--space-md);
}

.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  flex-shrink: 0;
}

.stat-icon-primary  { background-color: rgba(224,123,119,0.12); }
.stat-icon-secondary{ background-color: rgba(125,196,195,0.12); }
.stat-icon-success  { background-color: rgba(16,185,129,0.12); }
.stat-icon-warning  { background-color: rgba(245,158,11,0.12); }

.stat-content {
  flex: 1;
  min-width: 0;
}

.stat-value {
  font-size: var(--font-size-2xl);
  font-weight: var(--font-weight-bold);
  color: var(--color-text);
  line-height: 1;
  margin-bottom: var(--space-xs);
}

.stat-label {
  font-size: var(--font-size-sm);
  color: var(--color-text-muted);
}

/* ============================================================
   8. Navigation
   ============================================================ */

/* Top-Navigation */
.top-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--top-nav-height);
  background-color: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  z-index: 200;
  box-shadow: var(--shadow-xs);
}

.top-nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  padding-inline: var(--container-padding);
  max-width: var(--container-max);
  margin-inline: auto;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  text-decoration: none;
  color: var(--color-text);
}

.nav-brand:hover {
  color: var(--color-primary);
  text-decoration: none;
}

.nav-brand-logo {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
}

.nav-brand-text {
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-bold);
  color: var(--color-primary);
  letter-spacing: -0.02em;
}

.nav-right {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

/* Karten-Badge in der Top-Nav */
.nav-card-badge {
  display: flex;
  align-items: center;
  gap: 4px;
  background: rgba(224,123,119,0.12);
  color: var(--brand, #E07B77);
  font-weight: 600;
  font-size: 0.8rem;
  padding: 3px 9px;
  border-radius: 20px;
  border: 1.5px solid rgba(224,123,119,0.3);
  transition: background 0.15s;
  text-decoration: none;
}
.nav-card-badge:hover {
  background: rgba(224,123,119,0.22);
  color: var(--brand, #E07B77);
}

.nav-points {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  background: rgba(224,123,119,0.1);
  border-radius: var(--radius-full);
  padding: var(--space-xs) var(--space-sm);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  color: var(--color-primary-dark);
}

.nav-points .points-icon {
  font-size: 1rem;
}

.nav-user-link {
  display: block;
  text-decoration: none;
}

.avatar-mini {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--color-primary);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-bold);
  flex-shrink: 0;
}

.avatar {
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.avatar-sm { width: 36px; height: 36px; font-size: var(--font-size-sm); }
.avatar-md { width: 48px; height: 48px; font-size: var(--font-size-base); }
.avatar-lg { width: 64px; height: 64px; font-size: var(--font-size-xl); }
.avatar-xl { width: 96px; height: 96px; font-size: var(--font-size-2xl); }

/* Mobile Bottom-Navigation */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--bottom-nav-height);
  background-color: var(--color-surface);
  border-top: 1px solid var(--color-border);
  display: flex;
  align-items: stretch;
  z-index: 200;
  box-shadow: 0 -2px 8px rgba(0,0,0,0.06);
}

.bottom-nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  color: var(--color-neutral);
  text-decoration: none;
  font-size: 10px;
  font-weight: var(--font-weight-medium);
  padding: var(--space-xs);
  transition: color var(--transition-fast);
  min-width: 44px;
  position: relative;
}

.bottom-nav-item:hover {
  color: var(--color-primary);
  text-decoration: none;
}

.bottom-nav-item.active {
  color: var(--color-primary);
}

.bottom-nav-item.active::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 32px;
  height: 3px;
  background-color: var(--color-primary);
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
}

.bottom-nav-icon {
  width: 24px;
  height: 24px;
}

/* Notification-Badge auf Nav-Item */
.nav-badge {
  position: absolute;
  top: 4px;
  right: calc(50% - 16px);
  background: var(--color-danger);
  color: white;
  font-size: 9px;
  font-weight: var(--font-weight-bold);
  min-width: 16px;
  height: 16px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  border: 2px solid var(--color-surface);
}

/* ============================================================
   9. Badge-Komponenten
   ============================================================ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.2em 0.65em;
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-semibold);
  border-radius: var(--radius-full);
  line-height: 1.4;
  white-space: nowrap;
}

.badge-primary   { background: rgba(224,123,119,0.15); color: var(--color-primary-dark); }
.badge-secondary { background: rgba(125,196,195,0.15); color: var(--color-secondary-dark); }
.badge-success   { background: var(--color-success-light); color: var(--color-success-dark); }
.badge-danger    { background: var(--color-danger-light); color: var(--color-danger-dark); }
.badge-warning   { background: var(--color-warning-light); color: var(--color-warning-dark); }
.badge-info      { background: var(--color-info-light); color: var(--color-info-dark); }
.badge-neutral   { background: rgba(155,155,155,0.15); color: var(--color-text-muted); }
.badge-accent    { background: rgba(168,192,96,0.15); color: var(--color-accent-dark); }

/* Level-Badge */
.level-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  padding: 0.3rem 0.75rem;
  border-radius: var(--radius-full);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
}

.level-1 { background: #F3F4F6; color: #6B7280; }
.level-2 { background: rgba(125,196,195,0.2); color: var(--color-secondary-dark); }
.level-3 { background: rgba(168,192,96,0.2); color: var(--color-accent-dark); }
.level-4 { background: rgba(224,123,119,0.2); color: var(--color-primary-dark); }
.level-5 { background: linear-gradient(135deg, rgba(224,123,119,0.2), rgba(168,192,96,0.2)); color: var(--color-primary-dark); }

/* Achievement-Badge */
.achievement-badge {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-xs);
  padding: var(--space-md);
  background: var(--color-surface);
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  text-align: center;
  min-width: 80px;
}

.achievement-badge .achievement-icon {
  font-size: 2rem;
}

.achievement-badge .achievement-label {
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-medium);
  color: var(--color-text-muted);
}

.achievement-badge.earned {
  border-color: var(--color-accent);
  background: rgba(168,192,96,0.05);
}

.achievement-badge.earned .achievement-label {
  color: var(--color-accent-dark);
}

/* ============================================================
   10. Toast-Notifications
   ============================================================ */
#toast-container {
  position: fixed;
  top: var(--space-lg);
  right: var(--space-md);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  max-width: 340px;
  width: calc(100vw - 2rem);
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: var(--space-sm);
  padding: var(--space-md) var(--space-md);
  background-color: var(--color-surface);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  border-left: 4px solid var(--color-primary);
  pointer-events: auto;

  opacity: 0;
  transform: translateX(100%);
  transition: opacity var(--transition-normal),
              transform var(--transition-normal);
}

.toast.toast-visible {
  opacity: 1;
  transform: translateX(0);
}

.toast-success { border-left-color: var(--color-success); }
.toast-error   { border-left-color: var(--color-danger); }
.toast-warning { border-left-color: var(--color-warning); }
.toast-info    { border-left-color: var(--color-info); }

.toast-icon {
  font-size: var(--font-size-lg);
  flex-shrink: 0;
  margin-top: 1px;
  width: 20px;
  text-align: center;
}

.toast-success .toast-icon { color: var(--color-success); }
.toast-error   .toast-icon { color: var(--color-danger); }
.toast-warning .toast-icon { color: var(--color-warning); }
.toast-info    .toast-icon { color: var(--color-info); }

.toast-message {
  font-size: var(--font-size-sm);
  color: var(--color-text);
  line-height: var(--line-height-normal);
  flex: 1;
}

/* ============================================================
   11. Modal
   ============================================================ */
/* Modal-Typen */
.modal-danger .modal-header {
  border-bottom-color: var(--color-danger-light);
}

.modal-danger .modal-header h3 {
  color: var(--color-danger);
}

/* ============================================================
   12. Kurs-Karte (.course-card)
   ============================================================ */
.course-card {
  background: var(--color-surface);
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: box-shadow var(--transition-normal),
              transform var(--transition-normal);
}

.course-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.course-card-header {
  padding: var(--space-md);
  border-bottom: 1px solid var(--color-border);
  background: linear-gradient(135deg, rgba(248,249,250,1) 0%, rgba(255,255,255,1) 100%);
}

.course-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-sm);
  margin-bottom: var(--space-sm);
  flex-wrap: wrap;
}

.course-type-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.2em 0.65em;
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-semibold);
  border-radius: var(--radius-full);
  background: rgba(224,123,119,0.12);
  color: var(--color-primary-dark);
  white-space: nowrap;
}

.course-time {
  font-size: var(--font-size-xs);
  color: var(--color-text-muted);
  font-weight: var(--font-weight-medium);
}

.course-card-title {
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-semibold);
  margin-bottom: var(--space-xs);
  color: var(--color-text);
}

.course-trainer,
.course-location {
  display: block;
  font-size: var(--font-size-sm);
  color: var(--color-text-muted);
  margin-top: var(--space-xs);
}

.course-card-body {
  padding: var(--space-md);
}

/* Kapazitäts-Balken */
.capacity-bar {
  height: 6px;
  background: var(--color-bg);
  border-radius: var(--radius-full);
  overflow: hidden;
  margin-bottom: var(--space-xs);
}

.capacity-fill {
  height: 100%;
  background: var(--color-success);
  border-radius: var(--radius-full);
  transition: width var(--transition-slow);
}

.capacity-fill.capacity-high {
  background: var(--color-warning);
}

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

.capacity-text {
  display: block;
  font-size: var(--font-size-xs);
  color: var(--color-text-muted);
  margin-bottom: var(--space-md);
}

/* Kursraster */
.courses-grid {
  display: grid;
  gap: var(--space-md);
  grid-template-columns: 1fr;
}

/* Filter-Leiste */
.courses-filter {
  display: flex;
  gap: var(--space-sm);
  overflow-x: auto;
  padding-bottom: var(--space-sm);
  margin-bottom: var(--space-md);
  scrollbar-width: none;
}

.courses-filter::-webkit-scrollbar {
  display: none;
}

.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  padding: var(--space-xs) var(--space-md);
  border-radius: var(--radius-full);
  border: 1.5px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-text-muted);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  white-space: nowrap;
  cursor: pointer;
  transition: all var(--transition-fast);
  min-height: 36px;
}

.filter-chip:hover,
.filter-chip.active {
  border-color: var(--color-primary);
  background: rgba(224,123,119,0.08);
  color: var(--color-primary-dark);
}

/* ============================================================
   13. Gamification-Widgets
   ============================================================ */
.gamification-panel {
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  color: white;
  position: relative;
  overflow: hidden;
}

.gamification-panel::before {
  content: '';
  position: absolute;
  top: -40px;
  right: -40px;
  width: 150px;
  height: 150px;
  border-radius: 50%;
  background: rgba(255,255,255,0.1);
}

.gamification-panel::after {
  content: '';
  position: absolute;
  bottom: -60px;
  left: -20px;
  width: 200px;
  height: 200px;
  border-radius: 50%;
  background: rgba(255,255,255,0.06);
}

.gamification-panel .panel-title {
  font-size: var(--font-size-sm);
  opacity: 0.85;
  margin-bottom: var(--space-sm);
  font-weight: var(--font-weight-medium);
}

.gamification-panel .points-big {
  font-size: var(--font-size-4xl);
  font-weight: var(--font-weight-bold);
  line-height: 1;
  margin-bottom: var(--space-xs);
}

.gamification-panel .level-display {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-size: var(--font-size-sm);
  opacity: 0.9;
}

/* Level-Progress-Bar */
.level-progress {
  margin-top: var(--space-md);
}

.level-progress-bar {
  height: 8px;
  background: rgba(255,255,255,0.25);
  border-radius: var(--radius-full);
  overflow: hidden;
  margin-bottom: var(--space-xs);
}

.level-progress-fill {
  height: 100%;
  background: rgba(255,255,255,0.85);
  border-radius: var(--radius-full);
  transition: width var(--transition-slow);
}

.level-progress-label {
  font-size: var(--font-size-xs);
  opacity: 0.8;
  text-align: right;
}

/* Streak-Widget */
.streak-widget {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  background: var(--color-surface);
  border-radius: var(--radius-md);
  padding: var(--space-md) var(--space-lg);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-sm);
}

.streak-icon {
  font-size: 2.5rem;
  flex-shrink: 0;
}

.streak-content {
  flex: 1;
}

.streak-count {
  font-size: var(--font-size-2xl);
  font-weight: var(--font-weight-bold);
  color: var(--color-warning);
  line-height: 1;
}

.streak-label {
  font-size: var(--font-size-sm);
  color: var(--color-text-muted);
  margin-top: 2px;
}

/* Punkte-Verlauf */
.points-history-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-sm) 0;
  border-bottom: 1px solid var(--color-border);
  font-size: var(--font-size-sm);
}

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

.points-change-positive {
  color: var(--color-success);
  font-weight: var(--font-weight-semibold);
}

.points-change-negative {
  color: var(--color-danger);
  font-weight: var(--font-weight-semibold);
}

/* ============================================================
   14. Profil-Completion-Nudge
   ============================================================ */
.profile-completion-nudge {
  background: linear-gradient(135deg, rgba(125,196,195,0.1) 0%, rgba(168,192,96,0.1) 100%);
  border: 1px solid rgba(125,196,195,0.3);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  margin-bottom: var(--space-md);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-md);
}

.completion-info {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  flex: 1;
  min-width: 200px;
}

.completion-icon {
  font-size: 1.75rem;
  flex-shrink: 0;
}

.completion-info strong {
  display: block;
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  color: var(--color-text);
}

.completion-text {
  font-size: var(--font-size-xs);
  color: var(--color-text-muted);
}

.completion-progress {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  flex-basis: 100%;
}

.progress-bar {
  flex: 1;
  height: 8px;
  background: rgba(0,0,0,0.08);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(to right, var(--color-secondary), var(--color-accent));
  border-radius: var(--radius-full);
  transition: width var(--transition-slow);
}

.progress-label {
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-semibold);
  color: var(--color-secondary-dark);
  min-width: 32px;
  text-align: right;
}

/* ============================================================
   15. Warteliste-Anzeige
   ============================================================ */
.waitlist-info {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  background: var(--color-warning-light);
  border: 1px solid rgba(245,158,11,0.3);
  border-radius: var(--radius-md);
  padding: var(--space-sm) var(--space-md);
  font-size: var(--font-size-sm);
}

.waitlist-icon {
  color: var(--color-warning-dark);
  font-size: 1.1rem;
  flex-shrink: 0;
}

.waitlist-text {
  color: var(--color-warning-dark);
  font-weight: var(--font-weight-medium);
}

.waitlist-position {
  font-size: var(--font-size-xs);
  color: var(--color-warning);
  margin-left: auto;
  flex-shrink: 0;
}

/* ============================================================
   16. Loading & Skeleton
   ============================================================ */
@keyframes shimmer {
  0%   { background-position: -200% 0; }
  100% { background-position:  200% 0; }
}

.skeleton {
  background: linear-gradient(
    90deg,
    #f0f0f0 25%,
    #e0e0e0 50%,
    #f0f0f0 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-sm);
}

.skeleton-text {
  height: 1em;
  border-radius: var(--radius-sm);
  margin-bottom: 0.5em;
}

.skeleton-text-sm   { height: 0.75em; }
.skeleton-text-lg   { height: 1.5em; }
.skeleton-title     { height: 1.5em; width: 60%; margin-bottom: 0.75em; }
.skeleton-card      { height: 180px; border-radius: var(--radius-md); }
.skeleton-avatar    { width: 48px; height: 48px; border-radius: 50%; }
.skeleton-button    { height: 44px; border-radius: var(--radius-md); }

/* Lade-Overlay */
.loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(255,255,255,0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9000;
  backdrop-filter: blur(4px);
}

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

/* Inline-Spinner */
.spinner-sm {
  width: 20px;
  height: 20px;
  border-width: 2px;
}

.spinner-lg {
  width: 64px;
  height: 64px;
  border-width: 5px;
}

/* ============================================================
   17. Alert / Flash-Messages
   ============================================================ */
#flash-container {
  position: fixed;
  top: calc(var(--top-nav-height) + var(--space-sm));
  left: 50%;
  transform: translateX(-50%);
  z-index: 9000;
  width: min(calc(100vw - 2rem), 540px);
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.alert {
  display: flex;
  align-items: flex-start;
  gap: var(--space-sm);
  padding: var(--space-md) var(--space-lg);
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  font-size: var(--font-size-sm);
  box-shadow: var(--shadow-md);
  animation: slideDown 0.3s ease;
}

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

.alert-success {
  background: var(--color-success-light);
  border-color: rgba(16,185,129,0.3);
  color: var(--color-success-dark);
}

.alert-error,
.alert-danger {
  background: var(--color-danger-light);
  border-color: rgba(239,68,68,0.3);
  color: var(--color-danger-dark);
}

.alert-warning {
  background: var(--color-warning-light);
  border-color: rgba(245,158,11,0.3);
  color: var(--color-warning-dark);
}

.alert-info {
  background: var(--color-info-light);
  border-color: rgba(59,130,246,0.3);
  color: var(--color-info-dark);
}

.alert-message {
  flex: 1;
  line-height: var(--line-height-normal);
}

.alert-close {
  color: inherit;
  opacity: 0.6;
  font-size: 1.25rem;
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
  line-height: 1;
  flex-shrink: 0;
  margin-left: auto;
  transition: opacity var(--transition-fast);
}

.alert-close:hover {
  opacity: 1;
}

/* Inline-Alert (im Content-Bereich) */
.alert-inline {
  position: static;
  width: 100%;
  box-shadow: none;
  animation: none;
}

/* ============================================================
   18. Tables
   ============================================================ */
.table-wrapper {
  width: 100%;
  overflow-x: auto;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-sm);
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--font-size-sm);
  background: var(--color-surface);
}

.table th {
  background: var(--color-bg);
  padding: var(--space-sm) var(--space-md);
  text-align: left;
  font-weight: var(--font-weight-semibold);
  color: var(--color-text-muted);
  border-bottom: 1px solid var(--color-border);
  white-space: nowrap;
  font-size: var(--font-size-xs);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.table td {
  padding: var(--space-sm) var(--space-md);
  border-bottom: 1px solid var(--color-border);
  color: var(--color-text);
  vertical-align: middle;
}

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

.table tbody tr:hover {
  background: rgba(248,249,250,0.8);
}

.table-actions {
  display: flex;
  gap: var(--space-xs);
  justify-content: flex-end;
}

/* ============================================================
   19. Sonstige Komponenten
   ============================================================ */

/* Divider */
.divider {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  color: var(--color-text-muted);
  font-size: var(--font-size-sm);
  margin: var(--space-lg) 0;
}

.divider::before,
.divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--color-border);
}

/* Greeting-Bereich (Dashboard) */
.greeting-section {
  margin-bottom: var(--space-xl);
}

.greeting-text {
  font-size: var(--font-size-2xl);
  font-weight: var(--font-weight-bold);
  margin-bottom: var(--space-xs);
}

.greeting-text .greeting-name {
  color: var(--color-primary);
}

/* Buchungsübersicht-Item */
.booking-item {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-md);
  background: var(--color-surface);
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  transition: box-shadow var(--transition-fast);
}

.booking-item:hover {
  box-shadow: var(--shadow-sm);
}

.booking-date-badge {
  text-align: center;
  min-width: 48px;
  flex-shrink: 0;
}

.booking-date-day {
  font-size: var(--font-size-2xl);
  font-weight: var(--font-weight-bold);
  color: var(--color-primary);
  line-height: 1;
}

.booking-date-month {
  font-size: var(--font-size-xs);
  color: var(--color-text-muted);
  text-transform: uppercase;
  font-weight: var(--font-weight-medium);
}

.booking-info {
  flex: 1;
  min-width: 0;
}

.booking-name {
  font-weight: var(--font-weight-semibold);
  font-size: var(--font-size-sm);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.booking-meta {
  font-size: var(--font-size-xs);
  color: var(--color-text-muted);
  margin-top: 2px;
}

/* Auth-Seite */
.auth-page {
  background: linear-gradient(135deg, rgba(224,123,119,0.06) 0%, rgba(125,196,195,0.06) 100%);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-md);
}

.auth-container {
  width: 100%;
  max-width: 420px;
}

.auth-card {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  overflow: hidden;
}

.auth-header {
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
  padding: var(--space-xl) var(--space-xl) var(--space-lg);
  text-align: center;
}

.auth-logo-text {
  display: block;
  font-size: var(--font-size-2xl);
  font-weight: var(--font-weight-bold);
  color: white;
}

.auth-logo-subtitle {
  display: block;
  font-size: var(--font-size-xs);
  color: rgba(255,255,255,0.75);
  margin-top: var(--space-xs);
}

.auth-body {
  padding: var(--space-xl);
}

.auth-title {
  font-size: var(--font-size-xl);
  font-weight: var(--font-weight-bold);
  margin-bottom: var(--space-xs);
}

.auth-subtitle {
  color: var(--color-text-muted);
  font-size: var(--font-size-sm);
  margin-bottom: var(--space-xl);
}

.auth-alt-action {
  text-align: center;
  margin-top: var(--space-lg);
  font-size: var(--font-size-sm);
  color: var(--color-text-muted);
}

.auth-alt-action a {
  color: var(--color-primary);
  font-weight: 500;
}

.auth-footer {
  padding: var(--space-md) var(--space-xl);
  background: var(--color-bg);
  border-top: 1px solid var(--color-border);
  text-align: center;
  font-size: var(--font-size-xs);
  color: var(--color-text-muted);
}

/* ============================================================
   20. Utilities
   ============================================================ */
.hidden       { display: none !important; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  border: 0;
}

.truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.w-full    { width: 100%; }
.h-full    { height: 100%; }
.min-h-screen { min-height: 100vh; }

.rounded-sm   { border-radius: var(--radius-sm); }
.rounded-md   { border-radius: var(--radius-md); }
.rounded-lg   { border-radius: var(--radius-lg); }
.rounded-full { border-radius: var(--radius-full); }

.shadow-sm { box-shadow: var(--shadow-sm); }
.shadow-md { box-shadow: var(--shadow-md); }
.shadow-lg { box-shadow: var(--shadow-lg); }

.opacity-50 { opacity: 0.5; }
.opacity-75 { opacity: 0.75; }

.cursor-pointer { cursor: pointer; }

.overflow-hidden  { overflow: hidden; }
.overflow-x-auto  { overflow-x: auto; }

.bg-surface  { background-color: var(--color-surface); }
.bg-primary  { background-color: var(--color-primary); }
.bg-bg       { background-color: var(--color-bg); }

.border      { border: 1px solid var(--color-border); }
.border-top  { border-top: 1px solid var(--color-border); }
.border-bottom { border-bottom: 1px solid var(--color-border); }

.p-sm  { padding: var(--space-sm); }
.p-md  { padding: var(--space-md); }
.p-lg  { padding: var(--space-lg); }
.p-xl  { padding: var(--space-xl); }
.px-md { padding-inline: var(--space-md); }
.px-lg { padding-inline: var(--space-lg); }
.py-sm { padding-block: var(--space-sm); }
.py-md { padding-block: var(--space-md); }
.py-lg { padding-block: var(--space-lg); }

/* ============================================================
   21. Responsive Breakpoints
   ============================================================ */

/* SM: 640px+ */
@media (min-width: 640px) {
  :root {
    --container-padding: var(--space-lg);
  }

  .courses-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .grid-sm-2 { grid-template-columns: repeat(2, 1fr); }
}

/* MD: 768px+ */
@media (min-width: 768px) {
  .completion-progress {
    flex-basis: auto;
    width: 200px;
  }

  .courses-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .grid-md-3 { grid-template-columns: repeat(3, 1fr); }
}

/* LG: 1024px+ */
@media (min-width: 1024px) {
  /* Bottom-Nav auf Desktop ausblenden */
  .bottom-nav {
    display: none;
  }

  /* App-Content: kein Bottom-Padding für Bottom-Nav */
  .app-content {
    padding-bottom: var(--space-2xl);
  }

  .app-footer {
    padding-bottom: var(--space-md);
  }

  .courses-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .grid-lg-4 { grid-template-columns: repeat(4, 1fr); }
}

/* XL: 1280px+ */
@media (min-width: 1280px) {
  .courses-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* Reduziertere Bewegung */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ============================================================
   Utility-Klassen – ersetzt Inline-Styles in Templates
   ============================================================ */

/* ── Seiten-Container ──────────────────────────────────────── */
.page-wrap {
  max-width: 700px;
  margin-inline: auto;
  padding-bottom: 5rem;
}

/* Sticky Seitenheader innerhalb von .page-wrap */
.page-sticky-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--bs-body-bg);
  border-bottom: 1px solid var(--bs-border-color);
  padding: 0.75rem 1rem 0.5rem;
}

/* ── Kurs-Farbstreifen ─────────────────────────────────────── */
.course-stripe {
  width: 5px;
  flex-shrink: 0;
  background: var(--c, #E07B77);
}
.course-stripe-lg {
  width: 5px;
  height: 44px;
  flex-shrink: 0;
  border-radius: 3px;
  background: var(--c, #E07B77);
}

/* ── Fortschrittsbalken ────────────────────────────────────── */
.progress-thin {
  height: 3px;
  border-radius: 99px;
}
.progress-thin .progress-fill {
  height: 3px;
  border-radius: 99px;
}
.progress-medium {
  height: 5px;
  border-radius: 99px;
  background: #f1f5f9;
}
.progress-medium .progress-fill {
  height: 5px;
  border-radius: 99px;
}
.progress-thick {
  height: 8px;
  border-radius: 99px;
}

/* ── Badge-Farbvarianten ───────────────────────────────────── */
.badge-booked {
  background: #D1FAE5;
  color: #065F46;
  font-size: .65rem;
}
.badge-available {
  background: #ECFDF5;
  color: #059669;
  font-size: .65rem;
}
.badge-waitlist {
  background: #FEF3C7;
  color: #92400E;
  font-size: .65rem;
}
.badge-muted {
  background: #F3F4F6;
  color: #6B7280;
  font-size: .65rem;
}

/* ── Schriftgrößen-Hilfsklassen ────────────────────────────── */
.fs-xs   { font-size: .72rem !important; }
.fs-sm   { font-size: .8rem  !important; }
.fs-card { font-size: .9rem  !important; }

/* ── Leer-Zustand Seiten ───────────────────────────────────── */
.empty-state-icon {
  font-size: 3rem;
  opacity: .3;
}

/* ── Kurs-Karten ───────────────────────────────────────────── */
.course-card-hover {
  transition: transform .12s ease, box-shadow .12s ease;
  cursor: pointer;
}
.course-card-hover:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(0,0,0,.12) !important;
}
.course-card-booked {
  background: #F0FDF4;
}

/* ── Dashboard ─────────────────────────────────────────────── */
.insight-card {
  border-radius: 12px;
  padding: .85rem 1rem;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: .85rem;
  border: 1px solid transparent;
}
.insight-card-gold    { background: #FFFBEB; border-color: #FDE68A; }
.insight-card-success { background: #F0FDF4; border-color: #86EFAC; }
.insight-card-warning { background: #FFF7ED; border-color: #FCD34D; }
.insight-card-muted   { background: #F8FAFC; border-color: #E2E8F0; }
.insight-card-info    { background: #EFF6FF; border-color: #BFDBFE; }
.insight-icon { font-size: 1.5rem; flex-shrink: 0; }

.streak-badge {
  background: #FEF3C7;
  border: 1px solid #FDE68A;
  border-radius: 12px;
  padding: .4rem .75rem;
  text-align: center;
  flex-shrink: 0;
}
.streak-badge-fire   { font-size: 1.4rem; }
.streak-badge-value  { font-size: .95rem; font-weight: 700; color: #92400E; line-height: 1; }
.streak-badge-label  { font-size: .62rem; color: #B45309; }

/* Empfehlungs-Scroll */
.rec-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding-bottom: 4px;
  display: flex;
  gap: .5rem;
}
.rec-scroll::-webkit-scrollbar { display: none; }
.rec-card {
  width: 180px;
  min-width: 160px;
  flex-shrink: 0;
}
@media (min-width: 576px) {
  .rec-scroll {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    overflow-x: visible;
  }
  .rec-card { width: auto; min-width: unset; }
}

/* Level-Circle */
.level-circle {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.4rem;
  flex-shrink: 0;
}

/* ── Quick-Book Modal ──────────────────────────────────────── */
.modal-qb {
  max-width: 420px;
  margin: auto;
}
.qb-strip {
  height: 5px;
  background: var(--qb-color, #E07B77);
}
.qb-dot {
  width: 12px;
  height: 12px;
  background: var(--qb-color, #E07B77);
}

/* ===================================================================
   Utility Classes – Phase 2 Extension
   © AltmarkCloud UG (hb)
   =================================================================== */

/* Root Variable */
:root { --brand: #E07B77; }

/* Dynamic color (set --c on ancestor) */
.text-c       { color: var(--c, var(--brand)); }
.bg-c-muted   { background: color-mix(in srgb, var(--c, var(--brand)) 13%, transparent); }
.border-c     { border-color: var(--c, var(--brand)) !important; }

/* Hero gradients */
.hero-gradient {
  background: linear-gradient(135deg,
    color-mix(in srgb, var(--c, var(--brand)) 13%, transparent) 0%,
    color-mix(in srgb, var(--c, var(--brand))  3%, transparent) 100%);
  border-bottom: 1px solid color-mix(in srgb, var(--c, var(--brand)) 20%, transparent);
}
.course-detail-hero {
  background: color-mix(in srgb, var(--c, var(--brand)) 10%, transparent);
  border-bottom: 4px solid var(--c, var(--brand));
}
.color-bar { height: 5px; background: var(--c, var(--brand)); }

/* Avatar */
.avatar-md { width: 72px; height: 72px; object-fit: cover; border: 3px solid color-mix(in srgb, var(--c, var(--brand)) 25%, transparent); }
.avatar-sm { width: 56px; height: 56px; object-fit: cover; }
.avatar-initials-circle {
  background: color-mix(in srgb, var(--c, var(--brand)) 13%, transparent);
  color: var(--c, var(--brand));
  border: 3px solid color-mix(in srgb, var(--c, var(--brand)) 25%, transparent);
}
.avatar-initials-lg { font-size: 1.8rem; }
.avatar-initials-md { font-size: 1.3rem; }
.trainer-avatar-xs {
  width: 20px; height: 20px;
  border-radius: 50%;
  object-fit: cover;
  vertical-align: middle;
  border: 1.5px solid #e2e8f0;
  flex-shrink: 0;
}
.trainer-initials-xs {
  display: inline-flex; align-items: center; justify-content: center;
  width: 20px; height: 20px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--c, var(--brand)) 15%, transparent);
  color: var(--c, var(--brand));
  font-size: .62rem; font-weight: 700;
  flex-shrink: 0;
  vertical-align: middle;
}

/* Level icon circle */
.level-icon-circle {
  width: 72px; height: 72px;
  background: color-mix(in srgb, var(--c, var(--brand)) 13%, transparent);
  border: 3px solid color-mix(in srgb, var(--c, var(--brand)) 25%, transparent);
  font-size: 2rem;
  display: flex; align-items: center; justify-content: center; border-radius: 50%;
}

/* Level badge */
.badge-lv {
  background: color-mix(in srgb, var(--c, var(--brand)) 13%, transparent);
  color: var(--c, var(--brand));
  padding: 4px 10px;
}

/* Stat cards */
.stat-card-glass { background: rgba(255,255,255,.7); }
.stat-val        { color: var(--c, var(--brand)); }
.stat-lbl        { font-size: .75rem; }
.card-glass      { background: rgba(255,255,255,.85); }

/* Progress bars */
.progress-bar-c        { background: var(--c, var(--brand)); border-radius: 99px; }
.progress-bar-brand    { background: var(--brand); border-radius: 99px; }
.progress-bar-gradient { background: linear-gradient(90deg, #E07B77, #7DC4C3); border-radius: 99px; }
.progress-bar-dyn      { background: var(--c, #E07B77); border-radius: 99px; }
.progress-md { height: 8px;  border-radius: 99px; }
.progress-lg { height: 10px; border-radius: 99px; background: #f1f5f9; }
.progress-sm { height: 6px;  border-radius: 99px; background: #f1f5f9; }
.progress-xs { height: 8px;  background: #f1f5f9; }

/* Gamification badge cards */
.badge-icon-lg       { font-size: 1.8rem; flex-shrink: 0; }
.badge-icon-dim      { filter: grayscale(1); opacity: .3; }
.badge-pill-item     { background: white; font-size: .8rem; }
.badge-earned-bg     { background: linear-gradient(135deg,#fffbeb,#fef3c7); border: 1.5px solid #fde68a; }
.badge-unearned-bg   { background: #f8fafc; border: 1.5px solid #f1f5f9; }
.badge-name          { font-size: .72rem; }
.badge-name-earned   { color: #92400E; }
.badge-name-unearned { color: #94a3b8; }
.badge-date          { font-size: .62rem; }
.badge-not-earned    { font-size: .65rem; color: #94a3b8; line-height: 1.3; }
.badge-done-pill     { background: #D1FAE5; color: #065F46; font-size: .65rem; }
.badge-level-current {
  background: color-mix(in srgb, var(--lc, var(--brand)) 13%, transparent);
  color: var(--lc, var(--brand));
  font-size: .65rem;
}

/* Point history */
.text-positive { color: #059669; }
.text-negative { color: #EF4444; }

/* Level overview */
.level-row-current { background: #fafafa; }

/* Typography */
.text-brand   { color: #E07B77; }
.text-c-link  { color: var(--c, var(--brand)); text-decoration: none; }
.text-c-link:hover { text-decoration: underline; }
.fs-xxs  { font-size: .72rem; }
.fs-xxxs { font-size: .62rem; }

/* Activity feed */
.activity-dot     { width: 10px; height: 10px; border-radius: 50%; background: var(--c, #9B9B9B); flex-shrink: 0; }
.activity-dot-dim { opacity: .35; }
.badge-attended   { background: #D1FAE5; color: #065F46; font-size: .65rem; }

/* Statistics bars */
.stat-bar           { height: 8px; background: #f1f5f9; }
.stat-bar-fill      { height: 8px; border-radius: 99px; transition: width .3s; }
.stat-bar-brand     { background: #E07B77; }
.stat-bar-soft      { background: #E07B7788; }
.stat-bar-dyn       { background: var(--c, #E07B77); }
.stat-bar-gradient  { background: linear-gradient(90deg,#E07B77,#7DC4C3); }
.w-stat { width: 44px; }
.w-day  { width: 28px; }
.w-num  { width: 20px; text-align: right; }

/* Emoji */
.emoji-xl    { font-size: 3rem; opacity: .3; }
.emoji-lg    { font-size: 2rem; }
.emoji-lg-dim { font-size: 2rem; opacity: .4; }
.emoji-md    { font-size: 1.5rem; }
.emoji-stat  { font-size: 1.4rem; }

/* Detail page */
.detail-type-label  { text-transform: uppercase; letter-spacing: .07em; }
.card-booked-state  { background: #F0FDF4; border: 1.5px solid #86EFAC; border-radius: 16px; }
.btn-cta            { font-size: 1.1rem; border-radius: 14px; }
.btn-rounded-lg     { border-radius: 12px; }

/* Alert cards */
.alert-waitlist     { background: #FEF9C3; border-left: 4px solid #F59E0B; border-radius: 12px; }
.alert-warn-card    { background: #FFFBEB; border-left: 4px solid #F59E0B !important; }
.alert-danger-card  { background: #FEF2F2; border-left: 4px solid #EF4444 !important; }
.alert-success-soft { background: #D1FAE5; color: #065F46; }
.push-info-card     { background: #FEF9C3; border-left: 4px solid #F59E0B; }
.push-info-text     { color: #92400E; }

/* Notification toggles */
.toggle-switch:checked { background-color: #E07B77 !important; border-color: #E07B77 !important; }

/* Section labels (uppercase spaced) */
.section-label { text-transform: uppercase; letter-spacing: .06em; }

/* Goal chips (profile/edit) */
.goal-chip {
  display:inline-flex; align-items:center; gap:6px;
  padding:6px 14px; border-radius:99px; font-size:.82rem; font-weight:500;
  background:white; border:1.5px solid #e2e8f0; color:#64748b;
  transition:all .15s; user-select:none;
}
.goal-chip.active { background:#E07B7715; border-color:#E07B77; color:#E07B77; }
.time-chip .border { transition:all .15s; }
.time-chip.active .border { background:#E07B7710; border-color:#E07B77 !important; }

.text-lc { color: var(--lc, var(--brand)); }
.stat-kpi-value { font-size: 1.8rem; }

/* Dashboard specific */
.dashboard-hero    { background: linear-gradient(160deg, #E07B7718 0%, #7DC4C315 50%, var(--bs-body-bg) 100%); }
.dashboard-greeting { font-size: clamp(1.3rem, 4vw, 1.8rem); }
.level-gradient-bar { height: 4px; background: linear-gradient(90deg, #E07B77, #7DC4C3); }
.level-circle-brand { background: #E07B7715; border: 2.5px solid #E07B7740; color: #E07B77; }

/* Profile Edit specific */
.avatar-edit-circle { width: 80px; height: 80px; object-fit: cover; border: 3px solid #E07B7740; }
.avatar-edit-initials {
  width: 80px; height: 80px;
  background: #E07B7720; color: #E07B77; font-size: 2rem;
  border: 3px solid #E07B7740;
}
.avatar-edit-btn {
  width: 28px; height: 28px;
  background: #E07B77; cursor: pointer;
  border: 2px solid white;
}
.cursor-pointer { cursor: pointer; }
.resize-none    { resize: none; }
.chip-day { min-width: 48px; text-align: center; }
.quick-link-icon { opacity: 1; font-size: 1.6rem; }
.ls-sm  { letter-spacing: .06em; }
.mw-75  { max-width: 75%; }

/* Buddy-Dot – kleiner farbiger Kreis (z.B. Buddy-Initialen) */
.buddy-dot {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--bs-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: #fff;
  font-weight: 700;
}
