/* =============================================================================
   SCD Certs App – Stylesheet
   Farben direkt aus Swiss Cave Diving ClubDesk CSS
   --primary-color: #f7e63e  (SCD Gelb)
   --a-hover-color: #c8a62a  (Dunkelgelb)
   --h2-color:      #ccc
   Hintergrund:     #111 (fast schwarz)
   ============================================================================= */

@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;700&family=Roboto+Condensed:wght@300;400;700&display=swap');

:root {
  --control-height: 42px; /* einheitliche Höhe für Input/Select/Button in einer Zeile */

  --scd-yellow:      #f7e63e;
  --scd-yellow-dark: #c8a62a;
  --scd-yellow-dim:  rgba(247,230,62,0.15);
  --scd-yellow-border: rgba(247,230,62,0.3);

  --bg-base:    #111111;
  --bg-card:    #1e1e1e;
  --bg-input:   #2a2a2a;
  --bg-hover:   #252525;

  --text-primary:   #f0f0f0;
  --text-secondary: #cccccc;
  --text-muted:     #888888;

  --border:       rgba(255,255,255,0.08);
  --border-input: rgba(255,255,255,0.15);
  --border-focus: var(--scd-yellow);

  --green:       #4caf50;
  --green-light: rgba(76,175,80,0.15);
  --amber:       #ff9800;
  --amber-light: rgba(255,152,0,0.15);
  --red:         #f44336;
  --red-light:   rgba(244,67,54,0.15);

  --radius-sm: 6px;
  --radius:    10px;
  --radius-lg: 14px;
  --shadow:    0 2px 8px rgba(0,0,0,0.4);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; -webkit-text-size-adjust: 100%; }

body {
  font-family: 'Roboto', -apple-system, sans-serif;
  font-size: 18px;
  font-weight: 400;
  line-height: 1.65;
  color: var(--text-primary);
  background: var(--bg-base);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--scd-yellow); text-decoration: none; }
a:hover { color: var(--scd-yellow-dark); text-decoration: none; }

h1, h2, h3, h4 {
  font-family: 'Roboto', sans-serif;
  font-weight: 700;
  color: var(--text-primary);
}

/* ---- Navbar ---- */
.navbar {
  background: rgba(0,0,0,0.95);
  border-bottom: 1px solid var(--scd-yellow);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
  height: 64px;
  position: sticky;
  top: 0;
  z-index: 100;
}
.navbar-brand a {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--scd-yellow);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.navbar-menu {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

/* Icon-Links in der Navbar */
.nav-icon-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 22px;
  transition: color 0.15s, background 0.15s;
  position: relative;
}
.nav-icon-link:hover {
  color: var(--scd-yellow);
  background: rgba(247,230,62,0.08);
  text-decoration: none;
}
.nav-icon-link--muted { color: var(--text-muted); }
.nav-icon-link--muted:hover { color: var(--red); background: rgba(244,67,54,0.08); }

/* Tooltip via title-Attribut – native browser tooltip genügt */
/* Für bessere Tooltips: CSS-only */
.nav-icon-link::after {
  content: attr(title);
  position: absolute;
  bottom: -32px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0,0,0,0.85);
  color: #fff;
  font-size: 12px;
  font-family: 'Roboto', sans-serif;
  white-space: nowrap;
  padding: 3px 8px;
  border-radius: 4px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s;
  z-index: 200;
}
.nav-icon-link:hover::after { opacity: 1; }

.nav-divider {
  width: 1px;
  height: 24px;
  background: var(--border);
  margin: 0 0.25rem;
}

/* Aktiver Menüpunkt */
.nav-icon-link.active {
  color: var(--scd-yellow);
  background: rgba(247,230,62,0.1);
}

/* ---- Main ---- */
.main-content {
  flex: 1;
  padding: 1.5rem 1.5rem;
  max-width: 1280px;
  width: 100%;
  margin: 0 auto;
}

