/* FLX Tickets – Grundlagen und gemeinsame Komponenten
 * Werte 1:1 aus der Vorschau (gemeinsamer <style>-Block aller 12 Screens).
 * Klassen tragen dieselben Namen wie in der Vorschau, damit der Abgleich
 * einfach bleibt. Neue Klassen ersetzen die Inline-Styles der Vorschau.
 */

@font-face {
  font-family: 'Geist';
  src: url('../fonts/Geist-Variable.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--font); }
a { color: var(--accent-text); text-decoration: none; }
a:hover { color: var(--accent-hover); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
[hidden] { display: none !important; }

/* Nur für Screenreader sichtbar */
.sr {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.sr-fokus:focus, .sr-fokus:focus-within { position: static !important; width: auto; height: auto; margin: 0; clip: auto; overflow: visible; }

/* Hilfsklassen (Vorschau) */
.ml { margin-left: auto; }
.row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.mut { color: var(--muted); }
.sm { font-size: var(--fs-s); }
.num { font-variant-numeric: tabular-nums; }
/* Hilfsklassen (aus Inline-Styles der Vorschau) */
.nowrap { flex-wrap: nowrap; white-space: nowrap; }
.g4 { gap: 4px; } .g6 { gap: 6px; } .g8 { gap: 8px; } .g10 { gap: 10px; } .g12 { gap: 12px; } .g14 { gap: 14px; }
.flex1 { flex: 1; }
.stapel { display: flex; flex-direction: column; }
.fett5 { font-weight: 500; }
.text { color: var(--text); }
.text2 { color: var(--text-2); }

/* Knöpfe */
.btn {
  display: inline-flex; align-items: center; gap: 7px; height: 34px; padding: 0 14px;
  border-radius: var(--r-btn); font: 500 13px var(--font); border: 1px solid var(--border-btn);
  background: var(--surface-2); color: var(--text); cursor: pointer; white-space: nowrap; box-sizing: border-box;
}
a.btn:hover { color: var(--text); }
.btn.pri { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
a.btn.pri:hover { color: var(--on-accent); }
.btn.ic { width: 34px; padding: 0; justify-content: center; }
.btn.ghost { border-color: transparent; background: transparent; color: var(--text-2); }
.btn.h28 { height: 28px; }
.btn.h30 { height: 30px; }
.btn.ic.h28 { width: 28px; }
.btn.gefahr { color: var(--bad); padding: 0; }
.btn:disabled { opacity: .5; cursor: default; }

/* Karten */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-card); }
.card.zu { overflow: hidden; }
.ch { display: flex; align-items: center; gap: 10px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.ch h2 { margin: 0; font-size: 14px; font-weight: 600; }
.card-fuss { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 12px 20px; border-top: 1px solid var(--line); }
.card-pad { padding: 16px 20px; display: flex; flex-direction: column; gap: 14px; }

/* Status-Pillen (nur Team/Verwaltung; im Spielerbereich farbiger Text) */
.pill {
  display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 9px; border-radius: 11px;
  font-size: 12px; font-weight: 500; white-space: nowrap;
}
.dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.p-ok { background: var(--ok-soft); color: var(--ok); }
.p-wait { background: var(--wait-soft); color: var(--wait); }
.p-bad { background: var(--bad-soft); color: var(--bad); }
.p-gray { background: var(--active); color: var(--text-2); }
.p-blue { background: var(--accent-soft); color: var(--accent-text); }

/* Status und Priorität als Text */
.st-offen { color: var(--accent-text); }
.st-in_arbeit { color: var(--wait); }
.st-wartet { color: var(--text-2); }
.st-geloest { color: var(--ok); }
.prio-niedrig { color: var(--muted); }
.prio-normal { color: var(--text-2); }
.prio-hoch { color: var(--prio-hoch); }
.prio-dringend { color: var(--bad); font-weight: 500; }

/* Tabellen */
table { width: 100%; border-collapse: collapse; }
th { font-size: 12px; font-weight: 500; color: var(--muted); text-align: left; padding: 10px 20px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 13px 20px; border-bottom: 1px solid var(--line-soft); font-size: 13.5px; white-space: nowrap; }
tr:last-child td { border-bottom: none; }
th.r, td.r { text-align: right; }
.tabelle-scroll { overflow-x: auto; }
/* Ganze Zeile klickbar (rowlink.js); ohne JS trägt der Link in der Zeile */
tr[data-href] { cursor: pointer; }
tr[data-href]:hover td { background: var(--hover); }

/* Reiter / Filter */
.tab {
  height: 30px; padding: 0 12px; border-radius: 15px; font-size: 13px; color: var(--text-2);
  display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--border-tab);
  background: transparent; box-sizing: border-box; cursor: pointer;
}
a.tab:hover { color: var(--text); }
.tab.on, .tab:has(> input:checked) { background: var(--tab-on-bg); color: var(--tab-on-fg); border-color: var(--tab-on-bg); font-weight: 500; }
.tab.on:hover { color: var(--tab-on-fg); }
.tab:has(> input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.tab .zahl { color: var(--muted); }
.tab.on .zahl { color: inherit; opacity: .6; }
.tab.h26 { height: 26px; }
.tab.h28 { height: 28px; }
.tab.flach:not(.on):not(:has(> input:checked)) { border-color: transparent; }
.tabs { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }

/* Formularfelder */
.fld { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.fld > label, .fld .label { font-size: 13px; font-weight: 500; }
.fld .opt { color: var(--muted); font-weight: 400; }
.hint { font-size: var(--fs-s); color: var(--muted); }
.fehler-text { font-size: var(--fs-s); color: var(--bad); }
.in {
  min-height: 38px; border: 1px solid var(--border-field); background: var(--field); border-radius: var(--r-btn);
  padding: 0 12px; color: var(--text); font: 14px var(--font); display: flex; align-items: center; gap: 8px;
  box-sizing: border-box; width: 100%;
}
input.in, textarea.in { display: block; width: 100%; outline: none; }
input.in:focus, textarea.in:focus, .in:focus-within { border-color: var(--accent); }
.in::placeholder { color: var(--muted); }
textarea.in { min-height: 64px; padding: 10px 12px 10px; line-height: 1.5; resize: vertical; }
textarea.in.h76 { min-height: 76px; }
.in.fest { color: var(--text); }
.in[aria-invalid="true"] { border-color: var(--bad); }
.raster2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.ganz { grid-column: 1 / -1; }

/* Schalter: <label class="tgl"><input type="checkbox" class="sr"><span class="tg"></span></label> */
.tg { width: 36px; height: 20px; border-radius: 10px; background: var(--accent); position: relative; flex: none; display: inline-block; }
.tg::after { content: ''; position: absolute; top: 2px; right: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; }
.tg.off, input:not(:checked) + .tg { background: var(--border-btn); }
.tg.off::after, input:not(:checked) + .tg::after { right: auto; left: 2px; background: var(--knob-off); }
.tgl { display: inline-flex; cursor: pointer; position: relative; }
.tgl input:focus-visible + .tg { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Definitionsliste */
.kv { display: grid; grid-template-columns: 130px 1fr; row-gap: 12px; font-size: 13.5px; margin: 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }
.kv.k110 { grid-template-columns: 110px 1fr; font-size: 13px; margin: 1em 0; } /* Vorschau: Browser-Standardabstand der dl */

/* Avatar und Logo */
.av {
  width: 28px; height: 28px; border-radius: 50%; background: var(--avatar); color: #fff; font-size: 11.5px;
  font-weight: 600; display: flex; align-items: center; justify-content: center; flex: none; object-fit: cover;
}
.av.spieler { background: var(--avatar-player); }
.av.a22 { width: 22px; height: 22px; font-size: 9.5px; }
.av.a24 { width: 24px; height: 24px; font-size: 10px; }
.av.a34 { width: 34px; height: 34px; font-size: 12px; }
.av.a40 { width: 40px; height: 40px; font-size: 13px; }
.logo {
  width: 28px; height: 28px; border-radius: 7px; background: var(--logo-bg); color: #fff; font-weight: 700;
  font-size: 14px; display: flex; align-items: center; justify-content: center; flex: none; object-fit: cover;
}
.logo.l22 { width: 22px; height: 22px; font-size: 11px; border-radius: 6px; }
.logo.l56 { width: 56px; height: 56px; font-size: 24px; border-radius: 12px; }
.farbpunkt { width: 10px; height: 10px; flex: none; display: block; }

/* Eigenes Dropdown (dropdown.js). Ohne JS: <details> mit Radios oder Submit-Knöpfen.
 * <details class="dd"><summary class="in dd-knopf">…</summary><div class="dd-menu" role="listbox">…</div></details> */
.dd { position: relative; }
.dd > summary { list-style: none; cursor: pointer; justify-content: space-between; user-select: none; }
.dd > summary::-webkit-details-marker { display: none; }
.dd > summary .dd-wert { display: flex; align-items: center; gap: 8px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dd > summary > svg { flex: none; }
.dd-menu {
  position: absolute; z-index: 30; top: calc(100% + 4px); left: 0; min-width: 100%; max-height: 300px; overflow: auto;
  box-sizing: border-box; padding: 4px; background: var(--surface); border: 1px solid var(--border-btn);
  border-radius: var(--r-box); box-shadow: 0 12px 32px rgba(0, 0, 0, .35); display: flex; flex-direction: column; gap: 1px;
}
.dd.rechts .dd-menu { left: auto; right: 0; }
.dd-opt {
  display: flex; align-items: center; gap: 8px; min-height: 34px; padding: 0 10px; border-radius: 6px;
  font: 13.5px var(--font); color: var(--text); background: transparent; border: 0; text-align: left;
  cursor: pointer; white-space: nowrap; width: 100%; box-sizing: border-box;
}
.dd-opt:hover, .dd-opt.fokus, .dd-opt:focus-visible { background: var(--active); outline: none; }
.dd-opt:has(> input:checked), .dd-opt[aria-selected="true"] { font-weight: 500; }
.dd-opt .haken { margin-left: auto; visibility: hidden; color: var(--accent-text); }
.dd-opt:has(> input:checked) .haken, .dd-opt[aria-selected="true"] .haken { visibility: visible; }
.dd-ohnejs { padding: 6px 6px 2px; }
.js .dd-ohnejs { display: none; }

/* Dialog (dialog.js). Ohne JS öffnet :target den Dialog über einen Anker-Link. */
.dlg { position: fixed; inset: 0; z-index: 50; display: none; align-items: flex-start; justify-content: center; padding: 10vh 16px 16px; background: rgba(0, 0, 0, .55); overflow: auto; }
.dlg:target, .dlg.offen { display: flex; }
.dlg-box {
  width: 100%; max-width: 480px; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-card); box-shadow: 0 24px 64px rgba(0, 0, 0, .45); color: var(--text); font-size: 14px;
}
.dlg-box.breit { max-width: 640px; }
.dlg-inhalt { padding: 20px; display: flex; flex-direction: column; gap: 16px; }
.dlg-fuss { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 20px; border-top: 1px solid var(--line); }
body.dlg-auf { overflow: hidden; }

/* Hinweisleiste (Rückmeldung nach dem Speichern) */
.meldung { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: var(--r-box); font-size: 13.5px; background: var(--ok-soft); color: var(--ok); }
.meldung.fehler { background: var(--bad-soft); color: var(--bad); }

/* Ergänzungen */
.b6 { font-weight: 600; }
.mr-auto { margin-right: auto; }
.btn[aria-disabled="true"] { cursor: default; }
.btn.pri.gefahr-voll { background: var(--bad); border-color: var(--bad); color: #fff; }
.nur-ohnejs { }
.js .nur-ohnejs { display: none !important; }
.g20 { gap: 20px; }
