/* ============================================================
   Trainer DB – Haupt-Stylesheet
   Design-System für die Trainer-Wissensdatenbank

   TOKEN-NAMENSSCHEMA: --primary / --primary-deep / --secondary
   NIEMALS --color-primary oder andere Varianten verwenden!
   ============================================================ */

/* === INTER – lokal ausgeliefert ============================
   Variable Font: ein File deckt weight 400–700 ab.
   latin-ext für deutsche Sonderzeichen (wird vor latin geladen). */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('/assets/fonts/inter-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7,
                 U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF,
                 U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB,
                 U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('/assets/fonts/inter-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6,
                 U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F,
                 U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215,
                 U+FEFF, U+FFFD;
}

/* === DESIGN TOKENS =========================================*/
:root {
  /* Farben – organische Grünpalette (Erde, Wiese, Leder) */
  --primary:        #4d6630;   /* Waldgrün – Hauptfarbe                */
  --primary-deep:   #3d5224;   /* Tiefgrün – Hover, Footer             */
  --secondary:      #8a9a7e;   /* Nebel-Salbei – sekundäre Elemente    */
  --white:          #ffffff;
  --highlight:      #f2b84b;   /* Bernstein/Gold – CTA, Highlights     */
  --light-bg:       #f0e8da;   /* Warmes Kreide-Weiß – Hintergründe   */
  --soft-text:      #687860;   /* Gedämpftes Salbeigrau – Sekundärtext */
  --border-soft:    rgba(55, 74, 32, 0.20);
  --overlay-bg:     rgba(44, 60, 24, 0.40);

  /* Navigation */
  --nav-height:          72px;
  --nav-height-scrolled: 64px;

  /* Logo: etwas Luft zum Header-Rand; schrumpft beim Scrollen */
  --logo-size:           54px;
  --logo-size-scrolled:  46px;
  --logo-size-mobile:    48px;

  /* Border Radii */
  --radius-lg: 14px;
  --radius-md: 10px;
  --radius-sm: 8px;

  /* Transition */
  --transition:      0.18s ease;
  --transition-fast: 0.12s ease;
  --transition-slow: 0.22s ease;

  /* === INTERN: Zusätzliche Tokens === */
  --color-error:    #c0392b;
  --color-success:  #1e7e4a;
  --color-warning:  #d4820a;
  --color-text:     #1e2518;   /* Fließtext (dunkler als --primary)    */

  /* Semantische Text-Farben für Status-Alerts */
  --color-success-text: #14532d;
  --color-error-text:   #7f1d1d;
  --color-warning-text: #7a4200;
  --color-info-text:    #5c3d00;
  --color-tag-gold:     #7a5500;
  --color-nav-link:     rgba(255,255,255,0.85);

  /* Semantische Hintergrundfarben (Tags, Alerts, Status-Bereiche) */
  --bg-success-soft:  #edfaf3;
  --bg-warning-soft:  #fff8ed;
  --bg-error-soft:    #fdf0ef;
  --bg-info-soft:     #fef3d8;

  /* Semantische Border-Farben für Status-Bereiche */
  --border-success:   rgba(30, 126, 74, 0.25);
  --border-warning:   rgba(212, 130, 10, 0.30);
  --border-error:     rgba(192, 57, 43, 0.25);
  --border-info:      rgba(242, 184, 75, 0.40);

  /* Focus-Ring-Schatten (form-control) */
  --focus-ring-shadow: 0 0 0 3px rgba(77, 102, 48, 0.15);

  /* Abstände */
  --space-xs:  0.25rem;
  --space-sm:  0.5rem;
  --space-md:  1rem;
  --space-lg:  1.5rem;
  --space-xl:  2rem;
  --space-2xl: 3rem;

  /* Layout */
  --max-width:       1200px;
  --content-padding: 0 1.5rem;

  /* Schrift */
  --font-family:    'Inter', 'Segoe UI', Arial, sans-serif;
  --font-size-base: 16px;
  --font-size-sm:   0.8rem;   /* tdb4 */
  --font-size-lg:   1.125rem; /* tdb2 */
  --font-size-xl:   2rem;     /* tdb1 (war 1.5rem) */
  --font-size-h1:   2rem;     /* tdb1 */
  --font-size-h2:   1.125rem; /* tdb2 */
  --font-size-h3:   1rem;     /* tdb2 – kleiner als h2 für Hierarchie */
  --font-size-tag:  0.775rem; /* Tag-Sonderfall */
  --line-height:    1.65;

  /* Schatten */
  --shadow-sm: 0 1px 4px rgba(55, 74, 32, 0.08);
  --shadow-md: 0 4px 16px rgba(55, 74, 32, 0.13);
  --shadow-lg: 0 8px 28px rgba(55, 74, 32, 0.18);
}

/* === RESET & BASIS ======================================== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 1rem;
  scroll-behavior: smooth;
}

/* display:flex/grid auf Elementen mit hidden-Attribut würde hidden wirkungslos machen */
[hidden] { display: none !important; }

body {
  font-family: var(--font-family);
  font-size: 1rem;
  line-height: var(--line-height);
  color: var(--color-text);
  background: var(--white);
}

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

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

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

a:visited {
  color: var(--primary-deep);
}

/* === SKIP-LINK (Keyboard-Navigation) ====================== */
.skip-link {
  position: absolute;
  top: -100%;
  left: var(--space-sm);
  z-index: 9999;
  background: var(--primary);
  color: var(--white);
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: var(--font-size-sm);
  text-decoration: none;
  transition: top var(--transition-fast);
}

.skip-link:focus {
  top: var(--space-sm);
  outline: 2px solid var(--highlight);
  outline-offset: 2px;
}

/* === FOCUS-STYLES (Keyboard-Navigation) =================== */
:focus-visible {
  outline: 2px solid var(--highlight);
  outline-offset: 3px;
  border-radius: 4px;
}

.btn:focus-visible {
  outline: 2px solid var(--highlight);
  outline-offset: 3px;
  box-shadow: 0 0 0 4px rgba(242,184,75,0.2);
}

.form-control:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 0;
  border-color: var(--primary);
  box-shadow: var(--focus-ring-shadow);
}

.icon-btn:focus-visible {
  outline: 2px solid var(--highlight);
  outline-offset: 2px;
}

.site-nav a:focus-visible,
.admin-subnav__link:focus-visible,
.my-area-subnav__link:focus-visible {
  outline: 2px solid var(--highlight);
  outline-offset: -2px;
  border-radius: 0;
}

.like-btn:focus-visible {
  outline: 2px solid var(--highlight);
  outline-offset: 2px;
}

/* === TYPOGRAFIE =========================================== */
h1 { font-size: var(--font-size-h1); font-weight: 700; line-height: 1.2; letter-spacing: 0.03em; margin-bottom: var(--space-md); color: var(--primary); }
h2 { font-size: var(--font-size-h2); font-weight: 700; margin-bottom: var(--space-md); color: var(--primary); }
h3 { font-size: var(--font-size-h3); font-weight: 700; margin-bottom: var(--space-sm); color: var(--primary); }
p  { margin-bottom: var(--space-md); }

/* === TYPOGRAFIE-SYSTEM: tdb1–tdb4 ========================
   Vier verbindliche Stile – keine Abweichungen, keine Zwischengrößen.
   Utility-Klassen für direkte Anwendung wo kein Komponenten-Selektor greift.
   tdb1 – Seitentitel  | tdb2 – Abschnitt | tdb3 – Fließtext | tdb4 – Meta/Label */
.tdb1 { font-size: 2rem;                font-weight: 700; color: var(--primary);    }
.tdb2 { font-size: 1.25rem;              font-weight: 700; color: var(--primary);    }
.tdb3 { font-size: 1rem;                font-weight: 400; color: var(--color-text); }
.tdb4 { font-size: var(--font-size-sm); font-weight: 400; color: var(--soft-text);  }

/* === LAYOUT =============================================== */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: var(--content-padding);
}

.page-wrapper {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

@keyframes page-fade-in {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: none; }
}

main.site-main {
  flex: 1;
  padding: var(--space-xl) 0;
  animation: page-fade-in var(--transition-slow) both;
}

/* === HEADER =============================================== */
.site-header {
  background: linear-gradient(120deg, #1a2a0a 0%, var(--primary-deep) 50%, var(--primary) 100%);
  color: var(--white);
  height: var(--nav-height);
  display: flex;
  align-items: center;
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 0;
  z-index: 100;
  transition: height var(--transition), box-shadow var(--transition);
}

.site-header.is-scrolled {
  height: var(--nav-height-scrolled);
  box-shadow: var(--shadow-md);
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
  width: 100%;
  position: relative;
}

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

.site-header__logo img {
  height: var(--logo-size);
  width: auto;
  transition: height var(--transition);
}

.site-header.is-scrolled .site-header__logo img {
  height: var(--logo-size-scrolled);
}

.site-header__title {
  font-size: var(--font-size-lg);
  font-weight: 600;
  letter-spacing: 0.03em;
  color: var(--white);
  line-height: 1.2;
}

.site-header__subtitle {
  font-size: var(--font-size-sm);
  color: rgba(255, 255, 255, 0.75);
}

/* === BURGER-BUTTON ======================================== */
.nav-toggle {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  background: rgba(255, 255, 255, 0.14);
  border: none;
  cursor: pointer;
  padding: 4px;
  border-radius: var(--radius-sm);
  transition: background var(--transition);
  flex-shrink: 0;
}

.nav-toggle:hover {
  background: rgba(255, 255, 255, 0.24);
}

.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--white);
  border-radius: 2px;
  transition: transform var(--transition), opacity var(--transition);
  transform-origin: center;
}

/* Burger -> X Animation */
.nav-toggle.is-open span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.nav-toggle.is-open span:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}
.nav-toggle.is-open span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* === NAVIGATION (immer als Dropdown) ===================== */
.site-nav {
  display: none;
  position: absolute;
  top: 100%;
  right: 0;
  left: auto;
  width: 256px;
  background: rgba(40, 55, 22, 0.72);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: var(--shadow-lg);
  z-index: 99;
  flex-direction: column;
  align-items: stretch;
  gap: 0;
  padding: 0;
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 12px;
  margin-top: 6px;
}

.site-nav.is-open {
  display: flex;
}

.site-nav a,
.site-nav a:visited {
  display: inline-flex;
  align-items: center;
  width: 100%;
  color: var(--color-nav-link);
  text-decoration: none;
  padding: 0.75rem 1.25rem;
  gap: var(--space-sm);
  border-radius: 0;
  border: none;
  border-bottom: 1px solid rgba(255,255,255,0.07);
  transition: background var(--transition), color var(--transition);
  font-size: 1rem;
  font-weight: 400;
  min-height: 44px;
  box-sizing: border-box;
}

.site-nav a svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.site-nav a:last-child {
  border-bottom: none;
}

.site-nav a:hover {
  background: rgba(255,255,255,0.09);
  color: var(--white);
  text-decoration: none;
}

.site-nav a.is-active {
  background: rgba(255,255,255,0.09);
  color: var(--white);
  text-decoration: none;
  border-left: 3px solid var(--highlight);
  padding-left: calc(1.25rem - 3px);
  font-weight: 600;
}

/* === DESKTOP-NAV: persistente Hauptlinks ab 900px ======== */
@media (min-width: 900px) {
  .nav-toggle {
    display: none;
  }

  .site-nav {
    display: flex !important;  /* override .is-open pattern */
    position: static;
    flex-direction: row;
    width: auto;
    background: transparent;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    box-shadow: none;
    border: none;
    border-radius: 0;
    gap: 0;
    padding: 0;
    margin-top: 0;
  }

  .site-nav a {
    padding: 0 0.875rem;
    border-bottom: none;
    border-radius: 0;
    font-size: var(--font-size-sm);
    min-height: var(--nav-height);
    position: relative;
    white-space: nowrap;
  }

  /* Hover-State ohne Hintergrund-Fill auf Desktop */
  .site-nav a:hover {
    background: rgba(255,255,255,0.06);
  }

  /* Aktiver Eintrag: Highlight-Unterstrich statt Hintergrund */
  .site-nav a.is-active {
    background: transparent;
    color: var(--white);
    font-weight: 600;
    border-left: none;
    padding-left: 0.875rem;
  }
  .site-nav a.is-active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0.875rem;
    right: 0.875rem;
    height: 3px;
    background: rgba(255, 255, 255, 0.92);
    border-radius: 2px 2px 0 0;
  }
}

/* === FOOTER =============================================== */
.site-footer {
  background: linear-gradient(300deg, #1a2a0a 0%, var(--primary-deep) 50%, var(--primary) 100%);
  color: var(--secondary);
  padding: var(--space-sm) 0;
  font-size: var(--font-size-sm);
  text-align: center;
  margin-top: auto;
}

.site-footer__copy {
  margin: 0;
  color: rgba(255, 255, 255, 0.7);
  font-size: var(--font-size-sm);
}

.site-footer__link,
.site-footer__link:visited {
  color: rgba(255, 255, 255, 0.75);
  text-decoration: none;
  transition: color var(--transition);
}

.site-footer__link:hover,
.site-footer__link:focus-visible {
  color: var(--white);
  text-decoration: underline;
}

.site-footer__version {
  color: rgba(255, 255, 255, 0.55);
  font-size: var(--font-size-sm);
}

.site-footer__sep {
  color: rgba(255, 255, 255, 0.35);
  margin: 0 0.3em;
  user-select: none;
}

/* === BUTTONS ============================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-xs);
  padding: 0.6rem 1.25rem;
  border: none;
  border-radius: var(--radius-md);
  font-family: var(--font-family);
  font-size: var(--font-size-sm);
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: background var(--transition), box-shadow var(--transition), transform var(--transition);
  line-height: 1.4;
  min-height: 44px;
  letter-spacing: 0.01em;
}

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

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

.btn--primary {
  background: linear-gradient(to bottom, #5b7a38, var(--primary));
  color: var(--white);
}
.btn--primary:hover {
  background: linear-gradient(to bottom, #4d6630, var(--primary-deep));
  color: var(--white);
}

.btn--highlight {
  background: var(--highlight);
  color: var(--primary-deep);
}
.btn--highlight:hover {
  filter: brightness(0.9);
}

.btn--outline {
  background: transparent;
  color: var(--primary);
  border: 2px solid var(--primary);
}
.btn--outline:hover {
  background: var(--primary);
  color: var(--white);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.btn--sm {
  padding: 0.4rem 0.875rem;
}

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

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

/* === FORMULARE ============================================ */
.form-group {
  margin-bottom: var(--space-md);
}

.form-label {
  display: block;
  margin-bottom: var(--space-xs);
  font-weight: 600;
  font-size: var(--font-size-sm);
  color: var(--primary);
}

.form-control {
  width: 100%;
  padding: 0.6rem 0.875rem;
  border: 1.5px solid var(--border-soft);
  border-radius: var(--radius-sm);
  font-family: var(--font-family);
  font-size: 1rem;
  color: var(--color-text);
  background: var(--white);
  transition: border-color var(--transition), box-shadow var(--transition);
}

.form-control:hover:not(:focus):not(:disabled) {
  border-color: rgba(55, 74, 32, 0.30);
}

.form-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: var(--focus-ring-shadow);
}

.form-control::placeholder {
  color: var(--secondary);
  opacity: 0.75;
}

.form-control--error {
  border-color: var(--color-error);
  background: var(--bg-error-soft);
}

.form-control--valid {
  border-color: var(--color-success);
  background: var(--bg-success-soft);
}

.form-control:disabled,
.form-control[disabled] {
  background: var(--light-bg);
  color: var(--soft-text);
  border-color: var(--border-soft);
  cursor: not-allowed;
  opacity: 0.7;
}

.form-control[readonly] {
  background: var(--light-bg);
  color: var(--soft-text);
  cursor: default;
}

textarea.form-control {
  resize: vertical;
  min-height: 6rem;
  font-family: var(--font-family);
  line-height: var(--line-height);
}

/* === KARTEN =============================================== */
.card, .ex-card {
  background: var(--white);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
  padding: var(--space-lg);
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition), transform var(--transition);
}

@media (hover: hover) {
  .card:hover, .ex-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
  }
}

.card__title {
  font-size: var(--font-size-lg);
  font-weight: 700;
  color: var(--primary);
  margin-bottom: var(--space-sm);
}

.card__meta {
  font-size: var(--font-size-sm);
  color: var(--soft-text);
  margin-bottom: var(--space-sm);
}

/* === TAGS / BADGES ======================================== */
.tag {
  display: inline-block;
  padding: 0.2rem 0.65rem;
  border-radius: 999px;
  font-size: var(--font-size-tag);
  font-weight: 500;
  text-transform: none;
  letter-spacing: 0;
  line-height: 1.4;
  background: var(--light-bg);
  color: var(--primary);
  border: 1px solid var(--border-soft);
}