.page-title {
  font-family: 'Roboto Condensed', sans-serif;
  font-size: 30px;
  font-weight: 700;
  color: var(--scd-yellow);
  border-bottom: 1px solid var(--scd-yellow-border);
  padding-bottom: 0.5rem;
  margin-bottom: 1.25rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.page-title i {
  font-size: 28px;
  opacity: 0.9;
}

/* Referenznummern (REQ-2026-0001 etc.) – kompakt statt Standard-Monospace */
.ref-number {
  font-family: 'Roboto Condensed', sans-serif;
  font-weight: 500;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

/* ---- Footer ---- */
.footer {
  padding: 0.75rem 1.5rem;
  font-size: 12px;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
}

/* ---- Buttons ---- */
.btn {
  appearance: none;
  -webkit-appearance: none;
  box-sizing: border-box;
  margin: 0;
  height: var(--control-height);
  line-height: 1;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 1.125rem;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  font-family: 'Roboto', sans-serif;
  font-size: 16px;
  font-weight: 500;
  letter-spacing: 0.01em;
  text-transform: none;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.15s;
}
.btn:hover { text-decoration: none; opacity: 0.88; }
.btn--primary {
  background: var(--scd-yellow);
  color: #111;
  border-color: var(--scd-yellow-dark);
}
.btn--primary:hover { background: var(--scd-yellow-dark); color: #000; opacity: 1; }
.btn--secondary {
  background: transparent;
  color: var(--text-secondary);
  border-color: var(--border-input);
}
.btn--secondary:hover { border-color: var(--scd-yellow); color: var(--scd-yellow); opacity: 1; }
.btn--danger    { background: var(--red);   color: #fff; border-color: #c62828; }
.btn--success   { background: var(--green); color: #fff; border-color: #2e7d32; }
.btn--full      { width: 100%; justify-content: center; }
.btn--sm        { padding: 0.25rem 0.75rem; font-size: 12px; }

/* ---- Forms ---- */
.form-group { margin-bottom: 1rem; }
.form-group label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.01em;
  text-transform: none;
  color: var(--text-muted);
  margin-bottom: 5px;
}
input[type="text"], input[type="email"], input[type="password"],
input[type="date"], input[type="tel"], input[type="url"],
input[type="number"], input[type="search"], select {
  height: var(--control-height);
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
  padding: 0 0.875rem;
  border: 1px solid var(--border-input);
  border-radius: var(--radius-sm);
  font-family: 'Roboto', sans-serif;
  font-size: 17px;
  background: var(--bg-input);
  color: var(--text-primary);
  transition: border-color 0.15s, box-shadow 0.15s;
  overflow: hidden;
  text-overflow: ellipsis;
}
textarea {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
  padding: 0.5625rem 0.875rem;
  border: 1px solid var(--border-input);
  border-radius: var(--radius-sm);
  font-family: 'Roboto', sans-serif;
  font-size: 17px;
  background: var(--bg-input);
  color: var(--text-primary);
  transition: border-color 0.15s, box-shadow 0.15s;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--scd-yellow);
  box-shadow: 0 0 0 2px rgba(247,230,62,0.15);
}
input:disabled { opacity: 0.5; cursor: not-allowed; }
select option { background: var(--bg-input); }
.form-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; min-width: 0; }
.form-grid-2 > * { min-width: 0; }
.form-grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 1rem; min-width: 0; }
.form-grid-3 > * { min-width: 0; }

/* ---- Cards ---- */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  box-shadow: var(--shadow);
}
.card + .card { margin-top: 1rem; }
.card-title {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

/* ---- Brevet-Karte ---- */
.brevet-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1rem 1.25rem;
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  box-shadow: var(--shadow);
  margin-bottom: 0.75rem;
  transition: border-color 0.15s;
}
.brevet-card:hover { border-color: var(--scd-yellow-border); }
.brevet-images { display: flex; gap: 8px; flex-shrink: 0; }
.brevet-img {
  width: 85.6px;
  height: 54px;
  border-radius: 4px;
  object-fit: cover;
  border: 1px solid var(--border);
  cursor: pointer;
  transition: transform 0.15s, border-color 0.15s;
}
.brevet-img:hover { transform: scale(1.05); border-color: var(--scd-yellow); }
.brevet-img--placeholder { background: var(--bg-input); }
.brevet-info { flex: 1; min-width: 0; }
.brevet-title { font-size: 19px; font-weight: 500; color: var(--text-primary); }
.brevet-meta  { font-size: 15px; color: var(--text-muted); margin-top: 4px; }

