/* ============================================================
   theme-v2 — Facelift (nur Optik, keine Strukturänderung).
   Wird NACH assets/style.css (und assets/zentrale.css) geladen und
   überschreibt Farben, Ecken, Schrift- und Steuerelementgrößen.
   Abschalten: die <link ... theme-v2.css>-Zeile aus den Seiten entfernen.

   Regeln:
   - Schriftgrößen: 12 / 14 / 16 / 20 px, Gewichte 400 / 500
   - Steuerelemente (Button, Feld, Select): eine Höhe (--h = 28px) auf
     Geräten mit Maus; auf Touch-Geräten bleiben sie groß (iOS zoomt bei
     Feldern < 16px und Fingertreffer brauchen mehr Fläche)
   - Ecken: --r (4px) für Steuerelemente/Badges, --r-card (6px) für Karten
   - eine Akzentfarbe (--accent), Grün/Amber/Rot nur für Status
   ============================================================ */

:root {
  --accent: #0369a1;
  --accent-bg: #e0f2fe;
  --btn-bg: #0369a1;
  --btn-text: #ffffff;
  --r: 4px;
  --r-card: 6px;
  --h: 28px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --accent: #7dd3fc;
    --accent-bg: #082f49;
    --btn-bg: #0369a1;
    --btn-text: #ffffff;
  }
}
:root[data-theme="dark"] {
  --accent: #7dd3fc;
  --accent-bg: #082f49;
  --btn-bg: #0369a1;
  --btn-text: #ffffff;
}
:root[data-theme="light"] {
  --accent: #0369a1;
  --accent-bg: #e0f2fe;
  --btn-bg: #0369a1;
  --btn-text: #ffffff;
}

/* ---------- Ecken ---------- */
input, select, textarea, button, .btn, .tabs, .msg,
.theme-toggle, .icon-btn, .autocomplete-dropdown, .assign-to-list,
#qr-reader, summary.btn-secondary,
.zentrale-participation-person, .zentrale-dropzone,
.zentrale-comment-attachments img, .zentrale-comment-attachments .file-chip,
.zentrale-pending-attachment img, .zentrale-pending-attachment .file-icon,
.zentrale-nav > a, .zentrale-nav-sub, .flag-tooltip {
  border-radius: var(--r);
}
.card, .visitor-card, .user-row, .overlay-card { border-radius: var(--r-card); }
.brand-badge, .zentrale-badge { border-radius: var(--r); }
.vt-track { border-radius: var(--r-card); }
.vt-thumb { border-radius: var(--r); }
/* Button-Gruppen bleiben verbunden: nur die äußeren Ecken, jetzt kantiger. */
.visitor-actions-buttons > button:first-child,
.visitor-actions-buttons > .btn:first-child,
.btn-row > button:first-child,
.btn-row > .btn:first-child {
  border-top-left-radius: var(--r);
  border-bottom-left-radius: var(--r);
}
.visitor-actions-buttons > button:last-child,
.visitor-actions-buttons > .btn:last-child,
.btn-row > button:last-child,
.btn-row > .btn:last-child {
  border-top-right-radius: var(--r);
  border-bottom-right-radius: var(--r);
}

/* ---------- Schrift ---------- */
h1 { font-size: 20px; font-weight: 500; }
.zentrale-content h2 { font-weight: 500; }
.section-label {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.05em;
  color: var(--muted);
}
.zentrale-nav-group-label { font-weight: 500; }
.zentrale-badge, .brand-badge { font-weight: 500; }
.wait-time-green, .wait-time-yellow, .wait-time-red { font-weight: 500; }

/* ---------- Akzent ---------- */
input:focus, select:focus, textarea:focus,
.vt-switch input:focus-visible ~ .vt-track {
  outline-color: var(--accent);
}
.zentrale-nav > a.active,
.zentrale-nav-sub.active {
  background: var(--accent-bg);
  color: var(--accent);
}
.zentrale-nav > a:hover,
.zentrale-nav-sub:hover { background: var(--bg); }
.zentrale-nav > a.active:hover,
.zentrale-nav-sub.active:hover { background: var(--accent-bg); }
.zentrale-sidebar-header h1 { font-weight: 500; }

/* ---------- Kompakte Steuerelemente (nur Maus/Desktop) ---------- */
@media (hover: hover) and (pointer: fine) {
  body { font-size: 14px; }

  button, .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: var(--h);
    padding: 0 12px;
    font-size: 14px;
    line-height: 1;
  }
  input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="range"]),
  select {
    height: var(--h);
    padding: 0 12px;
    font-size: 14px;
  }
  textarea { padding: 6px 12px; font-size: 14px; }

  .btn-input-height { height: var(--h); }
  .zentrale-select-style-btn { height: var(--h); font-size: 14px; }
  .header-select { padding: 0 10px; }
  summary.btn-secondary {
    display: inline-flex;
    align-items: center;
    height: var(--h);
    padding: 0 12px;
    font-size: 14px;
  }
  .theme-toggle, .icon-btn { width: var(--h); height: var(--h); font-size: 14px; }
  .tabs a {
    display: flex;
    align-items: center;
    justify-content: center;
    height: var(--h);
    padding: 0 12px;
  }
  .vt-track label { padding: 5px 0; font-size: 14px; }
  .choice { font-size: 14px; }
  /* Einzelne Felder mit fest verdrahteter Höhe im Markup angleichen. */
  [style*="height:33px"] { height: var(--h) !important; }
}