/* ── Header-Tags: kurze Labels (Kategorie, Schwierigkeit, Stufe) */
.tag--label {
  font-size: var(--font-size-sm);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.tag--highlight {
  background: var(--bg-info-soft);
  color: var(--color-info-text);
  border-color: var(--border-info);
}

.tag--status-neu {
  background: var(--bg-warning-soft);
  color: var(--color-warning-text);
  border-color: var(--border-warning);
}

.tag--status-kuratiert {
  background: var(--bg-success-soft);
  color: var(--color-success-text);
  border-color: var(--border-success);
}

.admin-badge {
  background: var(--highlight);
  color: var(--primary-deep);
  font-size: var(--font-size-sm);
  font-weight: 700;
  padding: 0.15rem 0.45rem;
  border-radius: 6px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Lernziel-Badges: mehrzeilig, kompakt */
.tag--goal {
  display: inline-block;
  font-size: var(--font-size-tag);
  font-weight: 500;
  white-space: normal;
  word-break: normal;
  line-height: 1.3;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  background: var(--light-bg);
  color: var(--primary);
  border: 1px solid var(--border-soft);
  max-width: 200px;
}

/* Tag-Liste: flexible Anordnung mit Zeilenumbruch */
.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
}

/* === ALERTS =============================================== */
@keyframes alert-slide-in {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.alert {
  padding: var(--space-md) var(--space-lg);
  border-radius: var(--radius-sm);
  margin-bottom: var(--space-md);
  border-left: 4px solid;
  font-size: var(--font-size-sm);
}

.alert--success {
  background: var(--bg-success-soft);
  border-color: var(--color-success);
  color: var(--color-success-text);
  animation: alert-slide-in var(--transition-slow) both;
}

.alert--error {
  background: var(--bg-error-soft);
  border-color: var(--color-error);
  color: var(--color-error-text);
  animation: alert-slide-in var(--transition-slow) both;
}

.alert--warning {
  background: var(--bg-warning-soft);
  border-color: var(--color-warning);
  color: var(--color-warning-text);
  animation: alert-slide-in var(--transition-slow) both;
}

/* === SUCHBEREICH ========================================== */
.search-bar {
  display: flex;
  gap: var(--space-sm);
  flex-wrap: wrap;
  align-items: flex-end;
  background: var(--light-bg);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
  padding: var(--space-lg);
  margin-bottom: var(--space-xl);
}

.search-bar .form-group {
  flex: 1 1 180px;
  margin-bottom: 0;
}

/* === EXERCISE GRID ======================================== */
/* Abschnitts-Kopfzeile: Überschrift + Icon-Button nebeneinander */
.section-head-row {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: var(--space-sm);
  margin-bottom: var(--space-lg);
}
.section-head-row > h2,
.section-head-row > h3 {
  margin: 0;
  flex: 0 0 auto;
}
.section-head-row > .icon-btn {
  flex: 0 0 auto;
}

/* Trennlinie zwischen "Eigene" und "Gemerkte" Sammlungen */
.mc-liked-section {
  margin-top: var(--space-2xl);
  padding-top: var(--space-xl);
  border-top: 1px solid var(--border-soft);
}

.exercise-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: var(--space-lg);
}

/* --- Übungskarte ------------------------------------------ */
.ex-card {
  cursor: pointer;
  display: flex;
  flex-direction: column;
  user-select: none;
}

@media (hover: hover) {
  .ex-card:hover .ex-card__title {
    color: var(--primary-deep);
  }
}

.ex-card:focus-within {
  box-shadow: var(--shadow-md);
  outline: 2px solid var(--highlight);
  outline-offset: 2px;
}

.ex-card__head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--space-sm);
  margin-bottom: var(--space-sm);
}

.ex-card__title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--primary);
  margin: 0;
  line-height: 1.35;
  transition: color var(--transition);
}

.ex-card__desc {
  font-size: 0.875rem;
  color: var(--color-text);
  margin: 0 0 var(--space-md);
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.ex-card__footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-xs);
  margin-top: auto;
}

.ex-card__id {
  margin-left: auto;
}

.ex-card__actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: var(--space-xs);
}

/* === EXERCISES-SEITE ====================================== */
.card--linked {
  display: block;
  text-decoration: none;
  color: inherit;
}

.card--linked .card__title {
  transition: color var(--transition);
}

@media (hover: hover) {
  .card--linked:hover {
    text-decoration: none;
    color: inherit;
  }
  .card--linked:hover .card__title {
    color: var(--primary-deep);
  }
}

.page-header {
  border-bottom: 2px solid var(--border-soft);
  padding-bottom: var(--space-md);
  margin-bottom: var(--space-xl);
}

/* === LOGIN ================================================ */
.login-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(ellipse at 50% 0%, rgba(77, 102, 48, 0.08) 0%, transparent 55%), var(--light-bg);
  padding: var(--space-xl);
}

/* Vertikaler Stack: Brand oben, Box unten */
.login-stack {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  max-width: 440px;
  gap: var(--space-md);
}

/* Marken-Block über der Box */
.login-brand {
  text-align: center;
}

.login-brand__logo {
  height: 72px;
  object-fit: contain;
  display: block;
  margin: 0 auto var(--space-sm);
}

.login-brand__title {
  font-size: var(--font-size-xl);
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 0.25rem;
}

.login-brand__subtitle {
  font-size: var(--font-size-sm);
  color: var(--soft-text);
  margin-bottom: 0;
}

.login-box {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: var(--space-2xl);
  width: 100%;
}

.login-box__submit {
  width: 100%;
  margin-bottom: var(--space-sm);
}

.login-box__forgot {
  text-align: center;
  margin-top: var(--space-xs);
}

.login-box__forgot-link,
.login-box__forgot-link:visited {
  font-size: 0.875rem;
  color: var(--soft-text);
  text-decoration: none;
  transition: color var(--transition);
}

.login-box__forgot-link:hover {
  color: var(--primary);
  text-decoration: underline;
}

/* === ADMIN ================================================ */
.admin-header {
  background: var(--primary-deep);
}

/* === RESPONSIV: Header-Größe (Mobile) ===================== */
@media (max-width: 1024px) {
  :root {
    --nav-height: 64px;
    --logo-size: 56px;
  }

  .site-header {
    height: var(--nav-height);
  }

  .site-header .container {
    gap: 0;
    padding-block: var(--space-sm);
  }
}

/* === RESPONSIV: Layout-Elemente (768px) =================== */
@media (max-width: 768px) {
  .exercise-grid {
    grid-template-columns: 1fr;
  }

  .search-bar {
    flex-direction: column;
    padding: var(--space-sm);
    gap: var(--space-xs);
    margin-bottom: var(--space-md);
  }

  .search-bar .form-group {
    width: 100%;
    margin-bottom: 0;
    flex: 0 0 auto;
  }
}

/* === SEARCH-BAR: Desktop-Fixes ============================= */
.search-bar {
  align-items: flex-start;
}

.search-bar .form-control {
  height: 2.75rem;
}

/* Select: Browser-Eigenstil deaktivieren → border-radius greift */
select.form-control {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23003656' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.875rem center;
  padding-right: 2.25rem;
}

/* Search-Bar: stärkere Card-Optik mit Schatten */
.search-bar {
  box-shadow: var(--shadow-sm);
  border-color: var(--border-soft);
}

/* Suchen-Button: Schrift + Größe */
.search-bar .btn--primary {
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
}

/* Empty-State: strukturierter Leer-Zustand */
.empty-state {
  border: 1.5px dashed var(--secondary);
  background: var(--light-bg);
  color: var(--soft-text);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-2xl) var(--space-xl);
  border-radius: var(--radius-md);
}

.empty-state__icon {
  color: var(--secondary);
  opacity: 0.7;
}

.empty-state__text {
  color: var(--soft-text);
  font-size: 1rem;
  margin: 0;
}

.empty-state__hint {
  font-size: var(--font-size-sm);
  color: var(--soft-text);
  margin: 0;
}

/* Page-Header: Subtitle etwas kleiner für bessere Hierarchie */
.page-header p {
  font-size: var(--font-size-sm);
  color: var(--color-text);
  margin-bottom: 0;
}


/* === SQL-TABELLE – 2026-04-10 ============================== */

/* Box-Wrapper um die Tabelle */
.sql-table-box {
  background: var(--white);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  margin-bottom: var(--space-lg);
}

/* Tabelle selbst – kein eigener Border, Box übernimmt das */
.sql-table {
  width: 100%;
  border-collapse: collapse;
}

/* Kopfzeile */
.sql-table__head {
  background: var(--light-bg);
  border-bottom: 2px solid var(--border-soft);
}

.sql-table__th {
  padding: var(--space-sm) var(--space-md);
  text-align: left;
  font-size: var(--font-size-sm);
  font-weight: 700;
  color: var(--primary);
  white-space: nowrap;
}

/* Spaltenbreiten */
.sql-table__th--name   { width: 40%; }
.sql-table__th--status { width: 10%; text-align: center; }
.sql-table__th--ts     { width: 25%; }
.sql-table__th--action { width: 25%; text-align: right; }

/* Datenzeilen */
.sql-table__row {
  border-bottom: 1px solid var(--border-soft);
  transition: background var(--transition);
}

.sql-table__row:last-child {
  border-bottom: none;
}

.sql-table__row[data-href] {
  cursor: pointer;
}

@media (hover: hover) and (min-width: 601px) {
  .sql-table__row:hover {
    background: var(--light-bg);
  }
}

/* done-Zeile: leichte Grün-Tönung + linke Markierung */
.sql-table__row--done {
  background: var(--bg-success-soft);
  border-left: 3px solid var(--color-success);
}

@media (hover: hover) and (min-width: 601px) {
  .sql-table__row--done:hover {
    background: var(--bg-success-soft);
  }
}

/* Zellen */
.sql-table__cell {
  padding: var(--space-sm) var(--space-md);
  font-size: var(--font-size-sm);
  vertical-align: middle;
}

.sql-table__cell--status {
  text-align: center;
}

.sql-table__cell--action {
  text-align: right;
}

/* Action-Cell: Ausführen + Löschen nebeneinander */
.sql-item__actions {
  display: flex;
  gap: var(--space-xs);
  justify-content: flex-end;
  align-items: center;
  flex-wrap: nowrap;
}

/* btn--danger: Hover-Variante */
.btn--danger:hover {
  background: #a93226;
  color: var(--white);
}

/* === ÜBUNGSTABELLE (exercises.php) – 2026-04-10 =========== */

/* Spaltenbreiten exercises-Tabelle */
.sql-table__th--title    { width: 45%; }
.sql-table__th--category { width: 20%; }
.sql-table__th--level    { width: 15%; }
.sql-table__th--ex-link  { width: 20%; text-align: right; }

/* Zellen exercises-Tabelle */
.sql-table__cell--name     { font-size: 1rem; }
.sql-table__cell--category { vertical-align: middle; }
.sql-table__cell--level    { vertical-align: middle; }
.sql-table__cell--ex-link  { text-align: right; vertical-align: middle; }

/* Beschreibung + Meta-Zeile innerhalb der Name-Zelle */
.sql-table__cell-desc {
  font-size: var(--font-size-sm);
  color: var(--soft-text);
  margin: .2rem 0 0;
  line-height: 1.4;
}

.sql-table__cell-meta {
  display: flex;
  flex-wrap: wrap;
  gap: .15rem .4rem;
  align-items: center;
  margin-top: .2rem;
  font-size: var(--font-size-sm);
  color: var(--soft-text);
}

/* Responsive: Link-Spalte auf Mobile kleiner */
@media (max-width: 600px) {
  .sql-table__th--category,
  .sql-table__cell--category {
    display: none;
  }
}


/* === MOBILE-FIXES Übungssammlung (exercises.php) – 2026-04-10 =========== */

/* Fix 1+2: Suchen-Button-Gruppe auf Mobile kompakt – kein Flex-grow, kein Phantom-Leerraum  */
@media (max-width: 768px) {
  .search-bar .form-group--action {
    flex: 0 0 auto;
    justify-content: flex-start;
  }

  /* Fix 3: Details-Button in Übungstabelle: volle Breite + Mindest-Tappfläche 44px */
  .sql-table__cell--ex-link .btn {
    display: block;
    width: 100%;
    min-height: 44px;
    text-align: center;
  }
}

/* Fix 4: Übungstabelle auf Mobile als Card-Stack
   Tabelle bleibt im DOM, wird aber optisch zu gestapelten Cards umgebaut   */
@media (max-width: 600px) {

  /* Tabellenkopf auf Mobile ausblenden */
  .sql-table__head {
    display: none;
  }

  /* Jede Zeile wird zur Card */
  .sql-table__row {
    display: block;
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-sm);
    margin-bottom: var(--space-sm);
    padding: var(--space-md);
    box-shadow: var(--shadow-sm);
  }

  .sql-table__row:last-child {
    border-bottom: 1px solid var(--border-soft);
  }

  /* Alle Zellen: Block-Layout */
  .sql-table__cell {
    display: block;
    padding: 0;
    margin-bottom: var(--space-xs);
    text-align: left;
  }

  .sql-table__cell:last-child {
    margin-bottom: 0;
  }

  /* Titel-Zelle: Name oben, fett */
  .sql-table__cell--name {
    margin-bottom: var(--space-sm);
  }

  /* Kategorie + Schwierigkeit: inline nebeneinander als Badges */
  .sql-table__cell--category,
  .sql-table__cell--level {
    display: inline-block;
    margin-right: var(--space-xs);
    margin-bottom: var(--space-sm);
  }

  /* ID-Spalte: nackte Zahl ohne Kontext – auf Mobile ausblenden */
  .sql-table__cell--id {
    display: none;
  }

  /* Link-Zelle: Like + Öffnen-Icon nebeneinander */
  .sql-table__cell--ex-link {
    display: flex;
    gap: .5rem;
    align-items: center;
    margin-top: var(--space-sm);
  }

  /* sql-table-box: kein overflow:hidden, damit border-radius der Rows sichtbar */
  .sql-table-box {
    background: transparent;
    border: none;
    box-shadow: none;
    border-radius: 0;
    overflow: visible;
  }

  /* sql-table selbst: kein border-collapse nötig, da Block-Layout */
  .sql-table {
    display: block;
  }

  .sql-table tbody {
    display: block;
  }
}


/* === SUCH-ACCORDION (exercises.php) – 2026-04-11 ========== */

/* Wrapper – Desktop: kein visueller Unterschied zum alten .search-bar-Wrapper */
.search-accordion {
  margin-bottom: var(--space-xl);
}

/* Filterfelder: gleiche Schriftgröße wie Beschreibungstext (var(--font-size-sm) = 0.8rem) */
.search-accordion .form-control {
  font-size: var(--font-size-sm);
  height: auto;
}

/* Toggle-Button: auf Desktop unsichtbar */
.search-accordion__toggle {
  display: none;
  width: 100%;
  padding: var(--space-md) var(--space-lg);
  background: var(--light-bg);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
  font-family: var(--font-family);
  font-size: 1rem;
  font-weight: 600;
  color: var(--primary);
  cursor: pointer;
  text-align: left;
  align-items: center;
  justify-content: space-between;
  box-shadow: var(--shadow-sm);
  transition: background var(--transition), border-color var(--transition);
}

.search-accordion__toggle:hover {
  background: var(--light-bg);
  border-color: var(--border-soft);
}

.search-accordion__toggle-icon {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  transition: transform var(--transition);
}

.search-accordion__toggle-icon.is-open {
  transform: rotate(180deg);
}

/* Body – Desktop: immer sichtbar */
.search-accordion__body {
  display: block;
}

/* === FORM-GROUP--ACTION: Suchen + Reset-Button nebeneinander  */
.search-bar .form-group--action {
  flex: 1 1 180px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: var(--space-sm);
}

/* === MOBILE: Accordion aktiv ================================ */
@media (max-width: 768px) {

  /* Abstand nach dem Accordion-Block reduzieren */
  .search-accordion {
    margin-bottom: var(--space-sm);
  }

  /* Toggle-Button einblenden */
  .search-accordion__toggle {
    display: flex;
  }

  /* Body standardmäßig versteckt – sanfte max-height-Animation statt hartem display:none */
  .search-accordion__body {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    margin-top: 0;
    transition: max-height 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                opacity 0.2s ease,
                visibility 0s 0.3s;
  }

  /* Body geöffnet */
  .search-accordion .search-accordion__body--open {
    max-height: 800px;
    opacity: 1;
    visibility: visible;
    margin-top: var(--space-sm);
    transition: max-height 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                opacity 0.2s ease,
                visibility 0s 0s;
  }

  /* Suchen + Reset im Action-Block untereinander, volle Breite */
  .search-bar .form-group--action {
    flex: 0 0 auto;
    flex-direction: column;
  }

  .search-bar .form-group--action .btn {
    width: 100%;
    justify-content: center;
  }
}


/* ============================================================
   === DETAILSEITE TRAININGSÜBUNG (exercise_detail.php) =======
   === 2026-04-11 — an bestehende style.css angehängt =========
   ============================================================ */

/* ── Container ─────────────────────────────────────────────── */
.ex-detail {
  padding-bottom: var(--space-2xl);
}

.ex-detail--edit {
  border-left: 3px solid var(--highlight);
  padding-left: var(--space-md);
}

/* ── Breadcrumb ─────────────────────────────────────────────── */
.ex-breadcrumb {
  margin-bottom: var(--space-sm);
  font-size: var(--font-size-sm);
  color: var(--soft-text);
}
.ex-breadcrumb .ex-section__title {
  margin-bottom: 0;
}
.ex-breadcrumb a {
  color: var(--soft-text);
  text-decoration: none;
}
.ex-breadcrumb a:hover {
  color: var(--primary);
  text-decoration: underline;
}

/* ── Topbar: Breadcrumb links, Aktions-Icons rechts ────────── */
.ex-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-sm);
}
.ex-topbar .ex-breadcrumb {
  margin-bottom: 0;
}