/* ---- Status-Badges ---- */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.badge--valid   { background: var(--green-light); color: var(--green); border: 1px solid rgba(76,175,80,0.3); }
.badge--pending { background: var(--amber-light); color: var(--amber); border: 1px solid rgba(255,152,0,0.3); }
.badge--error   { background: var(--red-light);   color: var(--red);   border: 1px solid rgba(244,67,54,0.3); }
.badge--gray    { background: rgba(255,255,255,0.06); color: var(--text-muted); border: 1px solid var(--border); }

/* ---- Tabellen ---- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
thead { background: rgba(247,230,62,0.06); }
th {
  padding: 0.625rem 0.875rem;
  text-align: left;
  font-family: 'Roboto', sans-serif;
  font-size: 13px;
  font-weight: 700;
  color: var(--scd-yellow);
  letter-spacing: 0.03em;
  text-transform: uppercase;
  border-bottom: 1px solid var(--scd-yellow-border);
}
td { padding: 0.75rem 0.875rem; border-bottom: 1px solid var(--border); vertical-align: middle; color: var(--text-secondary); font-size: 17px; }
tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--bg-hover); }

/* ---- Flash-Messages ---- */
.flash {
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  margin-bottom: 1rem;
  font-size: 16px;
  font-weight: 500;
  transition: opacity 0.5s;
}
.flash--success { background: var(--green-light); color: var(--green); border: 1px solid rgba(76,175,80,0.3); }
.flash--error   { background: var(--red-light);   color: var(--red);   border: 1px solid rgba(244,67,54,0.3); }
.flash--info    { background: var(--scd-yellow-dim); color: var(--scd-yellow); border: 1px solid var(--scd-yellow-border); }

/* ---- Fullscreen-Overlay ---- */
.fullscreen-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.96);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  cursor: pointer;
}
.fullscreen-overlay img {
  max-width: 95vw;
  max-height: 90vh;
  border-radius: 6px;
  object-fit: contain;
  box-shadow: 0 0 60px rgba(247,230,62,0.1);
}

/* ---- Login-Seite ---- */
.login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: var(--bg-base);
}
.login-card {
  background: var(--bg-card);
  border: 1px solid var(--scd-yellow-border);
  border-radius: var(--radius-lg);
  padding: 2.5rem 2rem;
  width: 100%;
  max-width: 380px;
  box-shadow: 0 8px 40px rgba(0,0,0,0.6), 0 0 0 1px rgba(247,230,62,0.05);
}
.login-logo {
  text-align: center;
  margin-bottom: 2rem;
}
.login-logo h1 {
  font-size: 26px;
  font-weight: 700;
  color: var(--scd-yellow);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-top: 0.75rem;
}
.login-logo p { font-size: 12px; color: var(--text-muted); letter-spacing: 0.1em; text-transform: uppercase; }
.login-form .btn { margin-top: 0.5rem; }
  

/* ---- Verifikationsseite ---- */
.verify-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: var(--bg-base);
}
.verify-card {
  background: var(--bg-card);
  border: 1px solid var(--scd-yellow-border);
  border-radius: var(--radius-lg);
  padding: 2.5rem 2rem;
  max-width: 360px;
  width: 100%;
  text-align: center;
  box-shadow: 0 8px 40px rgba(0,0,0,0.6);
}
.verify-result--valid  { color: var(--green); margin: 1.5rem 0; }
.verify-result--invalid{ color: var(--red);   margin: 1.5rem 0; }
.verify-check { font-size: 52px; display: block; }
.verify-x     { font-size: 52px; display: block; }
.verify-name  { font-size: 22px; font-weight: 700; margin-top: 0.5rem; color: var(--text-primary); }
.verify-level { font-size: 16px; color: var(--scd-yellow); font-weight: 500; }
.verify-org   { font-size: 13px; color: var(--text-muted); }
.verify-date  { font-size: 13px; color: var(--text-muted); margin-top: 0.25rem; }
.verify-footer{ margin-top: 1.5rem; font-size: 12px; color: var(--text-muted); }