/* ---------- Handy: Button-Gruppen dürfen umbrechen ----------
   Die verbundene Button-Gruppe (.btn-row) ist mit 4-5 Buttons breiter als
   eine Karte auf dem Handy und ragte rechts heraus. Mobil bricht sie jetzt
   um; jeder Button bekommt dann wieder eigene Ecken statt der verbundenen. */
@media (max-width: 600px) {
  .btn-row { flex-wrap: wrap; gap: 8px; width: 100%; }
  .btn-row > button,
  .btn-row > .btn,
  .btn-row > button:first-child,
  .btn-row > .btn:first-child,
  .btn-row > button:last-child,
  .btn-row > .btn:last-child {
    margin-left: 0;
    border-radius: var(--r);
    flex: 1 1 auto;
  }
  .user-row-summary--inline .btn-row { width: auto; }
}

/* ---------- Sidebar-Untermenü ----------
   Der Elternpunkt (Emails / Users / MIS data) ist bei aktivem Unterpunkt nur
   betont, nicht gefüllt — gefüllt ist der aktive Unterpunkt. */
.zentrale-nav > a.has-sub.active { background: transparent; color: var(--ink); }
.zentrale-nav > a.has-sub.active:hover { background: var(--bg); }
.zentrale-nav-subgroup { display: flex; flex-direction: column; gap: 2px; margin-bottom: 4px; }

/* ---------- Status-Badges (Participating / Approved / Active ...) ----------
   Höher (24px) und mit der Grundlinie des danebenstehenden Namens
   ausgerichtet (vertical-align: baseline), damit Name und Tags auf einer
   Ebene stehen statt leicht nach unten versetzt. */
.zentrale-badge {
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 10px;
  line-height: 1;
  vertical-align: baseline;
}

/* ---------- Aktionen in der Einladungsliste ----------
   Hauptaktion (Approval for show) frei links, übrige Aktionen als verbundene
   Gruppe mit Symbolen; Kommentar-Anzahl als kleiner Zähler. */
.inv-actions { display: flex; align-items: center; gap: 12px; flex-shrink: 0; flex-wrap: wrap; justify-content: flex-end; }
.inv-actions button,
.inv-actions .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.inv-actions .st-ico { width: 15px; height: 15px; opacity: 0.85; }
.inv-actions .btn-secondary:disabled .st-ico { opacity: 0.5; }
.inv-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 99px;
  background: var(--accent-bg, var(--bg));
  color: var(--accent, var(--ink));
  font-size: 12px;
  font-weight: 500;
  line-height: 1;
}
@media (max-width: 600px) {
  .inv-actions { width: 100%; flex-direction: column; align-items: stretch; gap: 8px; }
  .inv-actions .btn-row { width: 100%; }
  .inv-actions .inv-approve { width: 100%; }
}


/* ---------- Auswahl-Dropdown (z.B. Marken je Lounge) ----------
   Aufklappbares <details> mit Checkbox-Liste: Pfeil im Auslöser, kompakte
   Zeilen mit Hover, gewählte Einträge in der Akzentfarbe, weicher Schatten.
   Gilt in Pier Authority und in der App (Settings > Lounges). */
details > summary.btn-secondary {
  justify-content: space-between;
  gap: 8px;
  text-align: left;
}
details > summary.btn-secondary::after {
  content: "";
  width: 7px;
  height: 7px;
  flex-shrink: 0;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: rotate(45deg) translateY(-2px);
  transition: transform 0.15s ease;
}
details[open] > summary.btn-secondary::after { transform: rotate(-135deg) translateY(-2px); }
details > .autocomplete-dropdown {
  padding: 4px;
  border-radius: var(--r-card);
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.16), 0 2px 6px rgba(15, 23, 42, 0.08);
  max-height: 280px;
}
details > .autocomplete-dropdown .autocomplete-item {
  height: 32px;
  padding: 0 10px;
  margin: 0;
  border-bottom: 0;
  border-radius: var(--r);
  font-size: 14px;
  font-weight: 400;
  cursor: pointer;
}
details > .autocomplete-dropdown .autocomplete-item:hover { background: var(--bg); }
details > .autocomplete-dropdown .autocomplete-item:has(input:checked) {
  background: var(--accent-bg, var(--bg));
  color: var(--accent, var(--ink));
  font-weight: 500;
}
details > .autocomplete-dropdown .autocomplete-item input[type="checkbox"] {
  width: 16px !important;
  height: 16px !important;
  margin: 0;
  padding: 0;
  accent-color: var(--accent, var(--btn-bg));
}


/* ---------- Kein Auto-Zoom auf dem Handy ----------
   iOS Safari zoomt beim Fokussieren in ein Feld hinein, sobald dessen
   Schrift kleiner als 16px ist. Auf Touch-Geräten (grober Zeiger) sind
   Formularfelder daher immer mindestens 16px, egal welche Regel sonst gilt. */
@media (pointer: coarse) {
  input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]),
  select,
  textarea {
    font-size: 16px !important;
  }
}