/* ── Seitenkopf ─────────────────────────────────────────────── */
.ex-header {
  margin-bottom: var(--space-xl);
}
.ex-header__meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs);
  margin-bottom: var(--space-sm);
}
.ex-header__tidb {
  font-size: var(--font-size-sm);
  color: var(--soft-text);
  font-family: 'JetBrains Mono', monospace;
  align-self: center;
  margin-left: var(--space-xs);
}
.ex-header__title {
  margin-bottom: var(--space-sm);
}
.ex-header__lead {
  font-size: 1rem;
  color: var(--color-text);
  line-height: var(--line-height);
  margin-bottom: var(--space-md);
  max-width: 72ch;
}

/* ── Aktionen (Bearbeiten / PDF / Zurück) ───────────────────── */
.ex-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  margin-top: var(--space-xl);
}

/* ── Zweispaltiges Body-Layout ──────────────────────────────── */
.ex-body {
  display: grid;
  grid-template-columns: 1fr 320px;
  grid-template-areas: "main aside" "gallery aside";
  gap: var(--space-xl);
  align-items: start;
}

/* ── Haupt-Spalte ───────────────────────────────────────────── */
.ex-main {
  grid-area: main;
  min-width: 0; /* verhindert Grid-Overflow */
}

/* ── Abschnitt ──────────────────────────────────────────────── */
.ex-section {
  margin-bottom: var(--space-xl);
}
.ex-main > :last-child {
  margin-bottom: 0;
}
.ex-section__title {
  font-size: 1rem;
  color: var(--primary);
  font-weight: 700;
  margin-bottom: var(--space-md);
}
.ex-section__hint {
  font-size: var(--font-size-sm);
  color: var(--soft-text);
  margin-bottom: var(--space-sm);
}

/* ── Ablaufschritte ─────────────────────────────────────────── */
.ex-steps {
  list-style: none;
  counter-reset: steps-counter;
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}
.ex-steps__item {
  display: flex;
  gap: var(--space-md);
  align-items: flex-start;
}
.ex-steps__num {
  flex-shrink: 0;
  width: 2rem;
  height: 2rem;
  background: var(--primary);
  color: var(--white);
  border-radius: 50%;
  font-size: var(--font-size-sm);
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 0.15rem;
}
.ex-steps__text {
  line-height: var(--line-height);
  color: var(--color-text);
}

/* ── Trainer-Notizen ────────────────────────────────────────── */
.ex-notes {
  background: var(--light-bg);
  border-left: 4px solid var(--secondary);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: var(--space-md) var(--space-lg);
  font-size: 1rem;
  line-height: var(--line-height);
  color: var(--color-text);
}

/* ── Meta-Karte (Aside) ─────────────────────────────────────── */
.ex-aside {
  grid-area: aside;
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}
.ex-meta-card {
  background: var(--white);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
  padding: var(--space-md) var(--space-lg);
  box-shadow: var(--shadow-sm);
}
.ex-meta-card__title {
  font-size: var(--font-size-sm);
  font-weight: 700;
  color: var(--soft-text);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: var(--space-sm);
}
.ex-meta-card--source {
  border-top: 3px solid var(--border-soft);
}

/* ── Desktop: Aside als eine unified Karte mit Trennlinien ── */
@media (min-width: 901px) {
  .ex-aside {
    gap: 0;
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
  }
  .ex-aside .ex-meta-card {
    border: none;
    border-bottom: 1px solid var(--border-soft);
    border-radius: 0;
    box-shadow: none;
  }
  .ex-aside .ex-meta-card:last-child {
    border-bottom: none;
  }
  .ex-aside .ex-meta-card--source {
    border-top: none;
  }
}

/* ── Meta-Liste (dt/dd) ─────────────────────────────────────── */
.ex-meta-list {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: var(--space-xs) var(--space-md);
  font-size: 1rem;
}
.ex-meta-list dt {
  font-size: var(--font-size-sm);
  font-weight: 600;
  color: var(--soft-text);
  white-space: nowrap;
  align-self: center;
}
.ex-meta-list dd {
  color: var(--color-text);
  margin: 0;
}
.ex-meta-list__items {
  list-style: disc;
  padding-left: var(--space-md);
  margin: 0;
}
.ex-meta-list__items li {
  margin-bottom: 0.2rem;
}

/* ── Tag-Liste (Aside) ──────────────────────────────────────── */
.ex-tag-list {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs);
  margin: 0;
  padding: 0;
}

/* ── Schlagwörter ───────────────────────────────────────────── */
.ex-keywords {
  font-size: var(--font-size-sm);
  color: var(--soft-text);
  margin: 0;
}

/* ── Quelle ─────────────────────────────────────────────────── */
.ex-source__author {
  font-size: var(--font-size-sm);
  color: var(--soft-text);
  margin-bottom: var(--space-xs);
}
.ex-source__link {
  font-size: var(--font-size-sm);
  color: var(--primary);
  word-break: break-all;
}

/* ── Schwierigkeits-Tags (eigene Farben) ────────────────────── */
.tag--diff-easy   { background: var(--bg-success-soft); color: var(--color-success); border-color: var(--border-success); }
.tag--diff-medium { background: var(--bg-warning-soft); color: var(--color-warning-text); border-color: var(--border-warning); }
.tag--diff-hard   { background: var(--bg-error-soft);   color: var(--color-error-text); border-color: var(--border-error); }

/* ── Edit-Formular ──────────────────────────────────────────── */
.ex-edit-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-md);
}
.ex-edit-steps {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.875rem;
  line-height: 1.8;
}
.ex-edit-form__actions {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  position: sticky;
  top: calc(var(--nav-height) + var(--space-md));
}

/* ── Kommentare ─────────────────────────────────────────────── */
.ex-comments {
  margin-top: var(--space-2xl);
  padding-top: var(--space-md);
}
.ex-comments__empty {
  color: var(--soft-text);
  font-style: italic;
  margin-bottom: var(--space-xl);
}

.ex-comment-list {
  list-style: none;
  padding: 0;
  margin: 0 0 var(--space-xl);
}
.ex-comment {
  padding: var(--space-md) 0;
  border-bottom: 1px solid var(--border-soft);
}
.ex-comment:last-child {
  border-bottom: none;
}
.ex-comment__header {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin-bottom: var(--space-xs);
  flex-wrap: wrap;
}
.ex-comment__author {
  font-weight: 700;
  color: var(--primary);
  font-size: var(--font-size-sm);
}
.ex-comment__time {
  font-size: var(--font-size-sm);
  color: var(--soft-text);
  margin-right: auto;
}
.ex-comment__actions {
  display: flex;
  gap: var(--space-xs);
}
.ex-comment__body {
  font-size: 1rem;
  line-height: var(--line-height);
  color: var(--color-text);
  white-space: pre-wrap;
}
.ex-comment__edit-input {
  margin-bottom: var(--space-sm);
}
.ex-comment__edit-actions {
  display: flex;
  gap: var(--space-xs);
}
.ex-comment__del-form {
  margin: 0;
}

/* ── Neuer Kommentar ────────────────────────────────────────── */
.ex-comment-new {
  padding-top: var(--space-lg);
  border-top: 1px solid var(--border-soft);
}
.ex-comment-new__title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: var(--space-md);
}

/* ── Print / PDF-Export ─────────────────────────────────────── */
.no-print { /* Für Kommentare, Nav, Buttons: via @media print unterdrückt */ }

/* ── Responsive: Mobile ─────────────────────────────────────── */
@media (max-width: 900px) {
  .ex-body {
    grid-template-columns: 1fr;
    grid-template-areas: "main" "gallery" "aside";
  }
  .ex-aside {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-md);
  }
}
@media (max-width: 600px) {
  .ex-aside {
    grid-template-columns: 1fr;
  }
  .ex-edit-row {
    grid-template-columns: 1fr;
  }
  .ex-edit-form__actions {
    position: static;
  }
  .ex-comment__header {
    flex-wrap: wrap;
  }
}


.search-bar .btn--primary {
  width: auto;
  min-width: 140px;
  align-self: flex-end;
}

.search-bar .form-group--action {
  flex: 1 1 100%;
  display: flex;
  flex-direction: row;
  justify-content: flex-end;
  align-items: center;
  gap: var(--space-sm);
  margin-top: var(--space-sm);
}

@media (max-width: 768px) {
  .search-bar .btn--primary {
    width: 100%;
    align-self: stretch;
  }
  .search-bar .form-group--action {
    flex-direction: column;
    align-items: stretch;
  }
}

.sql-table__cell .tag--goal {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 180px;
  word-break: keep-all;
}

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

.exercises-empty-cell {
  font-size: var(--font-size-sm);
  color: var(--soft-text);
  font-style: italic;
}

/* B-004: Trefferanzahl-Zeile – immer sichtbar */
.ai-message-banner {
  display: flex;
  align-items: flex-start;
  gap: .5rem;
  background: var(--light-bg);
  border-left: 3px solid var(--primary);
  border-radius: var(--radius-sm);
  padding: .65rem 1rem;
  margin-bottom: var(--space-md);
  font-size: var(--font-size-sm);
  color: var(--color-text);
  line-height: 1.5;
}
.ai-message-banner svg {
  flex-shrink: 0;
  margin-top: .1rem;
  color: var(--primary);
}

.exercises-result-count {
  margin-bottom: var(--space-md);
  color: var(--soft-text);
  font-size: var(--font-size-sm);
}
.exercises-result-count__filters {
  margin-left: var(--space-xs);
  color: var(--primary);
  font-weight: 600;
}


/* ============================================================
   === FILTER-MANAGER MODAL (exercises.php) – v3.0 ===========
   === 2026-04-17 — an bestehende style.css angehängt =========
   ============================================================ */

/* ── bearbeiten-Link unter Dropdowns ───────────────────────── */
.filter-edit-link {
  display: inline-block;
  margin-top: 0.3rem;
  font-size: var(--font-size-sm);
  color: var(--soft-text);
  text-decoration: none;
  border-bottom: 1px dashed var(--soft-text);
  transition: color var(--transition), border-color var(--transition);
  cursor: pointer;
}

.filter-edit-link:hover {
  color: var(--primary);
  border-color: var(--primary);
  text-decoration: none;
}

/* ── Modal: Backdrop ────────────────────────────────────────── */
.filter-modal {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-md);
}

.filter-modal[hidden] {
  display: none;
}

.filter-modal__backdrop {
  position: absolute;
  inset: 0;
  background: var(--overlay-bg);
  cursor: pointer;
}

/* ── Modal: Box ─────────────────────────────────────────────── */
.filter-modal__box {
  position: relative;
  background: var(--white);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 480px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 1;
}

/* ── Modal: Header ──────────────────────────────────────────── */
.filter-modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-md) var(--space-lg);
  border-bottom: 1px solid var(--border-soft);
  background: var(--light-bg);
  flex-shrink: 0;
}

.filter-modal__title {
  font-size: var(--font-size-h3);
  color: var(--primary);
  margin: 0;
  font-weight: 700;
}

.filter-modal__close {
  background: transparent;
  border: none;
  font-size: 1rem;
  color: var(--soft-text);
  cursor: pointer;
  line-height: 1;
  padding: 0.2rem 0.4rem;
  border-radius: var(--radius-sm);
  transition: color var(--transition), background var(--transition);
  flex-shrink: 0;
}

.filter-modal__close:hover {
  color: var(--primary);
  background: var(--border-soft);
}

/* ── Modal: Body ────────────────────────────────────────────── */
.filter-modal__body {
  padding: var(--space-lg);
  overflow-y: auto;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

/* ── Eintrags-Liste ─────────────────────────────────────────── */
.filter-modal__list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.filter-modal__item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-md);
  background: var(--light-bg);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  transition: background var(--transition);
}

.filter-modal__item:hover {
  background: var(--light-bg);
}

.filter-modal__item-name {
  font-size: 1rem;
  color: var(--color-text);
  flex: 1;
  min-width: 0;
  word-break: break-word;
}

.filter-modal__item-del {
  flex-shrink: 0;
}

.filter-modal__loading,
.filter-modal__empty {
  font-size: var(--font-size-sm);
  color: var(--soft-text);
  font-style: italic;
  padding: var(--space-sm) 0;
}

/* ── Hinzufügen-Formular ────────────────────────────────────── */
.filter-modal__add-form {
  border-top: 1px solid var(--border-soft);
  padding-top: var(--space-md);
  flex-shrink: 0;
}

.filter-modal__add-row {
  display: flex;
  gap: var(--space-sm);
  align-items: center;
}

.filter-modal__add-input {
  flex: 1;
  min-width: 0;
}

/* ── Fehlermeldung ──────────────────────────────────────────── */
.filter-modal__error {
  margin-top: var(--space-xs);
  font-size: var(--font-size-sm);
  color: var(--color-error);
}

/* ── Body-Scroll sperren wenn Modal offen ───────────────────── */
body.filter-modal-open {
  overflow: hidden;
}

/* ── Responsive: Mobile ─────────────────────────────────────── */
@media (max-width: 600px) {
  .filter-modal__box {
    max-height: 90vh;
    border-radius: var(--radius-sm);
  }

  .filter-modal__add-row {
    flex-direction: column;
    align-items: stretch;
  }

  .filter-modal__add-row .btn {
    width: 100%;
    justify-content: center;
  }
}


/* ── Filter-Modal: Inline-Edit (v3.1) ──────────────────────── */

/* Aktions-Container: Edit + Löschen nebeneinander */
.filter-modal__item-actions {
  display: flex;
  gap: var(--space-xs);
  flex-shrink: 0;
}

/* Editier-Inputfeld innerhalb eines Listeneintrags */
.filter-modal__item-input {
  flex: 1;
  min-width: 0;
  height: 2.25rem;
  padding: 0.3rem 0.6rem;
  font-size: 1rem;
}

/* Eintrag im Bearbeitungs-Modus: leichter Highlight */
.filter-modal__item--editing {
  background: var(--light-bg);
  border-color: var(--secondary);
}

/* Bearbeiten-Button: dezenter als Löschen */
.filter-modal__item-edit {
  white-space: nowrap;
}

/* Speichern/Abbrechen: kompakter */
.filter-modal__item-save,
.filter-modal__item-cancel {
  white-space: nowrap;
}


/* ── v3.2: form-label-row – Label + bearbeiten-Link in einer Zeile ── */
.form-label-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: var(--space-xs);
}

/* Label im Row-Kontext: kein eigenes margin-bottom mehr nötig */
.form-label-row .form-label {
  margin-bottom: 0;
}

/* bearbeiten-Link im Row-Kontext: kein margin-top mehr nötig */
.form-label-row .filter-edit-link {
  margin-top: 0;
  font-size: var(--font-size-sm);
}


/* ── Edit-Modus: Checkbox-Listen (Lernziele, Probleme, Hundetypen) ─ v3.3 ── */
.ex-checkbox-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.ex-checkbox-list__item {
  display: block;
}

.ex-checkbox-label {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  font-size: 1rem;
  color: var(--color-text);
  cursor: pointer;
  line-height: 1.4;
}

.ex-checkbox-label input[type="checkbox"] {
  flex-shrink: 0;
  width: 1rem;
  height: 1rem;
  margin-top: 0.1rem;
  accent-color: var(--primary);
  cursor: pointer;
}

.ex-checkbox-label:hover {
  color: var(--primary);
}

/* ═══════════════════════════════════════════════════════════════════════════
   Print-Layout – exercise_detail.php                             v6.0
   Migriert aus inline <style>-Block (war Regelverstoß).
   Alle @media print-Regeln zentral in style.css.
   ═══════════════════════════════════════════════════════════════════════════ */

/* Screen: Druckkopf + Druckfußzeile unsichtbar */
.print-header {
  display: none;
}
.print-footer {
  display: none;
}

/* Utility: Element per JS/PHP verstecken (ersetzt style="display:none;") */
.is-hidden {
  display: none !important;
}

/* Form-Group ohne unteren Abstand */
.form-group--no-margin {
  margin-bottom: 0;
}

/* Letztes Meta-Item im Druckkopf (ID) rechtsbündig */
.print-header__meta-item--last {
  margin-left: auto;
}

/* ── @media print ── */
@page {
  size: A4 portrait;
  margin: 10mm 12mm;
}