/* ---- Fehlerseiten ---- */
.error-page { display: flex; align-items: center; justify-content: center; min-height: 100vh; }
.error-card { text-align: center; }
.error-card h1 { font-size: 80px; font-weight: 300; color: var(--scd-yellow); opacity: 0.3; }
.error-card p  { color: var(--text-muted); margin-bottom: 1.5rem; }

/* ---- Responsive ---- */
@media (max-width: 600px) {
  .main-content { padding: 1rem; }
  .form-grid-2, .form-grid-3 { grid-template-columns: 1fr; }
  .navbar { padding: 0 1rem; }
  .brevet-card { flex-direction: column; }
  .brevet-images { justify-content: center; }
}

/* Disabled Button */
.btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  pointer-events: auto;
}
.btn:disabled:hover { opacity: 0.35; }

/* Icon-only Buttons – quadratisch, nur Icon */
.btn.icon-only {
  width: var(--control-height);
  height: var(--control-height);
  padding: 0;
  justify-content: center;
  font-size: 18px;
}
.btn.icon-only.btn--sm {
  width: 30px;
  height: 30px;
  font-size: 16px;
}

/* Required-Sternchen via CSS statt HTML */
label:has(+ input[required])::after,
label:has(+ select[required])::after {
  content: ' *';
  color: var(--scd-yellow);
  font-size: 12px;
}

/* File-Input */
input[type="file"] {
  font-family: 'Roboto', sans-serif;
  font-size: 15px;
  color: var(--text-secondary);
  background: var(--bg-input);
  border: 1px solid var(--border-input);
  border-radius: var(--radius-sm);
  padding: 0.4rem 0.75rem;
  width: 100%;
  cursor: pointer;
}
input[type="file"]::file-selector-button {
  background: var(--bg-hover);
  color: var(--text-primary);
  border: 1px solid var(--border-input);
  border-radius: var(--radius-sm);
  padding: 0.3rem 0.75rem;
  margin-right: 0.75rem;
  cursor: pointer;
  font-family: 'Roboto', sans-serif;
  font-size: 14px;
}
input[type="file"]::file-selector-button:hover {
  border-color: var(--scd-yellow);
  color: var(--scd-yellow);
}

/* Checkboxen & Radio-Buttons */
input[type="checkbox"],
input[type="radio"] {
  appearance: none;
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border: 2px solid var(--border-input);
  border-radius: 4px;
  background: var(--bg-input);
  cursor: pointer;
  position: relative;
  flex-shrink: 0;
  transition: border-color 0.15s, background 0.15s;
}
input[type="radio"] {
  border-radius: 50%;
}
input[type="checkbox"]:checked,
input[type="radio"]:checked {
  background: var(--scd-yellow);
  border-color: var(--scd-yellow-dark);
}
input[type="checkbox"]:checked::after {
  content: '';
  position: absolute;
  left: 4px;
  top: 1px;
  width: 6px;
  height: 10px;
  border: 2px solid #111;
  border-top: none;
  border-left: none;
  transform: rotate(45deg);
}
input[type="radio"]:checked::after {
  content: '';
  position: absolute;
  left: 3px;
  top: 3px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #111;
}
input[type="checkbox"]:hover,
input[type="radio"]:hover {
  border-color: var(--scd-yellow);
}

/* =============================================================================
   BREVET-KARTEN (Member-Ansicht)
   ============================================================================= */
.brevet-card {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
}
.brevet-images {
  display: flex;
  gap: .5rem;
  flex-shrink: 0;
}
.brevet-img {
  width: 120px;
  height: 76px;
  border-radius: 5px;
  border: 1px solid var(--border);
  object-fit: cover;
  cursor: pointer;
  transition: transform 0.15s;
}
.brevet-img:hover { transform: scale(1.03); }
.brevet-img--placeholder { opacity: 0.35; }
.brevet-info { flex: 1; min-width: 0; }
.brevet-title { font-size: 17px; font-weight: 600; color: var(--text-primary); }
.brevet-meta { font-size: 14px; color: var(--text-muted); margin-top: .25rem; }