@media print {

  /* Druckkopf einblenden */
  .print-header {
    display: block;
    margin-bottom: 20pt;
  }

  /* Blauer Balken mit Logo + Vereinsname */
  .print-header__bar {
    background: var(--primary);
    color: var(--white);
    display: flex;
    align-items: center;
    gap: 14pt;
    padding: 10pt 16pt;
    border-radius: 6pt 6pt 0 0;
  }

  .print-header__logo {
    height: 46pt;
    width: auto;
    object-fit: contain;
    flex-shrink: 0;
    background: var(--white);
    border-radius: 4pt;
    padding: 3pt;
  }

  .print-header__brand {
    display: flex;
    flex-direction: column;
    gap: 2pt;
  }

  .print-header__name {
    font-size: 13pt;
    font-weight: 700;
    letter-spacing: 0.01em;
    color: var(--white);
  }

  .print-header__sub {
    font-size: 8pt;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: rgba(255,255,255,0.75);
  }

  .print-header__meta {
    background: var(--light-bg);
    border: 1pt solid var(--secondary);
    border-top: none;
    border-radius: 0 0 6pt 6pt;
    padding: 7pt 16pt;
    display: flex;
    gap: 18pt;
    flex-wrap: wrap;
    align-items: center;
  }

  .print-header__meta-item {
    font-size: 8pt;
    color: var(--primary);
  }

  .print-header__meta-item strong {
    font-weight: 600;
    margin-right: 3pt;
  }

  .print-header__meta-item--last {
    margin-left: auto;
  }

  .print-header__meta-badge {
    display: inline-block;
    background: var(--primary);
    color: var(--white);
    border-radius: 3pt;
    padding: 1pt 5pt;
    font-size: 7.5pt;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
  }

  /* Übungs-Titel im Print */
  .print-header__title {
    font-size: 16pt;
    font-weight: 700;
    color: var(--primary);
    margin: 14pt 0 4pt 0;
    line-height: 1.25;
  }

  .print-header__lead {
    font-size: 10pt;
    color: var(--soft-text);
    margin: 0 0 6pt 0;
  }

  /* Trennlinie */
  .print-header__divider {
    border: none;
    border-top: 1.5pt solid var(--primary);
    margin: 0 0 16pt 0;
    opacity: 0.25;
  }

  /* Druckfußzeile */
  .print-footer {
    display: flex;
    margin-top: 20pt;
    padding-top: 6pt;
    border-top: 0.75pt solid var(--secondary);
    font-size: 7.5pt;
    color: var(--soft-text);
    justify-content: space-between;
  }

  /* Allgemeine Print-Regeln */
  .no-print,
  .ex-actions,
  .ex-breadcrumb,
  .ex-header__action-group,
  .site-header,
  .site-footer,
  .site-nav,
  .nav-toggle,
  .ex-comments,
  .btn {
    display: none !important;
  }

  body {
    font-size: 9.5pt;
    color: var(--color-text);
    background: var(--white);
  }

  .container {
    max-width: 100%;
    padding: 0;
  }

  .ex-detail {
    padding-top: 0;
    padding-bottom: 0;
  }

  .ex-topbar {
    display: block;
  }

  .ex-body {
    display: grid;
    grid-template-columns: 62% 35%;
    grid-template-areas: "main aside";
    gap: 12pt;
  }

  .ex-header {
    display: none;
  }

  .ex-section__title {
    font-size: 10pt;
    font-weight: 700;
    color: var(--primary);
    border-bottom: 0.75pt solid var(--secondary);
    padding-bottom: 3pt;
    margin-bottom: 6pt;
  }

  .ex-steps {
    padding-left: 16pt;
    margin: 0;
  }

  .ex-steps__item {
    margin-bottom: 4pt;
    font-size: 9pt;
  }

  .ex-steps__num {
    display: inline-block;
    background: var(--primary);
    color: var(--white);
    border-radius: 50%;
    width: 14pt;
    height: 14pt;
    line-height: 14pt;
    text-align: center;
    font-size: 7pt;
    font-weight: 700;
    margin-right: 5pt;
    flex-shrink: 0;
  }

  .ex-meta-card {
    background: var(--light-bg);
    border: 0.75pt solid var(--secondary);
    border-radius: 5pt;
    padding: 7pt 9pt;
    margin-bottom: 7pt;
    break-inside: avoid;
  }

  .ex-meta-card__title {
    font-size: 7.5pt;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--primary);
    margin: 0 0 5pt 0;
  }

  .ex-meta-list {
    margin: 0;
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 2pt 8pt;
    font-size: 8.5pt;
  }

  .ex-meta-list dt {
    color: var(--soft-text);
    font-weight: 600;
  }

  .ex-meta-list dd {
    margin: 0;
    color: var(--color-text);
  }

  .ex-tag-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 3pt;
  }

  .tag {
    display: inline-block;
    background: var(--light-bg);
    color: var(--primary);
    border-radius: 3pt;
    padding: 1pt 5pt;
    font-size: 7.5pt;
    font-weight: 500;
    white-space: nowrap;
  }

  .ex-notes {
    font-size: 8.5pt;
    color: var(--soft-text);
    background: var(--bg-info-soft);
    border-left: 3pt solid var(--highlight);
    padding: 5pt 8pt;
    border-radius: 0 4pt 4pt 0;
  }

  .ex-source__author,
  .ex-source__link {
    font-size: 8pt;
    color: var(--soft-text);
  }

  .ex-keywords {
    font-size: 8pt;
    color: var(--soft-text);
  }

  /* Seitenumbruch */
  .ex-section {
    break-inside: avoid;
  }

  /* Sammlungs-Druckliste (collection_detail.php) */
  .coll-print-list {
    display: block;
    margin: 0;
    padding-left: 1.5em;
    break-before: avoid;
  }

  .coll-print-list__item {
    font-size: 9pt;
    line-height: 1.6;
    margin-bottom: 1.5mm;
    break-inside: avoid;
    color: #000;
  }

  .coll-print-list__cat {
    font-size: 8pt;
    color: #666;
    margin-left: 4pt;
  }
}


/* ── Admin-Tabs (users.php) – v6.2 ──────────────────────────────────────── */

.admin-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  border-bottom: 2px solid var(--border-soft);
}

.admin-tab {
  padding: 0.6rem 1.2rem;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--soft-text);
  font-family: var(--font-family);
  font-size: 1rem;
  font-weight: 400;
  cursor: pointer;
  margin-bottom: -2px;
  transition: color var(--transition), border-color var(--transition);
}

.admin-tab:hover {
  color: var(--primary);
}

.admin-tab--active {
  border-bottom-color: var(--primary);
  color: var(--primary);
  font-weight: 700;
}


/* ── Nav-User-Dropdown (header.php) – v6.9 ──────────────────────────────── */

.nav-user-dropdown {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.nav-user-dropdown__toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.85rem;
  background: rgba(255,255,255,0.12);
  border: 1.5px solid rgba(255,255,255,0.3);
  border-radius: var(--radius-sm);
  color: var(--white);
  font-family: var(--font-family);
  font-size: var(--font-size-sm);
  font-weight: 500;
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition);
  white-space: nowrap;
}

.nav-user-dropdown__toggle:hover {
  background: rgba(255,255,255,0.2);
  border-color: rgba(255,255,255,0.5);
}

.nav-user-dropdown__toggle .admin-badge {
  font-size: var(--font-size-tag);
  padding: 0.1rem 0.35rem;
}

.nav-user-dropdown__caret {
  font-size: var(--font-size-sm);
  opacity: 0.7;
  margin-left: 0.1rem;
}

.nav-user-dropdown__menu {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  background: var(--white);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md);
  min-width: 190px;
  z-index: 300;
  overflow: hidden;
  border: 1px solid var(--border-soft);
}

.nav-user-dropdown__item {
  display: block;
  width: 100%;
  padding: 0.7rem 1rem;
  color: var(--primary);
  font-size: 1rem;
  font-family: var(--font-family);
  text-decoration: none;
  background: none;
  border: none;
  border-bottom: 1px solid var(--border-soft);
  text-align: left;
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
  line-height: 1.4;
  box-sizing: border-box;
}

.nav-user-dropdown__item:last-child {
  border-bottom: none;
}

.nav-user-dropdown__item:hover {
  background: var(--light-bg);
  color: var(--primary-deep);
  text-decoration: none;
}

.nav-user-dropdown__item--danger {
  color: var(--color-error);
}

.nav-user-dropdown__item--danger:hover {
  background: var(--bg-error-soft);
  color: var(--color-error);
}


/* ═══════════════════════════════════════════════════════════
   Foto-Galerie – exercise_detail.php                  v8.0
   Mobile-first: 2 Spalten → 3 → 4 (Desktop)
   ═══════════════════════════════════════════════════════════ */

/* ── Sektion ────────────────────────────────────────────── */
.ex-gallery {
  grid-area: gallery;
  padding-bottom: var(--space-xl);
}

/* ── Grid ───────────────────────────────────────────────── */
.ex-gallery__grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-sm);
  margin-bottom: var(--space-lg);
}

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

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

/* ── Foto-Karte ─────────────────────────────────────────── */
.ex-gallery__item {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
  background: var(--light-bg);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

/* ── Thumbnail-Button ───────────────────────────────────── */
.ex-gallery__thumb-btn {
  display: block;
  width: 100%;
  padding: 0;
  border: none;
  background: none;
  cursor: pointer;
  line-height: 0;
}

.ex-gallery__thumb-img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  display: block;
  transition: opacity var(--transition);
}

.ex-gallery__thumb-btn:hover .ex-gallery__thumb-img,
.ex-gallery__thumb-btn:focus-visible .ex-gallery__thumb-img {
  opacity: 0.85;
}

/* ── Bildunterschrift ───────────────────────────────────── */
.ex-gallery__caption {
  font-size: var(--font-size-sm);
  color: var(--soft-text);
  padding: 0 var(--space-sm);
  margin: 0;
  line-height: 1.35;
}

/* ── Sortier- + Lösch-Buttons ───────────────────────────── */
.ex-gallery__controls {
  display: flex;
  gap: 2px;
  padding: var(--space-xs) var(--space-xs);
  background: rgba(55, 74, 32, 0.04);
  border-top: 1px solid var(--border-soft);
}

.ex-gallery__ctrl-form {
  margin: 0;
}

.ex-gallery__ctrl-spacer {
  display: inline-block;
  width: 28px;   /* entspricht btn--xs Breite */
}

/* Extra-kleiner Button */
.btn--xs {
  padding: 0.2rem 0.75rem;
  line-height: 1;
}

/* ── Leer-Hinweis ───────────────────────────────────────── */
.ex-gallery__empty {
  color: var(--soft-text);
  font-size: var(--font-size-sm);
  font-style: italic;
  margin-bottom: var(--space-md);
}

.ex-gallery__limit-note {
  color: var(--color-warning-text);
  font-size: var(--font-size-sm);
  margin-bottom: var(--space-md);
}

/* ── Upload-Formular ────────────────────────────────────── */
.ex-gallery__upload-form {
  margin-top: var(--space-md);
  padding: var(--space-sm) var(--space-md);
  background: var(--light-bg);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
}

.ex-gallery__upload-row {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  align-items: stretch;
}

@media (min-width: 640px) {
  .ex-gallery__upload-row {
    flex-direction: row;
    align-items: center;
  }
}

/* Datei-Auswahl als kompakter Button gestylt */
.ex-gallery__file-label {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  padding: 0.4rem 0.875rem;
  background: var(--white);
  border: 1.5px solid var(--secondary);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: var(--font-size-sm);
  font-weight: 600;
  color: var(--primary);
  transition: border-color var(--transition), background var(--transition);
  min-height: 44px;
  white-space: nowrap;
}

.ex-gallery__file-label:hover {
  border-color: var(--primary);
  background: var(--white);
}

.ex-gallery__file-icon {
  font-size: var(--font-size-sm);
  flex-shrink: 0;
  line-height: 1;
  font-weight: 700;
  color: var(--secondary);
}

.ex-gallery__file-text {
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 18ch;
}

/* Input visuell versteckt – Label-Klick löst trotzdem den Dialog aus */
.ex-gallery__file-input {
  display: none;
}

.ex-gallery__caption-input {
  flex: 1;
  min-width: 0;
  /* gleiche Höhe wie btn--sm: padding 0.4rem + line-height */
  padding-top: 0.4rem;
  padding-bottom: 0.4rem;
}

.ex-gallery__upload-hint {
  margin: var(--space-xs) 0 0 0;
  font-size: var(--font-size-sm);
  color: var(--soft-text);
}

/* ── Lightbox ───────────────────────────────────────────── */
.lb {
  position: fixed;
  inset: 0;
  z-index: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-md);
}

.lb[hidden] {
  display: none;
}

.lb__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 20, 35, 0.88);
  cursor: pointer;
}

.lb__box {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: min(600px, 92vw);
  width: 100%;
  z-index: 1;
}

.lb__img {
  display: block;
  max-width: 100%;
  max-height: 80vh;
  border-radius: var(--radius-sm);
  box-shadow: 0 8px 40px rgba(0,0,0,0.6);
  object-fit: contain;
  background: #000;
}

/* Schließen */
.lb__close {
  position: absolute;
  top: -2.5rem;
  right: 0;
  background: rgba(255,255,255,0.15);
  border: none;
  color: var(--white);
  font-size: 1rem;
  width: 2.2rem;
  height: 2.2rem;
  border-radius: 50%;
  cursor: pointer;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition);
}

.lb__close:hover {
  background: rgba(255,255,255,0.3);
}

/* Vor/Zurück */
.lb__nav {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255,255,255,0.12);
  border: none;
  color: var(--white);
  font-size: 2rem;
  width: 2.8rem;
  height: 4rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition);
  z-index: 2;
  min-height: 44px;
}

.lb__nav:hover {
  background: rgba(255,255,255,0.25);
}

.lb__prev { left: var(--space-sm); }
.lb__next { right: var(--space-sm); }

/* Caption */
.lb__caption {
  color: rgba(255,255,255,0.75);
  font-size: var(--font-size-sm);
  margin-top: var(--space-sm);
  text-align: center;
  max-width: 100%;
  word-break: break-word;
}

.lb__caption:empty {
  display: none;
}

/* Body-Scroll sperren wenn Lightbox offen */
body.lb-open {
  overflow: hidden;
}

.nav-user-dropdown__logout-form {
  margin: 0;
  padding: 0;
}

/* Anmelden-Button (nicht eingeloggt) */
.nav-user-btn,
.nav-user-btn:visited {
  color: rgba(255,255,255,0.85);
  text-decoration: none;
  padding: 0.4rem 0.85rem;
  border-radius: var(--radius-sm);
  border: 1.5px solid rgba(255,255,255,0.3);
  font-size: var(--font-size-sm);
  font-weight: 500;
  transition: background var(--transition), border-color var(--transition);
}

.nav-user-btn:hover {
  background: rgba(255,255,255,0.12);
  border-color: rgba(255,255,255,0.5);
  color: var(--white);
  text-decoration: none;
}


/* ── exercises-action-bar: Suchen-Icon + Neue-Übung-Icon ── */
.exercises-action-bar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-xs);
  margin-bottom: var(--space-md);
}

.exercises-action-bar__sep {
  width: 1px;
  height: 18px;
  background: var(--border-soft);
  margin: 0 var(--space-xs);
  flex-shrink: 0;
}

.exercises-action-bar__new-btn:hover {
  background: rgba(30, 126, 74, .06);
  border-color: rgba(30, 126, 74, .25);
  color: var(--color-success);
}

@media (max-width: 768px) {
  .exercises-action-bar {
    margin-bottom: var(--space-xs);
    gap: var(--space-xs);
  }
}


/* ═══════════════════════════════════════════════════════════
   Nutzerverwaltung – users.php
   ═══════════════════════════════════════════════════════════ */

/* Rollen-Tag direkt hinter dem Namen */
.users-role-tag {
  vertical-align: middle;
  margin-left: 0.35rem;
  font-size: var(--font-size-sm);
}

/* Status-Anzeige */
.users-status         { font-size: var(--font-size-sm); font-weight: 600; }
.users-status--active { color: var(--color-success); }
.users-status--inactive { color: var(--soft-text); }

/* Gedämpfte Zellen (Datum etc.) */
.users-cell--muted {
  color: var(--soft-text);
  font-size: var(--font-size-sm);
}

/* Eigener-Account-Hinweis */
.users-own-account {
  font-size: var(--font-size-sm);
  color: var(--soft-text);
  font-style: italic;
}

/* E-Mail-Spalte auf engen Screens ausblenden (Klasse auf th + td) */
@media (max-width: 860px) {
  .users-th--email { display: none; }
}

/* ── Aktionen-Container ─────────────────────────────────── */
.users-actions {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.4rem;
}

.users-action-form {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

/* Role-Select: kompakt, nicht full-width */
.users-role-select {
  width: auto;          /* überschreibt form-control width:100% */
  max-width: 110px;
  padding: 0.35rem 1.75rem 0.35rem 0.5rem; /* Platz für Chevron */
  font-size: var(--font-size-sm);
  height: auto;
}

/* ── Einladungs-Formular-Card ───────────────────────────── */
.invite-card {
  max-width: 520px;
}

.invite-card__title {
  margin-bottom: var(--space-sm);
}

.invite-card__hint {
  font-size: var(--font-size-sm);
  color: var(--soft-text);
  margin-bottom: var(--space-lg);
  line-height: var(--line-height);
}

/* ── Status-Filter-Checkbox (exercises.php, curator/admin) ─── */
.ex-status-filter-label {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-size: 1rem;
  color: var(--color-text);
  cursor: pointer;
  min-height: 44px;
}

.ex-status-filter-label input[type="checkbox"] {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  cursor: pointer;
}

/* ── Tag: Verändert nach Kuratierung ─────────────────────── */
.tag--changed {
  background: var(--bg-warning-soft);
  color: var(--color-warning-text);
  border: 1px solid var(--border-warning);
  border-radius: 20px;
  padding: 0.1em 0.55em;
  font-size: var(--font-size-tag);
  font-weight: 600;
  white-space: nowrap;
  display: inline-block;
  vertical-align: middle;
}

/* ── Audit-Sektion (exercise_detail.php, curator/admin) ───── */
.ex-audit {
  margin-top: var(--space-xl);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--white);
}

/* Panel-Kopfzeile */
.ex-audit__header {
  display: flex;
  align-items: center;
  padding: 0.45rem var(--space-md);
  background: rgba(55, 74, 32, 0.05);
  border-bottom: 1px solid var(--border-soft);
}

.ex-audit__title {
  font-size: var(--font-size-sm);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--soft-text);
}

/* Inhalts-Bereich */
.ex-audit__body {
  padding: 0;
}

/* Kompakt-Infos: Erstellt von / Kuratiert von */
.ex-audit__meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  margin-bottom: var(--space-md);
}

.ex-audit__meta-item {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  background: var(--light-bg);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  padding: 0.4rem 0.75rem;
  min-width: 140px;
}

.ex-audit__meta-label {
  font-size: var(--font-size-sm);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--soft-text);
}

.ex-audit__meta-value {
  font-size: 1rem;
  color: var(--color-text);
  font-weight: 400;
  display: flex;
  align-items: baseline;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.ex-audit__meta-date {
  font-size: var(--font-size-sm);
  color: var(--soft-text);
  font-weight: 400;
}

/* Divider-Label vor der Tabelle */
.ex-audit__log-label {
  font-size: var(--font-size-sm);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--soft-text);
  margin-bottom: var(--space-sm);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.ex-audit__log-label::before {
  content: '';
  display: block;
  height: 1px;
  width: 1.5rem;
  background: var(--border-soft);
  flex-shrink: 0;
}

.ex-audit__log-label::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border-soft);
}

.ex-audit__empty {
  font-size: var(--font-size-sm);
  color: var(--soft-text);
  font-style: italic;
  padding: var(--space-md);
}

/* Tabelle */
.ex-audit-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.ex-audit-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--font-size-sm);
}

.ex-audit-table__col-time   { width: 12rem; }
.ex-audit-table__col-user   { width: 9rem; }
.ex-audit-table__col-action { }

.ex-audit-table th {
  padding: 0.4rem 0.9rem;
  text-align: left;
  background: var(--light-bg);
  color: var(--soft-text);
  font-size: var(--font-size-sm);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 1px solid var(--border-soft);
  white-space: nowrap;
}

.ex-audit-table td {
  padding: 0.5rem 0.9rem;
  border-bottom: 1px solid var(--border-soft);
  vertical-align: middle;
}

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

.ex-audit-table tbody tr:hover td {
  background: var(--light-bg);
}

/* Datum-Spalte: Tag + Uhrzeit getrennt */
.ex-audit-table__cell-time {
  white-space: nowrap;
  color: var(--color-text);
}

.ex-audit-table__time {
  display: inline-block;
  margin-left: 0.25rem;
  color: var(--soft-text);
  font-size: var(--font-size-sm);
}

/* Aktion-Badges */
.ex-audit-table__action-badge {
  display: inline-block;
  padding: 0.15em 0.55em;
  border-radius: 20px;
  font-size: var(--font-size-sm);
  font-weight: 600;
  white-space: nowrap;
  border: 1px solid transparent;
}

.ex-audit-table__action--created {
  background: var(--bg-success-soft);
  color: var(--color-success-text);
  border-color: var(--border-success);
}

.ex-audit-table__action--edited {
  background: var(--light-bg);
  color: var(--primary);
  border-color: var(--border-soft);
}

.ex-audit-table__action--curated {
  background: var(--bg-success-soft);
  color: var(--color-success-text);
  border-color: var(--border-success);
}

.ex-audit-table__action--decurated {
  background: var(--bg-warning-soft);
  color: var(--color-warning-text);
  border-color: var(--border-warning);
}


/* === KONTAKT / FEEDBACK ==================================== */

/* ── Hero-Header ─────────────────────────────────────────── */
.contact-hero {
  text-align: center;
  padding: var(--space-xl) 0 var(--space-2xl);
}

.contact-hero__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--primary);
  color: var(--white);
  margin-bottom: var(--space-md);
  box-shadow: var(--shadow-md);
}

.contact-hero__title {
  font-size: var(--font-size-h1);
  color: var(--primary);
  margin: 0 0 var(--space-sm);
}

.contact-hero__sub {
  color: var(--soft-text);
  font-size: 1rem;
  max-width: 480px;
  margin: 0 auto;
  line-height: 1.6;
}

/* ── Erfolgs-Banner ──────────────────────────────────────── */
.contact-success {
  display: flex;
  align-items: flex-start;
  gap: var(--space-md);
  background: var(--bg-success-soft);
  border: 1px solid var(--border-success);
  border-left: 4px solid var(--color-success);
  border-radius: var(--radius-sm);
  padding: var(--space-md) var(--space-lg);
  color: var(--color-success-text);
  margin-bottom: var(--space-xl);
  font-size: var(--font-size-sm);
}

.contact-success--full {
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: var(--space-2xl) var(--space-xl);
  border-left: none;
  border-top: 4px solid var(--color-success);
  border-radius: var(--radius-md);
  margin-bottom: 0;
}

.contact-success__icon {
  flex-shrink: 0;
  color: var(--color-success);
  margin-top: 1px;
}

.contact-success strong {
  display: block;
  margin-bottom: 2px;
  font-size: 1rem;
}

/* ── Formular-Card ───────────────────────────────────────── */
.contact-card {
  background: var(--white);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  padding: var(--space-xl) var(--space-lg);
  max-width: 700px;
  margin: 0 auto var(--space-2xl);
}

/* ── Zweispaltig: Name + E-Mail ──────────────────────────── */
.contact-form__row {
  display: flex;
  flex-direction: column;
  gap: 0;
}

/* ── Feld mit führendem Icon ─────────────────────────────── */
.contact-form__field-wrap {
  position: relative;
}

.contact-form__field-icon {
  position: absolute;
  left: 0.875rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--soft-text);
  pointer-events: none;
  transition: color var(--transition);
}

.contact-form__field {
  padding-left: 2.6rem;
}

.contact-form__field-wrap:focus-within .contact-form__field-icon {
  color: var(--primary);
}

/* ── Textarea ────────────────────────────────────────────── */
.contact-form__textarea {
  resize: vertical;
  min-height: 180px;
  line-height: 1.6;
}

/* ── Zeichenanzahl-Hinweis ───────────────────────────────── */
.contact-form__hint {
  font-size: var(--font-size-sm);
  color: var(--soft-text);
  margin: var(--space-xs) 0 0;
  text-align: right;
}

/* ── Footer-Zeile: Pflichtfeld-Hinweis + Sende-Button ────── */
.contact-form__footer {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: var(--space-sm);
  margin-top: var(--space-lg);
  padding-top: var(--space-lg);
  border-top: 1px solid var(--border-soft);
}

.contact-form__required-note {
  font-size: var(--font-size-sm);
  color: var(--soft-text);
  margin: 0;
}

.contact-form__required {
  color: var(--color-error);
  font-weight: 700;
}

.contact-form__submit {
  width: 100%;
  gap: var(--space-sm);
  font-size: 1rem;
  padding: 0.8rem 1.5rem;
  min-height: 52px;
}

@media (min-width: 600px) {
  .contact-card {
    padding: var(--space-2xl);
  }

  .contact-form__row {
    flex-direction: row;
    gap: var(--space-md);
  }

  .contact-form__row .form-group {
    flex: 1;
    min-width: 0;
  }

  .contact-form__footer {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }

  .contact-form__submit {
    width: auto;
    min-width: 200px;
  }
}

/* ── Feedback-Posteingang (Admin) ─────────────────────────── */
.feedback-inbox {
  margin-top: var(--space-2xl);
  padding-top: var(--space-xl);
  border-top: 2px solid var(--border-soft);
}

.feedback-inbox__heading {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-size: var(--font-size-h2);
  color: var(--primary);
  margin: 0 0 var(--space-lg);
}

.feedback-inbox__count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--secondary);
  color: var(--white);
  font-size: var(--font-size-sm);
  font-weight: 700;
  border-radius: 999px;
  min-width: 1.6rem;
  height: 1.6rem;
  padding: 0 0.4rem;
}

.feedback-inbox__list {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.feedback-card {
  background: var(--white);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
  padding: var(--space-sm) var(--space-md);
  border-left: 3px solid var(--primary);
}

.feedback-card--read {
  border-left-color: var(--border-soft);
  opacity: 0.75;
}

.feedback-card__actions {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  flex-shrink: 0;
}

.feedback-card__unread-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--primary);
  flex-shrink: 0;
}

.feedback-card__header {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
  margin-bottom: var(--space-xs);
}

.feedback-card__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.4rem;
  font-size: var(--font-size-sm);
}

.feedback-card__name {
  font-weight: 700;
  color: var(--primary);
}

.feedback-card__email {
  color: var(--soft-text);
}

.feedback-card__email:hover {
  color: var(--primary);
}

.feedback-card__account {
  color: var(--soft-text);
  font-style: italic;
}

.feedback-card__date {
  font-size: var(--font-size-sm);
  color: var(--soft-text);
}

.feedback-card__subject {
  font-size: 1rem;
  font-weight: 700;
  color: var(--primary);
  margin: 0 0 var(--space-xs);
}

.feedback-card__message {
  font-size: 1rem;
  line-height: var(--line-height);
  color: var(--color-text);
  white-space: pre-wrap;
  word-break: break-word;
}

@media (min-width: 600px) {
  .feedback-card__header {
    flex-direction: row;
    justify-content: space-between;
    align-items: flex-start;
  }
}


/* === ADMIN-SUBNAVIGATION ================================== */

.admin-subnav {
  background: var(--white);
  border-bottom: 1px solid var(--border-soft);
  box-shadow: var(--shadow-sm);
}

.admin-subnav .container {
  display: flex;
  gap: 0;
  overflow-x: auto;
  scrollbar-width: none;
  padding-block: 0;
}

.admin-subnav .container::-webkit-scrollbar {
  display: none;
}

.admin-subnav__link,
.admin-subnav__link:visited {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.7rem 1.1rem;
  color: var(--soft-text);
  font-size: var(--font-size-sm);
  font-weight: 400;
  text-decoration: none;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
  transition: color var(--transition), border-color var(--transition), background var(--transition);
}

.admin-subnav__link:hover {
  color: var(--primary);
  background: var(--light-bg);
  text-decoration: none;
}

.admin-subnav__link.is-active {
  color: var(--primary);
  border-bottom-color: var(--highlight);
  font-weight: 600;
}

@keyframes badge-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(242, 184, 75, 0.55); }
  50%       { box-shadow: 0 0 0 5px rgba(242, 184, 75, 0); }
}

.admin-subnav__badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--highlight);
  color: var(--primary-deep);
  font-size: var(--font-size-tag);
  font-weight: 700;
  min-width: 18px;
  height: 18px;
  border-radius: 999px;
  padding: 0 4px;
  line-height: 1;
  animation: badge-pulse 2.8s ease-in-out infinite;
}

/* === ADMIN-DASHBOARD ====================================== */

.dash-kpis {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: var(--space-md);
  margin-bottom: var(--space-xl);
}

.dash-kpi {
  background: var(--white);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
  padding: var(--space-lg) var(--space-md);
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.dash-kpi__value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--primary);
  line-height: 1;
}

.dash-kpi__label {
  font-size: var(--font-size-sm);
  color: var(--soft-text);
}

.dash-kpi--success .dash-kpi__value { color: var(--color-success); }
.dash-kpi--warn    .dash-kpi__value { color: var(--color-error); }
.dash-kpi--neutral .dash-kpi__value { color: var(--soft-text); }

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

.dash-section__title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--primary);
  margin: 0 0 var(--space-md);
  padding-bottom: var(--space-sm);
  border-bottom: 1px solid var(--border-soft);
}

.dash-list {
  list-style: none;
  margin: 0;
  padding: 0;
  background: var(--white);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.dash-list__item {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: 0.65rem var(--space-md);
  border-bottom: 1px solid var(--border-soft);
  font-size: var(--font-size-sm);
}

.dash-list__item:last-child {
  border-bottom: none;
}

.dash-list__item a {
  color: var(--primary);
  font-weight: 500;
}

.dash-list__meta {
  color: var(--soft-text);
  margin-left: auto;
  white-space: nowrap;
}

.dash-list__tag {
  font-size: var(--font-size-tag);
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  background: var(--light-bg);
  color: var(--primary);
  border: 1px solid var(--border-soft);
  white-space: nowrap;
}

.dash-empty {
  color: var(--soft-text);
  font-size: var(--font-size-sm);
  font-style: italic;
  padding: var(--space-md);
  background: var(--white);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
}

.dash-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-xl);
}

.dash-grid > * {
  min-width: 0;
}

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

.dash-grid--wide {
  grid-template-columns: 3fr 2fr;
}

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

/* === DASHBOARD SUB-HEADING ================================ */
.dash-sub-heading {
  font-size: var(--font-size-sm);
  font-weight: 600;
  color: var(--primary);
  margin: 0 0 var(--space-sm);
  display: flex;
  align-items: baseline;
  gap: 0.4rem;
}

.dash-sub-heading__note {
  font-size: var(--font-size-sm);
  font-weight: 400;
  color: var(--soft-text);
}

/* === LOGIN-ATTEMPTS TABLE ================================= */
.atm-table-wrap {
  overflow-x: auto;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-soft);
  background: var(--white);
}

.atm-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--font-size-sm);
  min-width: 560px;
}

.atm-table thead th {
  background: var(--light-bg);
  color: var(--soft-text);
  font-size: var(--font-size-sm);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.45rem 0.75rem;
  border-bottom: 1px solid var(--border-soft);
  white-space: nowrap;
  text-align: left;
}

.atm-table tbody tr {
  border-bottom: 1px solid var(--border-soft);
  transition: background var(--transition);
}

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

@media (hover: hover) {
  .atm-table tbody tr:hover {
    background: var(--light-bg);
  }
}

.atm-table td {
  padding: 0.5rem 0.75rem;
  vertical-align: middle;
  white-space: nowrap;
}

.atm-email {
  font-family: monospace;
  font-size: 0.875rem;
  color: var(--primary);
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.atm-mono {
  font-family: monospace;
  font-size: 0.875rem;
  color: var(--soft-text);
}

.atm-country strong {
  font-family: monospace;
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--primary);
}

.atm-none {
  color: var(--soft-text);
}

.atm-time {
  font-size: var(--font-size-sm);
  color: var(--soft-text);
}

/* Sidebar-Blöcke im Sicherheits-Panel */
.dash-security-sidebar {
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
}

.dash-sidebar-block {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.atm-country-code {
  font-weight: 700;
  color: var(--primary);
  min-width: 2.5rem;
}

.atm-country-stats {
  font-size: var(--font-size-sm);
  color: var(--soft-text);
  display: flex;
  gap: 0.5rem;
  align-items: center;
  flex-wrap: wrap;
}

.atm-stat-fail {
  color: var(--color-error);
}

.atm-stat-ok {
  color: var(--color-success);
}

.atm-blocked {
  color: var(--color-error) !important;
}

.atm-action {
  width: 2rem;
  text-align: right;
  padding-right: 0.5rem;
}

.atm-delete-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.4rem;
  height: 1.4rem;
  border: none;
  background: transparent;
  color: var(--soft-text);
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  border-radius: var(--radius-sm);
  opacity: 0;
  transition: opacity var(--transition), color var(--transition), background var(--transition);
}

@media (hover: hover) {
  .atm-table tbody tr:hover .atm-delete-btn {
    opacity: 1;
  }
  .atm-delete-btn:hover {
    color: var(--color-error);
    background: rgba(192, 57, 43, 0.08);
  }
}

.atm-delete-btn:disabled {
  opacity: 0.3;
  cursor: default;
}

/* === LIKE-BUTTON ========================================== */
.like-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.9rem;
  border: 1px solid var(--border-soft);
  background: var(--white);
  border-radius: 999px;
  cursor: pointer;
  font-size: var(--font-size-sm);
  font-weight: 500;
  color: var(--soft-text);
  transition: color var(--transition), border-color var(--transition), background var(--transition);
  min-height: 36px;
  white-space: nowrap;
}

@media (hover: hover) {
  .like-btn:hover {
    color: var(--color-error);
    border-color: rgba(192, 57, 43, 0.4);
    background: rgba(192, 57, 43, 0.04);
  }
}

.like-btn.is-liked {
  color: var(--color-error);
  border-color: rgba(192, 57, 43, 0.35);
  background: rgba(192, 57, 43, 0.06);
}

@keyframes like-pop {
  0%   { transform: scale(1); }
  25%  { transform: scale(1.55); }
  55%  { transform: scale(0.82); }
  78%  { transform: scale(1.12); }
  100% { transform: scale(1); }
}

.like-btn__icon {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
  transition: fill var(--transition-fast), stroke var(--transition-fast);
}

.like-btn__icon.is-popping {
  animation: like-pop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Kompakte Variante für Listen (kein Label, nur Icon) */
.like-btn--compact {
  padding: 0.3rem 0.45rem;
  min-height: 44px;
  min-width: 44px;
  border-color: transparent;
  background: transparent;
}

@media (hover: hover) {
  .like-btn--compact:hover {
    border-color: rgba(192, 57, 43, 0.3);
    background: rgba(192, 57, 43, 0.04);
  }
}

.like-btn--compact.is-liked {
  border-color: transparent;
  background: transparent;
}

.like-btn:disabled {
  opacity: 0.5;
  cursor: default;
}

/* ex-header: Titel links, Action-Buttons rechts – gleiche Zeile */
.ex-header__title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-md);
  flex-wrap: wrap;
}
.ex-header__title-row .ex-header__title {
  flex: 1;
  min-width: 0;
}
.ex-header__meta {
  margin-top: var(--space-sm);
}

/* === MEIN BEREICH ========================================= */
.my-area-subnav {
  background: var(--white);
  border-bottom: 1px solid var(--border-soft);
  box-shadow: var(--shadow-sm);
}

.my-area-subnav .container {
  display: flex;
  gap: 0;
  overflow-x: auto;
  scrollbar-width: none;
  padding-block: 0;
}

.my-area-subnav .container::-webkit-scrollbar {
  display: none;
}

.my-area-subnav__link,
.my-area-subnav__link:visited {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.7rem 1.1rem;
  color: var(--soft-text);
  font-size: var(--font-size-sm);
  font-weight: 400;
  text-decoration: none;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
  transition: color var(--transition), border-color var(--transition), background var(--transition);
}