/* Fullscreen-Overlay */
.fullscreen-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.92);
  z-index: 9999;
  align-items: center;
  justify-content: center;
}
.fullscreen-overlay.active { display: flex; }
.fullscreen-overlay img {
  max-width: 92vw;
  max-height: 88vh;
  border-radius: 8px;
  box-shadow: 0 8px 40px rgba(0,0,0,0.6);
}
.fullscreen-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: rgba(255,255,255,0.1);
  border: none;
  color: #fff;
  font-size: 28px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.fullscreen-close:hover { background: rgba(255,255,255,0.2); }

/* Mobile Responsive Brevet-Card */
@media (max-width: 600px) {
  .brevet-card { flex-direction: column; }
  .brevet-images { width: 100%; }
  .brevet-img { flex: 1; width: auto; height: 60px; }
}

/* Navbar Badge */
.nav-badge {
  position: absolute;
  top: 4px;
  right: 4px;
  background: var(--red);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  min-width: 16px;
  height: 16px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  line-height: 1;
  pointer-events: none;
}

/* =============================================================================
   MOBILE-OPTIMIERUNG: Icon-only Buttons + Header-Stapelung
   ============================================================================= */
@media (max-width: 640px) {

  /* Text-Label in Buttons ausblenden, nur Icon + Tooltip via title-Attribut */
  .btn .btn-label {
    display: none;
  }
  .btn {
    padding: 0.5rem;
    min-width: 40px;
    justify-content: center;
  }
  .btn--sm {
    padding: 0.3rem;
    min-width: 32px;
  }

  /* Header-Zeile (Titel + Aktions-Buttons) stapeln statt nebeneinander erzwingen */
  div[style*="justify-content:space-between"] {
    flex-wrap: wrap;
    row-gap: 0.5rem;
  }

  /* Button-Gruppen im Header: horizontal scrollbar statt Umbruch-Chaos */
  div[style*="display:flex"][style*="gap:.5rem"] {
    flex-wrap: wrap;
  }

  /* Page-Title etwas kompakter auf Mobile */
  .page-title {
    font-size: 20px;
  }

  /* Formulare: 2-Spalten-Grid auf 1 Spalte reduzieren */
  .form-grid-2 {
    grid-template-columns: 1fr;
  }
  .form-grid-3 {
    grid-template-columns: 1fr;
  }
  .form-grid-3 [style*="grid-column:span 2"] {
    grid-column: span 1;
  }

  /* Tabellen: horizontales Scrollen erlauben statt Layout zu sprengen */
  .table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
}

/* =============================================================================
   MOBILE: Tabellen als Karten-Ansicht
   ============================================================================= */
@media (max-width: 640px) {

  .table-wrap table,
  .table-wrap thead,
  .table-wrap tbody,
  .table-wrap th,
  .table-wrap td,
  .table-wrap tr {
    display: block;
    width: 100%;
  }

  .table-wrap thead {
    display: none;
  }

  .table-wrap tbody tr {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 0.75rem;
    padding: 0.75rem 1rem;
  }

  .table-wrap tbody tr:hover {
    background: var(--bg-card);
  }

  .table-wrap td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: 0.375rem 0;
    border: none !important;
    text-align: right;
  }

  .table-wrap td::before {
    content: attr(data-label);
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.02em;
    text-align: left;
    flex-shrink: 0;
  }

  /* Zellen ohne Label (z.B. reine Aktions-Spalten) rechtsbündig ohne Pseudo-Element */
  .table-wrap td:not([data-label])::before {
    content: none;
  }
  .table-wrap td:not([data-label]) {
    justify-content: flex-end;
  }

  /* Checkbox-Spalten (Bulk-Auswahl) kompakt am Kartenanfang */
  .table-wrap td.card-checkbox {
    justify-content: flex-start;
  }
  .table-wrap td.card-checkbox::before {
    content: none;
  }

  /* Name/Titel-Zelle optisch hervorheben als Karten-Header */
  .table-wrap td[data-label].card-title-cell {
    font-size: 16px;
    font-weight: 600;
    border-bottom: 1px solid var(--border) !important;
    padding-bottom: 0.5rem;
    margin-bottom: 0.25rem;
  }
  .table-wrap td.card-title-cell::before {
    content: none;
  }
  .table-wrap td.card-title-cell {
    justify-content: flex-start;
  }
}