.my-area-subnav__link:hover {
  color: var(--primary);
  background: var(--light-bg);
  text-decoration: none;
}

.my-area-subnav__link.is-active {
  color: var(--primary);
  border-bottom-color: var(--highlight);
  font-weight: 600;
}

.my-area-subnav__badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--highlight);
  color: var(--primary-deep);
  font-size: var(--font-size-tag);
  font-weight: 700;
  min-width: 1.25rem;
  height: 1.25rem;
  padding: 0 0.3rem;
  border-radius: 999px;
  line-height: 1;
  animation: badge-pulse 2.8s ease-in-out infinite;
}

.my-area-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-xl) var(--space-md);
  text-align: center;
}

.my-area-empty__icon {
  color: var(--secondary);
  opacity: 0.6;
}

.my-area-empty__text {
  color: var(--soft-text);
  font-size: 1rem;
  margin: 0;
}

.my-area-empty__hint {
  color: var(--soft-text);
  font-size: var(--font-size-sm);
  margin: 0;
}

/* ── Ähnliche Übungen (exercise_detail.php) ─────────────────── */
.ex-related {
  margin-top: var(--space-xl);
}

.ex-related__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-sm);
  margin-top: var(--space-md);
}

@media (min-width: 600px) {
  .ex-related__grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

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

.ex-related__card {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
  padding: var(--space-md);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  background: var(--light-bg);
  text-decoration: none;
  color: inherit;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.ex-related__card:focus-visible {
  border-color: var(--secondary);
  box-shadow: var(--shadow-sm);
  text-decoration: none;
  outline: none;
}
@media (hover: hover) {
  .ex-related__card:hover {
    border-color: var(--secondary);
    box-shadow: var(--shadow-sm);
    text-decoration: none;
  }
}

.ex-related__card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs);
  min-height: 1.4rem;
}

.ex-related__card-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--primary);
  line-height: 1.35;
}

.ex-related__card--auto {
  opacity: 0.85;
}

.ex-related__card-wrap {
  position: relative;
  display: flex;
  flex-direction: column;
}

.ex-related__card-wrap > .ex-related__card {
  flex: 1;
}

.ex-related__remove {
  position: absolute;
  top: 0.35rem;
  right: 0.35rem;
  width: 1.4rem;
  height: 1.4rem;
  border: none;
  border-radius: 50%;
  background: var(--primary);
  color: var(--white);
  font-size: var(--font-size-sm);
  line-height: 1;
  cursor: pointer;
  opacity: 0;
  transition: opacity var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.ex-related__card-wrap:focus-within .ex-related__remove {
  opacity: 1;
}
@media (hover: hover) {
  .ex-related__card-wrap:hover .ex-related__remove {
    opacity: 1;
  }
}

.ex-related__empty {
  color: var(--soft-text);
  font-size: var(--font-size-sm);
  margin-top: var(--space-sm);
}

.ex-related__add-form {
  margin-top: var(--space-lg);
  padding-top: var(--space-md);
  border-top: 1px solid var(--border-soft);
}

.ex-related__add-label {
  display: block;
  font-size: var(--font-size-sm);
  font-weight: 600;
  color: var(--soft-text);
  margin-bottom: var(--space-sm);
}

.ex-related__add-row {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

@media (min-width: 600px) {
  .ex-related__add-row {
    flex-direction: row;
    align-items: center;
  }
  .ex-related__select {
    flex: 1;
  }
}

.ex-related__add-error {
  color: var(--color-error);
  font-size: var(--font-size-sm);
  margin-top: var(--space-xs);
}

/* ============================================================
   SAMMLUNGEN (collections.php, collection_detail.php, my_collections.php)
   ============================================================ */

/* Karten-Grid */
.coll-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}
@media (min-width: 600px) {
  .coll-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 960px) {
  .coll-grid { grid-template-columns: repeat(3, 1fr); }
}

/* Einzelne Karte */
.coll-card {
  background: var(--white);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
  padding: 1rem 1.1rem;
  display: flex;
  flex-direction: column;
  gap: .5rem;
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition);
}
@media (hover: hover) {
  .coll-card:hover {
    box-shadow: var(--shadow-md);
  }
}
.coll-card__head {
  display: flex;
  align-items: center;
  gap: .4rem;
  flex-wrap: wrap;
  min-height: 28px;
}
.coll-card__head .like-btn {
  margin-left: auto;
}
.coll-card__title {
  font-weight: 700;
  color: var(--primary);
  font-size: 1rem;
  text-decoration: none;
  line-height: 1.35;
}
@media (hover: hover) {
  .coll-card__title:hover {
    text-decoration: underline;
  }
}
.coll-card__desc {
  font-size: var(--font-size-sm);
  color: var(--soft-text);
  line-height: 1.5;
  flex: 1;
}
.coll-card__meta {
  display: flex;
  gap: 1rem;
  font-size: var(--font-size-sm);
  color: var(--soft-text);
}
.coll-card__actions {
  display: flex;
  gap: .5rem;
  flex-wrap: wrap;
  margin-top: .25rem;
}

/* "Zur Sammlung"-Dropdown auf exercise_detail.php */
.ex-header__action-group {
  display: flex;
  align-items: center;
  gap: .75rem;
  flex-wrap: wrap;
}
.coll-add-wrap {
  position: relative;
}
.coll-add-panel {
  position: absolute;
  right: 0;
  top: calc(100% + .5rem);
  min-width: 220px;
  max-width: 300px;
  background: var(--white);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md);
  z-index: 200;
  padding: .5rem 0;
}
.coll-add-panel__label {
  font-size: var(--font-size-sm);
  color: var(--soft-text);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  padding: .25rem .75rem .1rem;
}
.coll-add-panel__item {
  display: flex;
  align-items: center;
  gap: .5rem;
  width: 100%;
  text-align: left;
  padding: .45rem .75rem;
  font-size: var(--font-size-sm);
  color: var(--color-text);
  background: none;
  border: none;
  cursor: pointer;
  transition: background var(--transition);
}
.coll-add-panel__item:hover {
  background: var(--light-bg);
}
.coll-add-panel__item.is-in-collection {
  color: var(--primary);
  font-weight: 700;
}
.coll-add-panel__check {
  flex-shrink: 0;
  width: 1em;
  color: var(--secondary);
}
.coll-add-panel__item.is-in-collection .coll-add-panel__check {
  color: var(--primary);
}
.coll-add-panel__empty {
  padding: .75rem;
  font-size: var(--font-size-sm);
  color: var(--soft-text);
  line-height: 1.5;
}

/* ── Icon-Buttons (tabellenintegriert) ── */
.icon-btn-group {
  display: flex;
  align-items: center;
  gap: .375rem;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  min-width: 44px;
  min-height: 44px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--soft-text);
  cursor: pointer;
  text-decoration: none;
  transition: background var(--transition), color var(--transition), border-color var(--transition);
  flex-shrink: 0;
}

.icon-btn svg {
  display: block;
  pointer-events: none;
}

.icon-btn:hover {
  background: var(--light-bg);
  border-color: var(--border-soft);
  color: var(--primary);
}

.icon-btn--danger:hover {
  background: rgba(192, 57, 43, .06);
  border-color: rgba(192, 57, 43, .25);
  color: var(--color-error);
}

.icon-btn--success:hover {
  background: rgba(30, 126, 74, .06);
  border-color: rgba(30, 126, 74, .25);
  color: var(--color-success);
}

/* ── Share-Wrap + Panel ─────────────────────────────────────── */
.share-wrap {
  position: relative;
}

.share-panel {
  position: absolute;
  right: 0;
  top: calc(100% + .5rem);
  min-width: 300px;
  max-width: 360px;
  background: var(--white);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md);
  z-index: 200;
  padding: var(--space-md);
}

.share-panel--left {
  right: auto;
  left: 0;
}

.share-panel__input {
  margin-bottom: var(--space-xs);
}

.share-panel__submit {
  width: 100%;
  margin-top: var(--space-sm);
}

.share-panel__error {
  color: var(--color-error);
  font-size: var(--font-size-sm);
  margin-top: var(--space-xs);
}

/* .share-panel__result-footer entfernt – ersetzt durch .share-expiry */

.share-panel__new-link {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--primary);
  font-size: var(--font-size-sm);
  text-decoration: underline;
  padding: 0;
}

.share-url-box {
  display: flex;
  gap: var(--space-xs);
  align-items: center;
}

.share-url-input {
  flex: 1;
  min-width: 0;
  font-size: var(--font-size-sm);
  color: var(--soft-text);
  background: var(--light-bg);
  cursor: text;
}

.share-panel__notice {
  background: var(--light-bg);
  border-radius: var(--radius-sm);
  padding: var(--space-xs) var(--space-sm);
  margin: 0 0 var(--space-sm);
  line-height: 1.4;
}

.share-section-label {
  margin: 0 0 var(--space-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .05em;
}

.share-new-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.share-new-form .share-panel__submit {
  margin-top: var(--space-xs);
}

.share-recipient-section {
  margin-top: var(--space-sm);
  padding-top: var(--space-sm);
  border-top: 1px solid var(--border-soft);
}

.share-expiry {
  margin: var(--space-xs) 0 0;
}

.share-url-box .js-share-copy {
  color: var(--primary);
}

.share-panel__loading {
  padding: var(--space-sm) 0;
  text-align: center;
}

.share-qr {
  display: flex;
  justify-content: center;
  margin: 0 auto var(--space-md);
}

.share-qr canvas,
.share-qr img {
  display: block;
  width: 168px !important;
  height: 168px !important;
  border-radius: 6px;
}

/* Share-Panel: Listenansicht */
.share-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.share-list__item {
  border: 1px solid var(--border-soft);
  border-radius: 6px;
  padding: var(--space-xs) var(--space-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  transition: background 0.1s;
}

.share-list__item:hover {
  background: var(--light-bg);
}

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

.share-list__item-name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.share-list__chevron {
  color: var(--border-soft);
  flex-shrink: 0;
  pointer-events: none;
}

.share-list__empty {
  color: var(--soft-text);
  font-size: var(--font-size-sm);
  margin: 0 0 var(--space-xs);
}

.share-panel__create-new {
  width: 100%;
  margin-top: var(--space-xs);
}

/* Share-Panel: Zurück-Button */
.share-panel__back {
  background: none;
  border: none;
  color: var(--soft-text);
  font-size: var(--font-size-sm);
  cursor: pointer;
  padding: 0;
  margin-bottom: var(--space-sm);
}

.share-panel__back:hover {
  color: var(--color-text);
}

.share-comment-section {
  margin-top: var(--space-xs);
}

.share-email-section {
  margin-top: var(--space-sm);
  padding-top: var(--space-sm);
  border-top: 1px solid var(--border-soft);
}

/* .share-email-section__label und .share-recipient-section__label
   wurden zu .share-section-label zusammengeführt */

.share-panel__success,
.share-panel__save-ok {
  color: #166534;
  font-size: var(--font-size-sm);
  margin-top: var(--space-xs);
}

.share-panel__comment {
  min-height: 72px;
  resize: vertical;
}

.js-share-copy.copy-ok {
  color: #166534;
}


/* ── Shared-Ansicht (pages/shared.php) ─────────────────────── */
.shared-banner {
  background: var(--light-bg);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  padding: var(--space-sm) var(--space-md);
  margin-bottom: var(--space-md);
  color: var(--soft-text);
}

.shared-comment {
  background: var(--bg-info-soft);
  border: 1px solid var(--border-info);
  border-radius: var(--radius-sm);
  padding: var(--space-sm) var(--space-md);
  margin-bottom: var(--space-xl);
}

.shared-comment__label {
  margin: 0 0 .4rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--color-info-text);
}

.shared-comment__text {
  margin: 0;
}

.shared-error {
  text-align: center;
  padding: var(--space-2xl) 0;
  color: var(--soft-text);
}

.shared-error__icon {
  color: var(--border-soft);
  margin-bottom: var(--space-md);
}

.shared-error__title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: var(--space-sm);
}

.shared-error__text {
  font-size: 1rem;
  color: var(--soft-text);
}

.shared-coll-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.shared-coll-list__item {
  display: flex;
  gap: var(--space-md);
  padding: var(--space-md);
  background: var(--light-bg);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-soft);
}

.shared-coll-list__num {
  flex-shrink: 0;
  width: 2rem;
  height: 2rem;
  background: var(--primary);
  color: var(--white);
  border-radius: 50%;
  font-size: var(--font-size-sm);
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.shared-coll-list__body {
  flex: 1;
  min-width: 0;
}

.shared-cta {
  margin-top: var(--space-2xl);
  padding-top: var(--space-xl);
  text-align: center;
  color: var(--soft-text);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-sm);
}

/* ── Admin-Shares-Seite ─────────────────────────────────────── */
.shares-kpi-row {
  display: flex;
  gap: var(--space-lg);
  margin-bottom: var(--space-xl);
  flex-wrap: wrap;
}

.shares-kpi {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: var(--light-bg);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  padding: var(--space-md) var(--space-xl);
  min-width: 80px;
}

.shares-kpi__num {
  font-size: 2rem;
  font-weight: 700;
  color: var(--primary);
  line-height: 1.2;
}

.shares-kpi__label {
  margin-top: .2rem;
}

.shares-filter {
  display: flex;
  gap: var(--space-xs);
  flex-wrap: wrap;
  margin-bottom: var(--space-lg);
}

.shares-resource,
.shares-recipient,
.shares-views {
  display: flex;
  flex-direction: column;
  gap: .2rem;
}

.shares-th--num    { text-align: center; }
.shares-th--action { text-align: right; }

.shares-cell--num {
  text-align: center;
  vertical-align: middle;
}

.shares-cell--action {
  text-align: right;
  vertical-align: middle;
}

.shares-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.shares-status {
  font-size: var(--font-size-sm);
  font-weight: 600;
  padding: .15rem .5rem;
  border-radius: 999px;
  white-space: nowrap;
}

.shares-status--active  { background: rgba(30, 126, 74, .1); color: var(--color-success); }
.shares-status--expired { background: var(--light-bg);    color: var(--soft-text); }
.shares-status--revoked { background: rgba(192,57,43,.08); color: var(--color-error); }

.shares-actions {
  display: flex;
  gap: var(--space-xs);
  justify-content: flex-end;
  align-items: center;
}

.sql-table__row--muted td {
  opacity: .55;
}

/* ── Sammlungsliste (collections.php + my_collections.php) ── */
.coll-list {
  list-style: none;
  padding: 0;
  margin: 0;
  border-top: 1px solid var(--border-soft);
}

.coll-list__item {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .75rem 0;
  border-bottom: 1px solid var(--border-soft);
}

.coll-list__main {
  flex: 1;
  min-width: 0;
}

.coll-list__title {
  font-weight: 700;
  color: var(--color-text);
  text-decoration: none;
  display: block;
  line-height: 1.3;
  margin-bottom: .2rem;
}

@media (hover: hover) {
  .coll-list__title:hover { color: var(--primary); }
}

.coll-list__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .2rem .4rem;
  margin-bottom: .25rem;
}

.coll-list__count {
  font-size: var(--font-size-sm);
  color: var(--soft-text);
  white-space: nowrap;
}

.coll-list__desc {
  font-size: var(--font-size-sm);
  color: var(--soft-text);
  margin: 0;
  line-height: 1.4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.coll-list__owner {
  font-size: var(--font-size-sm);
  color: var(--soft-text);
}

.coll-list__actions {
  flex-shrink: 0;
  align-self: center;
}

/* === COLL-LIST MOBILE (collections.php + my_collections.php) ====== */
@media (max-width: 600px) {
  .coll-list {
    border-top: none;
  }

  .coll-list__item {
    flex-direction: column;
    align-items: stretch;
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-sm);
    margin-bottom: var(--space-sm);
    padding: var(--space-md);
    box-shadow: var(--shadow-sm);
    gap: 0;
  }

  .coll-list__desc {
    white-space: normal;
    margin-bottom: .25rem;
  }

  .coll-list__actions {
    align-self: stretch;
    justify-content: flex-end;
    border-top: 1px solid var(--border-soft);
    padding-top: .5rem;
    margin-top: .5rem;
  }

  .coll-list__actions .icon-btn,
  .coll-list__actions .like-btn--compact {
    min-height: 44px;
    min-width: 44px;
  }
}

/* ═══════════════════════════════════════════════════════════════════════════
   Kuratierungs-Queue (admin/curation_queue.php)
   ═══════════════════════════════════════════════════════════════════════════ */

.queue-toolbar {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: var(--space-md);
  flex-wrap: wrap;
}

/* ═══════════════════════════════════════════════════════════════════════════
   Übungssuche in Sammlung (collection_detail.php)
   ═══════════════════════════════════════════════════════════════════════════ */

.coll-search-wrap {
  margin-bottom: var(--space-lg);
}

.coll-search-bar {
  position: relative;
}

.coll-search-results {
  list-style: none;
  margin: 0;
  padding: 0;
  position: absolute;
  left: 0;
  right: 0;
  background: var(--white);
  border: 1.5px solid var(--border-soft);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md);
  z-index: 200;
  max-height: 280px;
  overflow-y: auto;
}

.coll-search-results__item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: .6rem 1rem;
  border-bottom: 1px solid var(--border-soft);
}

.coll-search-results__item:last-child {
  border-bottom: none;
}

.coll-search-results__item--empty {
  justify-content: center;
  color: var(--soft-text);
  font-size: var(--font-size-sm);
}

.coll-search-results__title {
  flex: 1;
  font-size: 1rem;
  color: var(--color-text);
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ═══════════════════════════════════════════════════════════════════════════
   Paginator (exercises.php)
   ═══════════════════════════════════════════════════════════════════════════ */

.paginator {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin: var(--space-xl) 0;
  flex-wrap: wrap;
}

.paginator__info {
  min-width: 100px;
  text-align: center;
}

.paginator__disabled {
  opacity: 0.4;
  cursor: default;
  pointer-events: none;
}

/* ═══════════════════════════════════════════════════════════════════════════
   Print: Sammlung (collection_detail.php)
   ═══════════════════════════════════════════════════════════════════════════ */

.coll-print-list {
  display: none;
}

/* ═══════════════════════════════════════════════════════════════════════════
   Welcome / Erste Schritte (welcome.php)
   ═══════════════════════════════════════════════════════════════════════════ */

.welcome-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-md);
  margin-top: var(--space-lg);
}

@media (min-width: 640px) {
  .welcome-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

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

.welcome-card {
  background: var(--white);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: var(--space-lg);
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.welcome-card--role {
  border-left: 3px solid var(--primary);
}

.welcome-card__title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: .4rem;
  margin: 0;
}

.welcome-card__role-badge {
  display: inline-block;
  font-size: var(--font-size-tag);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--white);
  background: var(--primary);
  border-radius: var(--radius-sm);
  padding: .1rem .5rem;
  align-self: flex-start;
}

.welcome-card__role-badge--admin {
  background: var(--accent, #c8102e);
}

.welcome-card__btn {
  margin-top: auto;
  align-self: flex-start;
}

/* ═══════════════════════════════════════════════════════════════════════════
   Mein Profil (my_profile.php)
   ═══════════════════════════════════════════════════════════════════════════ */

.profile-dl {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: .35rem var(--space-md);
  margin: 0 0 var(--space-lg);
}

.profile-dl dt {
  font-size: var(--font-size-sm);
  font-weight: 700;
  color: var(--soft-text);
  text-transform: uppercase;
  letter-spacing: .05em;
  padding-top: .1rem;
}

/* ═══════════════════════════════════════════════════════════════════════════
   Vereinsverwaltung (admin/clubs.php)
   ═══════════════════════════════════════════════════════════════════════════ */

.clubs-form__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0 var(--space-md);
  margin-bottom: var(--space-md);
}

@media (min-width: 640px) {
  .clubs-form__grid {
    grid-template-columns: 1fr 1fr;
  }
  .clubs-form__plz {
    grid-column: span 1;
  }
}

/* ═══════════════════════════════════════════════════════════════════════════
   Nominations-Formular (my_area.php)
   ═══════════════════════════════════════════════════════════════════════════ */

.nomination-form {
  max-width: 480px;
}

/* ═══════════════════════════════════════════════════════════════════════════
   Welcome Page – Hero + Quick Actions + Steps + Callout (Redesign)
   ═══════════════════════════════════════════════════════════════════════════ */

@keyframes w-fade-up {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Hero -------------------------------------------------------------------- */

.welcome-hero {
  background: linear-gradient(135deg, var(--primary-deep) 0%, var(--primary) 65%, #0e4f7a 100%);
  color: #fff;
  border-radius: var(--radius-lg);
  padding: var(--space-xl) var(--space-lg);
  margin-bottom: var(--space-xl);
  position: relative;
  overflow: hidden;
  animation: w-fade-up 0.45s ease both;
}

.welcome-hero::before {
  content: '';
  position: absolute;
  top: -70px; right: -70px;
  width: 280px; height: 280px;
  border-radius: 50%;
  background: rgba(242, 184, 75, 0.13);
  pointer-events: none;
}

.welcome-hero::after {
  content: '';
  position: absolute;
  bottom: -110px; left: 28%;
  width: 400px; height: 400px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.04);
  pointer-events: none;
}

.welcome-hero__eyebrow {
  font-size: var(--font-size-sm);
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--highlight);
  margin: 0 0 var(--space-xs);
  position: relative;
}

.welcome-hero__heading {
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  font-weight: 700;
  line-height: 1.15;
  color: #fff;
  margin: 0 0 var(--space-sm);
  position: relative;
}

.welcome-hero__sub {
  font-size: 1rem;
  opacity: 0.85;
  max-width: 520px;
  margin: 0 0 var(--space-lg);
  position: relative;
}

.welcome-role-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.28);
  color: #fff;
  border-radius: 100px;
  padding: 0.35rem 1rem;
  font-size: var(--font-size-sm);
  font-weight: 700;
  letter-spacing: 0.04em;
  position: relative;
}

/* Quick Actions ----------------------------------------------------------- */

.welcome-section-label {
  font-size: var(--font-size-sm);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--soft-text);
  margin: 0 0 var(--space-md);
}

.welcome-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-md);
  margin-bottom: var(--space-xl);
}

@media (min-width: 560px) {
  .welcome-actions { grid-template-columns: repeat(2, 1fr); }
}

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

.welcome-action {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  background: #fff;
  border-radius: var(--radius-md);
  padding: var(--space-lg);
  box-shadow: var(--shadow-sm);
  border: 1.5px solid var(--border-soft, #dde5ec);
  text-decoration: none;
  color: inherit;
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
  animation: w-fade-up 0.45s ease both;
}

.welcome-action:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-md);
  border-color: var(--secondary);
  text-decoration: none;
  color: inherit;
}

.welcome-action:nth-child(1) { animation-delay: 0.06s; }
.welcome-action:nth-child(2) { animation-delay: 0.12s; }
.welcome-action:nth-child(3) { animation-delay: 0.18s; }
.welcome-action:nth-child(4) { animation-delay: 0.24s; }
.welcome-action:nth-child(5) { animation-delay: 0.30s; }
.welcome-action:nth-child(6) { animation-delay: 0.36s; }

.welcome-action__icon {
  width: 48px; height: 48px;
  border-radius: var(--radius-sm);
  background: var(--light-bg);
  color: var(--primary);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}


.welcome-action__title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--primary);
  margin: 0;
}

.welcome-action__desc {
  font-size: var(--font-size-sm);
  color: var(--soft-text);
  margin: 0;
  flex: 1;
}

.welcome-action__arrow {
  align-self: flex-end;
  color: var(--secondary);
  margin-top: var(--space-xs);
  opacity: 0;
  transform: translateX(-4px);
  transition: opacity var(--transition), transform var(--transition);
}

.welcome-action:hover .welcome-action__arrow {
  opacity: 1;
  transform: translateX(0);
}

/* Steps ------------------------------------------------------------------- */

.welcome-step-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-md);
  list-style: none;
  padding: 0;
  margin: 0 0 var(--space-2xl);
}

@media (min-width: 640px) {
  .welcome-step-list { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 960px) {
  .welcome-step-list { grid-template-columns: repeat(4, 1fr); }
}

.welcome-step {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  animation: w-fade-up 0.45s ease both;
}

.welcome-step:nth-child(1) { animation-delay: 0.10s; }
.welcome-step:nth-child(2) { animation-delay: 0.18s; }
.welcome-step:nth-child(3) { animation-delay: 0.26s; }
.welcome-step:nth-child(4) { animation-delay: 0.34s; }

.welcome-step__num {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-weight: 700;
  font-size: 0.9rem;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}

.welcome-step__title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--primary);
  margin: 0;
}

.welcome-step__text {
  font-size: var(--font-size-sm);
  color: var(--soft-text);
  margin: 0;
}

/* Collapsible Details Sections -------------------------------------------- */

.welcome-details {
  margin-bottom: var(--space-xl);
  border: 1.5px solid var(--border-soft);
  border-radius: var(--radius-md);
  background: var(--white);
}

.welcome-details__summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-sm);
  padding: var(--space-md) var(--space-lg);
  font-size: var(--font-size-sm);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--soft-text);
  cursor: pointer;
  list-style: none;
  user-select: none;
}

.welcome-details__summary::-webkit-details-marker { display: none; }

.welcome-details__summary::after {
  content: '▾';
  font-size: 1rem;
  transition: transform var(--transition);
  flex-shrink: 0;
}

.welcome-details[open] .welcome-details__summary::after {
  transform: rotate(180deg);
}

.welcome-details .welcome-step-list,
.welcome-details .welcome-callout {
  margin: 0;
  padding: 0 var(--space-lg) var(--space-lg);
  border: none;
  background: transparent;
  animation: none;
}

.welcome-details .welcome-step-list {
  padding-top: var(--space-sm);
}

/* Role Callout ------------------------------------------------------------ */