/* =============================================================================
   HAMBURGER-MENÜ (Mobile Navigation)
   ============================================================================= */

/* Toggle-Button: nur auf Mobile sichtbar */
.navbar-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 24px;
  padding: 0.5rem;
  cursor: pointer;
  z-index: 1001;
}

/* nav-label: auf Desktop unsichtbar, nur für Mobile-Menü gedacht */
.nav-label {
  display: none;
}

/* Overlay hinter dem aufgeklappten Menü */
.navbar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 90; /* unter .navbar (z-index:100) – sonst blockiert es Klicks im Menü-Panel */
}
.navbar-overlay.active {
  display: block;
}

@media (max-width: 860px) {

  .navbar {
    position: relative;
  }

  .navbar-toggle {
    display: block;
    position: relative;
    z-index: 1001;
  }

  /* Wenn Menü offen: X-Button über dem Panel positionieren (Klasse wird per JS gesetzt) */
  .navbar-toggle.menu-open {
    position: fixed;
    top: 12px;
    right: 1rem;
    z-index: 1002;
  }

  .navbar-menu {
    position: fixed;
    top: 0;
    right: -100%;
    width: min(320px, 85vw);
    height: 100vh;
    background: var(--bg-card);
    border-left: 1px solid var(--border);
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 0 0 1.5rem;
    overflow-y: auto;
    transition: right 0.25s ease;
    z-index: 1000;
  }

  .navbar-menu.open {
    right: 0;
  }

  .navbar-menu::before {
    content: 'Menü';
    display: block;
    padding: 1.25rem 3.5rem 1.25rem 1.5rem;
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border);
    margin-bottom: 0.5rem;
  }

  .navbar-menu .nav-icon-link {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 0.875rem;
    padding: 0.875rem 1.5rem;
    border-radius: 0;
    border-left: 3px solid transparent;
    font-size: 15px;
    color: var(--text-primary);
  }

  .navbar-menu .nav-icon-link i {
    font-size: 20px;
    width: 24px;
    flex-shrink: 0;
  }

  /* Tooltip im Mobile-Menü nicht nötig, Text ist bereits sichtbar */
  .navbar-menu .nav-icon-link::after {
    display: none;
  }

  /* Aktiver Menüpunkt: deutlich sichtbarer Gelb-Akzent statt kaum sichtbarem Grauton */
  .navbar-menu .nav-icon-link.active {
    background: rgba(247,230,62,0.12);
    border-left-color: var(--scd-yellow);
    color: var(--scd-yellow);
  }

  /* Touch-Feedback: sichtbarer Zustand beim Antippen (hover greift auf Touch nicht zuverlässig) */
  .navbar-menu .nav-icon-link:hover,
  .navbar-menu .nav-icon-link:active {
    background: rgba(247,230,62,0.18);
    border-left-color: var(--scd-yellow);
    color: var(--scd-yellow);
  }

  .nav-label {
    display: inline;
  }

  .navbar-menu .nav-badge {
    position: static;
    margin-left: auto;
  }

  .navbar-menu .nav-icon-link[style*="position:relative"] {
    position: relative;
  }

  .nav-divider {
    width: calc(100% - 3rem);
    height: 1px;
    margin: 0.5rem 1.5rem;
  }
}

/* =============================================================================
   PULL-TO-REFRESH (PWA Standalone-Modus)
   ============================================================================= */
.ptr-indicator {
  position: fixed;
  top: 8px;
  left: 50%;
  width: 40px;
  height: 40px;
  margin-left: -20px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--scd-yellow);
  font-size: 18px;
  opacity: 0;
  transform: translateY(0);
  transition: none;
  z-index: 1002;
  pointer-events: none;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.ptr-indicator.ptr-ready {
  color: var(--green);
  border-color: var(--green);
}

.ptr-indicator.ptr-loading {
  transition: transform 0.2s ease;
}

.ptr-indicator.ptr-loading i {
  animation: ptr-spin 0.6s linear infinite;
}

@keyframes ptr-spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}