.welcome-callout {
  border-radius: var(--radius-md);
  border: 1.5px solid var(--border-soft, #dde5ec);
  background: var(--light-bg);
  padding: var(--space-lg);
  margin-bottom: var(--space-xl);
  animation: w-fade-up 0.45s ease both;
  animation-delay: 0.25s;
}

.welcome-callout__header {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  flex-wrap: wrap;
  margin-bottom: var(--space-md);
}

.welcome-callout__badge {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.75rem;
  border-radius: 100px;
  font-size: var(--font-size-sm);
  font-weight: 700;
  background: var(--primary);
  color: #fff;
  letter-spacing: 0.04em;
}

.welcome-callout__badge--curator { background: #0e6b5e; }
.welcome-callout__badge--admin   { background: var(--accent, #c8102e); }

.welcome-callout__title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--primary);
  margin: 0;
}

.welcome-callout__list {
  margin: 0;
  padding-left: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.welcome-callout__list li {
  font-size: var(--font-size-sm);
  color: var(--soft-text);
}

.welcome-callout__list a {
  color: var(--primary);
  font-weight: 600;
}

/* === CHANGELOG ============================================ */
.changelog {
  max-width: 700px;
  margin: 0 auto var(--space-2xl);
}

.changelog__entry {
  background: var(--white);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  margin-bottom: var(--space-lg);
  overflow: hidden;
}

.changelog__entry-header {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-md) var(--space-lg);
  background: var(--light-bg);
  border-bottom: 1px solid var(--border-soft);
}

.changelog__version-badge {
  font-size: var(--font-size-sm);
  font-weight: 700;
  color: var(--white);
  background: var(--primary);
  border-radius: 99px;
  padding: 2px 10px;
  letter-spacing: 0.03em;
}

.changelog__entry-date {
  font-size: var(--font-size-sm);
  color: var(--soft-text);
}

.changelog__section {
  padding: var(--space-md) var(--space-lg) 0;
}

.changelog__section:last-child {
  padding-bottom: var(--space-md);
}

.changelog__section-label {
  font-size: var(--font-size-sm);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin: 0 0 var(--space-xs);
}

.changelog__section-label--neu       { color: var(--color-success); }
.changelog__section-label--verbessert { color: var(--color-warning); }
.changelog__section-label--behoben   { color: var(--soft-text); }

.changelog__list {
  margin: 0;
  padding-left: var(--space-lg);
}

.changelog__list li {
  font-size: 1rem;
  color: var(--color-text);
  line-height: 1.6;
  margin-bottom: 2px;
}

@media (max-width: 600px) {
  .changelog__entry-header {
    flex-wrap: wrap;
    gap: var(--space-xs);
  }
}

/* ============================================================
   KI-Suche – Floating Action Button + Panel (exercises.php)
   ============================================================ */

.ai-fab {
  position: fixed;
  bottom: 1.5rem;
  left: 1.5rem;
  z-index: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--primary);
  border: 2px solid var(--color-gold, #c9a84c);
  color: #fff;
  box-shadow: var(--shadow-md);
  cursor: pointer;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.ai-fab:hover {
  transform: scale(1.08);
  box-shadow: 0 6px 20px rgba(0,0,0,.28);
}

.ai-fab svg {
  pointer-events: none;
}

/* Panel */
.ai-panel {
  position: fixed;
  bottom: 5.5rem;
  left: 1.5rem;
  z-index: 901;
  width: min(360px, calc(100vw - 2rem));
  background: var(--surface, #fff);
  border: 1px solid var(--border-soft, #ddd);
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

.ai-panel__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .75rem 1rem;
  background: var(--primary);
  color: #fff;
}

.ai-panel__title {
  font-size: 1rem;
  font-weight: 700;
  margin: 0;
}

.ai-panel__close {
  background: none;
  border: none;
  color: #fff;
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  padding: .1rem .3rem;
  border-radius: 4px;
  opacity: .8;
}

.ai-panel__close:hover { opacity: 1; }

.ai-panel__body {
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: .75rem;
}

.ai-panel__input {
  resize: none;
  font-size: 1rem;
  min-height: 70px;
}

.ai-panel__actions {
  display: flex;
  align-items: center;
  gap: .75rem;
  flex-wrap: wrap;
}

.ai-panel__status {
  font-size: var(--font-size-sm);
  color: var(--soft-text);
}

.ai-panel__chips-label {
  font-size: var(--font-size-sm);
  color: var(--soft-text);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  margin-bottom: .3rem;
}

.ai-panel__chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem;
}

.ai-chip {
  display: inline-block;
  padding: .25rem .6rem;
  font-size: var(--font-size-sm);
  background: var(--bg-soft, #f5f5f5);
  border: 1px solid var(--border-soft, #ddd);
  border-radius: 20px;
  cursor: pointer;
  color: var(--color-text);
  transition: background .12s, border-color .12s;
  line-height: 1.4;
}

.ai-chip:hover {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

/* Admin-Seite: KI-Einstellungen */
.ai-settings {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  max-width: 680px;
  margin-top: var(--space-lg);
}

.ai-settings__card {
  background: var(--surface, #fff);
  border: 1px solid var(--border-soft, #ddd);
  border-radius: 8px;
  padding: 1.25rem 1.5rem;
}

.ai-settings__toggle-label {
  display: flex;
  align-items: center;
  gap: .5rem;
  cursor: pointer;
  font-size: 1rem;
  color: var(--color-text);
}

.ai-settings__toggle-label input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
  cursor: pointer;
}

@media (max-width: 600px) {
  .ai-fab {
    bottom: 1rem;
    left: 1rem;
    width: 48px;
    height: 48px;
  }

  .ai-panel {
    bottom: 4.5rem;
    left: 1rem;
    right: 1rem;
    width: auto;
  }
}

/* ================================================================
   POLISH: Toast-Benachrichtigungen
   ================================================================ */
#toast-container {
  position: fixed;
  bottom: 5rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  display: flex;
  flex-direction: column-reverse;
  gap: .4rem;
  align-items: center;
  pointer-events: none;
}
.toast {
  background: #1a1a2e;
  color: #fff;
  padding: .45rem 1.1rem;
  border-radius: 999px;
  font-size: var(--font-size-sm);
  font-weight: 500;
  box-shadow: var(--shadow-md);
  opacity: 0;
  transform: translateY(6px);
  transition: opacity var(--transition), transform var(--transition);
  white-space: nowrap;
}
.toast.toast--visible {
  opacity: 1;
  transform: translateY(0);
}
.toast.toast--error   { background: var(--color-error, #c62828); }
.toast.toast--success { background: var(--primary); }

/* ================================================================
   POLISH: Aktive Filter-Chips
   ================================================================ */
.filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: .375rem;
  margin-bottom: .875rem;
}
.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: .25rem;
  padding: .2rem .5rem .2rem .65rem;
  background: var(--primary);
  color: #fff;
  border-radius: 999px;
  font-size: var(--font-size-sm);
  text-decoration: none;
  transition: opacity var(--transition-fast);
  line-height: 1.5;
}
.filter-chip:hover { background: var(--primary-deep); color: #fff; transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.filter-chip__label { font-weight: 700; }
.filter-chip__remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 15px;
  height: 15px;
  background: rgba(255,255,255,.25);
  border-radius: 50%;
  font-size: .65rem;
  margin-left: .15rem;
}
.filter-chip--clear {
  background: var(--bg-soft, #eee);
  color: var(--soft-text);
  padding-left: .65rem;
}
.filter-chip--clear:hover { color: var(--soft-text); }

/* ================================================================
   POLISH: Klickbare Tabellenzeilen
   ================================================================ */
tr[data-href] { cursor: pointer; }
@media (hover: hover) and (min-width: 601px) {
  tr[data-href]:hover > td { background: var(--bg-soft, #f5f5f5); }
}

/* ================================================================
   POLISH: KI-Suche Ladeindikator
   ================================================================ */
@keyframes ai-pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: .45; }
}
.ai-status--loading {
  animation: ai-pulse 1.1s ease-in-out infinite;
}

/* ================================================================
   POLISH: Subnav Mobile-Toggle
   ================================================================ */
.subnav-mobile-toggle {
  display: none;
}

@media (max-width: 767px) {
  .subnav-mobile-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 0.75rem 1.5rem 0.75rem 1.25rem;
    background: var(--light-bg);
    border: none;
    color: var(--primary);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    font-family: var(--font-family);
    min-height: 48px;
    transition: color var(--transition), background var(--transition);
  }

  .subnav-mobile-toggle:hover,
  .subnav-mobile-toggle:focus-visible {
    color: var(--primary-deep);
    background: #e6ddd0;
  }

  .subnav-mobile-toggle__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    padding: 4px;
    background-color: var(--primary);
    background-image: linear-gradient(rgba(255,255,255,0.14), rgba(255,255,255,0.14));
    border-radius: var(--radius-sm);
    color: var(--white);
    transition: transform var(--transition), background-color var(--transition);
  }

  .subnav-mobile-toggle:hover .subnav-mobile-toggle__icon,
  .subnav-mobile-toggle:focus-visible .subnav-mobile-toggle__icon {
    background-color: var(--primary-deep);
  }

  .admin-subnav.is-open .subnav-mobile-toggle__icon,
  .my-area-subnav.is-open .subnav-mobile-toggle__icon {
    transform: rotate(180deg);
  }

  .admin-subnav .subnav-links,
  .my-area-subnav .subnav-links {
    display: none;
    flex-direction: column;
    padding-bottom: 0.25rem;
  }

  .admin-subnav.is-open .subnav-links,
  .my-area-subnav.is-open .subnav-links {
    display: flex;
  }

  .admin-subnav .subnav-links .admin-subnav__link,
  .my-area-subnav .subnav-links .my-area-subnav__link {
    border-bottom: none;
    border-top: 1px solid var(--border-soft);
    padding: 0.75rem 1.25rem;
    white-space: normal;
    font-size: 1rem;
    min-height: 44px;
  }

  .admin-subnav .subnav-links .admin-subnav__link.is-active,
  .my-area-subnav .subnav-links .my-area-subnav__link.is-active {
    background: var(--light-bg);
    border-left: 3px solid var(--highlight);
    padding-left: calc(1.25rem - 3px);
  }

  .admin-subnav .container,
  .my-area-subnav .container {
    flex-direction: column;
    overflow: visible;
    padding-block: 0;
  }
}

/* ================================================================
   POLISH: Passwort-Stärkemeter
   ================================================================ */
.pw-strength {
  margin-top: 0.5rem;
}

.pw-strength__bars {
  display: flex;
  gap: 4px;
  margin-bottom: 0.3rem;
}

.pw-strength__bar {
  flex: 1;
  height: 4px;
  border-radius: 999px;
  background: var(--border-soft);
  transition: background var(--transition-slow);
}

.pw-strength__bar--active-1 { background: var(--color-error); }
.pw-strength__bar--active-2 { background: var(--color-warning); }
.pw-strength__bar--active-3 { background: #3a9e6e; }
.pw-strength__bar--active-4 { background: var(--color-success); }

.pw-strength__label {
  font-size: var(--font-size-sm);
  color: var(--soft-text);
  transition: color var(--transition-slow);
}

.pw-strength__rule {
  font-size: var(--font-size-sm);
  color: var(--soft-text);
  display: flex;
  align-items: center;
  gap: 0.3rem;
  margin-top: 0.15rem;
}

.pw-strength__rule--ok {
  color: var(--color-success);
}

.pw-strength__rules {
  margin-top: 0.4rem;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

/* Loading-State für AJAX-Buttons */
@keyframes btn-spin {
  to { transform: rotate(360deg); }
}

.is-loading {
  opacity: 0.75;
  pointer-events: none;
  position: relative;
  color: transparent !important;
}

.is-loading::after {
  content: '';
  position: absolute;
  inset: 50% 50% auto auto;
  transform: translate(50%, -50%);
  width: 14px;
  height: 14px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: btn-spin 0.6s linear infinite;
  color: var(--white);
}

/* Spinner-Farbe für outline/ghost-Buttons */
.btn--outline.is-loading::after,
.icon-btn.is-loading::after {
  color: var(--primary);
}

/* Spinner ohne Text-Verstecken für Like/Coll-Buttons (haben Icon) */
.like-btn.is-loading,
.js-coll-like-btn.is-loading {
  color: transparent !important;
}

/* === SCROLL-TO-TOP BUTTON ================================= */
.scroll-top-btn {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--primary);
  color: var(--white);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-md);
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: opacity var(--transition), transform var(--transition), background var(--transition), box-shadow var(--transition);
  z-index: 90;
}

.scroll-top-btn.is-visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.scroll-top-btn:hover {
  background: var(--primary-deep);
  box-shadow: var(--shadow-lg);
}

/* === PFOTEN-BEWERTUNG (exercise_detail.php) =============== */

/* Versteckte SVG-Defs für Gradient-Definition */
.paw-gradient-defs {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
  pointer-events: none;
}

/* Durchschnitt-Zeile */
.rating-avg {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin-top: var(--space-xs);
  flex-wrap: wrap;
}

.rating-avg__paws {
  display: flex;
  gap: 0.15rem;
  align-items: center;
}

.rating-avg__paw {
  display: inline-flex;
  line-height: 0;
}

/* Outline-Zustand (default) */
.rating-avg__paw .paw-el {
  fill: none;
  stroke: var(--border-soft);
  stroke-width: 1.5px;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Gefüllt (Durchschnitt) */
.rating-avg__paw.is-filled .paw-el {
  fill: url(#paw-fill-gradient);
  stroke: #d4820a;
  stroke-width: 0.7px;
}

.rating-avg__text {
  color: var(--soft-text);
}

/* Eigene Bewertung */
.rating-user {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
}

.rating-paws {
  display: flex;
  gap: 0.1rem;
  align-items: center;
}

/* Einzelner Pfoten-Button */
.rating-paw {
  background: none;
  border: none;
  padding: 0.25rem;
  cursor: pointer;
  line-height: 0;
  border-radius: var(--radius-sm);
  transition: transform var(--transition-fast), filter var(--transition-fast);
  min-height: 44px;
  min-width: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Outline (default) */
.rating-paw .paw-el {
  fill: none;
  stroke: var(--soft-text);
  stroke-width: 1.5px;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: fill var(--transition-fast), stroke var(--transition-fast);
}

/* Aktiv gefüllt */
.rating-paw--filled .paw-el {
  fill: url(#paw-fill-gradient);
  stroke: #e0a020;
  stroke-width: 0.5px;
}

@media (hover: hover) {
  .rating-paw:hover {
    transform: scale(1.05);
  }

  /* Hover-Preview */
  .rating-paw--preview .paw-el {
    fill: url(#paw-fill-gradient);
    stroke: #e0a020;
    stroke-width: 0.5px;
    opacity: 0.7;
  }
}

/* Feedback-Text nach Klick (wird per toast angezeigt; Feld bleibt leer aber reserviert Platz) */
.rating-feedback {
  color: var(--color-success-text);
  font-size: var(--font-size-sm);
  min-height: 1rem;
}

/* === OPTIONALE FELDER AKKORDEON (exercise_new.php) =========
   Einklappbare Sektionen für selten genutzte Metafelder       */
.ex-optional-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  font-family: var(--font-family);
  font-size: 1rem;
  font-weight: 700;
  color: var(--primary);
  text-align: left;
  gap: var(--space-xs);
}

.ex-optional-toggle:hover {
  color: var(--primary-deep);
}

.ex-optional-toggle__icon {
  font-style: normal;
  flex-shrink: 0;
  transition: transform var(--transition-fast);
  color: var(--soft-text);
  font-size: var(--font-size-sm);
}

.ex-optional-toggle.is-open .ex-optional-toggle__icon {
  transform: rotate(180deg);
}

.ex-optional-body {
  overflow: hidden;
  max-height: 0;
  transition: max-height var(--transition-slow);
}

.ex-optional-body.is-open {
  max-height: 600px;
}

.ex-meta-card--optional .ex-meta-card__header {
  padding-bottom: var(--space-xs);
}

/* === SORTIERBARE TABELLEN (Admin) ==========================
   .sql-table__th[data-sort] / .atm-table thead th[data-sort]  */
.sql-table__th[data-sort],
.atm-table thead th[data-sort] {
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}

.sql-table__th[data-sort]:hover,
.atm-table thead th[data-sort]:hover {
  background: rgba(77, 102, 48, 0.06);
}

.sql-table__th[data-sort]::after,
.atm-table thead th[data-sort]::after {
  content: ' ⇅';
  font-size: 0.65em;
  color: var(--soft-text);
  opacity: 0.5;
}

.sql-table__th[data-sort="asc"]::after,
.atm-table thead th[data-sort="asc"]::after {
  content: ' ↑';
  opacity: 1;
  color: var(--primary);
}

.sql-table__th[data-sort="desc"]::after,
.atm-table thead th[data-sort="desc"]::after {
  content: ' ↓';
  opacity: 1;
  color: var(--primary);
}

/* === PREFERS-COLOR-SCHEME: DARK ============================
   Minimaler Dark-Mode: überschreibt die wichtigsten Farbtokens.
   Alle Komponenten-Farben leiten sich von diesen Tokens ab,
   sodass kein Selektor doppelt gepflegt werden muss.
   Noch kein vollständiges Dark-Theme – Vorbereitung für v2.x.  */
@media (prefers-color-scheme: dark) {
  :root {
    /* Hintergründe */
    --white:          #1c2419;
    --light-bg:       #242e1f;

    /* Text */
    --color-text:     #dde8d8;
    --soft-text:      #8aac7e;

    /* Rahmen */
    --border-soft:    rgba(160, 200, 130, 0.15);
    --overlay-bg:     rgba(10, 18, 6, 0.72);

    /* Schatten */
    --shadow-sm:  0 1px 4px rgba(0, 0, 0, 0.35);
    --shadow-md:  0 4px 16px rgba(0, 0, 0, 0.50);
    --shadow-lg:  0 8px 28px rgba(0, 0, 0, 0.65);

    /* Status-Hintergründe (gedämpft für Dark) */
    --bg-success-soft: rgba(30, 126, 74, 0.18);
    --bg-warning-soft: rgba(212, 130, 10, 0.18);
    --bg-error-soft:   rgba(192, 57, 43, 0.18);
    --bg-info-soft:    rgba(242, 184, 75, 0.15);

    /* Focus-Ring */
    --focus-ring-shadow: 0 0 0 3px rgba(120, 180, 90, 0.25);
  }

  /* Spezifische Overrides die nicht per Token lösbar sind */
  .site-header {
    background: linear-gradient(120deg, #0d1608 0%, #1c2b10 50%, #253515 100%);
  }

  .site-footer {
    background: linear-gradient(300deg, #0d1608 0%, #1c2b10 50%, #253515 100%);
  }

  .site-nav {
    background: rgba(15, 25, 10, 0.82);
  }

  .login-wrapper {
    background: radial-gradient(ellipse at 50% 0%, rgba(100, 160, 60, 0.08) 0%, transparent 55%), var(--light-bg);
  }

  .login-brand__title { color: var(--primary); }
  .login-brand__subtitle { color: var(--soft-text); }

  .login-box {
    background: var(--light-bg);
    box-shadow: var(--shadow-lg);
  }

  .sql-table__head {
    background: rgba(255,255,255,0.04);
  }

  select.form-control {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%238aac7e' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  }
}

/* === PREFERS-REDUCED-MOTION ================================
   Alle Animationen + Transitions für Nutzer deaktivieren,
   die im Betriebssystem "Bewegung reduzieren" aktiviert haben. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  /* Scroll-to-Top: sofort sichtbar/unsichtbar ohne Fade */
  .scroll-top-btn {
    opacity: 0;
    transform: none;
    transition: none;
  }
  .scroll-top-btn.is-visible {
    opacity: 1;
  }
}

/* ═══════════════════════════════════════════════════════════════════════════
   Admin: Statistiken (pages/admin/stats.php)
   ═══════════════════════════════════════════════════════════════════════════ */

.st-page {
  max-width: 1100px;
}

/* Hero KPIs ──────────────────────────────────────────────────── */
.st-hero {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-md);
  margin-bottom: var(--space-xl);
}

@media (min-width: 600px) {
  .st-hero {
    grid-template-columns: repeat(4, 1fr);
  }
}

.st-hero-kpi {
  background: var(--white);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
  padding: var(--space-lg) var(--space-md);
  text-align: center;
}

.st-hero-kpi__value {
  display: block;
  font-size: 2.25rem;
  font-weight: 700;
  line-height: 1.1;
  color: var(--primary);
}

.st-hero-kpi__label {
  display: block;
  font-size: var(--font-size-sm);
  color: var(--soft-text);
  margin-top: var(--space-xs);
  line-height: 1.4;
}

.st-hero-kpi--good .st-hero-kpi__value { color: var(--color-success); }
.st-hero-kpi--warn .st-hero-kpi__value { color: var(--color-error); }
.st-hero-kpi--muted .st-hero-kpi__value { color: var(--soft-text); }

.st-hero-kpi__trend {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  margin-top: 2px;
  margin-bottom: 4px;
}

.st-trend--up      { color: var(--color-success); }
.st-trend--down    { color: var(--color-error); }
.st-trend--neutral { color: var(--soft-text); font-weight: 400; }

/* Hauptgrid ──────────────────────────────────────────────────── */
.st-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-lg);
  align-items: start;
}

@media (min-width: 860px) {
  .st-grid {
    grid-template-columns: 320px 1fr;
  }
}

.st-right-col {
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
}

/* Karte ──────────────────────────────────────────────────────── */
.st-card {
  background: var(--white);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
  padding: var(--space-lg);
}

.st-card__group-title {
  font-size: var(--font-size-sm);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--soft-text);
  margin: 0 0 var(--space-sm);
}

.st-card__group-title + .st-card__group-title,
.st-metrics + .st-card__group-title,
.st-bar-chart + .st-card__group-title {
  margin-top: var(--space-lg);
  padding-top: var(--space-lg);
  border-top: 1px solid var(--border-soft);
}

.st-card__group-meta {
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
  margin-left: var(--space-xs);
}

/* Metrik-Zeilen ─────────────────────────────────────────────── */
.st-metrics {
  display: flex;
  flex-direction: column;
}

.st-metric-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: var(--space-sm);
  padding: 0.45rem 0;
  border-bottom: 1px solid var(--border-soft);
}

.st-metric-row:last-child {
  border-bottom: none;
}

.st-metric-row__label {
  font-size: 1rem;
  color: var(--color-text);
}

.st-metric-row__value {
  font-size: 1rem;
  font-weight: 700;
  color: var(--primary);
  flex-shrink: 0;
}

.st-metric-row__value--good  { color: var(--color-success); }
.st-metric-row__value--warn  { color: var(--color-error); }
.st-metric-row__value--muted { color: var(--soft-text); font-weight: 400; }

/* Balkendiagramm ────────────────────────────────────────────── */
.st-bar-chart {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.st-bar-row {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.st-bar-label {
  width: 130px;
  text-align: right;
  flex-shrink: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.st-bar-track {
  flex: 1;
  background: var(--border-soft);
  border-radius: 3px;
  height: 8px;
  min-width: 0;
}

.st-bar-fill {
  height: 100%;
  border-radius: 3px;
  background: var(--primary);
  transition: width 0.5s ease;
  width: 0;
}

.st-bar-count {
  width: 28px;
  text-align: right;
  flex-shrink: 0;
}

/* Top-Beitragende ───────────────────────────────────────────── */
.st-contributors {
  display: flex;
  flex-direction: column;
}

.st-contributor-row {
  display: flex;
  align-items: baseline;
  gap: var(--space-sm);
  padding: 0.45rem 0;
  border-bottom: 1px solid var(--border-soft);
}

.st-contributor-row:last-child {
  border-bottom: none;
}

.st-contributor-rank {
  width: 1.5rem;
  flex-shrink: 0;
  color: var(--soft-text);
  text-align: right;
}

.st-contributor-name {
  flex: 1;
}

.st-contributor-count {
  flex-shrink: 0;
  color: var(--soft-text);
}

/* Verlauf: vertikale Balkendiagramme ────────────────────────── */
.st-verlauf {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-lg);
  margin-top: var(--space-lg);
}

@media (min-width: 700px) {
  .st-verlauf { grid-template-columns: 1fr 1fr; }
}

.st-vbar-chart {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  height: 120px;
  padding-top: var(--space-lg);
}

.st-vbar-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  height: 100%;
  justify-content: flex-end;
  min-width: 0;
}

.st-vbar-count { line-height: 1; flex-shrink: 0; }

.st-vbar-track {
  width: 100%;
  flex: 1;
  display: flex;
  align-items: flex-end;
  min-height: 0;
}

.st-vbar-fill {
  width: 100%;
  height: 0;
  background: var(--primary);
  border-radius: 3px 3px 0 0;
  transition: height 0.5s ease;
  opacity: 0.85;
}

.st-vbar-label {
  flex-shrink: 0;
  text-align: center;
  white-space: nowrap;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Leerstand-Hinweis ─────────────────────────────────────────── */
.st-empty-hint {
  color: var(--soft-text);
  padding: var(--space-md);
  background: var(--bg-soft, #f8f8f8);
  border-radius: var(--radius-sm);
  line-height: 1.6;
}

.st-empty-hint code {
  font-family: monospace;
  font-size: 0.82em;
}

/* Abstandshalter zwischen Sektionen auf stats.php */
.st-section-gap { margin-top: var(--space-xl); }

/* Sektionsüberschrift außerhalb einer st-card */
.st-section-heading {
  margin-bottom: var(--space-md);
}

/* Übungsranking-Tabelle */
.st-card--wide { margin-top: var(--space-lg); }

.st-ex-rank-wrap { overflow-x: auto; }

.st-col-rank {
  width: 2rem;
  text-align: right;
  padding-right: var(--space-sm);
  white-space: nowrap;
  color: var(--soft-text);
}

.st-col-num {
  text-align: right;
  white-space: nowrap;
}

.st-rating-cell {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 1px;
}

.st-paw {
  font-size: 0.9rem;
  line-height: 1;
}

.st-paw--full  { color: var(--primary); }
.st-paw--half  { color: var(--primary); opacity: 0.5; }
.st-paw--empty { color: var(--border-soft); }

.st-rating-num {
  margin-left: 0.35rem;
  font-variant-numeric: tabular-nums;
}

@media (max-width: 480px) {
  .st-bar-label { width: 90px; }
  .st-hero-kpi__value { font-size: 1.75rem; }
}
